@funkit/core 2.1.2-next.0 → 2.1.2-next.2

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 (171) hide show
  1. package/dist/index.js +16641 -12
  2. package/dist/index.js.map +7 -1
  3. package/dist/src/common/constants.d.ts +42 -0
  4. package/dist/src/viem/Converter.d.ts +4 -4
  5. package/package.json +6 -4
  6. package/dist/src/abis/ApproveAndExec.json +0 -106
  7. package/dist/src/abis/ApproveAndSwap.json +0 -141
  8. package/dist/src/abis/CheckoutPaymaster.json +0 -3358
  9. package/dist/src/abis/ERC20.json +0 -1
  10. package/dist/src/abis/ERC721.json +0 -1
  11. package/dist/src/abis/EntryPoint.json +0 -1023
  12. package/dist/src/abis/EstimationPaymaster.json +0 -266
  13. package/dist/src/abis/FeePercentOracle.json +0 -218
  14. package/dist/src/abis/FunWallet.json +0 -758
  15. package/dist/src/abis/FunWalletFactory.json +0 -232
  16. package/dist/src/abis/GaslessPaymaster.json +0 -558
  17. package/dist/src/abis/LidoWithdrawQueue.json +0 -1
  18. package/dist/src/abis/RoleBasedAccessControl.json +0 -836
  19. package/dist/src/abis/TestNFT.json +0 -226
  20. package/dist/src/abis/TokenPaymaster.json +0 -696
  21. package/dist/src/abis/TokenPriceOracle.json +0 -57
  22. package/dist/src/abis/UniswapV2Factory.json +0 -1
  23. package/dist/src/abis/UniswapV2Router02.json +0 -1
  24. package/dist/src/abis/UniswapV3LimitOrder.json +0 -1
  25. package/dist/src/abis/UserAuthentication.json +0 -338
  26. package/dist/src/abis/univ3factory.json +0 -1
  27. package/dist/src/abis/univ3quoter.json +0 -1
  28. package/dist/src/abis/univ3router.json +0 -1
  29. package/dist/src/actions/AccessControl.js +0 -87
  30. package/dist/src/actions/AccessControl.js.map +0 -1
  31. package/dist/src/actions/BatchActions.js +0 -8
  32. package/dist/src/actions/BatchActions.js.map +0 -1
  33. package/dist/src/actions/Bridge.js +0 -42
  34. package/dist/src/actions/Bridge.js.map +0 -1
  35. package/dist/src/actions/FirstClassActions.js +0 -329
  36. package/dist/src/actions/FirstClassActions.js.map +0 -1
  37. package/dist/src/actions/Group.js +0 -30
  38. package/dist/src/actions/Group.js.map +0 -1
  39. package/dist/src/actions/LimitOrder.js +0 -43
  40. package/dist/src/actions/LimitOrder.js.map +0 -1
  41. package/dist/src/actions/Stake.js +0 -108
  42. package/dist/src/actions/Stake.js.map +0 -1
  43. package/dist/src/actions/Swap.js +0 -150
  44. package/dist/src/actions/Swap.js.map +0 -1
  45. package/dist/src/actions/Token.js +0 -103
  46. package/dist/src/actions/Token.js.map +0 -1
  47. package/dist/src/actions/index.js +0 -8
  48. package/dist/src/actions/index.js.map +0 -1
  49. package/dist/src/actions/types.js +0 -14
  50. package/dist/src/actions/types.js.map +0 -1
  51. package/dist/src/apis/AccessControlApis.js +0 -19
  52. package/dist/src/apis/AccessControlApis.js.map +0 -1
  53. package/dist/src/apis/BridgeApis.js +0 -54
  54. package/dist/src/apis/BridgeApis.js.map +0 -1
  55. package/dist/src/apis/ContractApis.js +0 -7
  56. package/dist/src/apis/ContractApis.js.map +0 -1
  57. package/dist/src/apis/GroupApis.js +0 -15
  58. package/dist/src/apis/GroupApis.js.map +0 -1
  59. package/dist/src/apis/InfoApis.js +0 -53
  60. package/dist/src/apis/InfoApis.js.map +0 -1
  61. package/dist/src/apis/ListenerApis.js +0 -31
  62. package/dist/src/apis/ListenerApis.js.map +0 -1
  63. package/dist/src/apis/NFTApis.js +0 -29
  64. package/dist/src/apis/NFTApis.js.map +0 -1
  65. package/dist/src/apis/OperationApis.js +0 -76
  66. package/dist/src/apis/OperationApis.js.map +0 -1
  67. package/dist/src/apis/PaymasterApis.js +0 -18
  68. package/dist/src/apis/PaymasterApis.js.map +0 -1
  69. package/dist/src/apis/SwapApis.js +0 -40
  70. package/dist/src/apis/SwapApis.js.map +0 -1
  71. package/dist/src/apis/UserApis.js +0 -56
  72. package/dist/src/apis/UserApis.js.map +0 -1
  73. package/dist/src/apis/index.js +0 -9
  74. package/dist/src/apis/index.js.map +0 -1
  75. package/dist/src/apis/types.js +0 -2
  76. package/dist/src/apis/types.js.map +0 -1
  77. package/dist/src/auth/Auth.js +0 -321
  78. package/dist/src/auth/Auth.js.map +0 -1
  79. package/dist/src/auth/SessionKeyAuth.js +0 -115
  80. package/dist/src/auth/SessionKeyAuth.js.map +0 -1
  81. package/dist/src/auth/index.js +0 -3
  82. package/dist/src/auth/index.js.map +0 -1
  83. package/dist/src/auth/types.js +0 -2
  84. package/dist/src/auth/types.js.map +0 -1
  85. package/dist/src/common/constants.js +0 -477
  86. package/dist/src/common/constants.js.map +0 -1
  87. package/dist/src/common/index.js +0 -3
  88. package/dist/src/common/index.js.map +0 -1
  89. package/dist/src/common/types.js +0 -2
  90. package/dist/src/common/types.js.map +0 -1
  91. package/dist/src/config/Config.js +0 -50
  92. package/dist/src/config/Config.js.map +0 -1
  93. package/dist/src/config/index.js +0 -3
  94. package/dist/src/config/index.js.map +0 -1
  95. package/dist/src/config/types.js +0 -2
  96. package/dist/src/config/types.js.map +0 -1
  97. package/dist/src/data/Chain.js +0 -209
  98. package/dist/src/data/Chain.js.map +0 -1
  99. package/dist/src/data/NFT.js +0 -101
  100. package/dist/src/data/NFT.js.map +0 -1
  101. package/dist/src/data/Operation.js +0 -88
  102. package/dist/src/data/Operation.js.map +0 -1
  103. package/dist/src/data/SolidityData.js +0 -84
  104. package/dist/src/data/SolidityData.js.map +0 -1
  105. package/dist/src/data/Token.js +0 -118
  106. package/dist/src/data/Token.js.map +0 -1
  107. package/dist/src/data/index.js +0 -7
  108. package/dist/src/data/index.js.map +0 -1
  109. package/dist/src/data/types.js +0 -22
  110. package/dist/src/data/types.js.map +0 -1
  111. package/dist/src/errors/BaseError.js +0 -25
  112. package/dist/src/errors/BaseError.js.map +0 -1
  113. package/dist/src/errors/ClientError.js +0 -63
  114. package/dist/src/errors/ClientError.js.map +0 -1
  115. package/dist/src/errors/ServerError.js +0 -13
  116. package/dist/src/errors/ServerError.js.map +0 -1
  117. package/dist/src/errors/errors.json +0 -626
  118. package/dist/src/errors/index.js +0 -5
  119. package/dist/src/errors/index.js.map +0 -1
  120. package/dist/src/errors/types.js +0 -48
  121. package/dist/src/errors/types.js.map +0 -1
  122. package/dist/src/sponsors/CheckoutSponsor.js +0 -61
  123. package/dist/src/sponsors/CheckoutSponsor.js.map +0 -1
  124. package/dist/src/sponsors/GaslessSponsor.js +0 -75
  125. package/dist/src/sponsors/GaslessSponsor.js.map +0 -1
  126. package/dist/src/sponsors/Sponsor.js +0 -80
  127. package/dist/src/sponsors/Sponsor.js.map +0 -1
  128. package/dist/src/sponsors/TokenSponsor.js +0 -251
  129. package/dist/src/sponsors/TokenSponsor.js.map +0 -1
  130. package/dist/src/sponsors/index.js +0 -5
  131. package/dist/src/sponsors/index.js.map +0 -1
  132. package/dist/src/sponsors/types.js +0 -8
  133. package/dist/src/sponsors/types.js.map +0 -1
  134. package/dist/src/utils/ApiUtils.js +0 -94
  135. package/dist/src/utils/ApiUtils.js.map +0 -1
  136. package/dist/src/utils/AuthUtils.js +0 -31
  137. package/dist/src/utils/AuthUtils.js.map +0 -1
  138. package/dist/src/utils/ChainUtils.js +0 -131
  139. package/dist/src/utils/ChainUtils.js.map +0 -1
  140. package/dist/src/utils/CheckoutUtils.js +0 -28
  141. package/dist/src/utils/CheckoutUtils.js.map +0 -1
  142. package/dist/src/utils/GroupUtils.js +0 -26
  143. package/dist/src/utils/GroupUtils.js.map +0 -1
  144. package/dist/src/utils/MerkleUtils.js +0 -86
  145. package/dist/src/utils/MerkleUtils.js.map +0 -1
  146. package/dist/src/utils/PaymasterUtils.js +0 -17
  147. package/dist/src/utils/PaymasterUtils.js.map +0 -1
  148. package/dist/src/utils/SwapUtils.js +0 -193
  149. package/dist/src/utils/SwapUtils.js.map +0 -1
  150. package/dist/src/utils/TypeUtils.js +0 -9
  151. package/dist/src/utils/TypeUtils.js.map +0 -1
  152. package/dist/src/utils/UserOpUtils.js +0 -171
  153. package/dist/src/utils/UserOpUtils.js.map +0 -1
  154. package/dist/src/utils/ViemUtils.js +0 -30
  155. package/dist/src/utils/ViemUtils.js.map +0 -1
  156. package/dist/src/utils/WalletUtils.js +0 -56
  157. package/dist/src/utils/WalletUtils.js.map +0 -1
  158. package/dist/src/utils/index.js +0 -9
  159. package/dist/src/utils/index.js.map +0 -1
  160. package/dist/src/viem/ContractInterface.js +0 -90
  161. package/dist/src/viem/ContractInterface.js.map +0 -1
  162. package/dist/src/viem/Converter.js +0 -47
  163. package/dist/src/viem/Converter.js.map +0 -1
  164. package/dist/src/viem/index.js +0 -3
  165. package/dist/src/viem/index.js.map +0 -1
  166. package/dist/src/wallet/FunWallet.js +0 -804
  167. package/dist/src/wallet/FunWallet.js.map +0 -1
  168. package/dist/src/wallet/index.js +0 -3
  169. package/dist/src/wallet/index.js.map +0 -1
  170. package/dist/src/wallet/types.js +0 -2
  171. package/dist/src/wallet/types.js.map +0 -1
