@t2000/cli 0.22.26 → 0.23.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.
Files changed (34) hide show
  1. package/README.md +11 -97
  2. package/dist/{ccip-JEEJV65M.js → ccip-XP27NGI7.js} +3 -3
  3. package/dist/{chunk-A5X4KG7U.js → chunk-3I6VJOM6.js} +210 -970
  4. package/dist/chunk-3I6VJOM6.js.map +1 -0
  5. package/dist/chunk-4N76GQCL.js +35382 -0
  6. package/dist/chunk-4N76GQCL.js.map +1 -0
  7. package/dist/{chunk-XOAZJ42V.js → chunk-DWOZSUBE.js} +588 -584
  8. package/dist/{chunk-XOAZJ42V.js.map → chunk-DWOZSUBE.js.map} +1 -1
  9. package/dist/chunk-EI3GHTKX.js +968 -0
  10. package/dist/chunk-EI3GHTKX.js.map +1 -0
  11. package/dist/{chunk-EEPD7SHV.js → chunk-TYYJRUQI.js} +15755 -15918
  12. package/dist/chunk-TYYJRUQI.js.map +1 -0
  13. package/dist/client-5KJQTN5X.js +84 -0
  14. package/dist/client-5KJQTN5X.js.map +1 -0
  15. package/dist/{client-R3NRAXMD.js → client-IXUBQ3HM.js} +334 -638
  16. package/dist/client-IXUBQ3HM.js.map +1 -0
  17. package/dist/{dist-NBWIWHHS.js → dist-E7HUP73Q.js} +5 -29
  18. package/dist/{dist-KJM2NT74.js → dist-W4Q4YXD7.js} +4200 -603
  19. package/dist/dist-W4Q4YXD7.js.map +1 -0
  20. package/dist/index.js +29 -1016
  21. package/dist/index.js.map +1 -1
  22. package/package.json +4 -5
  23. package/dist/chunk-3WKGZRWT.js +0 -77733
  24. package/dist/chunk-3WKGZRWT.js.map +0 -1
  25. package/dist/chunk-77SWBATH.js +0 -204
  26. package/dist/chunk-77SWBATH.js.map +0 -1
  27. package/dist/chunk-A5X4KG7U.js.map +0 -1
  28. package/dist/chunk-EEPD7SHV.js.map +0 -1
  29. package/dist/client-CK5OR2TP.js +0 -746
  30. package/dist/client-CK5OR2TP.js.map +0 -1
  31. package/dist/client-R3NRAXMD.js.map +0 -1
  32. package/dist/dist-KJM2NT74.js.map +0 -1
  33. /package/dist/{ccip-JEEJV65M.js.map → ccip-XP27NGI7.js.map} +0 -0
  34. /package/dist/{dist-NBWIWHHS.js.map → dist-E7HUP73Q.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/regex.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/runtime/signatures.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/version.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/errors.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/errors/abiItem.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/errors/abiParameter.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/errors/signature.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/errors/struct.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/errors/splitParameters.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/runtime/cache.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/runtime/utils.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/runtime/structs.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/parseAbi.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/formatAbiParameter.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/formatAbiParameters.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/formatAbiItem.ts","../../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3_zod@4.3.6/node_modules/abitype/src/human-readable/parseAbiParameters.ts","../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/src/sha3.ts"],"sourcesContent":["// TODO: This looks cool. Need to check the performance of `new RegExp` versus defined inline though.\n// https://twitter.com/GabrielVergnaud/status/1622906834343366657\nexport function execTyped<type>(regex: RegExp, string: string) {\n const match = regex.exec(string)\n return match?.groups as type | undefined\n}\n\n// `bytes<M>`: binary type of `M` bytes, `0 < M <= 32`\n// https://regexr.com/6va55\nexport const bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/\n\n// `(u)int<M>`: (un)signed integer type of `M` bits, `0 < M <= 256`, `M % 8 == 0`\n// https://regexr.com/6v8hp\nexport const integerRegex =\n /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/\n\nexport const isTupleRegex = /^\\(.+?\\).*?$/\n","import type { AbiStateMutability } from '../../abi.js'\nimport { execTyped } from '../../regex.js'\nimport type {\n EventModifier,\n FunctionModifier,\n Modifier,\n} from '../types/signatures.js'\n\n// https://regexr.com/7gmok\nconst errorSignatureRegex =\n /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?<parameters>.*?)\\)$/\nexport function isErrorSignature(signature: string) {\n return errorSignatureRegex.test(signature)\n}\nexport function execErrorSignature(signature: string) {\n return execTyped<{ name: string; parameters: string }>(\n errorSignatureRegex,\n signature,\n )\n}\n\n// https://regexr.com/7gmoq\nconst eventSignatureRegex =\n /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?<parameters>.*?)\\)$/\nexport function isEventSignature(signature: string) {\n return eventSignatureRegex.test(signature)\n}\nexport function execEventSignature(signature: string) {\n return execTyped<{ name: string; parameters: string }>(\n eventSignatureRegex,\n signature,\n )\n}\n\n// https://regexr.com/7gmot\nconst functionSignatureRegex =\n /^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?<parameters>.*?)\\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\\s?\\((?<returns>.*?)\\))?$/\nexport function isFunctionSignature(signature: string) {\n return functionSignatureRegex.test(signature)\n}\nexport function execFunctionSignature(signature: string) {\n return execTyped<{\n name: string\n parameters: string\n stateMutability?: AbiStateMutability\n returns?: string\n }>(functionSignatureRegex, signature)\n}\n\n// https://regexr.com/7gmp3\nconst structSignatureRegex =\n /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \\{(?<properties>.*?)\\}$/\nexport function isStructSignature(signature: string) {\n return structSignatureRegex.test(signature)\n}\nexport function execStructSignature(signature: string) {\n return execTyped<{ name: string; properties: string }>(\n structSignatureRegex,\n signature,\n )\n}\n\n// https://regexr.com/78u01\nconst constructorSignatureRegex =\n /^constructor\\((?<parameters>.*?)\\)(?:\\s(?<stateMutability>payable{1}))?$/\nexport function isConstructorSignature(signature: string) {\n return constructorSignatureRegex.test(signature)\n}\nexport function execConstructorSignature(signature: string) {\n return execTyped<{\n parameters: string\n stateMutability?: Extract<AbiStateMutability, 'payable'>\n }>(constructorSignatureRegex, signature)\n}\n\n// https://regexr.com/7srtn\nconst fallbackSignatureRegex =\n /^fallback\\(\\) external(?:\\s(?<stateMutability>payable{1}))?$/\nexport function isFallbackSignature(signature: string) {\n return fallbackSignatureRegex.test(signature)\n}\nexport function execFallbackSignature(signature: string) {\n return execTyped<{\n parameters: string\n stateMutability?: Extract<AbiStateMutability, 'payable'>\n }>(fallbackSignatureRegex, signature)\n}\n\n// https://regexr.com/78u1k\nconst receiveSignatureRegex = /^receive\\(\\) external payable$/\nexport function isReceiveSignature(signature: string) {\n return receiveSignatureRegex.test(signature)\n}\n\nexport const modifiers = new Set<Modifier>([\n 'memory',\n 'indexed',\n 'storage',\n 'calldata',\n])\nexport const eventModifiers = new Set<EventModifier>(['indexed'])\nexport const functionModifiers = new Set<FunctionModifier>([\n 'calldata',\n 'memory',\n 'storage',\n])\n","export const version = '1.2.3'\n","import type { OneOf, Pretty } from './types.js'\nimport { version } from './version.js'\n\ntype BaseErrorArgs = Pretty<\n {\n docsPath?: string | undefined\n metaMessages?: string[] | undefined\n } & OneOf<{ details?: string | undefined } | { cause?: BaseError | Error }>\n>\n\nexport class BaseError extends Error {\n details: string\n docsPath?: string | undefined\n metaMessages?: string[] | undefined\n shortMessage: string\n\n override name = 'AbiTypeError'\n\n constructor(shortMessage: string, args: BaseErrorArgs = {}) {\n const details =\n args.cause instanceof BaseError\n ? args.cause.details\n : args.cause?.message\n ? args.cause.message\n : args.details!\n const docsPath =\n args.cause instanceof BaseError\n ? args.cause.docsPath || args.docsPath\n : args.docsPath\n const message = [\n shortMessage || 'An error occurred.',\n '',\n ...(args.metaMessages ? [...args.metaMessages, ''] : []),\n ...(docsPath ? [`Docs: https://abitype.dev${docsPath}`] : []),\n ...(details ? [`Details: ${details}`] : []),\n `Version: abitype@${version}`,\n ].join('\\n')\n\n super(message)\n\n if (args.cause) this.cause = args.cause\n this.details = details\n this.docsPath = docsPath\n this.metaMessages = args.metaMessages\n this.shortMessage = shortMessage\n }\n}\n","import { BaseError } from '../../errors.js'\n\nexport class InvalidAbiItemError extends BaseError {\n override name = 'InvalidAbiItemError'\n\n constructor({ signature }: { signature: string | object }) {\n super('Failed to parse ABI item.', {\n details: `parseAbiItem(${JSON.stringify(signature, null, 2)})`,\n docsPath: '/api/human#parseabiitem-1',\n })\n }\n}\n\nexport class UnknownTypeError extends BaseError {\n override name = 'UnknownTypeError'\n\n constructor({ type }: { type: string }) {\n super('Unknown type.', {\n metaMessages: [\n `Type \"${type}\" is not a valid ABI type. Perhaps you forgot to include a struct signature?`,\n ],\n })\n }\n}\n\nexport class UnknownSolidityTypeError extends BaseError {\n override name = 'UnknownSolidityTypeError'\n\n constructor({ type }: { type: string }) {\n super('Unknown type.', {\n metaMessages: [`Type \"${type}\" is not a valid ABI type.`],\n })\n }\n}\n","import type { AbiItemType, AbiParameter } from '../../abi.js'\nimport { BaseError } from '../../errors.js'\nimport type { Modifier } from '../types/signatures.js'\n\nexport class InvalidAbiParameterError extends BaseError {\n override name = 'InvalidAbiParameterError'\n\n constructor({ param }: { param: string | object }) {\n super('Failed to parse ABI parameter.', {\n details: `parseAbiParameter(${JSON.stringify(param, null, 2)})`,\n docsPath: '/api/human#parseabiparameter-1',\n })\n }\n}\n\nexport class InvalidAbiParametersError extends BaseError {\n override name = 'InvalidAbiParametersError'\n\n constructor({ params }: { params: string | object }) {\n super('Failed to parse ABI parameters.', {\n details: `parseAbiParameters(${JSON.stringify(params, null, 2)})`,\n docsPath: '/api/human#parseabiparameters-1',\n })\n }\n}\n\nexport class InvalidParameterError extends BaseError {\n override name = 'InvalidParameterError'\n\n constructor({ param }: { param: string }) {\n super('Invalid ABI parameter.', {\n details: param,\n })\n }\n}\n\nexport class SolidityProtectedKeywordError extends BaseError {\n override name = 'SolidityProtectedKeywordError'\n\n constructor({ param, name }: { param: string; name: string }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `\"${name}\" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`,\n ],\n })\n }\n}\n\nexport class InvalidModifierError extends BaseError {\n override name = 'InvalidModifierError'\n\n constructor({\n param,\n type,\n modifier,\n }: {\n param: string\n type?: AbiItemType | 'struct' | undefined\n modifier: Modifier\n }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `Modifier \"${modifier}\" not allowed${\n type ? ` in \"${type}\" type` : ''\n }.`,\n ],\n })\n }\n}\n\nexport class InvalidFunctionModifierError extends BaseError {\n override name = 'InvalidFunctionModifierError'\n\n constructor({\n param,\n type,\n modifier,\n }: {\n param: string\n type?: AbiItemType | 'struct' | undefined\n modifier: Modifier\n }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `Modifier \"${modifier}\" not allowed${\n type ? ` in \"${type}\" type` : ''\n }.`,\n `Data location can only be specified for array, struct, or mapping types, but \"${modifier}\" was given.`,\n ],\n })\n }\n}\n\nexport class InvalidAbiTypeParameterError extends BaseError {\n override name = 'InvalidAbiTypeParameterError'\n\n constructor({\n abiParameter,\n }: {\n abiParameter: AbiParameter & { indexed?: boolean | undefined }\n }) {\n super('Invalid ABI parameter.', {\n details: JSON.stringify(abiParameter, null, 2),\n metaMessages: ['ABI parameter type is invalid.'],\n })\n }\n}\n","import type { AbiItemType } from '../../abi.js'\nimport { BaseError } from '../../errors.js'\n\nexport class InvalidSignatureError extends BaseError {\n override name = 'InvalidSignatureError'\n\n constructor({\n signature,\n type,\n }: {\n signature: string\n type: AbiItemType | 'struct'\n }) {\n super(`Invalid ${type} signature.`, {\n details: signature,\n })\n }\n}\n\nexport class UnknownSignatureError extends BaseError {\n override name = 'UnknownSignatureError'\n\n constructor({ signature }: { signature: string }) {\n super('Unknown signature.', {\n details: signature,\n })\n }\n}\n\nexport class InvalidStructSignatureError extends BaseError {\n override name = 'InvalidStructSignatureError'\n\n constructor({ signature }: { signature: string }) {\n super('Invalid struct signature.', {\n details: signature,\n metaMessages: ['No properties exist.'],\n })\n }\n}\n","import { BaseError } from '../../errors.js'\n\nexport class CircularReferenceError extends BaseError {\n override name = 'CircularReferenceError'\n\n constructor({ type }: { type: string }) {\n super('Circular reference detected.', {\n metaMessages: [`Struct \"${type}\" is a circular reference.`],\n })\n }\n}\n","import { BaseError } from '../../errors.js'\n\nexport class InvalidParenthesisError extends BaseError {\n override name = 'InvalidParenthesisError'\n\n constructor({ current, depth }: { current: string; depth: number }) {\n super('Unbalanced parentheses.', {\n metaMessages: [\n `\"${current.trim()}\" has too many ${\n depth > 0 ? 'opening' : 'closing'\n } parentheses.`,\n ],\n details: `Depth \"${depth}\"`,\n })\n }\n}\n","import type { AbiItemType, AbiParameter } from '../../abi.js'\nimport type { StructLookup } from '../types/structs.js'\n\n/**\n * Gets {@link parameterCache} cache key namespaced by {@link type} and {@link structs}. This prevents parameters from being accessible to types that don't allow them (e.g. `string indexed foo` not allowed outside of `type: 'event'`) and ensures different struct definitions with the same name are cached separately.\n * @param param ABI parameter string\n * @param type ABI parameter type\n * @param structs Struct definitions to include in cache key\n * @returns Cache key for {@link parameterCache}\n */\nexport function getParameterCacheKey(\n param: string,\n type?: AbiItemType | 'struct',\n structs?: StructLookup,\n) {\n let structKey = ''\n if (structs)\n for (const struct of Object.entries(structs)) {\n if (!struct) continue\n let propertyKey = ''\n for (const property of struct[1]) {\n propertyKey += `[${property.type}${property.name ? `:${property.name}` : ''}]`\n }\n structKey += `(${struct[0]}{${propertyKey}})`\n }\n if (type) return `${type}:${param}${structKey}`\n return `${param}${structKey}`\n}\n\n/**\n * Basic cache seeded with common ABI parameter strings.\n *\n * **Note: When seeding more parameters, make sure you benchmark performance. The current number is the ideal balance between performance and having an already existing cache.**\n */\nexport const parameterCache = new Map<\n string,\n AbiParameter & { indexed?: boolean }\n>([\n // Unnamed\n ['address', { type: 'address' }],\n ['bool', { type: 'bool' }],\n ['bytes', { type: 'bytes' }],\n ['bytes32', { type: 'bytes32' }],\n ['int', { type: 'int256' }],\n ['int256', { type: 'int256' }],\n ['string', { type: 'string' }],\n ['uint', { type: 'uint256' }],\n ['uint8', { type: 'uint8' }],\n ['uint16', { type: 'uint16' }],\n ['uint24', { type: 'uint24' }],\n ['uint32', { type: 'uint32' }],\n ['uint64', { type: 'uint64' }],\n ['uint96', { type: 'uint96' }],\n ['uint112', { type: 'uint112' }],\n ['uint160', { type: 'uint160' }],\n ['uint192', { type: 'uint192' }],\n ['uint256', { type: 'uint256' }],\n\n // Named\n ['address owner', { type: 'address', name: 'owner' }],\n ['address to', { type: 'address', name: 'to' }],\n ['bool approved', { type: 'bool', name: 'approved' }],\n ['bytes _data', { type: 'bytes', name: '_data' }],\n ['bytes data', { type: 'bytes', name: 'data' }],\n ['bytes signature', { type: 'bytes', name: 'signature' }],\n ['bytes32 hash', { type: 'bytes32', name: 'hash' }],\n ['bytes32 r', { type: 'bytes32', name: 'r' }],\n ['bytes32 root', { type: 'bytes32', name: 'root' }],\n ['bytes32 s', { type: 'bytes32', name: 's' }],\n ['string name', { type: 'string', name: 'name' }],\n ['string symbol', { type: 'string', name: 'symbol' }],\n ['string tokenURI', { type: 'string', name: 'tokenURI' }],\n ['uint tokenId', { type: 'uint256', name: 'tokenId' }],\n ['uint8 v', { type: 'uint8', name: 'v' }],\n ['uint256 balance', { type: 'uint256', name: 'balance' }],\n ['uint256 tokenId', { type: 'uint256', name: 'tokenId' }],\n ['uint256 value', { type: 'uint256', name: 'value' }],\n\n // Indexed\n [\n 'event:address indexed from',\n { type: 'address', name: 'from', indexed: true },\n ],\n ['event:address indexed to', { type: 'address', name: 'to', indexed: true }],\n [\n 'event:uint indexed tokenId',\n { type: 'uint256', name: 'tokenId', indexed: true },\n ],\n [\n 'event:uint256 indexed tokenId',\n { type: 'uint256', name: 'tokenId', indexed: true },\n ],\n])\n","import type {\n AbiItemType,\n AbiType,\n SolidityArray,\n SolidityBytes,\n SolidityString,\n SolidityTuple,\n} from '../../abi.js'\nimport {\n bytesRegex,\n execTyped,\n integerRegex,\n isTupleRegex,\n} from '../../regex.js'\nimport { UnknownSolidityTypeError } from '../errors/abiItem.js'\nimport {\n InvalidFunctionModifierError,\n InvalidModifierError,\n InvalidParameterError,\n SolidityProtectedKeywordError,\n} from '../errors/abiParameter.js'\nimport {\n InvalidSignatureError,\n UnknownSignatureError,\n} from '../errors/signature.js'\nimport { InvalidParenthesisError } from '../errors/splitParameters.js'\nimport type { FunctionModifier, Modifier } from '../types/signatures.js'\nimport type { StructLookup } from '../types/structs.js'\nimport { getParameterCacheKey, parameterCache } from './cache.js'\nimport {\n eventModifiers,\n execConstructorSignature,\n execErrorSignature,\n execEventSignature,\n execFallbackSignature,\n execFunctionSignature,\n functionModifiers,\n isConstructorSignature,\n isErrorSignature,\n isEventSignature,\n isFallbackSignature,\n isFunctionSignature,\n isReceiveSignature,\n} from './signatures.js'\n\nexport function parseSignature(signature: string, structs: StructLookup = {}) {\n if (isFunctionSignature(signature))\n return parseFunctionSignature(signature, structs)\n\n if (isEventSignature(signature))\n return parseEventSignature(signature, structs)\n\n if (isErrorSignature(signature))\n return parseErrorSignature(signature, structs)\n\n if (isConstructorSignature(signature))\n return parseConstructorSignature(signature, structs)\n\n if (isFallbackSignature(signature)) return parseFallbackSignature(signature)\n\n if (isReceiveSignature(signature))\n return {\n type: 'receive',\n stateMutability: 'payable',\n }\n\n throw new UnknownSignatureError({ signature })\n}\n\nexport function parseFunctionSignature(\n signature: string,\n structs: StructLookup = {},\n) {\n const match = execFunctionSignature(signature)\n if (!match) throw new InvalidSignatureError({ signature, type: 'function' })\n\n const inputParams = splitParameters(match.parameters)\n const inputs = []\n const inputLength = inputParams.length\n for (let i = 0; i < inputLength; i++) {\n inputs.push(\n parseAbiParameter(inputParams[i]!, {\n modifiers: functionModifiers,\n structs,\n type: 'function',\n }),\n )\n }\n\n const outputs = []\n if (match.returns) {\n const outputParams = splitParameters(match.returns)\n const outputLength = outputParams.length\n for (let i = 0; i < outputLength; i++) {\n outputs.push(\n parseAbiParameter(outputParams[i]!, {\n modifiers: functionModifiers,\n structs,\n type: 'function',\n }),\n )\n }\n }\n\n return {\n name: match.name,\n type: 'function',\n stateMutability: match.stateMutability ?? 'nonpayable',\n inputs,\n outputs,\n }\n}\n\nexport function parseEventSignature(\n signature: string,\n structs: StructLookup = {},\n) {\n const match = execEventSignature(signature)\n if (!match) throw new InvalidSignatureError({ signature, type: 'event' })\n\n const params = splitParameters(match.parameters)\n const abiParameters = []\n const length = params.length\n for (let i = 0; i < length; i++)\n abiParameters.push(\n parseAbiParameter(params[i]!, {\n modifiers: eventModifiers,\n structs,\n type: 'event',\n }),\n )\n return { name: match.name, type: 'event', inputs: abiParameters }\n}\n\nexport function parseErrorSignature(\n signature: string,\n structs: StructLookup = {},\n) {\n const match = execErrorSignature(signature)\n if (!match) throw new InvalidSignatureError({ signature, type: 'error' })\n\n const params = splitParameters(match.parameters)\n const abiParameters = []\n const length = params.length\n for (let i = 0; i < length; i++)\n abiParameters.push(\n parseAbiParameter(params[i]!, { structs, type: 'error' }),\n )\n return { name: match.name, type: 'error', inputs: abiParameters }\n}\n\nexport function parseConstructorSignature(\n signature: string,\n structs: StructLookup = {},\n) {\n const match = execConstructorSignature(signature)\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'constructor' })\n\n const params = splitParameters(match.parameters)\n const abiParameters = []\n const length = params.length\n for (let i = 0; i < length; i++)\n abiParameters.push(\n parseAbiParameter(params[i]!, { structs, type: 'constructor' }),\n )\n return {\n type: 'constructor',\n stateMutability: match.stateMutability ?? 'nonpayable',\n inputs: abiParameters,\n }\n}\n\nexport function parseFallbackSignature(signature: string) {\n const match = execFallbackSignature(signature)\n if (!match) throw new InvalidSignatureError({ signature, type: 'fallback' })\n\n return {\n type: 'fallback',\n stateMutability: match.stateMutability ?? 'nonpayable',\n }\n}\n\nconst abiParameterWithoutTupleRegex =\n /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\\spayable)?)(?<array>(?:\\[\\d*?\\])+?)?(?:\\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/\nconst abiParameterWithTupleRegex =\n /^\\((?<type>.+?)\\)(?<array>(?:\\[\\d*?\\])+?)?(?:\\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/\nconst dynamicIntegerRegex = /^u?int$/\n\ntype ParseOptions = {\n modifiers?: Set<Modifier>\n structs?: StructLookup\n type?: AbiItemType | 'struct'\n}\n\nexport function parseAbiParameter(param: string, options?: ParseOptions) {\n // optional namespace cache by `type`\n const parameterCacheKey = getParameterCacheKey(\n param,\n options?.type,\n options?.structs,\n )\n if (parameterCache.has(parameterCacheKey))\n return parameterCache.get(parameterCacheKey)!\n\n const isTuple = isTupleRegex.test(param)\n const match = execTyped<{\n array?: string\n modifier?: Modifier\n name?: string\n type: string\n }>(\n isTuple ? abiParameterWithTupleRegex : abiParameterWithoutTupleRegex,\n param,\n )\n if (!match) throw new InvalidParameterError({ param })\n\n if (match.name && isSolidityKeyword(match.name))\n throw new SolidityProtectedKeywordError({ param, name: match.name })\n\n const name = match.name ? { name: match.name } : {}\n const indexed = match.modifier === 'indexed' ? { indexed: true } : {}\n const structs = options?.structs ?? {}\n let type: string\n let components = {}\n if (isTuple) {\n type = 'tuple'\n const params = splitParameters(match.type)\n const components_ = []\n const length = params.length\n for (let i = 0; i < length; i++) {\n // remove `modifiers` from `options` to prevent from being added to tuple components\n components_.push(parseAbiParameter(params[i]!, { structs }))\n }\n components = { components: components_ }\n } else if (match.type in structs) {\n type = 'tuple'\n components = { components: structs[match.type] }\n } else if (dynamicIntegerRegex.test(match.type)) {\n type = `${match.type}256`\n } else if (match.type === 'address payable') {\n type = 'address'\n } else {\n type = match.type\n if (!(options?.type === 'struct') && !isSolidityType(type))\n throw new UnknownSolidityTypeError({ type })\n }\n\n if (match.modifier) {\n // Check if modifier exists, but is not allowed (e.g. `indexed` in `functionModifiers`)\n if (!options?.modifiers?.has?.(match.modifier))\n throw new InvalidModifierError({\n param,\n type: options?.type,\n modifier: match.modifier,\n })\n\n // Check if resolved `type` is valid if there is a function modifier\n if (\n functionModifiers.has(match.modifier as FunctionModifier) &&\n !isValidDataLocation(type, !!match.array)\n )\n throw new InvalidFunctionModifierError({\n param,\n type: options?.type,\n modifier: match.modifier,\n })\n }\n\n const abiParameter = {\n type: `${type}${match.array ?? ''}`,\n ...name,\n ...indexed,\n ...components,\n }\n parameterCache.set(parameterCacheKey, abiParameter)\n return abiParameter\n}\n\n// s/o latika for this\nexport function splitParameters(\n params: string,\n result: string[] = [],\n current = '',\n depth = 0,\n): readonly string[] {\n const length = params.trim().length\n // biome-ignore lint/correctness/noUnreachable: recursive\n for (let i = 0; i < length; i++) {\n const char = params[i]\n const tail = params.slice(i + 1)\n switch (char) {\n case ',':\n return depth === 0\n ? splitParameters(tail, [...result, current.trim()])\n : splitParameters(tail, result, `${current}${char}`, depth)\n case '(':\n return splitParameters(tail, result, `${current}${char}`, depth + 1)\n case ')':\n return splitParameters(tail, result, `${current}${char}`, depth - 1)\n default:\n return splitParameters(tail, result, `${current}${char}`, depth)\n }\n }\n\n if (current === '') return result\n if (depth !== 0) throw new InvalidParenthesisError({ current, depth })\n\n result.push(current.trim())\n return result\n}\n\nexport function isSolidityType(\n type: string,\n): type is Exclude<AbiType, SolidityTuple | SolidityArray> {\n return (\n type === 'address' ||\n type === 'bool' ||\n type === 'function' ||\n type === 'string' ||\n bytesRegex.test(type) ||\n integerRegex.test(type)\n )\n}\n\nconst protectedKeywordsRegex =\n /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/\n\n/** @internal */\nexport function isSolidityKeyword(name: string) {\n return (\n name === 'address' ||\n name === 'bool' ||\n name === 'function' ||\n name === 'string' ||\n name === 'tuple' ||\n bytesRegex.test(name) ||\n integerRegex.test(name) ||\n protectedKeywordsRegex.test(name)\n )\n}\n\n/** @internal */\nexport function isValidDataLocation(\n type: string,\n isArray: boolean,\n): type is Exclude<\n AbiType,\n SolidityString | Extract<SolidityBytes, 'bytes'> | SolidityArray\n> {\n return isArray || type === 'bytes' || type === 'string' || type === 'tuple'\n}\n","import type { AbiParameter } from '../../abi.js'\nimport { execTyped, isTupleRegex } from '../../regex.js'\nimport { UnknownTypeError } from '../errors/abiItem.js'\nimport { InvalidAbiTypeParameterError } from '../errors/abiParameter.js'\nimport {\n InvalidSignatureError,\n InvalidStructSignatureError,\n} from '../errors/signature.js'\nimport { CircularReferenceError } from '../errors/struct.js'\nimport type { StructLookup } from '../types/structs.js'\nimport { execStructSignature, isStructSignature } from './signatures.js'\nimport { isSolidityType, parseAbiParameter } from './utils.js'\n\nexport function parseStructs(signatures: readonly string[]) {\n // Create \"shallow\" version of each struct (and filter out non-structs or invalid structs)\n const shallowStructs: StructLookup = {}\n const signaturesLength = signatures.length\n for (let i = 0; i < signaturesLength; i++) {\n const signature = signatures[i]!\n if (!isStructSignature(signature)) continue\n\n const match = execStructSignature(signature)\n if (!match) throw new InvalidSignatureError({ signature, type: 'struct' })\n\n const properties = match.properties.split(';')\n\n const components: AbiParameter[] = []\n const propertiesLength = properties.length\n for (let k = 0; k < propertiesLength; k++) {\n const property = properties[k]!\n const trimmed = property.trim()\n if (!trimmed) continue\n const abiParameter = parseAbiParameter(trimmed, {\n type: 'struct',\n })\n components.push(abiParameter)\n }\n\n if (!components.length) throw new InvalidStructSignatureError({ signature })\n shallowStructs[match.name] = components\n }\n\n // Resolve nested structs inside each parameter\n const resolvedStructs: StructLookup = {}\n const entries = Object.entries(shallowStructs)\n const entriesLength = entries.length\n for (let i = 0; i < entriesLength; i++) {\n const [name, parameters] = entries[i]!\n resolvedStructs[name] = resolveStructs(parameters, shallowStructs)\n }\n\n return resolvedStructs\n}\n\nconst typeWithoutTupleRegex =\n /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\\[\\d*?\\])+?)?$/\n\nfunction resolveStructs(\n abiParameters: readonly (AbiParameter & { indexed?: true })[] = [],\n structs: StructLookup = {},\n ancestors = new Set<string>(),\n) {\n const components: AbiParameter[] = []\n const length = abiParameters.length\n for (let i = 0; i < length; i++) {\n const abiParameter = abiParameters[i]!\n const isTuple = isTupleRegex.test(abiParameter.type)\n if (isTuple) components.push(abiParameter)\n else {\n const match = execTyped<{ array?: string; type: string }>(\n typeWithoutTupleRegex,\n abiParameter.type,\n )\n if (!match?.type) throw new InvalidAbiTypeParameterError({ abiParameter })\n\n const { array, type } = match\n if (type in structs) {\n if (ancestors.has(type)) throw new CircularReferenceError({ type })\n\n components.push({\n ...abiParameter,\n type: `tuple${array ?? ''}`,\n components: resolveStructs(\n structs[type],\n structs,\n new Set([...ancestors, type]),\n ),\n })\n } else {\n if (isSolidityType(type)) components.push(abiParameter)\n else throw new UnknownTypeError({ type })\n }\n }\n }\n\n return components\n}\n","import type { Abi } from '../abi.js'\nimport type { Error, Filter } from '../types.js'\nimport { isStructSignature } from './runtime/signatures.js'\nimport { parseStructs } from './runtime/structs.js'\nimport { parseSignature } from './runtime/utils.js'\nimport type { Signatures } from './types/signatures.js'\nimport type { ParseStructs } from './types/structs.js'\nimport type { ParseSignature } from './types/utils.js'\n\n/**\n * Parses human-readable ABI into JSON {@link Abi}\n *\n * @param signatures - Human-readable ABI\n * @returns Parsed {@link Abi}\n *\n * @example\n * type Result = ParseAbi<\n * // ^? type Result = readonly [{ name: \"balanceOf\"; type: \"function\"; stateMutability:...\n * [\n * 'function balanceOf(address owner) view returns (uint256)',\n * 'event Transfer(address indexed from, address indexed to, uint256 amount)',\n * ]\n * >\n */\nexport type ParseAbi<signatures extends readonly string[]> =\n string[] extends signatures\n ? Abi // If `T` was not able to be inferred (e.g. just `string[]`), return `Abi`\n : signatures extends readonly string[]\n ? signatures extends Signatures<signatures> // Validate signatures\n ? ParseStructs<signatures> extends infer structs\n ? {\n [key in keyof signatures]: signatures[key] extends string\n ? ParseSignature<signatures[key], structs>\n : never\n } extends infer mapped extends readonly unknown[]\n ? Filter<mapped, never> extends infer result\n ? result extends readonly []\n ? never\n : result\n : never\n : never\n : never\n : never\n : never\n\n/**\n * Parses human-readable ABI into JSON {@link Abi}\n *\n * @param signatures - Human-Readable ABI\n * @returns Parsed {@link Abi}\n *\n * @example\n * const abi = parseAbi([\n * // ^? const abi: readonly [{ name: \"balanceOf\"; type: \"function\"; stateMutability:...\n * 'function balanceOf(address owner) view returns (uint256)',\n * 'event Transfer(address indexed from, address indexed to, uint256 amount)',\n * ])\n */\nexport function parseAbi<const signatures extends readonly string[]>(\n signatures: signatures['length'] extends 0\n ? Error<'At least one signature required'>\n : Signatures<signatures> extends signatures\n ? signatures\n : Signatures<signatures>,\n): ParseAbi<signatures> {\n const structs = parseStructs(signatures as readonly string[])\n const abi = []\n const length = signatures.length as number\n for (let i = 0; i < length; i++) {\n const signature = (signatures as readonly string[])[i]!\n if (isStructSignature(signature)) continue\n abi.push(parseSignature(signature, structs))\n }\n return abi as unknown as ParseAbi<signatures>\n}\n","import type { AbiEventParameter, AbiParameter } from '../abi.js'\nimport { execTyped } from '../regex.js'\nimport type { IsNarrowable, Join } from '../types.js'\nimport type { AssertName } from './types/signatures.js'\n\n/**\n * Formats {@link AbiParameter} to human-readable ABI parameter.\n *\n * @param abiParameter - ABI parameter\n * @returns Human-readable ABI parameter\n *\n * @example\n * type Result = FormatAbiParameter<{ type: 'address'; name: 'from'; }>\n * // ^? type Result = 'address from'\n */\nexport type FormatAbiParameter<\n abiParameter extends AbiParameter | AbiEventParameter,\n> = abiParameter extends {\n name?: infer name extends string\n type: `tuple${infer array}`\n components: infer components extends readonly AbiParameter[]\n indexed?: infer indexed extends boolean\n}\n ? FormatAbiParameter<\n {\n type: `(${Join<\n {\n [key in keyof components]: FormatAbiParameter<\n {\n type: components[key]['type']\n } & (IsNarrowable<components[key]['name'], string> extends true\n ? { name: components[key]['name'] }\n : unknown) &\n (components[key] extends { components: readonly AbiParameter[] }\n ? { components: components[key]['components'] }\n : unknown)\n >\n },\n ', '\n >})${array}`\n } & (IsNarrowable<name, string> extends true ? { name: name } : unknown) &\n (IsNarrowable<indexed, boolean> extends true\n ? { indexed: indexed }\n : unknown)\n >\n : `${abiParameter['type']}${abiParameter extends { indexed: true }\n ? ' indexed'\n : ''}${abiParameter['name'] extends infer name extends string\n ? name extends ''\n ? ''\n : ` ${AssertName<name>}`\n : ''}`\n\n// https://regexr.com/7f7rv\nconst tupleRegex = /^tuple(?<array>(\\[(\\d*)\\])*)$/\n\n/**\n * Formats {@link AbiParameter} to human-readable ABI parameter.\n *\n * @param abiParameter - ABI parameter\n * @returns Human-readable ABI parameter\n *\n * @example\n * const result = formatAbiParameter({ type: 'address', name: 'from' })\n * // ^? const result: 'address from'\n */\nexport function formatAbiParameter<\n const abiParameter extends AbiParameter | AbiEventParameter,\n>(abiParameter: abiParameter): FormatAbiParameter<abiParameter> {\n type Result = FormatAbiParameter<abiParameter>\n\n let type = abiParameter.type\n if (tupleRegex.test(abiParameter.type) && 'components' in abiParameter) {\n type = '('\n const length = abiParameter.components.length as number\n for (let i = 0; i < length; i++) {\n const component = abiParameter.components[i]!\n type += formatAbiParameter(component)\n if (i < length - 1) type += ', '\n }\n const result = execTyped<{ array?: string }>(tupleRegex, abiParameter.type)\n type += `)${result?.array || ''}`\n return formatAbiParameter({\n ...abiParameter,\n type,\n }) as Result\n }\n // Add `indexed` to type if in `abiParameter`\n if ('indexed' in abiParameter && abiParameter.indexed)\n type = `${type} indexed`\n // Return human-readable ABI parameter\n if (abiParameter.name) return `${type} ${abiParameter.name}` as Result\n return type as Result\n}\n","import type { AbiEventParameter, AbiParameter } from '../abi.js'\nimport type { Join } from '../types.js'\nimport {\n type FormatAbiParameter,\n formatAbiParameter,\n} from './formatAbiParameter.js'\n\n/**\n * Formats {@link AbiParameter}s to human-readable ABI parameter.\n *\n * @param abiParameters - ABI parameters\n * @returns Human-readable ABI parameters\n *\n * @example\n * type Result = FormatAbiParameters<[\n * // ^? type Result = 'address from, uint256 tokenId'\n * { type: 'address'; name: 'from'; },\n * { type: 'uint256'; name: 'tokenId'; },\n * ]>\n */\nexport type FormatAbiParameters<\n abiParameters extends readonly [\n AbiParameter | AbiEventParameter,\n ...(readonly (AbiParameter | AbiEventParameter)[]),\n ],\n> = Join<\n {\n [key in keyof abiParameters]: FormatAbiParameter<abiParameters[key]>\n },\n ', '\n>\n\n/**\n * Formats {@link AbiParameter}s to human-readable ABI parameters.\n *\n * @param abiParameters - ABI parameters\n * @returns Human-readable ABI parameters\n *\n * @example\n * const result = formatAbiParameters([\n * // ^? const result: 'address from, uint256 tokenId'\n * { type: 'address', name: 'from' },\n * { type: 'uint256', name: 'tokenId' },\n * ])\n */\nexport function formatAbiParameters<\n const abiParameters extends readonly [\n AbiParameter | AbiEventParameter,\n ...(readonly (AbiParameter | AbiEventParameter)[]),\n ],\n>(abiParameters: abiParameters): FormatAbiParameters<abiParameters> {\n let params = ''\n const length = abiParameters.length\n for (let i = 0; i < length; i++) {\n const abiParameter = abiParameters[i]!\n params += formatAbiParameter(abiParameter)\n if (i !== length - 1) params += ', '\n }\n return params as FormatAbiParameters<abiParameters>\n}\n","import type {\n Abi,\n AbiConstructor,\n AbiError,\n AbiEvent,\n AbiEventParameter,\n AbiFallback,\n AbiFunction,\n AbiParameter,\n AbiReceive,\n AbiStateMutability,\n} from '../abi.js'\nimport {\n type FormatAbiParameters as FormatAbiParameters_,\n formatAbiParameters,\n} from './formatAbiParameters.js'\nimport type { AssertName } from './types/signatures.js'\n\n/**\n * Formats ABI item (e.g. error, event, function) into human-readable ABI item\n *\n * @param abiItem - ABI item\n * @returns Human-readable ABI item\n */\nexport type FormatAbiItem<abiItem extends Abi[number]> =\n Abi[number] extends abiItem\n ? string\n :\n | (abiItem extends AbiFunction\n ? AbiFunction extends abiItem\n ? string\n : `function ${AssertName<abiItem['name']>}(${FormatAbiParameters<\n abiItem['inputs']\n >})${abiItem['stateMutability'] extends Exclude<\n AbiStateMutability,\n 'nonpayable'\n >\n ? ` ${abiItem['stateMutability']}`\n : ''}${abiItem['outputs']['length'] extends 0\n ? ''\n : ` returns (${FormatAbiParameters<abiItem['outputs']>})`}`\n : never)\n | (abiItem extends AbiEvent\n ? AbiEvent extends abiItem\n ? string\n : `event ${AssertName<abiItem['name']>}(${FormatAbiParameters<\n abiItem['inputs']\n >})`\n : never)\n | (abiItem extends AbiError\n ? AbiError extends abiItem\n ? string\n : `error ${AssertName<abiItem['name']>}(${FormatAbiParameters<\n abiItem['inputs']\n >})`\n : never)\n | (abiItem extends AbiConstructor\n ? AbiConstructor extends abiItem\n ? string\n : `constructor(${FormatAbiParameters<\n abiItem['inputs']\n >})${abiItem['stateMutability'] extends 'payable'\n ? ' payable'\n : ''}`\n : never)\n | (abiItem extends AbiFallback\n ? AbiFallback extends abiItem\n ? string\n : `fallback() external${abiItem['stateMutability'] extends 'payable'\n ? ' payable'\n : ''}`\n : never)\n | (abiItem extends AbiReceive\n ? AbiReceive extends abiItem\n ? string\n : 'receive() external payable'\n : never)\n\ntype FormatAbiParameters<\n abiParameters extends readonly (AbiParameter | AbiEventParameter)[],\n> = abiParameters['length'] extends 0\n ? ''\n : FormatAbiParameters_<\n abiParameters extends readonly [\n AbiParameter | AbiEventParameter,\n ...(readonly (AbiParameter | AbiEventParameter)[]),\n ]\n ? abiParameters\n : never\n >\n\n/**\n * Formats ABI item (e.g. error, event, function) into human-readable ABI item\n *\n * @param abiItem - ABI item\n * @returns Human-readable ABI item\n */\nexport function formatAbiItem<const abiItem extends Abi[number]>(\n abiItem: abiItem,\n): FormatAbiItem<abiItem> {\n type Result = FormatAbiItem<abiItem>\n type Params = readonly [\n AbiParameter | AbiEventParameter,\n ...(readonly (AbiParameter | AbiEventParameter)[]),\n ]\n\n if (abiItem.type === 'function')\n return `function ${abiItem.name}(${formatAbiParameters(\n abiItem.inputs as Params,\n )})${\n abiItem.stateMutability && abiItem.stateMutability !== 'nonpayable'\n ? ` ${abiItem.stateMutability}`\n : ''\n }${\n abiItem.outputs?.length\n ? ` returns (${formatAbiParameters(abiItem.outputs as Params)})`\n : ''\n }`\n if (abiItem.type === 'event')\n return `event ${abiItem.name}(${formatAbiParameters(\n abiItem.inputs as Params,\n )})`\n if (abiItem.type === 'error')\n return `error ${abiItem.name}(${formatAbiParameters(\n abiItem.inputs as Params,\n )})`\n if (abiItem.type === 'constructor')\n return `constructor(${formatAbiParameters(abiItem.inputs as Params)})${\n abiItem.stateMutability === 'payable' ? ' payable' : ''\n }`\n if (abiItem.type === 'fallback')\n return `fallback() external${\n abiItem.stateMutability === 'payable' ? ' payable' : ''\n }` as Result\n return 'receive() external payable' as Result\n}\n","import type { AbiParameter } from '../abi.js'\nimport type { Narrow } from '../narrow.js'\nimport type { Error, Filter } from '../types.js'\nimport { InvalidAbiParametersError } from './errors/abiParameter.js'\nimport { isStructSignature, modifiers } from './runtime/signatures.js'\nimport { parseStructs } from './runtime/structs.js'\nimport { splitParameters } from './runtime/utils.js'\nimport { parseAbiParameter as parseAbiParameter_ } from './runtime/utils.js'\nimport type { IsStructSignature, Modifier } from './types/signatures.js'\nimport type { ParseStructs } from './types/structs.js'\nimport type { SplitParameters } from './types/utils.js'\nimport type { ParseAbiParameters as ParseAbiParameters_ } from './types/utils.js'\n\n/**\n * Parses human-readable ABI parameters into {@link AbiParameter}s\n *\n * @param params - Human-readable ABI parameters\n * @returns Parsed {@link AbiParameter}s\n *\n * @example\n * type Result = ParseAbiParameters('address from, address to, uint256 amount')\n * // ^? type Result: [{ type: \"address\"; name: \"from\"; }, { type: \"address\";...\n *\n * @example\n * type Result = ParseAbiParameters<\n * // ^? type Result: [{ type: \"tuple\"; components: [{ type: \"string\"; name:...\n * ['Baz bar', 'struct Baz { string name; }']\n * >\n */\nexport type ParseAbiParameters<\n params extends string | readonly string[] | readonly unknown[],\n> =\n | (params extends string\n ? params extends ''\n ? never\n : string extends params\n ? readonly AbiParameter[]\n : ParseAbiParameters_<SplitParameters<params>, { modifier: Modifier }>\n : never)\n | (params extends readonly string[]\n ? string[] extends params\n ? AbiParameter // Return generic AbiParameter item since type was no inferrable\n : ParseStructs<params> extends infer structs\n ? {\n [key in keyof params]: params[key] extends string\n ? IsStructSignature<params[key]> extends true\n ? never\n : ParseAbiParameters_<\n SplitParameters<params[key]>,\n { modifier: Modifier; structs: structs }\n >\n : never\n } extends infer mapped extends readonly unknown[]\n ? Filter<mapped, never> extends readonly [...infer content]\n ? content['length'] extends 0\n ? never\n : DeepFlatten<content>\n : never\n : never\n : never\n : never)\n\n/**\n * Flatten all members of {@link T}\n *\n * @param T - List of items to flatten\n * @param Acc - The accumulator used while recursing\n * @returns The flattened array\n *\n * @example\n * type Result = DeepFlatten<[['a', 'b'], [['c']]]>\n * // ^? type Result = ['a', 'b', 'c']\n */\ntype DeepFlatten<\n T extends readonly unknown[],\n Acc extends readonly unknown[] = readonly [],\n> = T extends readonly [infer head, ...infer tail]\n ? tail extends undefined\n ? never\n : head extends readonly unknown[]\n ? DeepFlatten<tail, readonly [...Acc, ...DeepFlatten<head>]>\n : DeepFlatten<tail, readonly [...Acc, head]>\n : Acc\n\n/**\n * Parses human-readable ABI parameters into {@link AbiParameter}s\n *\n * @param params - Human-readable ABI parameters\n * @returns Parsed {@link AbiParameter}s\n *\n * @example\n * const abiParameters = parseAbiParameters('address from, address to, uint256 amount')\n * // ^? const abiParameters: [{ type: \"address\"; name: \"from\"; }, { type: \"address\";...\n *\n * @example\n * const abiParameters = parseAbiParameters([\n * // ^? const abiParameters: [{ type: \"tuple\"; components: [{ type: \"string\"; name:...\n * 'Baz bar',\n * 'struct Baz { string name; }',\n * ])\n */\nexport function parseAbiParameters<\n params extends string | readonly string[] | readonly unknown[],\n>(\n params: Narrow<params> &\n (\n | (params extends string\n ? params extends ''\n ? Error<'Empty string is not allowed.'>\n : unknown\n : never)\n | (params extends readonly string[]\n ? params extends readonly [] // empty array\n ? Error<'At least one parameter required.'>\n : string[] extends params\n ? unknown\n : unknown // TODO: Validate param string\n : never)\n ),\n): ParseAbiParameters<params> {\n const abiParameters: AbiParameter[] = []\n if (typeof params === 'string') {\n const parameters = splitParameters(params)\n const length = parameters.length\n for (let i = 0; i < length; i++) {\n abiParameters.push(parseAbiParameter_(parameters[i]!, { modifiers }))\n }\n } else {\n const structs = parseStructs(params as readonly string[])\n const length = params.length as number\n for (let i = 0; i < length; i++) {\n const signature = (params as readonly string[])[i]!\n if (isStructSignature(signature)) continue\n const parameters = splitParameters(signature)\n const length = parameters.length\n for (let k = 0; k < length; k++) {\n abiParameters.push(\n parseAbiParameter_(parameters[k]!, { modifiers, structs }),\n )\n }\n }\n }\n\n if (abiParameters.length === 0)\n throw new InvalidAbiParametersError({ params })\n\n return abiParameters as ParseAbiParameters<params>\n}\n","/**\n * SHA3 (keccak) hash function, based on a new \"Sponge function\" design.\n * Different from older hashes, the internal state is bigger than output size.\n *\n * Check out [FIPS-202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf),\n * [Website](https://keccak.team/keccak.html),\n * [the differences between SHA-3 and Keccak](https://crypto.stackexchange.com/questions/15727/what-are-the-key-differences-between-the-draft-sha-3-standard-and-the-keccak-sub).\n *\n * Check out `sha3-addons` module for cSHAKE, k12, and others.\n * @module\n */\nimport { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.ts';\n// prettier-ignore\nimport {\n abytes, aexists, anumber, aoutput,\n clean, createHasher, createXOFer, Hash,\n swap32IfBE,\n toBytes, u32,\n type CHash, type CHashXO, type HashXOF, type Input\n} from './utils.ts';\n\n// No __PURE__ annotations in sha3 header:\n// EVERYTHING is in fact used on every export.\n// Various per round constants calculations\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\nconst _0x71n = BigInt(0x71);\nconst SHA3_PI: number[] = [];\nconst SHA3_ROTL: number[] = [];\nconst _SHA3_IOTA: bigint[] = [];\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n) t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst IOTAS = split(_SHA3_IOTA, true);\nconst SHA3_IOTA_H = IOTAS[0];\nconst SHA3_IOTA_L = IOTAS[1];\n\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h: number, l: number, s: number) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h: number, l: number, s: number) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n\n/** `keccakf1600` internal function, additionally allows to adjust round count. */\nexport function keccakP(s: Uint32Array, rounds: number = 24): void {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++) B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++) B[x] = s[y + x];\n for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n clean(B);\n}\n\n/** Keccak sponge function. */\nexport class Keccak extends Hash<Keccak> implements HashXOF<Keccak> {\n protected state: Uint8Array;\n protected pos = 0;\n protected posOut = 0;\n protected finished = false;\n protected state32: Uint32Array;\n protected destroyed = false;\n\n public blockLen: number;\n public suffix: number;\n public outputLen: number;\n protected enableXOF = false;\n protected rounds: number;\n\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(\n blockLen: number,\n suffix: number,\n outputLen: number,\n enableXOF = false,\n rounds: number = 24\n ) {\n super();\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n // Can be passed from user as dkLen\n anumber(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n // 0 < blockLen < 200\n if (!(0 < blockLen && blockLen < 200))\n throw new Error('only keccak-f1600 function is supported');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n clone(): Keccak {\n return this._cloneInto();\n }\n protected keccak(): void {\n swap32IfBE(this.state32);\n keccakP(this.state32, this.rounds);\n swap32IfBE(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data: Input): this {\n aexists(this);\n data = toBytes(data);\n abytes(data);\n const { blockLen, state } = this;\n const len = data.length;\n for (let pos = 0; pos < len; ) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++) state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen) this.keccak();\n }\n return this;\n }\n protected finish(): void {\n if (this.finished) return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1) this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n protected writeInto(out: Uint8Array): Uint8Array {\n aexists(this, false);\n abytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len; ) {\n if (this.posOut >= blockLen) this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out: Uint8Array): Uint8Array {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF) throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes: number): Uint8Array {\n anumber(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out: Uint8Array): Uint8Array {\n aoutput(out, this);\n if (this.finished) throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest(): Uint8Array {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy(): void {\n this.destroyed = true;\n clean(this.state);\n }\n _cloneInto(to?: Keccak): Keccak {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds);\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\n\nconst gen = (suffix: number, blockLen: number, outputLen: number) =>\n createHasher(() => new Keccak(blockLen, suffix, outputLen));\n\n/** SHA3-224 hash function. */\nexport const sha3_224: CHash = /* @__PURE__ */ (() => gen(0x06, 144, 224 / 8))();\n/** SHA3-256 hash function. Different from keccak-256. */\nexport const sha3_256: CHash = /* @__PURE__ */ (() => gen(0x06, 136, 256 / 8))();\n/** SHA3-384 hash function. */\nexport const sha3_384: CHash = /* @__PURE__ */ (() => gen(0x06, 104, 384 / 8))();\n/** SHA3-512 hash function. */\nexport const sha3_512: CHash = /* @__PURE__ */ (() => gen(0x06, 72, 512 / 8))();\n\n/** keccak-224 hash function. */\nexport const keccak_224: CHash = /* @__PURE__ */ (() => gen(0x01, 144, 224 / 8))();\n/** keccak-256 hash function. Different from SHA3-256. */\nexport const keccak_256: CHash = /* @__PURE__ */ (() => gen(0x01, 136, 256 / 8))();\n/** keccak-384 hash function. */\nexport const keccak_384: CHash = /* @__PURE__ */ (() => gen(0x01, 104, 384 / 8))();\n/** keccak-512 hash function. */\nexport const keccak_512: CHash = /* @__PURE__ */ (() => gen(0x01, 72, 512 / 8))();\n\nexport type ShakeOpts = { dkLen?: number };\n\nconst genShake = (suffix: number, blockLen: number, outputLen: number) =>\n createXOFer<HashXOF<Keccak>, ShakeOpts>(\n (opts: ShakeOpts = {}) =>\n new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true)\n );\n\n/** SHAKE128 XOF with 128-bit security. */\nexport const shake128: CHashXO = /* @__PURE__ */ (() => genShake(0x1f, 168, 128 / 8))();\n/** SHAKE256 XOF with 256-bit security. */\nexport const shake256: CHashXO = /* @__PURE__ */ (() => genShake(0x1f, 136, 256 / 8))();\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEM,SAAU,UAAgB,OAAe,QAAc;AAC3D,QAAM,QAAQ,MAAM,KAAK,MAAM;AAC/B,SAAO,OAAO;AAChB;AAIO,IAAM,aAAa;AAInB,IAAM,eACX;AAEK,IAAM,eAAe;;;ACP5B,IAAM,sBACJ;AACI,SAAU,iBAAiB,WAAiB;AAChD,SAAO,oBAAoB,KAAK,SAAS;AAC3C;AACM,SAAU,mBAAmB,WAAiB;AAClD,SAAO,UACL,qBACA,SAAS;AAEb;AAGA,IAAM,sBACJ;AACI,SAAU,iBAAiB,WAAiB;AAChD,SAAO,oBAAoB,KAAK,SAAS;AAC3C;AACM,SAAU,mBAAmB,WAAiB;AAClD,SAAO,U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