diff --git a/.eslintrc.cjs b/.eslintrc.cjs index bdd2dac..0dd74f3 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -2,7 +2,7 @@ module.exports = { extends: ['plugin:@typescript-eslint/recommended'], parser: '@typescript-eslint/parser', parserOptions: { - project: "./tsconfig.json", + project: './tsconfig.json', tsconfigRootDir: __dirname, emcaVersion: 2018, sourceType: 'module', @@ -11,11 +11,24 @@ module.exports = { root: true, rules: { '@typescript-eslint/no-explicit-any': 'off', - "tsdoc/syntax": "warn", - "require-jsdoc": "warn", - "jsdoc/check-tag-names": "off", - "jsdoc/require-param-type": "off", - "jsdoc/require-returns-type": "off", - "jsdoc/empty-tags": "off" - } -}; + '@typescript-eslint/member-delimiter-style': [ + 'warn', + { + multiline: { + delimiter: 'comma', + requireLast: true, + }, + singleline: { + delimiter: 'comma', + requireLast: false, + }, + }, + ], + 'tsdoc/syntax': 'warn', + 'require-jsdoc': 'warn', + 'jsdoc/check-tag-names': 'off', + 'jsdoc/require-param-type': 'off', + 'jsdoc/require-returns-type': 'off', + 'jsdoc/empty-tags': 'off', + }, +} diff --git a/.gitignore b/.gitignore index 6aa0b9d..cb26d38 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ build .idea/ *.log .env +.vscode diff --git a/src/api/interfaces.ts b/src/api/interfaces.ts index 8de7220..11e4665 100644 --- a/src/api/interfaces.ts +++ b/src/api/interfaces.ts @@ -44,7 +44,7 @@ export type IEventHistoryEntry = { logs?: Array, gasUsed: string, mevGasPrice: string, - } + }, } /** @@ -85,7 +85,16 @@ export interface TransactionOptions { hints?: HintPreferences, /** Maximum block number for the transaction to be included in. */ maxBlockNumber?: number, + /** Builders that are allowed to receive this tx. See [flashbots docs](https://github.com/flashbots/dowg/blob/main/builder-registrations.json) for supported builders. */ builders?: string[], + /** Specifies how refund should be paid if tx is used by another searcher. */ + refund?: Array<{ + /** The address that receives this portion of the refund. */ + address: string, + /** Percentage of refund to be paid to `address`. Set this to `100` unless splitting refunds between multiple recipients. */ + percent: number, + }>, + } /** @@ -128,12 +137,12 @@ export interface BundleParams { privacy?: { /** Data fields from bundle transactions to be shared with searchers on MEV-Share. */ hints?: HintPreferences, - /** Builders that are allowed to receive this bundle. See [mev-share spec](https://github.com/flashbots/mev-share/blob/main/builders/registration.json) for supported builders. */ + /** Builders that are allowed to receive this bundle. See [flashbots docs](https://github.com/flashbots/dowg/blob/main/builder-registrations.json) for supported builders. */ builders?: Array, }, metadata?: { originId?: string, - } + }, } /** Response received from MEV-Share API */ diff --git a/src/api/mungers.ts b/src/api/mungers.ts index 5b00de8..803b66d 100644 --- a/src/api/mungers.ts +++ b/src/api/mungers.ts @@ -44,6 +44,9 @@ export function mungePrivateTxParams(signedTx: string, options?: TransactionOpti hints: extractSpecifiedHints(options.hints), }, builders: options?.builders, + validity: options?.refund && { + refund: options.refund + } }, }] }