@funkit/core 0.8.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 (234) hide show
  1. package/README.md +110 -0
  2. package/dist/fetch-polyfill.d.ts +1 -0
  3. package/dist/fetch-polyfill.js +35 -0
  4. package/dist/fetch-polyfill.js.map +1 -0
  5. package/dist/index.d.ts +12 -0
  6. package/dist/index.js +29 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/src/abis/ApproveAndExec.json +1 -0
  9. package/dist/src/abis/ApproveAndSwap.json +1 -0
  10. package/dist/src/abis/ERC20.json +1 -0
  11. package/dist/src/abis/ERC721.json +1 -0
  12. package/dist/src/abis/EntryPoint.json +1 -0
  13. package/dist/src/abis/EstimationPaymaster.json +1 -0
  14. package/dist/src/abis/FeePercentOracle.json +1 -0
  15. package/dist/src/abis/FunWallet.json +1 -0
  16. package/dist/src/abis/FunWalletFactory.json +1 -0
  17. package/dist/src/abis/GaslessPaymaster.json +1 -0
  18. package/dist/src/abis/LidoWithdrawQueue.json +1 -0
  19. package/dist/src/abis/RoleBasedAccessControl.json +1 -0
  20. package/dist/src/abis/TestNFT.json +1 -0
  21. package/dist/src/abis/TokenPaymaster.json +1 -0
  22. package/dist/src/abis/TokenPriceOracle.json +1 -0
  23. package/dist/src/abis/UniswapV2Factory.json +1 -0
  24. package/dist/src/abis/UniswapV2Router02.json +1 -0
  25. package/dist/src/abis/UniswapV3LimitOrder.json +1 -0
  26. package/dist/src/abis/UserAuthentication.json +1 -0
  27. package/dist/src/abis/univ3factory.json +1 -0
  28. package/dist/src/abis/univ3quoter.json +1 -0
  29. package/dist/src/abis/univ3router.json +1 -0
  30. package/dist/src/actions/AccessControl.d.ts +9 -0
  31. package/dist/src/actions/AccessControl.js +88 -0
  32. package/dist/src/actions/AccessControl.js.map +1 -0
  33. package/dist/src/actions/BatchActions.d.ts +3 -0
  34. package/dist/src/actions/BatchActions.js +12 -0
  35. package/dist/src/actions/BatchActions.js.map +1 -0
  36. package/dist/src/actions/FirstClassActions.d.ts +161 -0
  37. package/dist/src/actions/FirstClassActions.js +347 -0
  38. package/dist/src/actions/FirstClassActions.js.map +1 -0
  39. package/dist/src/actions/Group.d.ts +6 -0
  40. package/dist/src/actions/Group.js +44 -0
  41. package/dist/src/actions/Group.js.map +1 -0
  42. package/dist/src/actions/LimitOrder.d.ts +4 -0
  43. package/dist/src/actions/LimitOrder.js +45 -0
  44. package/dist/src/actions/LimitOrder.js.map +1 -0
  45. package/dist/src/actions/Stake.d.ts +8 -0
  46. package/dist/src/actions/Stake.js +124 -0
  47. package/dist/src/actions/Stake.js.map +1 -0
  48. package/dist/src/actions/Swap.d.ts +9 -0
  49. package/dist/src/actions/Swap.js +169 -0
  50. package/dist/src/actions/Swap.js.map +1 -0
  51. package/dist/src/actions/Token.d.ts +12 -0
  52. package/dist/src/actions/Token.js +102 -0
  53. package/dist/src/actions/Token.js.map +1 -0
  54. package/dist/src/actions/index.d.ts +7 -0
  55. package/dist/src/actions/index.js +24 -0
  56. package/dist/src/actions/index.js.map +1 -0
  57. package/dist/src/actions/types.d.ts +117 -0
  58. package/dist/src/actions/types.js +11 -0
  59. package/dist/src/actions/types.js.map +1 -0
  60. package/dist/src/apis/AccessControlApis.d.ts +5 -0
  61. package/dist/src/apis/AccessControlApis.js +22 -0
  62. package/dist/src/apis/AccessControlApis.js.map +1 -0
  63. package/dist/src/apis/AssetApis.d.ts +79 -0
  64. package/dist/src/apis/AssetApis.js +100 -0
  65. package/dist/src/apis/AssetApis.js.map +1 -0
  66. package/dist/src/apis/ContractApis.d.ts +1 -0
  67. package/dist/src/apis/ContractApis.js +11 -0
  68. package/dist/src/apis/ContractApis.js.map +1 -0
  69. package/dist/src/apis/GroupApis.d.ts +8 -0
  70. package/dist/src/apis/GroupApis.js +45 -0
  71. package/dist/src/apis/GroupApis.js.map +1 -0
  72. package/dist/src/apis/InfoApis.d.ts +6 -0
  73. package/dist/src/apis/InfoApis.js +59 -0
  74. package/dist/src/apis/InfoApis.js.map +1 -0
  75. package/dist/src/apis/ListenerApis.d.ts +3 -0
  76. package/dist/src/apis/ListenerApis.js +36 -0
  77. package/dist/src/apis/ListenerApis.js.map +1 -0
  78. package/dist/src/apis/NFTApis.d.ts +22 -0
  79. package/dist/src/apis/NFTApis.js +34 -0
  80. package/dist/src/apis/NFTApis.js.map +1 -0
  81. package/dist/src/apis/OnOffRampApis.d.ts +2 -0
  82. package/dist/src/apis/OnOffRampApis.js +23 -0
  83. package/dist/src/apis/OnOffRampApis.js.map +1 -0
  84. package/dist/src/apis/OnOffRampUtils.d.ts +2 -0
  85. package/dist/src/apis/OnOffRampUtils.js +23 -0
  86. package/dist/src/apis/OnOffRampUtils.js.map +1 -0
  87. package/dist/src/apis/OperationApis.d.ts +14 -0
  88. package/dist/src/apis/OperationApis.js +77 -0
  89. package/dist/src/apis/OperationApis.js.map +1 -0
  90. package/dist/src/apis/PaymasterApis.d.ts +15 -0
  91. package/dist/src/apis/PaymasterApis.js +89 -0
  92. package/dist/src/apis/PaymasterApis.js.map +1 -0
  93. package/dist/src/apis/UserApis.d.ts +12 -0
  94. package/dist/src/apis/UserApis.js +77 -0
  95. package/dist/src/apis/UserApis.js.map +1 -0
  96. package/dist/src/apis/index.d.ts +10 -0
  97. package/dist/src/apis/index.js +27 -0
  98. package/dist/src/apis/index.js.map +1 -0
  99. package/dist/src/apis/types.d.ts +49 -0
  100. package/dist/src/apis/types.js +3 -0
  101. package/dist/src/apis/types.js.map +1 -0
  102. package/dist/src/auth/Auth.d.ts +81 -0
  103. package/dist/src/auth/Auth.js +317 -0
  104. package/dist/src/auth/Auth.js.map +1 -0
  105. package/dist/src/auth/SessionKeyAuth.d.ts +19 -0
  106. package/dist/src/auth/SessionKeyAuth.js +118 -0
  107. package/dist/src/auth/SessionKeyAuth.js.map +1 -0
  108. package/dist/src/auth/index.d.ts +2 -0
  109. package/dist/src/auth/index.js +19 -0
  110. package/dist/src/auth/index.js.map +1 -0
  111. package/dist/src/auth/types.d.ts +20 -0
  112. package/dist/src/auth/types.js +3 -0
  113. package/dist/src/auth/types.js.map +1 -0
  114. package/dist/src/common/constants.d.ts +1072 -0
  115. package/dist/src/common/constants.js +153 -0
  116. package/dist/src/common/constants.js.map +1 -0
  117. package/dist/src/common/index.d.ts +2 -0
  118. package/dist/src/common/index.js +19 -0
  119. package/dist/src/common/index.js.map +1 -0
  120. package/dist/src/common/types.d.ts +32 -0
  121. package/dist/src/common/types.js +3 -0
  122. package/dist/src/common/types.js.map +1 -0
  123. package/dist/src/config/Config.d.ts +3 -0
  124. package/dist/src/config/Config.js +46 -0
  125. package/dist/src/config/Config.js.map +1 -0
  126. package/dist/src/config/index.d.ts +2 -0
  127. package/dist/src/config/index.js +19 -0
  128. package/dist/src/config/index.js.map +1 -0
  129. package/dist/src/config/types.d.ts +21 -0
  130. package/dist/src/config/types.js +3 -0
  131. package/dist/src/config/types.js.map +1 -0
  132. package/dist/src/data/Chain.d.ts +29 -0
  133. package/dist/src/data/Chain.js +174 -0
  134. package/dist/src/data/Chain.js.map +1 -0
  135. package/dist/src/data/NFT.d.ts +24 -0
  136. package/dist/src/data/NFT.js +104 -0
  137. package/dist/src/data/NFT.js.map +1 -0
  138. package/dist/src/data/Operation.d.ts +33 -0
  139. package/dist/src/data/Operation.js +68 -0
  140. package/dist/src/data/Operation.js.map +1 -0
  141. package/dist/src/data/SolidityData.d.ts +8 -0
  142. package/dist/src/data/SolidityData.js +72 -0
  143. package/dist/src/data/SolidityData.js.map +1 -0
  144. package/dist/src/data/Token.d.ts +26 -0
  145. package/dist/src/data/Token.js +122 -0
  146. package/dist/src/data/Token.js.map +1 -0
  147. package/dist/src/data/index.d.ts +6 -0
  148. package/dist/src/data/index.js +23 -0
  149. package/dist/src/data/index.js.map +1 -0
  150. package/dist/src/data/types.d.ts +112 -0
  151. package/dist/src/data/types.js +25 -0
  152. package/dist/src/data/types.js.map +1 -0
  153. package/dist/src/errors/BaseError.d.ts +9 -0
  154. package/dist/src/errors/BaseError.js +23 -0
  155. package/dist/src/errors/BaseError.js.map +1 -0
  156. package/dist/src/errors/ClientError.d.ts +22 -0
  157. package/dist/src/errors/ClientError.js +75 -0
  158. package/dist/src/errors/ClientError.js.map +1 -0
  159. package/dist/src/errors/ServerError.d.ts +7 -0
  160. package/dist/src/errors/ServerError.js +18 -0
  161. package/dist/src/errors/ServerError.js.map +1 -0
  162. package/dist/src/errors/index.d.ts +4 -0
  163. package/dist/src/errors/index.js +21 -0
  164. package/dist/src/errors/index.js.map +1 -0
  165. package/dist/src/errors/types.d.ts +54 -0
  166. package/dist/src/errors/types.js +45 -0
  167. package/dist/src/errors/types.js.map +1 -0
  168. package/dist/src/sponsors/GaslessSponsor.d.ts +19 -0
  169. package/dist/src/sponsors/GaslessSponsor.js +91 -0
  170. package/dist/src/sponsors/GaslessSponsor.js.map +1 -0
  171. package/dist/src/sponsors/Sponsor.d.ts +31 -0
  172. package/dist/src/sponsors/Sponsor.js +94 -0
  173. package/dist/src/sponsors/Sponsor.js.map +1 -0
  174. package/dist/src/sponsors/TokenSponsor.d.ts +40 -0
  175. package/dist/src/sponsors/TokenSponsor.js +271 -0
  176. package/dist/src/sponsors/TokenSponsor.js.map +1 -0
  177. package/dist/src/sponsors/index.d.ts +3 -0
  178. package/dist/src/sponsors/index.js +20 -0
  179. package/dist/src/sponsors/index.js.map +1 -0
  180. package/dist/src/sponsors/types.d.ts +9 -0
  181. package/dist/src/sponsors/types.js +10 -0
  182. package/dist/src/sponsors/types.js.map +1 -0
  183. package/dist/src/utils/ApiUtils.d.ts +19 -0
  184. package/dist/src/utils/ApiUtils.js +97 -0
  185. package/dist/src/utils/ApiUtils.js.map +1 -0
  186. package/dist/src/utils/AuthUtils.d.ts +4 -0
  187. package/dist/src/utils/AuthUtils.js +54 -0
  188. package/dist/src/utils/AuthUtils.js.map +1 -0
  189. package/dist/src/utils/ChainUtils.d.ts +12 -0
  190. package/dist/src/utils/ChainUtils.js +89 -0
  191. package/dist/src/utils/ChainUtils.js.map +1 -0
  192. package/dist/src/utils/MerkleUtils.d.ts +18 -0
  193. package/dist/src/utils/MerkleUtils.js +96 -0
  194. package/dist/src/utils/MerkleUtils.js.map +1 -0
  195. package/dist/src/utils/PaymasterUtils.d.ts +3 -0
  196. package/dist/src/utils/PaymasterUtils.js +17 -0
  197. package/dist/src/utils/PaymasterUtils.js.map +1 -0
  198. package/dist/src/utils/SwapUtils.d.ts +35 -0
  199. package/dist/src/utils/SwapUtils.js +193 -0
  200. package/dist/src/utils/SwapUtils.js.map +1 -0
  201. package/dist/src/utils/TypeUtils.d.ts +1 -0
  202. package/dist/src/utils/TypeUtils.js +13 -0
  203. package/dist/src/utils/TypeUtils.js.map +1 -0
  204. package/dist/src/utils/UserOpUtils.d.ts +12 -0
  205. package/dist/src/utils/UserOpUtils.js +166 -0
  206. package/dist/src/utils/UserOpUtils.js.map +1 -0
  207. package/dist/src/utils/ViemUtils.d.ts +9 -0
  208. package/dist/src/utils/ViemUtils.js +30 -0
  209. package/dist/src/utils/ViemUtils.js.map +1 -0
  210. package/dist/src/utils/WalletUtils.d.ts +11 -0
  211. package/dist/src/utils/WalletUtils.js +61 -0
  212. package/dist/src/utils/WalletUtils.js.map +1 -0
  213. package/dist/src/utils/index.d.ts +7 -0
  214. package/dist/src/utils/index.js +24 -0
  215. package/dist/src/utils/index.js.map +1 -0
  216. package/dist/src/viem/ContractInterface.d.ts +19 -0
  217. package/dist/src/viem/ContractInterface.js +88 -0
  218. package/dist/src/viem/ContractInterface.js.map +1 -0
  219. package/dist/src/viem/Converter.d.ts +1770 -0
  220. package/dist/src/viem/Converter.js +50 -0
  221. package/dist/src/viem/Converter.js.map +1 -0
  222. package/dist/src/viem/index.d.ts +2 -0
  223. package/dist/src/viem/index.js +19 -0
  224. package/dist/src/viem/index.js.map +1 -0
  225. package/dist/src/wallet/FunWallet.d.ts +185 -0
  226. package/dist/src/wallet/FunWallet.js +720 -0
  227. package/dist/src/wallet/FunWallet.js.map +1 -0
  228. package/dist/src/wallet/index.d.ts +2 -0
  229. package/dist/src/wallet/index.js +19 -0
  230. package/dist/src/wallet/index.js.map +1 -0
  231. package/dist/src/wallet/types.d.ts +13 -0
  232. package/dist/src/wallet/types.js +3 -0
  233. package/dist/src/wallet/types.js.map +1 -0
  234. package/package.json +89 -0
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertSignerToClient = exports.convertProviderToClient = void 0;
4
+ const viem_1 = require("viem");
5
+ const chains_1 = require("viem/chains");
6
+ const convertProviderToClient = ({ provider, viemChain }) => {
7
+ const chain = viemChain ? viemChain : chains_1.mainnet;
8
+ if (provider.request) {
9
+ return (0, viem_1.createWalletClient)({
10
+ chain,
11
+ transport: (0, viem_1.custom)(provider)
12
+ });
13
+ }
14
+ if (!provider.send)
15
+ throw new Error("Provider isn't EIP 1193 compliant");
16
+ return (0, viem_1.createWalletClient)({
17
+ chain,
18
+ transport: (0, viem_1.custom)({
19
+ async request({ method, params }) {
20
+ const response = await provider.send(method, params);
21
+ return response;
22
+ }
23
+ })
24
+ });
25
+ };
26
+ exports.convertProviderToClient = convertProviderToClient;
27
+ const convertSignerToClient = ({ signer, viemChain }) => {
28
+ const chain = viemChain ? viemChain : chains_1.mainnet;
29
+ if (signer.type === "local") {
30
+ return (0, viem_1.createWalletClient)({
31
+ chain,
32
+ transport: (0, viem_1.custom)(signer)
33
+ });
34
+ }
35
+ return (0, viem_1.createWalletClient)({
36
+ chain,
37
+ transport: (0, viem_1.custom)({
38
+ async request({ method, params }) {
39
+ if (method === "eth_requestAccounts") {
40
+ return [await signer.getAddress()];
41
+ }
42
+ else if (method === "personal_sign") {
43
+ return await signer.signMessage((0, viem_1.toBytes)(params[0]));
44
+ }
45
+ }
46
+ })
47
+ });
48
+ };
49
+ exports.convertSignerToClient = convertSignerToClient;
50
+ //# sourceMappingURL=Converter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Converter.js","sourceRoot":"","sources":["../../../src/viem/Converter.ts"],"names":[],"mappings":";;;AAAA,+BAA0D;AAC1D,wCAA4C;AAYrC,MAAM,uBAAuB,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAmC,EAAE,EAAE;IAChG,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAO,CAAA;IAC7C,IAAI,QAAQ,CAAC,OAAO,EAAE;QAClB,OAAO,IAAA,yBAAkB,EAAC;YACtB,KAAK;YACL,SAAS,EAAE,IAAA,aAAM,EAAC,QAAQ,CAAC;SAC9B,CAAC,CAAA;KACL;IACD,IAAI,CAAC,QAAQ,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;IACxE,OAAO,IAAA,yBAAkB,EAAC;QACtB,KAAK;QACL,SAAS,EAAE,IAAA,aAAM,EAAC;YACd,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE;gBAC5B,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;gBACpD,OAAO,QAAQ,CAAA;YACnB,CAAC;SACJ,CAAC;KACL,CAAC,CAAA;AACN,CAAC,CAAA;AAlBY,QAAA,uBAAuB,2BAkBnC;AAEM,MAAM,qBAAqB,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAiC,EAAE,EAAE;IAC1F,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAO,CAAA;IAC7C,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;QACzB,OAAO,IAAA,yBAAkB,EAAC;YACtB,KAAK;YACL,SAAS,EAAE,IAAA,aAAM,EAAC,MAAM,CAAC;SAC5B,CAAC,CAAA;KACL;IACD,OAAO,IAAA,yBAAkB,EAAC;QACtB,KAAK;QACL,SAAS,EAAE,IAAA,aAAM,EAAC;YACd,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE;gBAC5B,IAAI,MAAM,KAAK,qBAAqB,EAAE;oBAClC,OAAO,CAAC,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC,CAAA;iBACrC;qBAAM,IAAI,MAAM,KAAK,eAAe,EAAE;oBACnC,OAAO,MAAM,MAAM,CAAC,WAAW,CAAC,IAAA,cAAO,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;iBACtD;YACL,CAAC;SACJ,CAAC;KACL,CAAC,CAAA;AACN,CAAC,CAAA;AApBY,QAAA,qBAAqB,yBAoBjC"}
@@ -0,0 +1,2 @@
1
+ export * from "./ContractInterface";
2
+ export * from "./Converter";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ContractInterface"), exports);
18
+ __exportStar(require("./Converter"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/viem/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAmC;AACnC,8CAA2B"}
@@ -0,0 +1,185 @@
1
+ import { Address, Hex } from "viem";
2
+ import { FunWalletParams, User } from "./types";
3
+ import { FirstClassActions } from "../actions/FirstClassActions";
4
+ import { Auth } from "../auth";
5
+ import { ExecutionReceipt, TransactionParams } from "../common";
6
+ import { EnvOption } from "../config";
7
+ import { Operation, OperationStatus } from "../data";
8
+ export declare class FunWallet extends FirstClassActions {
9
+ walletUniqueId?: Hex;
10
+ userInfo?: Map<Hex, User>;
11
+ address?: Address;
12
+ /**
13
+ * Creates FunWallet object
14
+ * @constructor
15
+ * @param {object} params - The parameters for the constructing fun wallet - (users, uniqueId) or walletAddr
16
+ */
17
+ constructor(params: FunWalletParams | string);
18
+ /**
19
+ * Retrieves the wallet address associated with this FunWallet. The address should be the same for all EVM chains so no input is needed
20
+ * If the address is not already cached, it fetches it using the wallet's unique ID and chain information.
21
+ * @returns {Promise<Address>} The wallet address.
22
+ */
23
+ getAddress(): Promise<Address>;
24
+ /**
25
+ * Retrieves the wallet address associated with the provided unique ID using the given API key.
26
+ * @param {string} uniqueId - The unique ID of the wallet.
27
+ * @param {string} apiKey - The API key to access the required resources.
28
+ * @returns {Promise<Address>} The wallet address.
29
+ */
30
+ static getAddress(uniqueId: string, apiKey: string): Promise<Address>;
31
+ /**
32
+ * Retrieves the wallet address associated with the provided unique ID in an offline environment.
33
+ * @param {string} uniqueId - The unique ID of the wallet.
34
+ * @param {string} rpcUrl - The URL of the RPC endpoint for offline querying.
35
+ * @param {Address} factoryAddress - The address of the factory contract.
36
+ * @returns {Promise<Address>} The wallet address.
37
+ */
38
+ static getAddressOffline(uniqueId: string, rpcUrl: string, factoryAddress: Address): Promise<any>;
39
+ /**
40
+ * Get all tokens for a specific chain
41
+ * @param {string} chainId string version of the chainId or ALL. If empty, then default to the one in globalEnvOption
42
+ * @param {string} onlyVerifiedTokens If true, only return alchemy tokens that are verified(filters spam) - defaults to false
43
+ * @returns JSON
44
+ */
45
+ getTokens(chainIdInput?: string, onlyVerifiedTokens?: boolean): Promise<any>;
46
+ /**
47
+ * Given an address and a chain, returns all NFTs owned by that address
48
+ * @param {string} chainId string version of the chainId or ALL. If empty, then default to the one in globalEnvOption
49
+ * @returns array
50
+ */
51
+ getNFTs(chainIdInput?: string): Promise<any>;
52
+ /**
53
+ * Get all tokens on all supported chains. Merge tokens by symbol
54
+ * @param {string} chainIdInput string version of the chainId or ALL. If empty, then default to the one in globalEnvOption
55
+ * @param {*} onlyVerifiedTokens true if you want to filter out spam tokens(Uses alchemy lists)
56
+ * @param {boolean} checkStatus true if you want to check if the address has any pending lido withdrawals
57
+ * @returns JSON of all tokens owned by address
58
+ */
59
+ getAssets(chainIdInput?: string, onlyVerifiedTokens?: boolean, checkStatus?: boolean): Promise<{}>;
60
+ /**
61
+ * Retrieves the nonce value for the specified sender address and nonce key.
62
+ * If the nonce is unavailable, a random nonce key is generated and returned as the nonce.
63
+ * @param {string} sender - The sender's address.
64
+ * @param {string} key - The nonce key (default: randomly generated).
65
+ * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
66
+ * @returns {Promise<bigint>} The nonce value.
67
+ */
68
+ getNonce(sender: string, key?: bigint, txOptions?: EnvOption): Promise<bigint>;
69
+ /**
70
+ * Retrieves a list of operations associated with the wallet.
71
+ * @param {OperationStatus} status - The status of operations to retrieve (default: OperationStatus.ALL).
72
+ * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
73
+ * @returns {Promise<Operation[]>} A list of operations.
74
+ */
75
+ getOperations(status?: OperationStatus, txOptions?: EnvOption): Promise<Operation[]>;
76
+ /**
77
+ * Retrieves a specific operation by its ID.
78
+ * @param {Hex} opId - The ID of the operation to retrieve.
79
+ * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
80
+ * @returns {Promise<Operation>} The requested operation.
81
+ */
82
+ getOperation(opId: Hex, txOptions?: EnvOption): Promise<Operation>;
83
+ /**
84
+ * Retrieves a list of users associated with the wallet and their potential corresponding group information.
85
+ * @param {Auth} auth - The authentication instance for retrieving user information.
86
+ * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
87
+ * @returns {Promise<User[]>} A list of users with their group information.
88
+ */
89
+ getUsers(auth: Auth, txOptions?: EnvOption): Promise<User[]>;
90
+ /**
91
+ * Checks the deployment status of the wallet's address to determine if it's a contract.
92
+ * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
93
+ * @returns {Promise<boolean>} `true` if the address is a contract, `false` otherwise.
94
+ */
95
+ getDeploymentStatus(txOptions?: EnvOption): Promise<boolean>;
96
+ /**
97
+ * Creates the wallet.
98
+ * @param {Auth} auth - The authentication instance for the user.
99
+ * @param {string} userId - The ID of the user initiating the operation.
100
+ * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
101
+ * @returns {Promise<Operation>} The operation to create the wallet.
102
+ */
103
+ create(auth: Auth, userId: string, txOptions?: EnvOption): Promise<Operation>;
104
+ /**
105
+ * Generates an on-ramp URL for the account address.
106
+ * @param {Address} address - The account address (optional, defaults to the wallet's address).
107
+ * @returns {Promise<string>} The on-ramp URL.
108
+ */
109
+ onRamp(address?: Address): Promise<string>;
110
+ /**
111
+ * Generates an off-ramp URL for the account address.
112
+ * @param {Address} address - The account address (optional, defaults to the wallet's address).
113
+ * @returns {Promise<string>} The off-ramp URL.
114
+ */
115
+ offRamp(address?: Address): Promise<string>;
116
+ /**
117
+ * Creates a new operation to be associated with the wallet and prepares it for execution.
118
+ * @param {Auth} auth - The authentication instance for the user.
119
+ * @param {string} userId - The ID of the user initiating the operation.
120
+ * @param {TransactionParams} transactionParams - The parameters for the transaction.
121
+ * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
122
+ * @returns {Promise<Operation>} The created and prepared operation.
123
+ */
124
+ createOperation(auth: Auth, userId: string, transactionParams: TransactionParams, txOptions?: EnvOption): Promise<Operation>;
125
+ /**
126
+ * Signs an operation using the provided authentication instance and returns the signed operation.
127
+ * @param {Auth} auth - The authentication instance for the user.
128
+ * @param {Operation} operation - The operation to be signed.
129
+ * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
130
+ * @returns {Promise<Operation>} The signed operation.
131
+ */
132
+ signOperation(auth: Auth, operation: Operation, txOptions?: EnvOption): Promise<Operation>;
133
+ /**
134
+ * Executes an operation and returns the execution receipt.
135
+ * @param {Auth} auth - The authentication instance for the user.
136
+ * @param {Operation} operation - The operation to be executed.
137
+ * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
138
+ * @returns {Promise<ExecutionReceipt>} The execution receipt of the operation.
139
+ */
140
+ executeOperation(auth: Auth, operation: Operation, txOptions?: EnvOption): Promise<ExecutionReceipt>;
141
+ /**
142
+ * Schedules an operation for execution and returns the scheduled operation's ID.
143
+ * @param {Auth} auth - The authentication instance for the user.
144
+ * @param {Operation} operation - The operation to be scheduled.
145
+ * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
146
+ * @returns {Promise<Hex>} The ID of the scheduled operation.
147
+ */
148
+ scheduleOperation(auth: Auth, operation: Operation, txOptions?: EnvOption): Promise<Hex>;
149
+ /**
150
+ * Removes an operation from the system using its ID.
151
+ * @param {Auth} _ - The authentication instance (not used in this method).
152
+ * @param {Hex} operationId - The ID of the operation to be removed.
153
+ * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
154
+ * @returns {Promise<void>} A promise that resolves after the operation is removed.
155
+ */
156
+ removeOperation(_: Auth, operationId: Hex, txOptions?: EnvOption): Promise<void>;
157
+ /**
158
+ * Creates and prepares a rejection operation for an existing operation.
159
+ * @param {Auth} auth - The authentication instance for the user.
160
+ * @param {string} groupId - The ID of the group to which the operation belongs.
161
+ * @param {Operation} operation - The operation to be rejected.
162
+ * @param {string} rejectionMessage - Optional rejection message.
163
+ * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
164
+ * @returns {Promise<Operation>} The prepared rejection operation.
165
+ */
166
+ createRejectOperation(auth: Auth, groupId: string, operation: Operation, rejectionMessage?: string, txOptions?: EnvOption): Promise<Operation>;
167
+ /**
168
+ * Estimates the gas cost for executing an operation and returns the updated operation with gas estimation details.
169
+ * @param {Auth} auth - The authentication instance for the user.
170
+ * @param {string} userId - The ID of the user initiating the operation.
171
+ * @param {Operation} operation - The operation for which to estimate gas.
172
+ * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
173
+ * @returns {Promise<Operation>} The updated operation with gas estimation details.
174
+ */
175
+ estimateOperation(auth: Auth, userId: string, operation: Operation, txOptions?: EnvOption): Promise<Operation>;
176
+ private getThisInitCode;
177
+ private getInitCode;
178
+ /**
179
+ * Encodes arbitrary transactions calls to include fees
180
+ * @param params Transaction Params, generated from various calldata generating functions
181
+ * @param options EnvOptions to read fee data from
182
+ * @returns calldata to be passed into createUserOperation
183
+ */
184
+ private buildCalldata;
185
+ }