@metamask/transaction-controller 28.1.0 → 29.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -1
- package/dist/TransactionController.js +12 -11
- package/dist/TransactionController.mjs +11 -10
- package/dist/{chunk-LDXTSESK.mjs → chunk-4M7FHI4S.mjs} +20 -4
- package/dist/chunk-4M7FHI4S.mjs.map +1 -0
- package/dist/{chunk-FK7AP6SH.js → chunk-5C3CSQAD.js} +12 -5
- package/dist/{chunk-YEJJKWT2.mjs.map → chunk-5C3CSQAD.js.map} +1 -1
- package/dist/{chunk-V6UIRCOF.js → chunk-7DJO6UZA.js} +48 -13
- package/dist/chunk-7DJO6UZA.js.map +1 -0
- package/dist/{chunk-MG7HTD3H.mjs → chunk-7TPXSDXL.mjs} +121 -35
- package/dist/chunk-7TPXSDXL.mjs.map +1 -0
- package/dist/{chunk-TWND5SFD.mjs → chunk-AGJNOOBN.mjs} +17 -12
- package/dist/chunk-AGJNOOBN.mjs.map +1 -0
- package/dist/{chunk-LNX4JTOL.js → chunk-DUFOYA4D.js} +7 -7
- package/dist/chunk-DUFOYA4D.js.map +1 -0
- package/dist/{chunk-UH7FNVKS.js → chunk-EMDU4XLM.js} +19 -14
- package/dist/chunk-EMDU4XLM.js.map +1 -0
- package/dist/chunk-FMRLPVFZ.mjs +66 -0
- package/dist/chunk-FMRLPVFZ.mjs.map +1 -0
- package/dist/{chunk-EQNKFFTM.js → chunk-KNYSD4JP.js} +21 -5
- package/dist/chunk-KNYSD4JP.js.map +1 -0
- package/dist/{chunk-IZVRGO3P.mjs → chunk-MDRMMUMS.mjs} +32 -18
- package/dist/chunk-MDRMMUMS.mjs.map +1 -0
- package/dist/{chunk-DMMUAJKY.js → chunk-N55SEKK7.js} +125 -39
- package/dist/chunk-N55SEKK7.js.map +1 -0
- package/dist/{chunk-YEJJKWT2.mjs → chunk-N6JXPWLY.mjs} +11 -4
- package/dist/chunk-N6JXPWLY.mjs.map +1 -0
- package/dist/chunk-REOG6YD4.mjs +112 -0
- package/dist/chunk-REOG6YD4.mjs.map +1 -0
- package/dist/{chunk-HHK4QSNF.mjs → chunk-SL3GHHKG.mjs} +47 -12
- package/dist/chunk-SL3GHHKG.mjs.map +1 -0
- package/dist/chunk-TJMQEH57.js +66 -0
- package/dist/chunk-TJMQEH57.js.map +1 -0
- package/dist/chunk-VJYFB7BM.js +112 -0
- package/dist/chunk-VJYFB7BM.js.map +1 -0
- package/dist/{chunk-JAYYMCBQ.js → chunk-X3KACH5P.js} +32 -18
- package/dist/chunk-X3KACH5P.js.map +1 -0
- package/dist/{chunk-NCRWKI6Y.mjs → chunk-XL3HBKDE.mjs} +4 -4
- package/dist/chunk-XL3HBKDE.mjs.map +1 -0
- package/dist/errors.js +1 -1
- package/dist/errors.mjs +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.js +5 -5
- package/dist/gas-flows/DefaultGasFeeFlow.mjs +4 -4
- package/dist/gas-flows/LineaGasFeeFlow.js +6 -6
- package/dist/gas-flows/LineaGasFeeFlow.mjs +5 -5
- package/dist/gas-flows/TestGasFeeFlow.js +9 -0
- package/dist/gas-flows/TestGasFeeFlow.js.map +1 -0
- package/dist/gas-flows/TestGasFeeFlow.mjs +9 -0
- package/dist/gas-flows/TestGasFeeFlow.mjs.map +1 -0
- package/dist/helpers/EtherscanRemoteTransactionSource.js +1 -1
- package/dist/helpers/EtherscanRemoteTransactionSource.mjs +1 -1
- package/dist/helpers/GasFeePoller.js +4 -4
- package/dist/helpers/GasFeePoller.mjs +3 -3
- package/dist/helpers/MultichainTrackingHelper.js +1 -1
- package/dist/helpers/MultichainTrackingHelper.mjs +1 -1
- package/dist/helpers/PendingTransactionTracker.js +1 -1
- package/dist/helpers/PendingTransactionTracker.mjs +1 -1
- package/dist/index.js +16 -11
- package/dist/index.mjs +15 -10
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/TransactionController.d.ts +12 -5
- package/dist/types/TransactionController.d.ts.map +1 -1
- package/dist/types/gas-flows/DefaultGasFeeFlow.d.ts.map +1 -1
- package/dist/types/gas-flows/TestGasFeeFlow.d.ts +12 -0
- package/dist/types/gas-flows/TestGasFeeFlow.d.ts.map +1 -0
- package/dist/types/helpers/GasFeePoller.d.ts +5 -3
- package/dist/types/helpers/GasFeePoller.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +36 -18
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/gas-flow.d.ts +8 -14
- package/dist/types/utils/gas-flow.d.ts.map +1 -1
- package/dist/types/utils/simulation.d.ts +18 -0
- package/dist/types/utils/simulation.d.ts.map +1 -1
- package/dist/types.js +4 -2
- package/dist/types.mjs +3 -1
- package/dist/utils/external-transactions.js +1 -1
- package/dist/utils/external-transactions.mjs +1 -1
- package/dist/utils/gas-fees.js +4 -4
- package/dist/utils/gas-fees.mjs +3 -3
- package/dist/utils/gas-flow.js +3 -3
- package/dist/utils/gas-flow.mjs +2 -2
- package/dist/utils/simulation-api.js +1 -1
- package/dist/utils/simulation-api.mjs +1 -1
- package/dist/utils/simulation.js +5 -3
- package/dist/utils/simulation.mjs +4 -2
- package/dist/utils/swaps.js +1 -1
- package/dist/utils/swaps.mjs +1 -1
- package/dist/utils/transaction-type.js +1 -1
- package/dist/utils/transaction-type.mjs +1 -1
- package/dist/utils/utils.js +1 -1
- package/dist/utils/utils.mjs +1 -1
- package/dist/utils/validation.js +1 -1
- package/dist/utils/validation.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunk-4RJXBKSR.js +0 -90
- package/dist/chunk-4RJXBKSR.js.map +0 -1
- package/dist/chunk-DMMUAJKY.js.map +0 -1
- package/dist/chunk-EQNKFFTM.js.map +0 -1
- package/dist/chunk-FK7AP6SH.js.map +0 -1
- package/dist/chunk-HHK4QSNF.mjs.map +0 -1
- package/dist/chunk-IZVRGO3P.mjs.map +0 -1
- package/dist/chunk-JAYYMCBQ.js.map +0 -1
- package/dist/chunk-LDXTSESK.mjs.map +0 -1
- package/dist/chunk-LNX4JTOL.js.map +0 -1
- package/dist/chunk-MG7HTD3H.mjs.map +0 -1
- package/dist/chunk-NCRWKI6Y.mjs.map +0 -1
- package/dist/chunk-NPEXNXSY.mjs +0 -90
- package/dist/chunk-NPEXNXSY.mjs.map +0 -1
- package/dist/chunk-TWND5SFD.mjs.map +0 -1
- package/dist/chunk-UH7FNVKS.js.map +0 -1
- package/dist/chunk-V6UIRCOF.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/simulation.ts"],"names":["SupportedToken"],"mappings":";;;;;;;;;;;;;;;;;AACA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,aAAa;AAC/B,SAAS,UAAU,WAAW,kBAAkB;AAChD,SAAS,0BAAoC;AA4BtC,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,YAAS;AACT,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,mBAAgB;AAChB,EAAAA,gBAAA,mBAAgB;AALN,SAAAA;AAAA,GAAA;AA0BZ,IAAM,MAAM,mBAAmB,eAAe,YAAY;AAE1D,IAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,uBAAuB;AAAA,EAC3B,CAAC,mBAAoB,GAAG;AAAA,IACtB,KAAK;AAAA,IACL;AAAA,EACF;AAAA,EACA,CAAC,qBAAqB,GAAG;AAAA,IACvB,KAAK;AAAA,IACL;AAAA,EACF;AAAA,EACA,CAAC,uBAAsB,GAAG;AAAA,IACxB,KAAK;AAAA,IACL;AAAA,EACF;AAAA,EACA,CAAC,kCAA4B,GAAG;AAAA,IAC9B,KAAK;AAAA,IACL;AAAA,EACF;AAAA,EACA,CAAC,kCAA4B,GAAG;AAAA,IAC9B,KAAK;AAAA,I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C,QAAM,eAAe,QAAQ,UAAU,EAAE,IAAI,QAAQ,eAAe,CAAC;AACrE,QAAM,aAAa,aAAa,MAAM;AACtC,QAAM,aAAa,MAAM,aAAa,IAAI,CAAC;AAE3C,MAAI,aAAa,OAAO,GAAG;AACzB,QAAI,wBAAwB;AAC5B,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAOA,SAAS,qBAAqB,OAAiB;AAC7C,SAAO,MAAM,QAAQ,KAAK,CAAC;AAC7B;AAMA,SAAS,wBAAwD;AAC/D,QAAM,kBAAkB,OAAO,OAAO,cAAc;AAEpD,SAAO,IAAI;AAAA,IACT,gBAAgB,IAAI,CAAC,cAAc;AACjC,YAAM,EAAE,IAAI,IAAI,qBAAqB,SAAS;AAC9C,YAAM,oBAAoB,IAAI,UAAU,GAAG;AAC3C,aAAO,CAAC,WAAW,iBAAiB;AAAA,IACtC,CAAC;AAAA,EACH;AACF","sourcesContent":["import type { Fragment, LogDescription, Result } from '@ethersproject/abi';\nimport { Interface } from '@ethersproject/abi';\nimport { hexToBN, toHex } from '@metamask/controller-utils';\nimport { abiERC20, abiERC721, abiERC1155 } from '@metamask/metamask-eth-abis';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\n\nimport {\n ABI_SIMULATION_ERC20_WRAPPED,\n ABI_SIMULATION_ERC721_LEGACY,\n} from '../constants';\nimport {\n SimulationError,\n SimulationInvalidResponseError,\n SimulationRevertedError,\n} from '../errors';\nimport { projectLogger } from '../logger';\nimport type {\n SimulationBalanceChange,\n SimulationData,\n SimulationTokenBalanceChange,\n SimulationToken,\n} from '../types';\nimport { SimulationTokenStandard } from '../types';\nimport { simulateTransactions } from './simulation-api';\nimport type {\n SimulationResponseLog,\n SimulationRequestTransaction,\n SimulationResponse,\n SimulationResponseCallTrace,\n SimulationResponseTransaction,\n} from './simulation-api';\n\nexport enum SupportedToken {\n ERC20 = 'erc20',\n ERC721 = 'erc721',\n ERC1155 = 'erc1155',\n ERC20_WRAPPED = 'erc20Wrapped',\n ERC721_LEGACY = 'erc721Legacy',\n}\n\ntype ABI = Fragment[];\n\nexport type GetSimulationDataRequest = {\n chainId: Hex;\n from: Hex;\n to?: Hex;\n value?: Hex;\n data?: Hex;\n};\n\ntype ParsedEvent = {\n contractAddress: Hex;\n tokenStandard: SimulationTokenStandard;\n name: string;\n args: Record<string, Hex | Hex[]>;\n abi: ABI;\n};\n\nconst log = createModuleLogger(projectLogger, 'simulation');\n\nconst SUPPORTED_EVENTS = [\n 'Transfer',\n 'TransferSingle',\n 'TransferBatch',\n 'Deposit',\n 'Withdrawal',\n];\n\nconst SUPPORTED_TOKEN_ABIS = {\n [SupportedToken.ERC20]: {\n abi: abiERC20,\n standard: SimulationTokenStandard.erc20,\n },\n [SupportedToken.ERC721]: {\n abi: abiERC721,\n standard: SimulationTokenStandard.erc721,\n },\n [SupportedToken.ERC1155]: {\n abi: abiERC1155,\n standard: SimulationTokenStandard.erc1155,\n },\n [SupportedToken.ERC20_WRAPPED]: {\n abi: ABI_SIMULATION_ERC20_WRAPPED,\n standard: SimulationTokenStandard.erc20,\n },\n [SupportedToken.ERC721_LEGACY]: {\n abi: ABI_SIMULATION_ERC721_LEGACY,\n standard: SimulationTokenStandard.erc721,\n },\n};\n\nconst REVERTED_ERRORS = ['execution reverted', 'insufficient funds for gas'];\n\ntype BalanceTransactionMap = Map<SimulationToken, SimulationRequestTransaction>;\n\n/**\n * Generate simulation data for a transaction.\n * @param request - The transaction to simulate.\n * @param request.chainId - The chain ID of the transaction.\n * @param request.from - The sender of the transaction.\n * @param request.to - The recipient of the transaction.\n * @param request.value - The value of the transaction.\n * @param request.data - The data of the transaction.\n * @returns The simulation data.\n */\nexport async function getSimulationData(\n request: GetSimulationDataRequest,\n): Promise<SimulationData> {\n const { chainId, from, to, value, data } = request;\n\n log('Getting simulation data', request);\n\n try {\n const response = await simulateTransactions(chainId, {\n transactions: [\n {\n data,\n from,\n maxFeePerGas: '0x0',\n maxPriorityFeePerGas: '0x0',\n to,\n value,\n },\n ],\n withCallTrace: true,\n withLogs: true,\n });\n\n const transactionError = response.transactions?.[0]?.error;\n\n if (transactionError) {\n throw new SimulationError(transactionError);\n }\n\n const nativeBalanceChange = getNativeBalanceChange(request.from, response);\n const events = getEvents(response);\n\n log('Parsed events', events);\n\n const tokenBalanceChanges = await getTokenBalanceChanges(request, events);\n\n return {\n nativeBalanceChange,\n tokenBalanceChanges,\n };\n } catch (error) {\n log('Failed to get simulation data', error, request);\n\n let simulationError = error as SimulationError;\n\n if (\n REVERTED_ERRORS.some((revertErrorMessage) =>\n simulationError.message?.includes(revertErrorMessage),\n )\n ) {\n simulationError = new SimulationRevertedError();\n }\n\n const { code, message } = simulationError;\n\n return {\n tokenBalanceChanges: [],\n error: {\n code,\n message,\n },\n };\n }\n}\n\n/**\n * Extract the native balance change from a simulation response.\n * @param userAddress - The user's account address.\n * @param response - The simulation response.\n * @returns The native balance change or undefined if unchanged.\n */\nfunction getNativeBalanceChange(\n userAddress: Hex,\n response: SimulationResponse,\n): SimulationBalanceChange | undefined {\n const transactionResponse = response.transactions[0];\n\n /* istanbul ignore next */\n if (!transactionResponse) {\n return undefined;\n }\n\n const { stateDiff } = transactionResponse;\n const previousBalance = stateDiff?.pre?.[userAddress]?.balance;\n const newBalance = stateDiff?.post?.[userAddress]?.balance;\n\n if (!previousBalance || !newBalance) {\n return undefined;\n }\n\n return getSimulationBalanceChange(previousBalance, newBalance);\n}\n\n/**\n * Extract events from a simulation response.\n * @param response - The simulation response.\n * @returns The parsed events.\n */\nexport function getEvents(response: SimulationResponse): ParsedEvent[] {\n /* istanbul ignore next */\n const logs = extractLogs(\n response.transactions[0]?.callTrace ?? ({} as SimulationResponseCallTrace),\n );\n\n log('Extracted logs', logs);\n\n const interfaces = getContractInterfaces();\n\n return logs\n .map((currentLog) => {\n const event = parseLog(currentLog, interfaces);\n\n if (!event) {\n log('Failed to parse log', currentLog);\n return undefined;\n }\n\n /* istanbul ignore next */\n const inputs = event.abi.find((e) => e.name === event.name)?.inputs;\n\n /* istanbul ignore if */\n if (!inputs) {\n log('Failed to find inputs for event', event);\n return undefined;\n }\n\n const args = parseEventArgs(event.args, inputs);\n\n return {\n contractAddress: currentLog.address,\n tokenStandard: event.standard,\n name: event.name,\n args,\n abi: event.abi,\n };\n })\n .filter((e) => e !== undefined) as ParsedEvent[];\n}\n\n/**\n * Parse event arguments using ABI input definitions.\n * @param args - The raw event arguments.\n * @param abiInputs - The ABI input definitions.\n * @returns The parsed event arguments.\n */\nfunction parseEventArgs(\n args: Result,\n abiInputs: { name: string }[],\n): Record<string, Hex | Hex[]> {\n return args.reduce((result, arg, index) => {\n const name = abiInputs[index].name.replace('_', '');\n const value = parseEventArgValue(arg);\n\n result[name] = value;\n\n return result;\n }, {});\n}\n\n/**\n * Parse an event argument value.\n * @param value - The event argument value.\n * @returns The parsed event argument value.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction parseEventArgValue(value: any): Hex | Hex[] {\n if (Array.isArray(value)) {\n return value.map(parseEventArgValue) as Hex[];\n }\n\n return (value.toHexString?.() ?? value).toLowerCase();\n}\n\n/**\n * Generate token balance changes from parsed events.\n * @param request - The transaction that was simulated.\n * @param events - The parsed events.\n * @returns An array of token balance changes.\n */\nasync function getTokenBalanceChanges(\n request: GetSimulationDataRequest,\n events: ParsedEvent[],\n): Promise<SimulationTokenBalanceChange[]> {\n const balanceTxs = getTokenBalanceTransactions(request, events);\n\n log('Generated balance transactions', [...balanceTxs.after.values()]);\n\n const transactions = [\n ...balanceTxs.before.values(),\n request,\n ...balanceTxs.after.values(),\n ];\n\n if (transactions.length === 1) {\n return [];\n }\n\n const response = await simulateTransactions(request.chainId as Hex, {\n transactions,\n });\n\n log('Balance simulation response', response);\n\n if (response.transactions.length !== transactions.length) {\n throw new SimulationInvalidResponseError();\n }\n\n return [...balanceTxs.after.keys()]\n .map((token, index) => {\n const previousBalanceCheckSkipped = !balanceTxs.before.get(token);\n const previousBalance = previousBalanceCheckSkipped\n ? '0x0'\n : getValueFromBalanceTransaction(\n request.from,\n token,\n response.transactions[index],\n );\n\n const newBalance = getValueFromBalanceTransaction(\n request.from,\n token,\n response.transactions[index + balanceTxs.before.size + 1],\n );\n\n const balanceChange = getSimulationBalanceChange(\n previousBalance,\n newBalance,\n );\n\n if (!balanceChange) {\n return undefined;\n }\n\n return {\n ...token,\n ...balanceChange,\n };\n })\n .filter((change) => change !== undefined) as SimulationTokenBalanceChange[];\n}\n\n/**\n * Generate transactions to check token balances.\n * @param request - The transaction that was simulated.\n * @param events - The parsed events.\n * @returns A map of token balance transactions keyed by token.\n */\nfunction getTokenBalanceTransactions(\n request: GetSimulationDataRequest,\n events: ParsedEvent[],\n): {\n before: BalanceTransactionMap;\n after: BalanceTransactionMap;\n} {\n const tokenKeys = new Set();\n const before = new Map();\n const after = new Map();\n\n const userEvents = events.filter(\n (event) =>\n SUPPORTED_EVENTS.includes(event.name) &&\n [event.args.from, event.args.to].includes(request.from),\n );\n\n log('Filtered user events', userEvents);\n\n for (const event of userEvents) {\n const tokenIds = getEventTokenIds(event);\n\n log('Extracted token ids', tokenIds);\n\n for (const tokenId of tokenIds) {\n const simulationToken: SimulationToken = {\n address: event.contractAddress,\n standard: event.tokenStandard,\n id: tokenId,\n };\n\n const tokenKey = JSON.stringify(simulationToken);\n\n if (tokenKeys.has(tokenKey)) {\n log(\n 'Ignoring additional event with same contract and token ID',\n simulationToken,\n );\n continue;\n }\n\n tokenKeys.add(tokenKey);\n\n const data = getBalanceTransactionData(\n event.tokenStandard,\n request.from,\n tokenId,\n );\n\n const transaction: SimulationRequestTransaction = {\n from: request.from,\n to: event.contractAddress,\n data,\n };\n\n if (skipPriorBalanceCheck(event)) {\n after.set(simulationToken, transaction);\n } else {\n before.set(simulationToken, transaction);\n after.set(simulationToken, transaction);\n }\n }\n }\n\n return { before, after };\n}\n\n/**\n * Check if an event needs to check the previous balance.\n * @param event - The parsed event.\n * @returns True if the prior balance check should be skipped.\n */\nfunction skipPriorBalanceCheck(event: ParsedEvent): boolean {\n // In the case of an NFT mint, we cannot check the NFT owner before the mint\n // as the balance check transaction would revert.\n return (\n event.name === 'Transfer' &&\n event.tokenStandard === SimulationTokenStandard.erc721 &&\n parseInt(event.args.from as string, 16) === 0\n );\n}\n\n/**\n * Extract token IDs from a parsed event.\n * @param event - The parsed event.\n * @returns An array of token IDs.\n */\nfunction getEventTokenIds(event: ParsedEvent): (Hex | undefined)[] {\n if (event.tokenStandard === SimulationTokenStandard.erc721) {\n return [event.args.tokenId as Hex];\n }\n\n if (\n event.tokenStandard === SimulationTokenStandard.erc1155 &&\n event.name === 'TransferSingle'\n ) {\n return [event.args.id as Hex];\n }\n\n if (\n event.tokenStandard === SimulationTokenStandard.erc1155 &&\n event.name === 'TransferBatch'\n ) {\n return event.args.ids as Hex[];\n }\n\n // ERC-20 does not have a token ID so default to undefined.\n return [undefined];\n}\n\n/**\n * Extract the value from a balance transaction response.\n * @param from - The address to check the balance of.\n * @param token - The token to check the balance of.\n * @param response - The balance transaction response.\n * @returns The value of the balance transaction.\n */\nfunction getValueFromBalanceTransaction(\n from: Hex,\n token: SimulationToken,\n response: SimulationResponseTransaction,\n): Hex {\n const normalizedReturn = normalizeReturnValue(response.return);\n\n if (token.standard === SimulationTokenStandard.erc721) {\n return normalizedReturn === from ? '0x1' : '0x0';\n }\n\n return normalizedReturn;\n}\n\n/**\n * Generate the balance transaction data for a token.\n * @param tokenStandard - The token standard.\n * @param from - The address to check the balance of.\n * @param tokenId - The token ID to check the balance of.\n * @returns The balance transaction data.\n */\nfunction getBalanceTransactionData(\n tokenStandard: SimulationTokenStandard,\n from: Hex,\n tokenId?: Hex,\n): Hex {\n switch (tokenStandard) {\n case SimulationTokenStandard.erc721:\n return new Interface(abiERC721).encodeFunctionData('ownerOf', [\n tokenId,\n ]) as Hex;\n\n case SimulationTokenStandard.erc1155:\n return new Interface(abiERC1155).encodeFunctionData('balanceOf', [\n from,\n tokenId,\n ]) as Hex;\n\n default:\n return new Interface(abiERC20).encodeFunctionData('balanceOf', [\n from,\n ]) as Hex;\n }\n}\n\n/**\n * Parse a raw event log using known ABIs.\n * @param eventLog - The raw event log.\n * @param interfaces - The contract interfaces.\n * @returns The parsed event log or undefined if it could not be parsed.\n */\nfunction parseLog(\n eventLog: SimulationResponseLog,\n interfaces: Map<SupportedToken, Interface>,\n):\n | (LogDescription & { abi: ABI; standard: SimulationTokenStandard })\n | undefined {\n const supportedTokens = Object.values(SupportedToken);\n\n for (const token of supportedTokens) {\n try {\n const contractInterface = interfaces.get(token) as Interface;\n const { abi, standard } = SUPPORTED_TOKEN_ABIS[token];\n\n return {\n ...contractInterface.parseLog(eventLog),\n abi,\n standard,\n };\n } catch (e) {\n continue;\n }\n }\n\n return undefined;\n}\n\n/**\n * Extract all logs from a call trace tree.\n * @param call - The root call trace.\n * @returns An array of logs.\n */\nfunction extractLogs(\n call: SimulationResponseCallTrace,\n): SimulationResponseLog[] {\n /* istanbul ignore next */\n const logs = call.logs ?? [];\n\n /* istanbul ignore next */\n const nestedCalls = call.calls ?? [];\n\n return [\n ...logs,\n ...nestedCalls.map((nestedCall) => extractLogs(nestedCall)).flat(),\n ];\n}\n\n/**\n * Generate balance change data from previous and new balances.\n * @param previousBalance - The previous balance.\n * @param newBalance - The new balance.\n * @returns The balance change data or undefined if unchanged.\n */\nfunction getSimulationBalanceChange(\n previousBalance: Hex,\n newBalance: Hex,\n): SimulationBalanceChange | undefined {\n const differenceBN = hexToBN(newBalance).sub(hexToBN(previousBalance));\n const isDecrease = differenceBN.isNeg();\n const difference = toHex(differenceBN.abs());\n\n if (differenceBN.isZero()) {\n log('Balance change is zero');\n return undefined;\n }\n\n return {\n previousBalance,\n newBalance,\n difference,\n isDecrease,\n };\n}\n\n/**\n * Normalize a return value.\n * @param value - The return value to normalize.\n * @returns The normalized return value.\n */\nfunction normalizeReturnValue(value: Hex): Hex {\n return toHex(hexToBN(value));\n}\n\n/**\n * Get the contract interfaces for all supported tokens.\n * @returns A map of supported tokens to their contract interfaces.\n */\nfunction getContractInterfaces(): Map<SupportedToken, Interface> {\n const supportedTokens = Object.values(SupportedToken);\n\n return new Map(\n supportedTokens.map((tokenType) => {\n const { abi } = SUPPORTED_TOKEN_ABIS[tokenType];\n const contractInterface = new Interface(abi);\n return [tokenType, contractInterface];\n }),\n );\n}\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DefaultGasFeeFlow
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-REOG6YD4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
projectLogger
|
|
6
6
|
} from "./chunk-UQQWZT6C.mjs";
|
|
7
7
|
import {
|
|
8
8
|
GasFeeEstimateLevel
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-N6JXPWLY.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__privateAdd,
|
|
12
12
|
__privateMethod
|
|
@@ -71,7 +71,7 @@ getLineaGasFees_fn = async function(request) {
|
|
|
71
71
|
maxPriorityFeePerGas: toHex(priorityFees[level])
|
|
72
72
|
}
|
|
73
73
|
}),
|
|
74
|
-
{}
|
|
74
|
+
{ type: "fee-market" /* FeeMarket */ }
|
|
75
75
|
);
|
|
76
76
|
return { estimates };
|
|
77
77
|
};
|
|
@@ -118,4 +118,4 @@ feesToString_fn = function(fees) {
|
|
|
118
118
|
export {
|
|
119
119
|
LineaGasFeeFlow
|
|
120
120
|
};
|
|
121
|
-
//# sourceMappingURL=chunk-
|
|
121
|
+
//# sourceMappingURL=chunk-XL3HBKDE.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/gas-flows/LineaGasFeeFlow.ts"],"sourcesContent":["import { ChainId, hexToBN, query, toHex } from '@metamask/controller-utils';\nimport type EthQuery from '@metamask/eth-query';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\nimport type BN from 'bn.js';\n\nimport { projectLogger } from '../logger';\nimport type {\n GasFeeEstimates,\n GasFeeFlow,\n GasFeeFlowRequest,\n GasFeeFlowResponse,\n TransactionMeta,\n} from '../types';\nimport { GasFeeEstimateLevel, GasFeeEstimateType } from '../types';\nimport { DefaultGasFeeFlow } from './DefaultGasFeeFlow';\n\ntype LineaEstimateGasResponse = {\n baseFeePerGas: Hex;\n priorityFeePerGas: Hex;\n};\n\ntype FeesByLevel = {\n [key in GasFeeEstimateLevel]: BN;\n};\n\nconst log = createModuleLogger(projectLogger, 'linea-gas-fee-flow');\n\nconst LINEA_CHAIN_IDS: Hex[] = [\n ChainId['linea-mainnet'],\n ChainId['linea-goerli'],\n ChainId['linea-sepolia'],\n];\n\nconst BASE_FEE_MULTIPLIERS = {\n low: 1,\n medium: 1.35,\n high: 1.7,\n};\n\nconst PRIORITY_FEE_MULTIPLIERS = {\n low: 1,\n medium: 1.05,\n high: 1.1,\n};\n\n/**\n * Implementation of a gas fee flow specific to Linea networks that obtains gas fee estimates using:\n * - The `linea_estimateGas` RPC method to obtain the base fee and lowest priority fee.\n * - Static multipliers to increase the base and priority fees.\n */\nexport class LineaGasFeeFlow implements GasFeeFlow {\n matchesTransaction(transactionMeta: TransactionMeta): boolean {\n return LINEA_CHAIN_IDS.includes(transactionMeta.chainId);\n }\n\n async getGasFees(request: GasFeeFlowRequest): Promise<GasFeeFlowResponse> {\n try {\n return await this.#getLineaGasFees(request);\n } catch (error) {\n log('Using default flow as fallback due to error', error);\n return new DefaultGasFeeFlow().getGasFees(request);\n }\n }\n\n async #getLineaGasFees(\n request: GasFeeFlowRequest,\n ): Promise<GasFeeFlowResponse> {\n const { ethQuery, transactionMeta } = request;\n\n const lineaResponse = await this.#getLineaResponse(\n transactionMeta,\n ethQuery,\n );\n\n log('Received Linea response', lineaResponse);\n\n const baseFees = this.#getValuesFromMultipliers(\n lineaResponse.baseFeePerGas,\n BASE_FEE_MULTIPLIERS,\n );\n\n log('Generated base fees', this.#feesToString(baseFees));\n\n const priorityFees = this.#getValuesFromMultipliers(\n lineaResponse.priorityFeePerGas,\n PRIORITY_FEE_MULTIPLIERS,\n );\n\n log('Generated priority fees', this.#feesToString(priorityFees));\n\n const maxFees = this.#getMaxFees(baseFees, priorityFees);\n\n log('Generated max fees', this.#feesToString(maxFees));\n\n const estimates = Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: {\n maxFeePerGas: toHex(maxFees[level]),\n maxPriorityFeePerGas: toHex(priorityFees[level]),\n },\n }),\n { type: GasFeeEstimateType.FeeMarket } as GasFeeEstimates,\n );\n\n return { estimates };\n }\n\n #getLineaResponse(\n transactionMeta: TransactionMeta,\n ethQuery: EthQuery,\n ): Promise<LineaEstimateGasResponse> {\n return query(ethQuery, 'linea_estimateGas', [\n {\n from: transactionMeta.txParams.from,\n to: transactionMeta.txParams.to,\n value: transactionMeta.txParams.value,\n input: transactionMeta.txParams.data,\n // Required in request but no impact on response.\n gasPrice: '0x100000000',\n },\n ]);\n }\n\n #getValuesFromMultipliers(\n value: Hex,\n multipliers: { low: number; medium: number; high: number },\n ): FeesByLevel {\n const base = hexToBN(value);\n const low = base.muln(multipliers.low);\n const medium = base.muln(multipliers.medium);\n const high = base.muln(multipliers.high);\n\n return {\n low,\n medium,\n high,\n };\n }\n\n #getMaxFees(\n baseFees: Record<GasFeeEstimateLevel, BN>,\n priorityFees: Record<GasFeeEstimateLevel, BN>,\n ): FeesByLevel {\n return {\n low: baseFees.low.add(priorityFees.low),\n medium: baseFees.medium.add(priorityFees.medium),\n high: baseFees.high.add(priorityFees.high),\n };\n }\n\n #feesToString(fees: FeesByLevel) {\n return Object.values(GasFeeEstimateLevel).map((level) =>\n fees[level].toString(10),\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,SAAS,SAAS,OAAO,aAAa;AAE/C,SAAS,0BAAoC;AAuB7C,IAAM,MAAM,mBAAmB,eAAe,oBAAoB;AAElE,IAAM,kBAAyB;AAAA,EAC7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AAAA,QAClC,sBAAsB,MAAM,aAAa,KAAK,CAAC;AAAA,MACjD;AAAA,IACF;AAAA,IACA,EAAE,mCAAmC;AAAA,EACvC;AAEA,SAAO,EAAE,UAAU;AACrB;AAEA;AAAA,sBAAiB,SACf,iBACA,UACmC;AACnC,SAAO,MAAM,UAAU,qBAAqB;AAAA,IAC1C;AAAA,MACE,MAAM,gBAAgB,SAAS;AAAA,MAC/B,IAAI,gBAAgB,SAAS;AAAA,MAC7B,OAAO,gBAAgB,SAAS;AAAA,MAChC,OAAO,gBAAgB,SAAS;AAAA;AAAA,MAEhC,UAAU;AAAA,IACZ;AAAA,EACF,CAAC;AACH;AAEA;AAAA,8BAAyB,SACvB,OACA,aACa;AACb,QAAM,OAAO,QAAQ,KAAK;AAC1B,QAAM,MAAM,KAAK,KAAK,YAAY,GAAG;AACrC,QAAM,SAAS,KAAK,KAAK,YAAY,MAAM;AAC3C,QAAM,OAAO,KAAK,KAAK,YAAY,IAAI;AAEvC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEA;AAAA,gBAAW,SACT,UACA,cACa;AACb,SAAO;AAAA,IACL,KAAK,SAAS,IAAI,IAAI,aAAa,GAAG;AAAA,IACtC,QAAQ,SAAS,OAAO,IAAI,aAAa,MAAM;AAAA,IAC/C,MAAM,SAAS,KAAK,IAAI,aAAa,IAAI;AAAA,EAC3C;AACF;AAEA;AAAA,kBAAa,SAAC,MAAmB;AAC/B,SAAO,OAAO,OAAO,mBAAmB,EAAE;AAAA,IAAI,CAAC,UAC7C,KAAK,KAAK,EAAE,SAAS,EAAE;AAAA,EACzB;AACF;","names":[]}
|
package/dist/errors.js
CHANGED
package/dist/errors.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var _chunkVJYFB7BMjs = require('../chunk-VJYFB7BM.js');
|
|
4
|
+
require('../chunk-KNYSD4JP.js');
|
|
5
5
|
require('../chunk-C2LNDHP4.js');
|
|
6
6
|
require('../chunk-UGFBA4GV.js');
|
|
7
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-EMDU4XLM.js');
|
|
8
8
|
require('../chunk-UGN7PBON.js');
|
|
9
9
|
require('../chunk-S6VGOPUY.js');
|
|
10
|
-
require('../chunk-
|
|
10
|
+
require('../chunk-5C3CSQAD.js');
|
|
11
11
|
require('../chunk-Z4BLTVTB.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.DefaultGasFeeFlow =
|
|
14
|
+
exports.DefaultGasFeeFlow = _chunkVJYFB7BMjs.DefaultGasFeeFlow;
|
|
15
15
|
//# sourceMappingURL=DefaultGasFeeFlow.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DefaultGasFeeFlow
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-REOG6YD4.mjs";
|
|
4
|
+
import "../chunk-4M7FHI4S.mjs";
|
|
5
5
|
import "../chunk-ZGUNOEUQ.mjs";
|
|
6
6
|
import "../chunk-J56A7UCK.mjs";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-AGJNOOBN.mjs";
|
|
8
8
|
import "../chunk-O6ZZVIFH.mjs";
|
|
9
9
|
import "../chunk-UQQWZT6C.mjs";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-N6JXPWLY.mjs";
|
|
11
11
|
import "../chunk-XUI43LEZ.mjs";
|
|
12
12
|
export {
|
|
13
13
|
DefaultGasFeeFlow
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
3
|
+
var _chunkDUFOYA4Djs = require('../chunk-DUFOYA4D.js');
|
|
4
|
+
require('../chunk-VJYFB7BM.js');
|
|
5
|
+
require('../chunk-KNYSD4JP.js');
|
|
6
6
|
require('../chunk-C2LNDHP4.js');
|
|
7
7
|
require('../chunk-UGFBA4GV.js');
|
|
8
|
-
require('../chunk-
|
|
8
|
+
require('../chunk-EMDU4XLM.js');
|
|
9
9
|
require('../chunk-UGN7PBON.js');
|
|
10
10
|
require('../chunk-S6VGOPUY.js');
|
|
11
|
-
require('../chunk-
|
|
11
|
+
require('../chunk-5C3CSQAD.js');
|
|
12
12
|
require('../chunk-Z4BLTVTB.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
exports.LineaGasFeeFlow =
|
|
15
|
+
exports.LineaGasFeeFlow = _chunkDUFOYA4Djs.LineaGasFeeFlow;
|
|
16
16
|
//# sourceMappingURL=LineaGasFeeFlow.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LineaGasFeeFlow
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-XL3HBKDE.mjs";
|
|
4
|
+
import "../chunk-REOG6YD4.mjs";
|
|
5
|
+
import "../chunk-4M7FHI4S.mjs";
|
|
6
6
|
import "../chunk-ZGUNOEUQ.mjs";
|
|
7
7
|
import "../chunk-J56A7UCK.mjs";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-AGJNOOBN.mjs";
|
|
9
9
|
import "../chunk-O6ZZVIFH.mjs";
|
|
10
10
|
import "../chunk-UQQWZT6C.mjs";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-N6JXPWLY.mjs";
|
|
12
12
|
import "../chunk-XUI43LEZ.mjs";
|
|
13
13
|
export {
|
|
14
14
|
LineaGasFeeFlow
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkTJMQEH57js = require('../chunk-TJMQEH57.js');
|
|
4
|
+
require('../chunk-5C3CSQAD.js');
|
|
5
|
+
require('../chunk-Z4BLTVTB.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.TestGasFeeFlow = _chunkTJMQEH57js.TestGasFeeFlow;
|
|
9
|
+
//# sourceMappingURL=TestGasFeeFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -4,7 +4,7 @@ var _chunkEQT25RSPjs = require('../chunk-EQT25RSP.js');
|
|
|
4
4
|
require('../chunk-FDUCRHYT.js');
|
|
5
5
|
require('../chunk-UGN7PBON.js');
|
|
6
6
|
require('../chunk-S6VGOPUY.js');
|
|
7
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-5C3CSQAD.js');
|
|
8
8
|
require('../chunk-Z4BLTVTB.js');
|
|
9
9
|
|
|
10
10
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk7DJO6UZAjs = require('../chunk-7DJO6UZA.js');
|
|
4
4
|
require('../chunk-2XKEAKQG.js');
|
|
5
|
-
require('../chunk-
|
|
5
|
+
require('../chunk-EMDU4XLM.js');
|
|
6
6
|
require('../chunk-S6VGOPUY.js');
|
|
7
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-5C3CSQAD.js');
|
|
8
8
|
require('../chunk-Z4BLTVTB.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.GasFeePoller =
|
|
11
|
+
exports.GasFeePoller = _chunk7DJO6UZAjs.GasFeePoller;
|
|
12
12
|
//# sourceMappingURL=GasFeePoller.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GasFeePoller
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-SL3GHHKG.mjs";
|
|
4
4
|
import "../chunk-NOHEXQ7Y.mjs";
|
|
5
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-AGJNOOBN.mjs";
|
|
6
6
|
import "../chunk-UQQWZT6C.mjs";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-N6JXPWLY.mjs";
|
|
8
8
|
import "../chunk-XUI43LEZ.mjs";
|
|
9
9
|
export {
|
|
10
10
|
GasFeePoller
|
|
@@ -5,7 +5,7 @@ import "../chunk-CPMTUMMZ.mjs";
|
|
|
5
5
|
import "../chunk-QZLPYOGC.mjs";
|
|
6
6
|
import "../chunk-O6ZZVIFH.mjs";
|
|
7
7
|
import "../chunk-UQQWZT6C.mjs";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-N6JXPWLY.mjs";
|
|
9
9
|
import "../chunk-XUI43LEZ.mjs";
|
|
10
10
|
export {
|
|
11
11
|
MultichainTrackingHelper
|
package/dist/index.js
CHANGED
|
@@ -2,31 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkN55SEKK7js = require('./chunk-N55SEKK7.js');
|
|
6
|
+
require('./chunk-ZNZEJDOE.js');
|
|
7
|
+
require('./chunk-X3KACH5P.js');
|
|
7
8
|
require('./chunk-KT6UAKBB.js');
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
var _chunkSD6CWFDFjs = require('./chunk-SD6CWFDF.js');
|
|
11
12
|
require('./chunk-VH47Q6TS.js');
|
|
13
|
+
require('./chunk-5KMU2IAT.js');
|
|
12
14
|
require('./chunk-7LXE4KHV.js');
|
|
13
15
|
require('./chunk-V72C4MCR.js');
|
|
14
16
|
require('./chunk-QP75SWIQ.js');
|
|
15
|
-
require('./chunk-ZNZEJDOE.js');
|
|
16
17
|
require('./chunk-NYKRCWBG.js');
|
|
17
18
|
require('./chunk-WR5F34OW.js');
|
|
18
19
|
require('./chunk-YVCX6Z75.js');
|
|
19
|
-
require('./chunk-
|
|
20
|
+
require('./chunk-TJMQEH57.js');
|
|
21
|
+
require('./chunk-7DJO6UZA.js');
|
|
20
22
|
require('./chunk-2XKEAKQG.js');
|
|
21
23
|
require('./chunk-DTDTOMTB.js');
|
|
22
24
|
require('./chunk-5XQ2KRYL.js');
|
|
23
25
|
require('./chunk-EQT25RSP.js');
|
|
24
26
|
require('./chunk-FDUCRHYT.js');
|
|
25
|
-
require('./chunk-5KMU2IAT.js');
|
|
26
27
|
require('./chunk-HMOSP33F.js');
|
|
27
|
-
require('./chunk-
|
|
28
|
-
require('./chunk-
|
|
29
|
-
require('./chunk-
|
|
28
|
+
require('./chunk-DUFOYA4D.js');
|
|
29
|
+
require('./chunk-VJYFB7BM.js');
|
|
30
|
+
require('./chunk-KNYSD4JP.js');
|
|
30
31
|
require('./chunk-C2LNDHP4.js');
|
|
31
32
|
|
|
32
33
|
|
|
@@ -34,7 +35,7 @@ require('./chunk-C2LNDHP4.js');
|
|
|
34
35
|
var _chunkUGFBA4GVjs = require('./chunk-UGFBA4GV.js');
|
|
35
36
|
|
|
36
37
|
|
|
37
|
-
var
|
|
38
|
+
var _chunkEMDU4XLMjs = require('./chunk-EMDU4XLM.js');
|
|
38
39
|
require('./chunk-UGN7PBON.js');
|
|
39
40
|
require('./chunk-S6VGOPUY.js');
|
|
40
41
|
|
|
@@ -45,7 +46,9 @@ require('./chunk-S6VGOPUY.js');
|
|
|
45
46
|
|
|
46
47
|
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
var _chunk5C3CSQADjs = require('./chunk-5C3CSQAD.js');
|
|
49
52
|
require('./chunk-Z4BLTVTB.js');
|
|
50
53
|
|
|
51
54
|
|
|
@@ -62,5 +65,7 @@ require('./chunk-Z4BLTVTB.js');
|
|
|
62
65
|
|
|
63
66
|
|
|
64
67
|
|
|
65
|
-
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
exports.CANCEL_RATE = _chunkN55SEKK7js.CANCEL_RATE; exports.GasFeeEstimateLevel = _chunk5C3CSQADjs.GasFeeEstimateLevel; exports.GasFeeEstimateType = _chunk5C3CSQADjs.GasFeeEstimateType; exports.HARDFORK = _chunkN55SEKK7js.HARDFORK; exports.SimulationErrorCode = _chunk5C3CSQADjs.SimulationErrorCode; exports.SimulationTokenStandard = _chunk5C3CSQADjs.SimulationTokenStandard; exports.TransactionController = _chunkN55SEKK7js.TransactionController; exports.TransactionEnvelopeType = _chunk5C3CSQADjs.TransactionEnvelopeType; exports.TransactionStatus = _chunk5C3CSQADjs.TransactionStatus; exports.TransactionType = _chunk5C3CSQADjs.TransactionType; exports.UserFeeLevel = _chunk5C3CSQADjs.UserFeeLevel; exports.WalletDevice = _chunk5C3CSQADjs.WalletDevice; exports.determineTransactionType = _chunkSD6CWFDFjs.determineTransactionType; exports.isEIP1559Transaction = _chunkUGFBA4GVjs.isEIP1559Transaction; exports.mergeGasFeeEstimates = _chunkEMDU4XLMjs.mergeGasFeeEstimates; exports.normalizeTransactionParams = _chunkUGFBA4GVjs.normalizeTransactionParams;
|
|
66
71
|
//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
CHANGED
|
@@ -2,31 +2,32 @@ import {
|
|
|
2
2
|
CANCEL_RATE,
|
|
3
3
|
HARDFORK,
|
|
4
4
|
TransactionController
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-7TPXSDXL.mjs";
|
|
6
|
+
import "./chunk-NHRBO3LU.mjs";
|
|
7
|
+
import "./chunk-MDRMMUMS.mjs";
|
|
7
8
|
import "./chunk-K4KOSAGM.mjs";
|
|
8
9
|
import {
|
|
9
10
|
determineTransactionType
|
|
10
11
|
} from "./chunk-KG4UW4K4.mjs";
|
|
11
12
|
import "./chunk-NM6OYEPP.mjs";
|
|
13
|
+
import "./chunk-5YES3V2R.mjs";
|
|
12
14
|
import "./chunk-FRKQ3Z2L.mjs";
|
|
13
15
|
import "./chunk-5G6OHAXI.mjs";
|
|
14
16
|
import "./chunk-XGRAHX6T.mjs";
|
|
15
|
-
import "./chunk-NHRBO3LU.mjs";
|
|
16
17
|
import "./chunk-VEVVBHP3.mjs";
|
|
17
18
|
import "./chunk-Z4GV3YQQ.mjs";
|
|
18
19
|
import "./chunk-FG74Z3F5.mjs";
|
|
19
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-FMRLPVFZ.mjs";
|
|
21
|
+
import "./chunk-SL3GHHKG.mjs";
|
|
20
22
|
import "./chunk-NOHEXQ7Y.mjs";
|
|
21
23
|
import "./chunk-Y7ENNK7L.mjs";
|
|
22
24
|
import "./chunk-F6E3TTR3.mjs";
|
|
23
25
|
import "./chunk-CPMTUMMZ.mjs";
|
|
24
26
|
import "./chunk-QZLPYOGC.mjs";
|
|
25
|
-
import "./chunk-5YES3V2R.mjs";
|
|
26
27
|
import "./chunk-HQSNKCXI.mjs";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-XL3HBKDE.mjs";
|
|
29
|
+
import "./chunk-REOG6YD4.mjs";
|
|
30
|
+
import "./chunk-4M7FHI4S.mjs";
|
|
30
31
|
import "./chunk-ZGUNOEUQ.mjs";
|
|
31
32
|
import {
|
|
32
33
|
isEIP1559Transaction,
|
|
@@ -34,10 +35,12 @@ import {
|
|
|
34
35
|
} from "./chunk-J56A7UCK.mjs";
|
|
35
36
|
import {
|
|
36
37
|
mergeGasFeeEstimates
|
|
37
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-AGJNOOBN.mjs";
|
|
38
39
|
import "./chunk-O6ZZVIFH.mjs";
|
|
39
40
|
import "./chunk-UQQWZT6C.mjs";
|
|
40
41
|
import {
|
|
42
|
+
GasFeeEstimateLevel,
|
|
43
|
+
GasFeeEstimateType,
|
|
41
44
|
SimulationErrorCode,
|
|
42
45
|
SimulationTokenStandard,
|
|
43
46
|
TransactionEnvelopeType,
|
|
@@ -45,10 +48,12 @@ import {
|
|
|
45
48
|
TransactionType,
|
|
46
49
|
UserFeeLevel,
|
|
47
50
|
WalletDevice
|
|
48
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-N6JXPWLY.mjs";
|
|
49
52
|
import "./chunk-XUI43LEZ.mjs";
|
|
50
53
|
export {
|
|
51
54
|
CANCEL_RATE,
|
|
55
|
+
GasFeeEstimateLevel,
|
|
56
|
+
GasFeeEstimateType,
|
|
52
57
|
HARDFORK,
|
|
53
58
|
SimulationErrorCode,
|
|
54
59
|
SimulationTokenStandard,
|