@aa-sdk/core 4.8.0 → 4.10.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.
@@ -1,4 +1,3 @@
1
- import { getTransaction } from "viem/actions";
2
1
  import { isBaseSmartAccountClient } from "../../client/isSmartAccountClient.js";
3
2
  import { IncompatibleClientError } from "../../errors/client.js";
4
3
  import { FailedToFindTransactionError } from "../../errors/transaction.js";
@@ -46,9 +45,7 @@ export const waitForUserOperationTransaction = async (client, args) => {
46
45
  Logger.error(`[SmartAccountProvider] waitForUserOperationTransaction error fetching receipt for ${hash}: ${e}`);
47
46
  });
48
47
  if (receipt) {
49
- return getTransaction(client, {
50
- hash: receipt.receipt.transactionHash,
51
- }).then((x) => x.hash);
48
+ return receipt?.receipt.transactionHash;
52
49
  }
53
50
  }
54
51
  throw new FailedToFindTransactionError(hash);
@@ -1 +1 @@
1
- {"version":3,"file":"waitForUserOperationTransacation.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/waitForUserOperationTransacation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAMxB,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IACzC,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,uBAAuB,CAC/B,wBAAwB,EACxB,iCAAiC,EACjC,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,EACJ,IAAI,EACJ,OAAO,GAAG;QACR,UAAU,EAAE,MAAM,CAAC,YAAY;QAC/B,UAAU,EAAE,MAAM,CAAC,iBAAiB;QACpC,UAAU,EAAE,MAAM,CAAC,iBAAiB;KACrC,GACF,GAAG,IAAI,CAAC;IAET,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,MAAM,2BAA2B,GAC/B,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;YACpD,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC;QAEtB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAC5B,UAAU,CAAC,OAAO,EAAE,2BAA2B,CAAC,CACjD,CAAC;QAEF,MAAM,OAAO,GAAG,MAAM,MAAM;aACzB,uBAAuB,CAAC,IAAqB,CAAC;aAC9C,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACX,MAAM,CAAC,KAAK,CACV,qFAAqF,IAAI,KAAK,CAAC,EAAE,CAClG,CAAC;QACJ,CAAC,CAAC,CAAC;QAEL,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,cAAc,CAAC,MAAM,EAAE;gBAC5B,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,eAAe;aACtC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAED,MAAM,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC,CAAC","sourcesContent":["import type { Chain, Client, Hex, Transport } from \"viem\";\nimport { getTransaction } from \"viem/actions\";\nimport { isBaseSmartAccountClient } from \"../../client/isSmartAccountClient.js\";\nimport { IncompatibleClientError } from \"../../errors/client.js\";\nimport { FailedToFindTransactionError } from \"../../errors/transaction.js\";\nimport { Logger } from \"../../logger.js\";\nimport type { WaitForUserOperationTxParameters } from \"./types.js\";\n\n/**\n * Waits for a user operation transaction to be confirmed by checking the receipt periodically until it is found or a maximum number of retries is reached.\n *\n * @example\n * ```ts\n * import { createSmartAccountClient } from \"@aa-sdk/core\";\n *\n * // smart account client is already extended with waitForUserOperationTransaction\n * const client = createSmartAccountClient(...);\n * const result = await client.waitForUserOperationTransaction({\n * hash: \"0x...\",\n * retries: {...} // optional param to configure the retry amounts\n * });\n * ```\n *\n * @param {Client<TTransport, TChain, any>} client The client instance used to interact with the blockchain\n * @param {WaitForUserOperationTxParameters} args The parameters for the transaction to wait for\n * @param {Hex} args.hash The transaction hash to wait for\n * @param {WaitForUserOperationTxParameters[\"retries\"]} [args.retries] Optional retry parameters\n * @param {number} [args.retries.maxRetries] The maximum number of retry attempts\n * @param {number} [args.retries.intervalMs] The interval in milliseconds between retries\n * @param {number} [args.retries.multiplier] The multiplier for the interval between retries\n * @returns {Promise<Hex>} A promise that resolves to the transaction hash when the transaction is confirmed\n */\nexport const waitForUserOperationTransaction: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined\n>(\n client: Client<TTransport, TChain, any>,\n args: WaitForUserOperationTxParameters\n) => Promise<Hex> = async (client, args) => {\n if (!isBaseSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"BaseSmartAccountClient\",\n \"waitForUserOperationTransaction\",\n client\n );\n }\n\n const {\n hash,\n retries = {\n maxRetries: client.txMaxRetries,\n intervalMs: client.txRetryIntervalMs,\n multiplier: client.txRetryMultiplier,\n },\n } = args;\n\n for (let i = 0; i < retries.maxRetries; i++) {\n const txRetryIntervalWithJitterMs =\n retries.intervalMs * Math.pow(retries.multiplier, i) +\n Math.random() * 100;\n\n await new Promise((resolve) =>\n setTimeout(resolve, txRetryIntervalWithJitterMs)\n );\n\n const receipt = await client\n .getUserOperationReceipt(hash as `0x${string}`)\n .catch((e) => {\n Logger.error(\n `[SmartAccountProvider] waitForUserOperationTransaction error fetching receipt for ${hash}: ${e}`\n );\n });\n\n if (receipt) {\n return getTransaction(client, {\n hash: receipt.receipt.transactionHash,\n }).then((x) => x.hash);\n }\n }\n\n throw new FailedToFindTransactionError(hash);\n};\n"]}
1
+ {"version":3,"file":"waitForUserOperationTransacation.js","sourceRoot":"","sources":["../../../../src/actions/smartAccount/waitForUserOperationTransacation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAMxB,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IACzC,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,uBAAuB,CAC/B,wBAAwB,EACxB,iCAAiC,EACjC,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,EACJ,IAAI,EACJ,OAAO,GAAG;QACR,UAAU,EAAE,MAAM,CAAC,YAAY;QAC/B,UAAU,EAAE,MAAM,CAAC,iBAAiB;QACpC,UAAU,EAAE,MAAM,CAAC,iBAAiB;KACrC,GACF,GAAG,IAAI,CAAC;IAET,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,MAAM,2BAA2B,GAC/B,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;YACpD,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC;QAEtB,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAC5B,UAAU,CAAC,OAAO,EAAE,2BAA2B,CAAC,CACjD,CAAC;QAEF,MAAM,OAAO,GAAG,MAAM,MAAM;aACzB,uBAAuB,CAAC,IAAqB,CAAC;aAC9C,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACX,MAAM,CAAC,KAAK,CACV,qFAAqF,IAAI,KAAK,CAAC,EAAE,CAClG,CAAC;QACJ,CAAC,CAAC,CAAC;QAEL,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC;QAC1C,CAAC;IACH,CAAC;IAED,MAAM,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC,CAAC","sourcesContent":["import type { Chain, Client, Hex, Transport } from \"viem\";\nimport { isBaseSmartAccountClient } from \"../../client/isSmartAccountClient.js\";\nimport { IncompatibleClientError } from \"../../errors/client.js\";\nimport { FailedToFindTransactionError } from \"../../errors/transaction.js\";\nimport { Logger } from \"../../logger.js\";\nimport type { WaitForUserOperationTxParameters } from \"./types.js\";\n\n/**\n * Waits for a user operation transaction to be confirmed by checking the receipt periodically until it is found or a maximum number of retries is reached.\n *\n * @example\n * ```ts\n * import { createSmartAccountClient } from \"@aa-sdk/core\";\n *\n * // smart account client is already extended with waitForUserOperationTransaction\n * const client = createSmartAccountClient(...);\n * const result = await client.waitForUserOperationTransaction({\n * hash: \"0x...\",\n * retries: {...} // optional param to configure the retry amounts\n * });\n * ```\n *\n * @param {Client<TTransport, TChain, any>} client The client instance used to interact with the blockchain\n * @param {WaitForUserOperationTxParameters} args The parameters for the transaction to wait for\n * @param {Hex} args.hash The transaction hash to wait for\n * @param {WaitForUserOperationTxParameters[\"retries\"]} [args.retries] Optional retry parameters\n * @param {number} [args.retries.maxRetries] The maximum number of retry attempts\n * @param {number} [args.retries.intervalMs] The interval in milliseconds between retries\n * @param {number} [args.retries.multiplier] The multiplier for the interval between retries\n * @returns {Promise<Hex>} A promise that resolves to the transaction hash when the transaction is confirmed\n */\nexport const waitForUserOperationTransaction: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined\n>(\n client: Client<TTransport, TChain, any>,\n args: WaitForUserOperationTxParameters\n) => Promise<Hex> = async (client, args) => {\n if (!isBaseSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"BaseSmartAccountClient\",\n \"waitForUserOperationTransaction\",\n client\n );\n }\n\n const {\n hash,\n retries = {\n maxRetries: client.txMaxRetries,\n intervalMs: client.txRetryIntervalMs,\n multiplier: client.txRetryMultiplier,\n },\n } = args;\n\n for (let i = 0; i < retries.maxRetries; i++) {\n const txRetryIntervalWithJitterMs =\n retries.intervalMs * Math.pow(retries.multiplier, i) +\n Math.random() * 100;\n\n await new Promise((resolve) =>\n setTimeout(resolve, txRetryIntervalWithJitterMs)\n );\n\n const receipt = await client\n .getUserOperationReceipt(hash as `0x${string}`)\n .catch((e) => {\n Logger.error(\n `[SmartAccountProvider] waitForUserOperationTransaction error fetching receipt for ${hash}: ${e}`\n );\n });\n\n if (receipt) {\n return receipt?.receipt.transactionHash;\n }\n }\n\n throw new FailedToFindTransactionError(hash);\n};\n"]}
@@ -10,6 +10,10 @@ export declare const asyncPipe: <S, O, F>(...fns: ((s: S, o?: O | undefined, f?:
10
10
  export type Deferrable<T> = {
11
11
  [K in keyof T]: PromiseOrValue<T[K]>;
12
12
  };
13
+ /**
14
+ * Used to ensure type doesn't extend another, for use in & chaining of properties
15
+ */
16
+ export type NotType<A, B> = A extends B ? never : unknown;
13
17
  /**
14
18
  * Await all of the properties of a Deferrable object
15
19
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAI7B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GACpB,CAAU,GAAG,GAA2C,EAAE,EAAE,CAC5D,KAAK,EAAE,CAAI,EAAE,CAAK,EAAE,CAAK,EAAE,E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{ PromiseOrValue } from \"../types.js\";\nimport type { RecordableKeys } from \"./types.js\";\n\n/**\n * Utility function that allows for piping a series of async functions together\n *\n * @param {((s: S, o?: O, f?: F) => Promise<S>)[]} fns - functions to pipe\n * @returns {S} result of the pipe\n */\nexport const asyncPipe =\n <S, O, F>(...fns: ((s: S, o?: O, f?: F) => Promise<S>)[]) =>\n async (s: S, o?: O, f?: F) => {\n let result = s;\n for (const fn of fns) {\n result = await fn(result, o, f);\n }\n return result;\n };\n\n// based on @ethersproject/properties, but pulled in here to minize the dependency on ethers\nexport type Deferrable<T> = {\n [K in keyof T]: PromiseOrValue<T[K]>;\n};\n\n/**\n * Await all of the properties of a Deferrable object\n *\n * @param {Deferrable<T>} object - a Deferrable object\n * @returns {Promise<T>} the object with its properties resolved\n */\nexport async function resolveProperties<T>(object: Deferrable<T>): Promise<T> {\n const promises = Object.keys(object).map((key) => {\n const value = object[key as keyof Deferrable<T>];\n return Promise.resolve(value).then((v) => ({ key: key, value: v }));\n });\n\n const results = await Promise.all(promises);\n\n return filterUndefined<T>(\n results.reduce((accum, curr) => {\n accum[curr.key as keyof T] = curr.value;\n return accum;\n }, {} as T)\n );\n}\n\n/**\n * Recursively converts all values in an object to hex strings\n *\n * @param {any} obj - obj to deep hexlify\n * @returns {any} object with all of its values hexlified\n */\nexport function deepHexlify(obj: any): any {\n if (typeof obj === \"function\") {\n return undefined;\n }\n if (obj == null || typeof obj === \"string\" || typeof obj === \"boolean\") {\n return obj;\n } else if (typeof obj === \"bigint\") {\n return toHex(obj);\n } else if (obj._isBigNumber != null || typeof obj !== \"object\") {\n return toHex(obj).replace(/^0x0/, \"0x\");\n }\n if (Array.isArray(obj)) {\n return obj.map((member) => deepHexlify(member));\n }\n return Object.keys(obj).reduce(\n (set, key) => ({\n ...set,\n [key]: deepHexlify(obj[key]),\n }),\n {}\n );\n}\n\n/**\n * Filters out properties with undefined or null values from the provided object.\n *\n * @example\n * ```ts\n * import { filterUndefined } from \"@aa-sdk/core\";\n *\n * const result = filterUndefined({\n * foo: undefined,\n * bar: null,\n * baz: \"baz\",\n * }); // { baz: \"baz\" }\n * ```\n *\n * @param {T} obj the object from which to remove properties with undefined or null values\n * @returns {T} the object with undefined or null properties removed\n */\nexport function filterUndefined<T>(obj: T): T {\n for (const key in obj) {\n if (obj[key] == null) {\n delete obj[key];\n }\n }\n return obj as T;\n}\n\n/**\n * Picks the specified keys from an object and returns a new object containing only those key-value pairs.\n *\n * @example\n * ```ts\n * import { pick } from \"@aa-sdk/core\";\n *\n * const picked = pick({\n * foo: \"foo\",\n * bar: \"bar\",\n * }, [\"foo\"]); // { foo: \"foo\" }\n * ```\n *\n * @param {Record<string, unknown>} obj The object from which to pick keys\n * @param {string|string[]} keys A single key or an array of keys to pick from the object\n * @returns {Record<string, unknown>} A new object containing only the picked key-value pairs\n */\nexport function pick(obj: Record<string, unknown>, keys: string | string[]) {\n return Object.keys(obj)\n .filter((k) => keys.includes(k))\n .reduce((res, k) => Object.assign(res, { [k]: obj[k] }), {});\n}\n\n/**\n * Utility method for checking if the passed in values are all equal (strictly)\n *\n * @param {...any[]} params - values to check\n * @returns {boolean} a boolean indicating if all values are the same\n * @throws if no values are passed in\n */\nexport const allEqual = (...params: any[]): boolean => {\n if (params.length === 0) {\n throw new Error(\"no values passed in\");\n }\n return params.every((v) => v === params[0]);\n};\n\n/**\n * Utility method for checking the condition and return the value if condition holds true, undefined if not.\n *\n * @param {Promise<boolean>} condition - condition to check\n * @param {() => Promise<T>} value - value to return when condition holds true\n * @returns {Promise<T | undefined>} the value if condition holds true, undefined if not\n */\nexport const conditionalReturn = <T>(\n condition: Promise<boolean>,\n value: () => Promise<T>\n): Promise<T | undefined> => condition.then((t) => (t ? value() : undefined));\n\n/**\n * Converts an array of objects into a record (object) where each key is determined by the specified selector and the value is determined by the provided function.\n *\n * @example\n * ```ts\n * import { toRecord } from \"@aa-sdk/core\";\n * import { sepolia, mainnet } from \"viem/chains\";\n *\n * const addressesByChain = toRecord(\n * [sepolia, mainnet],\n * \"id\",\n * () => \"0x...\"\n * ); // { [sepolia.id]: \"0x...\", [mainnet.id]: \"0x...\" }\n * ```\n *\n * @param {T[]} array The array of objects to convert to a record\n * @param {K} selector The key used to select the property that will become the record's key\n * @param {(item: T) => V} fn The function that transforms each item in the array into the record's value\n * @returns {Record<T[K], V>} The resulting record object\n */\nexport const toRecord = <\n T extends { [K in RecordableKeys<T>]: string | number | symbol },\n K extends RecordableKeys<T>,\n V\n>(\n array: T[],\n selector: K,\n fn: (item: T) => V\n): Record<T[K], V> =>\n array.reduce((acc, item) => {\n acc[item[selector]] = fn(item);\n return acc;\n }, {} as Record<T[K], V>);\n\nexport * from \"./bigint.js\";\nexport * from \"./bytes.js\";\nexport * from \"./defaults.js\";\nexport * from \"./schema.js\";\nexport type * from \"./types.js\";\nexport * from \"./userop.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAI7B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GACpB,CAAU,GAAG,GAA2C,EAAE,EAAE,CAC5D,KAAK,EAAE,CAAI,EAAE,CAAK,EAAE,CAAK,EAAE,EAAE;IAC3B,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACrB,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAYJ;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAI,MAAqB;IAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,GAA0B,CAAC,CAAC;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AM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,SAA2B,EAC3B,KAAuB,EACC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAKtB,KAAU,EACV,QAAW,EACX,EAAkB,EACD,EAAE,CACnB,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IACzB,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO,GAAG,CAAC;AACb,CAAC,EAAE,EAAqB,CAAC,CAAC;AAE5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAE5B,cAAc,aAAa,CAAC","sourcesContent":["import { toHex } from \"viem\";\nimport type { PromiseOrValue } from \"../types.js\";\nimport type { RecordableKeys } from \"./types.js\";\n\n/**\n * Utility function that allows for piping a series of async functions together\n *\n * @param {((s: S, o?: O, f?: F) => Promise<S>)[]} fns - functions to pipe\n * @returns {S} result of the pipe\n */\nexport const asyncPipe =\n <S, O, F>(...fns: ((s: S, o?: O, f?: F) => Promise<S>)[]) =>\n async (s: S, o?: O, f?: F) => {\n let result = s;\n for (const fn of fns) {\n result = await fn(result, o, f);\n }\n return result;\n };\n\n// based on @ethersproject/properties, but pulled in here to minize the dependency on ethers\nexport type Deferrable<T> = {\n [K in keyof T]: PromiseOrValue<T[K]>;\n};\n\n/**\n * Used to ensure type doesn't extend another, for use in & chaining of properties\n */\nexport type NotType<A, B> = A extends B ? never : unknown;\n\n/**\n * Await all of the properties of a Deferrable object\n *\n * @param {Deferrable<T>} object - a Deferrable object\n * @returns {Promise<T>} the object with its properties resolved\n */\nexport async function resolveProperties<T>(object: Deferrable<T>): Promise<T> {\n const promises = Object.keys(object).map((key) => {\n const value = object[key as keyof Deferrable<T>];\n return Promise.resolve(value).then((v) => ({ key: key, value: v }));\n });\n\n const results = await Promise.all(promises);\n\n return filterUndefined<T>(\n results.reduce((accum, curr) => {\n accum[curr.key as keyof T] = curr.value;\n return accum;\n }, {} as T)\n );\n}\n\n/**\n * Recursively converts all values in an object to hex strings\n *\n * @param {any} obj - obj to deep hexlify\n * @returns {any} object with all of its values hexlified\n */\nexport function deepHexlify(obj: any): any {\n if (typeof obj === \"function\") {\n return undefined;\n }\n if (obj == null || typeof obj === \"string\" || typeof obj === \"boolean\") {\n return obj;\n } else if (typeof obj === \"bigint\") {\n return toHex(obj);\n } else if (obj._isBigNumber != null || typeof obj !== \"object\") {\n return toHex(obj).replace(/^0x0/, \"0x\");\n }\n if (Array.isArray(obj)) {\n return obj.map((member) => deepHexlify(member));\n }\n return Object.keys(obj).reduce(\n (set, key) => ({\n ...set,\n [key]: deepHexlify(obj[key]),\n }),\n {}\n );\n}\n\n/**\n * Filters out properties with undefined or null values from the provided object.\n *\n * @example\n * ```ts\n * import { filterUndefined } from \"@aa-sdk/core\";\n *\n * const result = filterUndefined({\n * foo: undefined,\n * bar: null,\n * baz: \"baz\",\n * }); // { baz: \"baz\" }\n * ```\n *\n * @param {T} obj the object from which to remove properties with undefined or null values\n * @returns {T} the object with undefined or null properties removed\n */\nexport function filterUndefined<T>(obj: T): T {\n for (const key in obj) {\n if (obj[key] == null) {\n delete obj[key];\n }\n }\n return obj as T;\n}\n\n/**\n * Picks the specified keys from an object and returns a new object containing only those key-value pairs.\n *\n * @example\n * ```ts\n * import { pick } from \"@aa-sdk/core\";\n *\n * const picked = pick({\n * foo: \"foo\",\n * bar: \"bar\",\n * }, [\"foo\"]); // { foo: \"foo\" }\n * ```\n *\n * @param {Record<string, unknown>} obj The object from which to pick keys\n * @param {string|string[]} keys A single key or an array of keys to pick from the object\n * @returns {Record<string, unknown>} A new object containing only the picked key-value pairs\n */\nexport function pick(obj: Record<string, unknown>, keys: string | string[]) {\n return Object.keys(obj)\n .filter((k) => keys.includes(k))\n .reduce((res, k) => Object.assign(res, { [k]: obj[k] }), {});\n}\n\n/**\n * Utility method for checking if the passed in values are all equal (strictly)\n *\n * @param {...any[]} params - values to check\n * @returns {boolean} a boolean indicating if all values are the same\n * @throws if no values are passed in\n */\nexport const allEqual = (...params: any[]): boolean => {\n if (params.length === 0) {\n throw new Error(\"no values passed in\");\n }\n return params.every((v) => v === params[0]);\n};\n\n/**\n * Utility method for checking the condition and return the value if condition holds true, undefined if not.\n *\n * @param {Promise<boolean>} condition - condition to check\n * @param {() => Promise<T>} value - value to return when condition holds true\n * @returns {Promise<T | undefined>} the value if condition holds true, undefined if not\n */\nexport const conditionalReturn = <T>(\n condition: Promise<boolean>,\n value: () => Promise<T>\n): Promise<T | undefined> => condition.then((t) => (t ? value() : undefined));\n\n/**\n * Converts an array of objects into a record (object) where each key is determined by the specified selector and the value is determined by the provided function.\n *\n * @example\n * ```ts\n * import { toRecord } from \"@aa-sdk/core\";\n * import { sepolia, mainnet } from \"viem/chains\";\n *\n * const addressesByChain = toRecord(\n * [sepolia, mainnet],\n * \"id\",\n * () => \"0x...\"\n * ); // { [sepolia.id]: \"0x...\", [mainnet.id]: \"0x...\" }\n * ```\n *\n * @param {T[]} array The array of objects to convert to a record\n * @param {K} selector The key used to select the property that will become the record's key\n * @param {(item: T) => V} fn The function that transforms each item in the array into the record's value\n * @returns {Record<T[K], V>} The resulting record object\n */\nexport const toRecord = <\n T extends { [K in RecordableKeys<T>]: string | number | symbol },\n K extends RecordableKeys<T>,\n V\n>(\n array: T[],\n selector: K,\n fn: (item: T) => V\n): Record<T[K], V> =>\n array.reduce((acc, item) => {\n acc[item[selector]] = fn(item);\n return acc;\n }, {} as Record<T[K], V>);\n\nexport * from \"./bigint.js\";\nexport * from \"./bytes.js\";\nexport * from \"./defaults.js\";\nexport * from \"./schema.js\";\nexport type * from \"./types.js\";\nexport * from \"./userop.js\";\n"]}
@@ -1 +1 @@
1
- export declare const VERSION = "4.8.0";
1
+ export declare const VERSION = "4.10.0";
@@ -1,4 +1,4 @@
1
1
  // This file is autogenerated by inject-version.ts. Any changes will be
2
2
  // overwritten on commit!
3
- export const VERSION = "4.8.0";
3
+ export const VERSION = "4.10.0";
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.8.0\";\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.10.0\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"waitForUserOperationTransacation.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/waitForUserOperationTransacation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAM1D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,+BAA+B,EAAE,CAC5C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EAEpD,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,CAAC,EACvC,IAAI,EAAE,gCAAgC,KACnC,OAAO,CAAC,GAAG,CA2Cf,CAAC"}
1
+ {"version":3,"file":"waitForUserOperationTransacation.d.ts","sourceRoot":"","sources":["../../../../src/actions/smartAccount/waitForUserOperationTransacation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAK1D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,+BAA+B,EAAE,CAC5C,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EAEpD,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,CAAC,EACvC,IAAI,EAAE,gCAAgC,KACnC,OAAO,CAAC,GAAG,CAyCf,CAAC"}
@@ -10,6 +10,10 @@ export declare const asyncPipe: <S, O, F>(...fns: ((s: S, o?: O | undefined, f?:
10
10
  export type Deferrable<T> = {
11
11
  [K in keyof T]: PromiseOrValue<T[K]>;
12
12
  };
13
+ /**
14
+ * Used to ensure type doesn't extend another, for use in & chaining of properties
15
+ */
16
+ export type NotType<A, B> = A extends B ? never : unknown;
13
17
  /**
14
18
  * Await all of the properties of a Deferrable object
15
19
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,iJAQnB,CAAC;AAGJ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sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aa-sdk/core",
3
3
  "license": "MIT",
4
- "version": "4.8.0",
4
+ "version": "4.10.0",
5
5
  "description": "viem based SDK that enables interactions with ERC-4337 Smart Accounts. ABIs are based off the definitions generated in @account-abstraction/contracts",
6
6
  "author": "Alchemy",
7
7
  "type": "module",
@@ -17,6 +17,7 @@
17
17
  "!vitest.config.ts",
18
18
  "!.env",
19
19
  "!src/**/*.test.ts",
20
+ "!src/**/*.test-d.ts",
20
21
  "!src/__tests__/**/*"
21
22
  ],
22
23
  "exports": {
@@ -64,5 +65,5 @@
64
65
  "url": "https://github.com/alchemyplatform/aa-sdk/issues"
65
66
  },
66
67
  "homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
67
- "gitHead": "06d9deda91e24f7c654bbf2e5713644fd39f6a85"
68
+ "gitHead": "8acd2d8e45410bfb2d7e4447d3a130e23e605cd4"
68
69
  }
@@ -1,5 +1,4 @@
1
1
  import type { Chain, Client, Hex, Transport } from "viem";
2
- import { getTransaction } from "viem/actions";
3
2
  import { isBaseSmartAccountClient } from "../../client/isSmartAccountClient.js";
4
3
  import { IncompatibleClientError } from "../../errors/client.js";
5
4
  import { FailedToFindTransactionError } from "../../errors/transaction.js";
@@ -72,9 +71,7 @@ export const waitForUserOperationTransaction: <
72
71
  });
73
72
 
74
73
  if (receipt) {
75
- return getTransaction(client, {
76
- hash: receipt.receipt.transactionHash,
77
- }).then((x) => x.hash);
74
+ return receipt?.receipt.transactionHash;
78
75
  }
79
76
  }
80
77
 
@@ -23,6 +23,11 @@ export type Deferrable<T> = {
23
23
  [K in keyof T]: PromiseOrValue<T[K]>;
24
24
  };
25
25
 
26
+ /**
27
+ * Used to ensure type doesn't extend another, for use in & chaining of properties
28
+ */
29
+ export type NotType<A, B> = A extends B ? never : unknown;
30
+
26
31
  /**
27
32
  * Await all of the properties of a Deferrable object
28
33
  *
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // This file is autogenerated by inject-version.ts. Any changes will be
2
2
  // overwritten on commit!
3
- export const VERSION = "4.8.0";
3
+ export const VERSION = "4.10.0";