@@ -1,42 +0,0 @@
1
- import { getSocketBridgeAllowance, getSocketBridgeApproveTransaction, getSocketBridgeQuote, getSocketBridgeTransaction, } from '../apis/BridgeApis';
2
- import { APPROVE_AND_EXEC_CONTRACT_INTERFACE, } from '../common';
3
- import { Chain, Token } from '../data';
4
- import { ErrorCode, InvalidParameterError } from '../errors';
5
- import { SocketSort } from './types';
6
- export const bridgeTransactionParams = async (params, walletAddress, chain) => {
7
- const { recipient, fromToken, toToken, sort } = params;
8
- const fromTokenObj = new Token(fromToken, chain);
9
- const toTokenObj = new Token(toToken, chain);
10
- const amount = await fromTokenObj.getDecimalAmount(params.amount);
11
- if (!recipient) {
12
- throw new InvalidParameterError(ErrorCode.InvalidParameter, 'Recipient Parameter was undefined', { params }, 'Please provide a recipient', 'https://docs.fun.xyz');
13
- }
14
- const fromChain = await Chain.getChain({ chainIdentifier: params.fromChain });
15
- const toChain = await Chain.getChain({ chainIdentifier: params.toChain });
16
- const fromChainId = await fromChain.getChainId();
17
- const approveAndExecAddress = await fromChain.getAddress('approveAndExecAddress');
18
- const route = await getSocketBridgeQuote(recipient, walletAddress, fromChainId, await toChain.getChainId(), await fromTokenObj.getAddress(), await toTokenObj.getAddress(), amount, sort ?? SocketSort.output);
19
- const socketTx = await getSocketBridgeTransaction(route);
20
- if (socketTx.result.approvalData !== null) {
21
- const { allowanceTarget, minimumApprovalAmount } = socketTx.result.approvalData;
22
- const allowanceStatusCheck = await getSocketBridgeAllowance(fromChainId, walletAddress, allowanceTarget, await fromTokenObj.getAddress());
23
- const allowanceValue = allowanceStatusCheck.result.value;
24
- if (minimumApprovalAmount > allowanceValue) {
25
- const approveTxData = await getSocketBridgeApproveTransaction(fromChainId, walletAddress, allowanceTarget, await fromTokenObj.getAddress(), amount);
26
- const approveData = approveTxData.result.data;
27
- return APPROVE_AND_EXEC_CONTRACT_INTERFACE.encodeTransactionParams(approveAndExecAddress, 'approveAndExecute', [
28
- socketTx.result.txTarget,
29
- socketTx.result.value,
30
- socketTx.result.txData,
31
- await fromTokenObj.getAddress(),
32
- approveData,
33
- ]);
34
- }
35
- }
36
- return {
37
- to: socketTx.result.txTarget,
38
- value: socketTx.result.value,
39
- data: socketTx.result.txData,
40
- };
41
- };
42
- //# sourceMappingURL=Bridge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Bridge.js","sourceRoot":"","sources":["../../../src/actions/Bridge.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EACjC,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,mCAAmC,GAEpC,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,EAAgB,UAAU,EAAE,MAAM,SAAS,CAAA;AAElD,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAC1C,MAAoB,E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YAAY,KAAK,IAAI,EAAE,CAAC;QAC1C,MAAM,EAAE,eAAe,EAAE,qBAAqB,EAAE,GAC9C,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAA;QAC9B,MAAM,oBAAoB,GAAG,MAAM,wBAAwB,CACzD,WAAW,EACX,aAAa,EACb,eAAe,EACf,MAAM,YAAY,CAAC,UAAU,EAAE,CAChC,CAAA;QACD,MAAM,cAAc,GAAG,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAA;QACxD,IAAI,qBAAqB,GAAG,cAAc,EAAE,CAAC;YAC3C,MAAM,aAAa,GAAG,MAAM,iCAAiC,CAC3D,WAAW,EACX,aAAa,EACb,eAAe,EACf,MAAM,YAAY,CAAC,UAAU,EAAE,EAC/B,MAAM,CACP,CAAA;YACD,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAA;YAC7C,OAAO,mCAAmC,CAAC,uBAAuB,CAChE,qBAAqB,EACrB,mBAAmB,EACnB;gBACE,QAAQ,CAAC,MAAM,CAAC,QAAQ;gBACxB,QAAQ,CAAC,MAAM,CAAC,KAAK;gBACrB,QAAQ,CAAC,MAAM,CAAC,MAAM;gBACtB,MAAM,YAAY,CAAC,UAAU,EAAE;gBAC/B,WAAW;aACZ,CACF,CAAA;QACH,CAAC;IACH,CAAC;IACD,OAAO;QACL,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ;QAC5B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK;QAC5B,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM;KAC7B,CAAA;AACH,CAAC,CAAA"}
@@ -1,329 +0,0 @@
1
- import { pad } from 'viem';
2
- import { Chain } from '../data';
3
- import { ErrorCode, InvalidParameterError, ResourceNotFoundError, } from '../errors';
4
- import { getOnChainGroupData } from '../utils/GroupUtils';
5
- import { addOwnerTxParams, createSessionKeyTransactionParams, removeOwnerTxParams, } from './AccessControl';
6
- import { createExecuteBatchTxParams } from './BatchActions';
7
- import { bridgeTransactionParams } from './Bridge';
8
- import { createGroupTxParams, removeGroupTxParams, updateGroupTxParams, } from './Group';
9
- import { limitSwapOrderTransactionParams } from './LimitOrder';
10
- import { finishUnstakeTransactionParams, isFinishUnstakeParams, isRequestUnstakeParams, requestUnstakeTransactionParams, stakeTransactionParams, } from './Stake';
11
- import { oneInchSupported, oneInchTransactionParams, uniswapV2SwapTransactionParams, uniswapV3Supported, uniswapV3SwapTransactionParams, } from './Swap';
12
- import { erc20ApproveTransactionParams, erc721ApproveTransactionParams, erc721TransferTransactionParams, isERC20ApproveParams, isERC721ApproveParams, isERC721TransferParams, isTokenTransferParams, tokenTransferFromTransactionParams, tokenTransferTransactionParams, } from './Token';
13
- export class FirstClassActions {
14
- chain;
15
- constructor(chain) {
16
- this.chain = chain;
17
- }
18
- async bridge(auth, userId, params, txOptions = globalThis.globalEnvOption) {
19
- const paramsCopy = JSON.parse(JSON.stringify(params));
20
- paramsCopy.recipient ??= await this.getAddress();
21
- const transactionParams = await bridgeTransactionParams(paramsCopy, await this.getAddress(), this.chain);
22
- return this.createOperation(auth, userId, transactionParams, txOptions);
23
- }
24
- /**
25
- * Initiates a swap operation and returns the prepared operation for execution.
26
- * @param {Auth} auth - The authentication instance for the user.
27
- * @param {string} userId - The ID of the user initiating the swap.
28
- * @param {SwapParams} params - The parameters for the swap operation.
29
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
30
- * @returns {Promise<Operation>} The prepared swap operation.
31
- */
32
- async swap(auth, userId, params, txOptions = globalThis.globalEnvOption) {
33
- if (!params.tokenIn) {
34
- throw new InvalidParameterError(ErrorCode.InvalidParameter, 'Missing tokenIn parameter in the swap params object.', { params }, '', 'https://docs.fun.xyz');
35
- }
36
- if (!params.tokenOut) {
37
- throw new InvalidParameterError(ErrorCode.InvalidParameter, 'Missing tokenOut parameter in the swap params object.', { params }, '', 'https://docs.fun.xyz');
38
- }
39
- if (!params.inAmount) {
40
- throw new InvalidParameterError(ErrorCode.InvalidParameter, 'Missing inAmount parameter in the swap params object.', { params }, '', 'https://docs.fun.xyz');
41
- }
42
- let transactionParams;
43
- const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
44
- const chainId = Number(await chain.getChainId());
45
- params.recipient ??= await this.getAddress();
46
- if (oneInchSupported.includes(chainId)) {
47
- transactionParams = await oneInchTransactionParams(params, await this.getAddress(), txOptions);
48
- }
49
- else if (uniswapV3Supported.includes(chainId)) {
50
- transactionParams = await uniswapV3SwapTransactionParams(params, txOptions);
51
- }
52
- else if (chainId === 8453) {
53
- throw new InvalidParameterError(ErrorCode.InvalidParameter, 'Swap is not supported on Base', { params }, 'Use a different chain or a different first class method', 'https://docs.fun.xyz');
54
- }
55
- else {
56
- transactionParams = await uniswapV2SwapTransactionParams(params, txOptions);
57
- }
58
- return await this.createOperation(auth, userId, transactionParams, txOptions);
59
- }
60
- /**
61
- * Initiates a limit swap order operation and returns the prepared operation for execution.
62
- * @param {Auth} auth - The authentication instance for the user.
63
- * @param {string} userId - The ID of the user initiating the limit swap order.
64
- * @param {LimitOrderParam} params - The parameters for the limit swap order.
65
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
66
- * @returns {Promise<Operation>} The prepared limit swap order operation.
67
- */
68
- async limitSwapOrder(auth, userId, params, txOptions = globalThis.globalEnvOption) {
69
- const transactionParams = await limitSwapOrderTransactionParams(params, this.chain);
70
- return await this.createOperation(auth, userId, transactionParams, txOptions);
71
- }
72
- /**
73
- * Initiates a transfer operation and returns the prepared operation for execution.
74
- * @param {Auth} auth - The authentication instance for the user.
75
- * @param {string} userId - The ID of the user initiating the transfer.
76
- * @param {TransferParams} params - The parameters for the transfer.
77
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
78
- * @returns {Promise<Operation>} The prepared transfer operation.
79
- * @throws {InvalidParameterError} When provided parameters are missing or incorrect.
80
- */
81
- async transfer(auth, userId, params, txOptions = globalThis.globalEnvOption) {
82
- const overrideChain = await Chain.getChain({
83
- chainIdentifier: txOptions?.chain,
84
- });
85
- let transactionParams;
86
- if (isERC721TransferParams(params)) {
87
- params.from = params.from ? params.from : await this.getAddress();
88
- transactionParams = await erc721TransferTransactionParams(params);
89
- }
90
- else if (isTokenTransferParams(params)) {
91
- if (params.from) {
92
- transactionParams = await tokenTransferFromTransactionParams(params, overrideChain ?? this.chain);
93
- }
94
- else {
95
- transactionParams = await tokenTransferTransactionParams(params, overrideChain ?? this.chain);
96
- }
97
- }
98
- else {
99
- throw new InvalidParameterError(ErrorCode.InvalidParameter, 'Params were missing or incorrect', { params }, 'Provide correct transfer params.', 'https://docs.fun.xyz');
100
- }
101
- return await this.createOperation(auth, userId, transactionParams, txOptions);
102
- }
103
- /**
104
- * Initiates a erc20/erc721 token approval operation and returns the prepared operation for execution.
105
- * @param {Auth} auth - The authentication instance for the user.
106
- * @param {string} userId - The ID of the user initiating the token approval.
107
- * @param {ApproveParams} params - The parameters for the token approval.
108
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
109
- * @returns {Promise<Operation>} The prepared token approval operation.
110
- * @throws {InvalidParameterError} When provided parameters are missing or incorrect.
111
- */
112
- async tokenApprove(auth, userId, params, txOptions = globalThis.globalEnvOption) {
113
- let transactionParams;
114
- if (isERC20ApproveParams(params)) {
115
- transactionParams = await erc20ApproveTransactionParams(params);
116
- }
117
- else if (isERC721ApproveParams(params)) {
118
- transactionParams = await erc721ApproveTransactionParams(params);
119
- }
120
- else {
121
- throw new InvalidParameterError(ErrorCode.InvalidParameter, 'Params were missing or incorrect', { params }, 'Provide correct token approve params.', 'https://docs.fun.xyz');
122
- }
123
- return await this.createOperation(auth, userId, transactionParams, txOptions);
124
- }
125
- /**
126
- * Initiates a stake operation and returns the prepared operation for execution.
127
- * @param {Auth} auth - The authentication instance for the user.
128
- * @param {string} userId - The ID of the user initiating the stake operation.
129
- * @param {StakeParams} params - The parameters for the stake operation.
130
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
131
- * @returns {Promise<Operation>} The prepared stake operation.
132
- */
133
- async stake(auth, userId, params, txOptions = globalThis.globalEnvOption) {
134
- const transactionParams = await stakeTransactionParams(params, txOptions);
135
- return await this.createOperation(auth, userId, transactionParams, txOptions);
136
- }
137
- /**
138
- * Initiates an unstake operation and returns the prepared operation for execution.
139
- * @param {Auth} auth - The authentication instance for the user.
140
- * @param {string} userId - The ID of the user initiating the unstake operation.
141
- * @param {RequestUnstakeParams | FinishUnstakeParams} params - The parameters for the unstake operation.
142
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
143
- * @returns {Promise<Operation>} The prepared unstake operation.
144
- * @throws {InvalidParameterError} When provided parameters are missing or incorrect.
145
- */
146
- async unstake(auth, userId, params, txOptions = globalThis.globalEnvOption) {
147
- params.recipient ??= await this.getAddress();
148
- let transactionParams;
149
- if (isRequestUnstakeParams(params)) {
150
- transactionParams = await requestUnstakeTransactionParams(params, txOptions);
151
- }
152
- else if (isFinishUnstakeParams(params)) {
153
- transactionParams = await finishUnstakeTransactionParams(params, txOptions);
154
- }
155
- else {
156
- throw new InvalidParameterError(ErrorCode.InvalidParameter, 'Params were missing or incorrect', { params }, 'Provide correct unstake params.', 'https://docs.fun.xyz');
157
- }
158
- return await this.createOperation(auth, userId, transactionParams, txOptions);
159
- }
160
- /**
161
- * Initiates a session key creation operation and returns the prepared operation for execution.
162
- * @param {Auth} auth - The authentication instance for the user.
163
- * @param {string} userId - The ID of the user initiating the session key creation.
164
- * @param {SessionKeyParams} params - The parameters for the session key creation.
165
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
166
- * @returns {Promise<Operation>} The prepared session key creation operation.
167
- */
168
- async createSessionKey(auth, userId, params, txOptions = globalThis.globalEnvOption) {
169
- const transactionParams = await createSessionKeyTransactionParams(params, txOptions);
170
- return await this.createOperation(auth, userId, transactionParams, txOptions);
171
- }
172
- /**
173
- * Initiates an add owner operation and returns the prepared operation for execution.
174
- * @param {Auth} auth - The authentication instance for the user.
175
- * @param {string} userId - The ID of the user initiating the add owner operation.
176
- * @param {AddOwnerParams} params - The parameters for the add owner operation.
177
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
178
- * @returns {Promise<Operation>} The prepared add owner operation.
179
- */
180
- async addOwner(auth, userId, params, txOptions = globalThis.globalEnvOption) {
181
- const txParams = await addOwnerTxParams(params, txOptions);
182
- return await this.createOperation(auth, userId, txParams, txOptions);
183
- }
184
- /**
185
- * Initiates a remove owner operation and returns the prepared operation for execution.
186
- * @param {Auth} auth - The authentication instance for the user.
187
- * @param {string} userId - The ID of the user initiating the remove owner operation.
188
- * @param {RemoveOwnerParams} params - The parameters for the remove owner operation.
189
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
190
- * @returns {Promise<Operation>} The prepared remove owner operation.
191
- */
192
- async removeOwner(auth, userId, params, txOptions = globalThis.globalEnvOption) {
193
- const txParams = await removeOwnerTxParams(params, txOptions);
194
- return await this.createOperation(auth, userId, txParams, txOptions);
195
- }
196
- /**
197
- * Initiates a create group operation and returns the prepared operation for execution.
198
- * @param {Auth} auth - The authentication instance for the user.
199
- * @param {string} userId - The ID of the user initiating the create group operation.
200
- * @param {CreateGroupParams} params - The parameters for the create group operation.
201
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
202
- * @returns {Promise<Operation>} The prepared create group operation.
203
- */
204
- async createGroup(auth, userId, params, txOptions = globalThis.globalEnvOption) {
205
- const txParams = await createGroupTxParams(params, txOptions);
206
- return await this.createOperation(auth, userId, txParams, txOptions);
207
- }
208
- /**
209
- * Initiates an add user to group operation and returns the prepared operation for execution.
210
- * @param {Auth} auth - The authentication instance for the user.
211
- * @param {string} userId - The ID of the user initiating the add user to group operation.
212
- * @param {AddUserToGroupParams} params - The parameters for the add user to group operation.
213
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
214
- * @returns {Promise<Operation>} The prepared add user to group operation.
215
- */
216
- async addUserToGroup(auth, userId, params, txOptions = globalThis.globalEnvOption) {
217
- params.userId = pad(params.userId, { size: 32 });
218
- params.groupId = pad(params.groupId, { size: 32 });
219
- const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
220
- const onChainGroupData = await getOnChainGroupData(params.groupId, chain, await this.getAddress());
221
- if (!onChainGroupData || onChainGroupData.memberIds.length === 0) {
222
- throw new ResourceNotFoundError(ErrorCode.GroupNotFound, 'group is not found', { params }, 'Provide correct groupId and chainId.', 'https://docs.fun.xyz');
223
- }
224
- const originalMembers = new Set(onChainGroupData.memberIds);
225
- const members = new Set(onChainGroupData.memberIds);
226
- members.add(params.userId);
227
- if (members.size <= originalMembers.size) {
228
- throw new InvalidParameterError(ErrorCode.UserAlreadyExists, 'user already exists in group', { params, originalMembers, userId: params.userId }, 'Catch this error and swallow it as the user is already added.', 'https://docs.fun.xyz');
229
- }
230
- const updateGroupParams = {
231
- groupId: params.groupId,
232
- group: {
233
- userIds: Array.from(members),
234
- threshold: onChainGroupData.threshold,
235
- },
236
- };
237
- const txParams = await updateGroupTxParams(updateGroupParams, txOptions);
238
- return await this.createOperation(auth, userId, txParams, txOptions);
239
- }
240
- /**
241
- * Initiates a remove user from group operation and returns the prepared operation for execution.
242
- * @param {Auth} auth - The authentication instance for the user.
243
- * @param {string} userId - The ID of the user initiating the remove user from group operation.
244
- * @param {RemoveUserFromGroupParams} params - The parameters for the remove user from group operation.
245
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
246
- * @returns {Promise<Operation>} The prepared remove user from group operation.
247
- */
248
- async removeUserFromGroup(auth, userId, params, txOptions = globalThis.globalEnvOption) {
249
- params.userId = pad(params.userId, { size: 32 });
250
- params.groupId = pad(params.groupId, { size: 32 });
251
- const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
252
- const onChainGroupData = await getOnChainGroupData(params.groupId, chain, await this.getAddress());
253
- if (!onChainGroupData || onChainGroupData.memberIds.length === 0) {
254
- throw new ResourceNotFoundError(ErrorCode.GroupNotFound, 'group is not found', { params }, 'Provide correct groupId and chainId.', 'https://docs.fun.xyz');
255
- }
256
- const originalMembers = new Set(onChainGroupData.memberIds);
257
- const members = new Set(onChainGroupData.memberIds);
258
- members.delete(params.userId);
259
- if (members.size >= originalMembers.size) {
260
- throw new ResourceNotFoundError(ErrorCode.UserNotFound, 'user does not exist in group', { params, originalMembers, userId: params.userId }, 'Catch this error and swallow it as the user does not exist in the group.', 'https://docs.fun.xyz');
261
- }
262
- const updateGroupParams = {
263
- groupId: params.groupId,
264
- group: {
265
- userIds: Array.from(members),
266
- threshold: onChainGroupData.threshold,
267
- },
268
- };
269
- const txParams = await updateGroupTxParams(updateGroupParams, txOptions);
270
- return await this.createOperation(auth, userId, txParams, txOptions);
271
- }
272
- /**
273
- * Initiates an update threshold of group operation and returns the prepared operation for execution.
274
- * @param {Auth} auth - The authentication instance for the user.
275
- * @param {string} userId - The ID of the user initiating the update threshold of group operation.
276
- * @param {UpdateThresholdOfGroupParams} params - The parameters for the update threshold of group operation.
277
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
278
- * @returns {Promise<Operation>} The prepared update threshold of group operation.
279
- */
280
- async updateThresholdOfGroup(auth, userId, params, txOptions = globalThis.globalEnvOption) {
281
- params.groupId = pad(params.groupId, { size: 32 });
282
- const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
283
- const onChainGroupData = await getOnChainGroupData(params.groupId, chain, await this.getAddress());
284
- if (!onChainGroupData || onChainGroupData.memberIds.length === 0) {
285
- throw new ResourceNotFoundError(ErrorCode.GroupNotFound, 'group is not found', { params }, 'Provide correct groupId and chainId.', 'https://docs.fun.xyz');
286
- }
287
- if (!Number.isInteger(params.threshold) ||
288
- params.threshold < 1 ||
289
- params.threshold > onChainGroupData.memberIds.length) {
290
- throw new InvalidParameterError(ErrorCode.InvalidThreshold, 'threshold can not be 0 or bigger than number of members in the group', { params, memberIds: onChainGroupData.memberIds }, 'Provide proper threshold number.', 'https://docs.fun.xyz');
291
- }
292
- const updateGroupParams = {
293
- groupId: params.groupId,
294
- group: {
295
- userIds: onChainGroupData.memberIds,
296
- threshold: params.threshold,
297
- },
298
- };
299
- const txParams = await updateGroupTxParams(updateGroupParams, txOptions);
300
- return await this.createOperation(auth, userId, txParams, txOptions);
301
- }
302
- /**
303
- * Initiates a remove group operation and returns the prepared operation for execution.
304
- * @param {Auth} auth - The authentication instance for the user.
305
- * @param {string} userId - The ID of the user initiating the remove group operation.
306
- * @param {RemoveGroupParams} params - The parameters for the remove group operation.
307
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
308
- * @returns {Promise<Operation>} The prepared remove group operation.
309
- */
310
- async removeGroup(auth, userId, params, txOptions = globalThis.globalEnvOption) {
311
- params.groupId = pad(params.groupId, { size: 32 });
312
- const txParams = await removeGroupTxParams(params, txOptions);
313
- return await this.createOperation(auth, userId, txParams, txOptions);
314
- }
315
- /**
316
- * Initiates a batch operation and returns the prepared operation for execution.
317
- * @param {Auth} auth - The authentication instance for the user.
318
- * @param {string} userId - The ID of the user initiating the batch operation.
319
- * @param {TransactionParams[]} params - An array of transaction parameters for the batch operation.
320
- * @param {EnvOption} txOptions - Transaction environment options (default: global environment options).
321
- * @returns {Promise<Operation>} The prepared batch operation.
322
- */
323
- async createBatchOperation(auth, userId, params, txOptions = globalThis.globalEnvOption) {
324
- const walletAddress = await this.getAddress();
325
- const txParams = createExecuteBatchTxParams(params, walletAddress);
326
- return await this.createOperation(auth, userId, txParams, txOptions);
327
- }
328
- }
329
- //# sourceMappingURL=FirstClassActions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FirstClassActions.js","sourceRoot":"","sources":["../../../src/actions/FirstClassActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,GAAG,EAAE,MAAM,MAAM,CAAA;AAKnC,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAA;AAC1C,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC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;;;OAOG;IACH,KAAK,CAAC,oBAAoB,CACxB,IAAU,EACV,MAAc,EACd,MAA2B,EAC3B,YAAwB,UAAkB,CAAC,eAAe;QAE1D,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAA;QAC7C,MAAM,QAAQ,GAAG,0BAA0B,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;QAClE,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;IACtE,CAAC;CACF"}
@@ -1,30 +0,0 @@
1
- import { pad } from 'viem';
2
- import { USER_AUTHENTICATION_CONTRACT_INTERFACE, } from '../common';
3
- import { Chain } from '../data';
4
- export const createGroupTxParams = async (params, txOptions = globalThis.globalEnvOption) => {
5
- const { groupId, group } = params;
6
- group.userIds = group.userIds.map((userId) => {
7
- return pad(userId, { size: 32 });
8
- });
9
- const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
10
- const userAuthAddress = await chain.getAddress('userAuthAddress');
11
- return USER_AUTHENTICATION_CONTRACT_INTERFACE.encodeTransactionParams(userAuthAddress, 'createMultiSigGroup', [pad(groupId, { size: 32 }), group]);
12
- };
13
- export const updateGroupTxParams = async (params, txOptions = globalThis.globalEnvOption) => {
14
- const { groupId, group } = params;
15
- group.userIds = group.userIds
16
- .map((userId) => {
17
- return pad(userId, { size: 32 });
18
- })
19
- .sort((a, b) => b.localeCompare(a));
20
- const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
21
- const userAuthAddress = await chain.getAddress('userAuthAddress');
22
- return USER_AUTHENTICATION_CONTRACT_INTERFACE.encodeTransactionParams(userAuthAddress, 'updateMultiSigGroup', [pad(groupId, { size: 32 }), group]);
23
- };
24
- export const removeGroupTxParams = async (params, txOptions = globalThis.globalEnvOption) => {
25
- const { groupId } = params;
26
- const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
27
- const userAuthAddress = await chain.getAddress('userAuthAddress');
28
- return USER_AUTHENTICATION_CONTRACT_INTERFACE.encodeTransactionParams(userAuthAddress, 'deleteMultiSigGroup', [pad(groupId, { size: 32 })]);
29
- };
30
- //# sourceMappingURL=Group.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Group.js","sourceRoot":"","sources":["../../../src/actions/Group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAE1B,OAAO,EAEL,sCAAsC,GACvC,MAAM,WAAW,CAAA;AAElB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAO/B,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,MAAyB,EACzB,YAAwB,UAAkB,CAAC,eAAe,EAC9B,EAAE;IAC9B,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IACjC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC3C,OAAO,GAAG,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAA;IAClC,CAAC,CAAC,CAAA;IACF,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,EAAE,eAAe,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC,CAAA;IACxE,MAAM,eAAe,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAA;IACjE,OAAO,sCAAsC,CAAC,uBAAuB,CACnE,eAAe,EACf,qBAAqB,EACrB,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,CACpC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACtC,MAAyB,EACzB,YAAwB,UAAkB,CAAC,eAAe,EAC9B,EAAE;IAC9B,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GA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
2
- import { encodeAbiParameters } from 'viem';
3
- import { APPROVE_AND_EXEC_CONTRACT_INTERFACE, ERC20_CONTRACT_INTERFACE, UNISWAP_V3_LIMIT_ORDER_CONTRACT_INTERFACE, } from '../common';
4
- import { Token } from '../data';
5
- const fees = {
6
- lowest: FeeAmount.LOWEST,
7
- low: FeeAmount.LOW,
8
- medium: FeeAmount.MEDIUM,
9
- high: FeeAmount.HIGH,
10
- };
11
- export const limitSwapOrderTransactionParams = async (params, chain) => {
12
- const { tokenIn, tokenOut, tokenInAmount, tokenOutAmount, poolFee } = params;
13
- const tokenInAddress = await new Token(tokenIn, chain).getAddress();
14
- const tokenOutAddress = await new Token(tokenOut, chain).getAddress();
15
- const amountIn = await new Token(tokenIn, chain).getDecimalAmount(tokenInAmount);
16
- const amountOut = await new Token(tokenOut, chain).getDecimalAmount(tokenOutAmount);
17
- const uniswapv3LimitOrderAddress = await chain.getAddress('uniswapv3LimitOrder');
18
- const approveAndExecAddress = await chain.getAddress('approveAndExecAddress');
19
- const _poolFee = poolFee ? fees[poolFee] : FeeAmount.MEDIUM;
20
- const data = encodeAbiParameters([
21
- {
22
- type: 'tuple',
23
- components: [
24
- { type: 'uint24' },
25
- { type: 'address' },
26
- { type: 'address' },
27
- { type: 'uint256' },
28
- { type: 'uint256' },
29
- ],
30
- },
31
- ], [[_poolFee, tokenInAddress, tokenOutAddress, amountIn, amountOut]]);
32
- const UniswapV3LimitOrderExecuteData = UNISWAP_V3_LIMIT_ORDER_CONTRACT_INTERFACE.encodeTransactionParams(uniswapv3LimitOrderAddress, 'execute', [data]).data;
33
- const approveData = ERC20_CONTRACT_INTERFACE.encodeTransactionParams(tokenInAddress, 'approve', [uniswapv3LimitOrderAddress, amountIn]).data;
34
- const approveAndExecData = APPROVE_AND_EXEC_CONTRACT_INTERFACE.encodeTransactionParams(approveAndExecAddress, 'approveAndExecute', [
35
- uniswapv3LimitOrderAddress,
36
- 0,
37
- UniswapV3LimitOrderExecuteData,
38
- tokenInAddress,
39
- approveData,
40
- ]);
41
- return approveAndExecData;
42
- };
43
- //# sourceMappingURL=LimitOrder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LimitOrder.js","sourceRoot":"","sources":["../../../src/actions/LimitOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAA;AAE1C,OAAO,EACL,mCAAmC,EACnC,wBAAwB,EAExB,yCAAyC,GAC1C,MAAM,WAAW,CAAA;AAClB,OAAO,EAAS,KAAK,EAAE,MAAM,SAAS,CAAA;AAGtC,MAAM,IAAI,GAAG;IACX,MAAM,EAAE,SAAS,CAAC,MAAM;IACxB,GAAG,EAAE,SAAS,CAAC,GAAG;IAClB,MAAM,EAAE,SAAS,CAAC,MAAM;IACxB,IAAI,EAAE,SAAS,CAAC,IAAI;CACrB,CAAA;AAED,MAAM,CAAC,MAAM,+BAA+B,GAAG,KAAK,EAClD,MAAuB,EACvB,KAAY,EACgB,EAAE;IAC9B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;IAC5E,MAAM,cAAc,GAAG,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,UAAU,EAAE,CAAA;IACnE,MAAM,eAAe,GAAG,MAAM,IAAI,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,UAAU,EAAE,CAAA;IACrE,MAAM,QAAQ,GAAG,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,gBAAgB,CAC/D,aAAa,CACd,CAAA;IACD,MAAM,SAAS,GAAG,MAAM,IAAI,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,gBAAgB,CACjE,cAAc,CACf,CAAA;IACD,MAAM,0BAA0B,GAAG,MAAM,KAAK,CAAC,UAAU,CACvD,qBAAqB,CACtB,CAAA;IACD,MAAM,qBAAqB,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAA;IAC7E,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAA;IAC3D,MAAM,IAAI,GAAG,mBAAmB,CAC9B;QACE;YACE,IAAI,EAAE,OAAO;YACb,UAAU,EAAE;gBACV,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAClB,EAAE,IAAI,EAAE,SAAS,EAAE;gBACnB,EAAE,IAAI,EAAE,SAAS,EAAE;gBACnB,EAAE,IAAI,EAAE,SAAS,EAAE;gBACnB,EAAE,IAAI,EAAE,SAAS,EAAE;aACpB;SACF;KACF,EACD,CAAC,CAAC,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CACnE,CAAA;IAED,MAAM,8BAA8B,GAClC,yCAAyC,CAAC,uBAAuB,CAC/D,0BAA0B,EAC1B,SAAS,EACT,CAAC,IAAI,CAAC,CACP,CAAC,IAAI,CAAA;IACR,MAAM,WAAW,GAAG,wBAAwB,CAAC,uBAAuB,CAClE,cAAc,EACd,SAAS,EACT,CAAC,0BAA0B,EAAE,QAAQ,CAAC,CACvC,CAAC,IAAI,CAAA;IACN,MAAM,kBAAkB,GACtB,mCAAmC,CAAC,uBAAuB,CACzD,qBAAqB,EACrB,mBAAmB,EACnB;QACE,0BAA0B;QAC1B,CAAC;QACD,8BAA8B;QAC9B,cAAc;QACd,WAAW;KACZ,CACF,CAAA;IACH,OAAO,kBAAkB,CAAA;AAC3B,CAAC,CAAA"}
@@ -1,108 +0,0 @@
1
- import { isAddress, parseEther } from 'viem';
2
- import { APPROVE_AND_EXEC_CONTRACT_INTERFACE, ERC20_CONTRACT_INTERFACE, WITHDRAW_QUEUE_ABI, } from '../common';
3
- import { Chain } from '../data';
4
- import { ErrorCode, InternalFailureError, InvalidParameterError, } from '../errors';
5
- import { ContractInterface } from '../viem/ContractInterface';
6
- const getWithdrawQueueInterface = () => {
7
- return new ContractInterface(WITHDRAW_QUEUE_ABI);
8
- };
9
- export const isRequestUnstakeParams = (input) => {
10
- return input.amounts !== undefined;
11
- };
12
- export const isFinishUnstakeParams = (input) => {
13
- return input.recipient !== undefined;
14
- };
15
- export const stakeTransactionParams = async (params, txOptions = globalThis.globalEnvOption) => {
16
- const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
17
- const lidoAddress = getSteth(await chain.getChainId());
18
- return { to: lidoAddress, value: parseEther(`${params.amount}`), data: '0x' };
19
- };
20
- export const requestUnstakeTransactionParams = async (params, txOptions = globalThis.globalEnvOption) => {
21
- if (!isAddress(params.recipient ?? '')) {
22
- throw new InvalidParameterError(ErrorCode.InvalidParameter, 'Recipient address is not a valid address, please make sure it is a valid checksum address.', { params }, 'Please make sure it is a valid checksum address', 'https://docs.fun.xyz');
23
- }
24
- // Approve steth
25
- const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
26
- const chainId = await chain.getChainId();
27
- const steth = getSteth(chainId);
28
- const withdrawalQueue = getWithdrawalQueue(chainId);
29
- if (!steth ||
30
- !withdrawalQueue ||
31
- steth.length === 0 ||
32
- withdrawalQueue.length === 0) {
33
- throw new InvalidParameterError(ErrorCode.ChainNotSupported, 'Incorrect chainId, staking only available on Ethereum mainnet and Goerli', { params }, 'Provide correct chainId.', 'https://docs.fun.xyz');
34
- }
35
- const approveAmount = params.amounts.reduce((partialSum, a) => partialSum + a, 0);
36
- const approveData = ERC20_CONTRACT_INTERFACE.encodeTransactionParams(steth, 'approve', [withdrawalQueue, parseEther(`${approveAmount}`)]);
37
- // Request Withdrawal
38
- const requestWithdrawalData = getWithdrawQueueInterface().encodeTransactionParams(withdrawalQueue, 'requestWithdrawals', [
39
- params.amounts.map((amount) => parseEther(`${amount}`)),
40
- params.recipient,
41
- ]);
42
- const approveAndExecAddress = await chain.getAddress('approveAndExecAddress');
43
- return APPROVE_AND_EXEC_CONTRACT_INTERFACE.encodeTransactionParams(approveAndExecAddress, 'approveAndExecute', [withdrawalQueue, 0, requestWithdrawalData.data, steth, approveData.data]);
44
- };
45
- export const finishUnstakeTransactionParams = async (params, txOptions = globalThis.globalEnvOption) => {
46
- if (!isAddress(params.recipient ?? '')) {
47
- throw new InvalidParameterError(ErrorCode.InvalidParameter, 'Recipient address is not a valid address, please make sure it is a valid checksum address.', { params }, 'Please make sure it is a valid checksum address', 'https://docs.fun.xyz');
48
- }
49
- const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
50
- const withdrawQueueAddress = getWithdrawalQueue(await chain.getChainId());
51
- const readyToWithdrawRequestIds = (await getReadyToWithdrawRequests(params, txOptions)).slice(0, 5);
52
- if (readyToWithdrawRequestIds.length === 0) {
53
- throw new InvalidParameterError(ErrorCode.InvalidParameter, 'Not ready to withdraw requests', { params }, 'Please wait a bit.', 'https://docs.fun.xyz');
54
- }
55
- // claim batch withdrawal
56
- const lastCheckpoint = await getWithdrawQueueInterface().readFromChain(withdrawQueueAddress, 'getLastCheckpointIndex', [], chain);
57
- const hints = await getWithdrawQueueInterface().readFromChain(withdrawQueueAddress, 'findCheckpointHints', [readyToWithdrawRequestIds, 1, lastCheckpoint], chain);
58
- if (!hints) {
59
- throw new InternalFailureError(ErrorCode.CheckPointHintsNotFound, 'lido checkpoint hints are not found when batching the withdrawal', { params, readyToWithdrawRequestIds, lastCheckpoint, hints }, 'Retry later.', 'https://docs.fun.xyz');
60
- }
61
- return getWithdrawQueueInterface().encodeTransactionParams(withdrawQueueAddress, 'claimWithdrawalsTo', [readyToWithdrawRequestIds, hints, params.recipient]);
62
- };
63
- const getReadyToWithdrawRequests = async (params, txOptions) => {
64
- if (!isAddress(params.recipient ?? '')) {
65
- throw new InvalidParameterError(ErrorCode.InvalidParameter, 'Recipient address is not a valid address, please make sure it is a valid checksum address.', { params }, 'Please make sure it is a valid checksum address', 'https://docs.fun.xyz');
66
- }
67
- // check withdrawal requests
68
- const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
69
- const withdrawalQueueAddr = getWithdrawalQueue(await chain.getChainId());
70
- const withdrawalRequests = await getWithdrawQueueInterface().readFromChain(withdrawalQueueAddr, 'getWithdrawalRequests', [params.walletAddress], chain);
71
- // get the state of a particular nft
72
- const withdrawalStatusTx = await getWithdrawQueueInterface().readFromChain(withdrawalQueueAddr, 'getWithdrawalStatus', [withdrawalRequests], chain);
73
- const readyToWithdraw = [];
74
- for (let i = 0; i < withdrawalStatusTx.length; i++) {
75
- if (withdrawalStatusTx[i].isFinalized) {
76
- readyToWithdraw.push(withdrawalRequests[i]);
77
- }
78
- }
79
- const readyToWithdrawRequestIds = [...readyToWithdraw].sort((a, b) => {
80
- return a > b ? 1 : -1;
81
- });
82
- return readyToWithdrawRequestIds;
83
- };
84
- const getWithdrawalQueue = (chainId) => {
85
- switch (parseInt(chainId)) {
86
- case 1:
87
- return '0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1';
88
- case 5:
89
- return '0xCF117961421cA9e546cD7f50bC73abCdB3039533';
90
- case 36865:
91
- return '0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1';
92
- default:
93
- throw new InvalidParameterError(ErrorCode.ChainNotSupported, 'Incorrect chainId, staking only available on Ethereum mainnet and Goerli', { chainId }, 'Provide correct chainId.', 'https://docs.fun.xyz');
94
- }
95
- };
96
- const getSteth = (chainId) => {
97
- switch (parseInt(chainId)) {
98
- case 1:
99
- return '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84';
100
- case 5:
101
- return '0x1643E812aE58766192Cf7D2Cf9567dF2C37e9B7F';
102
- case 36865:
103
- return '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84';
104
- default:
105
- throw new InvalidParameterError(ErrorCode.ChainNotSupported, 'Incorrect chainId, staking only available on Ethereum mainnet and Goerli', { chainId }, 'Provide correct chainId.', 'https://docs.fun.xyz');
106
- }
107
- };
108
- //# sourceMapp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