@funkit/core 2.0.1 → 2.1.1

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 (154) hide show
  1. package/dist/index.js +11 -27
  2. package/dist/index.js.map +1 -1
  3. package/dist/src/abis/ApproveAndExec.json +45 -9
  4. package/dist/src/abis/ApproveAndSwap.json +141 -1
  5. package/dist/src/abis/CheckoutPaymaster.json +3358 -1
  6. package/dist/src/abis/EntryPoint.json +590 -113
  7. package/dist/src/abis/EstimationPaymaster.json +134 -24
  8. package/dist/src/abis/FeePercentOracle.json +94 -18
  9. package/dist/src/abis/FunWallet.json +280 -56
  10. package/dist/src/abis/FunWalletFactory.json +112 -21
  11. package/dist/src/abis/GaslessPaymaster.json +279 -50
  12. package/dist/src/abis/RoleBasedAccessControl.json +2 -1
  13. package/dist/src/abis/TestNFT.json +71 -15
  14. package/dist/src/abis/TokenPriceOracle.json +17 -4
  15. package/dist/src/abis/UserAuthentication.json +147 -32
  16. package/dist/src/actions/AccessControl.js +39 -48
  17. package/dist/src/actions/AccessControl.js.map +1 -1
  18. package/dist/src/actions/BatchActions.js +3 -7
  19. package/dist/src/actions/BatchActions.js.map +1 -1
  20. package/dist/src/actions/Bridge.js +16 -20
  21. package/dist/src/actions/Bridge.js.map +1 -1
  22. package/dist/src/actions/FirstClassActions.js +74 -77
  23. package/dist/src/actions/FirstClassActions.js.map +1 -1
  24. package/dist/src/actions/Group.js +14 -20
  25. package/dist/src/actions/Group.js.map +1 -1
  26. package/dist/src/actions/LimitOrder.js +18 -22
  27. package/dist/src/actions/LimitOrder.js.map +1 -1
  28. package/dist/src/actions/Stake.js +40 -43
  29. package/dist/src/actions/Stake.js.map +1 -1
  30. package/dist/src/actions/Swap.js +40 -46
  31. package/dist/src/actions/Swap.js.map +1 -1
  32. package/dist/src/actions/Token.js +41 -53
  33. package/dist/src/actions/Token.js.map +1 -1
  34. package/dist/src/actions/index.js +7 -23
  35. package/dist/src/actions/index.js.map +1 -1
  36. package/dist/src/actions/types.js +4 -7
  37. package/dist/src/actions/types.js.map +1 -1
  38. package/dist/src/apis/AccessControlApis.js +10 -16
  39. package/dist/src/apis/AccessControlApis.js.map +1 -1
  40. package/dist/src/apis/BridgeApis.js +14 -20
  41. package/dist/src/apis/BridgeApis.js.map +1 -1
  42. package/dist/src/apis/ContractApis.js +4 -7
  43. package/dist/src/apis/ContractApis.js.map +1 -1
  44. package/dist/src/apis/GroupApis.js +6 -10
  45. package/dist/src/apis/GroupApis.js.map +1 -1
  46. package/dist/src/apis/InfoApis.js +16 -23
  47. package/dist/src/apis/InfoApis.js.map +1 -1
  48. package/dist/src/apis/ListenerApis.js +9 -13
  49. package/dist/src/apis/ListenerApis.js.map +1 -1
  50. package/dist/src/apis/NFTApis.js +6 -10
  51. package/dist/src/apis/NFTApis.js.map +1 -1
  52. package/dist/src/apis/OperationApis.js +26 -40
  53. package/dist/src/apis/OperationApis.js.map +1 -1
  54. package/dist/src/apis/PaymasterApis.js +4 -7
  55. package/dist/src/apis/PaymasterApis.js.map +1 -1
  56. package/dist/src/apis/SwapApis.js +8 -13
  57. package/dist/src/apis/SwapApis.js.map +1 -1
  58. package/dist/src/apis/UserApis.js +20 -29
  59. package/dist/src/apis/UserApis.js.map +1 -1
  60. package/dist/src/apis/index.js +8 -24
  61. package/dist/src/apis/index.js.map +1 -1
  62. package/dist/src/apis/types.js +1 -2
  63. package/dist/src/auth/Auth.js +60 -76
  64. package/dist/src/auth/Auth.js.map +1 -1
  65. package/dist/src/auth/SessionKeyAuth.js +30 -33
  66. package/dist/src/auth/SessionKeyAuth.js.map +1 -1
  67. package/dist/src/auth/index.js +2 -18
  68. package/dist/src/auth/index.js.map +1 -1
  69. package/dist/src/auth/types.js +1 -2
  70. package/dist/src/common/constants.d.ts +141 -3
  71. package/dist/src/common/constants.js +211 -191
  72. package/dist/src/common/constants.js.map +1 -1
  73. package/dist/src/common/index.js +2 -18
  74. package/dist/src/common/index.js.map +1 -1
  75. package/dist/src/common/types.js +1 -2
  76. package/dist/src/config/Config.js +8 -13
  77. package/dist/src/config/Config.js.map +1 -1
  78. package/dist/src/config/index.js +2 -18
  79. package/dist/src/config/index.js.map +1 -1
  80. package/dist/src/config/types.js +1 -2
  81. package/dist/src/data/Chain.js +35 -33
  82. package/dist/src/data/Chain.js.map +1 -1
  83. package/dist/src/data/NFT.js +28 -31
  84. package/dist/src/data/NFT.js.map +1 -1
  85. package/dist/src/data/Operation.js +28 -11
  86. package/dist/src/data/Operation.js.map +1 -1
  87. package/dist/src/data/SolidityData.js +23 -30
  88. package/dist/src/data/SolidityData.js.map +1 -1
  89. package/dist/src/data/Token.js +21 -23
  90. package/dist/src/data/Token.js.map +1 -1
  91. package/dist/src/data/index.js +6 -22
  92. package/dist/src/data/index.js.map +1 -1
  93. package/dist/src/data/types.js +6 -9
  94. package/dist/src/data/types.js.map +1 -1
  95. package/dist/src/errors/BaseError.js +6 -5
  96. package/dist/src/errors/BaseError.js.map +1 -1
  97. package/dist/src/errors/ClientError.js +21 -34
  98. package/dist/src/errors/ClientError.js.map +1 -1
  99. package/dist/src/errors/ServerError.js +6 -11
  100. package/dist/src/errors/ServerError.js.map +1 -1
  101. package/dist/src/errors/index.js +4 -20
  102. package/dist/src/errors/index.js.map +1 -1
  103. package/dist/src/errors/types.js +6 -9
  104. package/dist/src/errors/types.js.map +1 -1
  105. package/dist/src/sponsors/CheckoutSponsor.js +10 -14
  106. package/dist/src/sponsors/CheckoutSponsor.js.map +1 -1
  107. package/dist/src/sponsors/GaslessSponsor.js +23 -27
  108. package/dist/src/sponsors/GaslessSponsor.js.map +1 -1
  109. package/dist/src/sponsors/Sponsor.js +10 -8
  110. package/dist/src/sponsors/Sponsor.js.map +1 -1
  111. package/dist/src/sponsors/TokenSponsor.js +79 -82
  112. package/dist/src/sponsors/TokenSponsor.js.map +1 -1
  113. package/dist/src/sponsors/index.js +4 -20
  114. package/dist/src/sponsors/index.js.map +1 -1
  115. package/dist/src/sponsors/types.js +2 -5
  116. package/dist/src/sponsors/types.js.map +1 -1
  117. package/dist/src/utils/ApiUtils.js +30 -38
  118. package/dist/src/utils/ApiUtils.js.map +1 -1
  119. package/dist/src/utils/AuthUtils.js +9 -14
  120. package/dist/src/utils/AuthUtils.js.map +1 -1
  121. package/dist/src/utils/ChainUtils.js +38 -49
  122. package/dist/src/utils/ChainUtils.js.map +1 -1
  123. package/dist/src/utils/CheckoutUtils.js +13 -18
  124. package/dist/src/utils/CheckoutUtils.js.map +1 -1
  125. package/dist/src/utils/GroupUtils.js +6 -9
  126. package/dist/src/utils/GroupUtils.js.map +1 -1
  127. package/dist/src/utils/MerkleUtils.js +34 -47
  128. package/dist/src/utils/MerkleUtils.js.map +1 -1
  129. package/dist/src/utils/PaymasterUtils.js +5 -9
  130. package/dist/src/utils/PaymasterUtils.js.map +1 -1
  131. package/dist/src/utils/SwapUtils.js +44 -43
  132. package/dist/src/utils/SwapUtils.js.map +1 -1
  133. package/dist/src/utils/TypeUtils.js +5 -9
  134. package/dist/src/utils/TypeUtils.js.map +1 -1
  135. package/dist/src/utils/UserOpUtils.js +20 -29
  136. package/dist/src/utils/UserOpUtils.js.map +1 -1
  137. package/dist/src/utils/ViemUtils.js +6 -12
  138. package/dist/src/utils/ViemUtils.js.map +1 -1
  139. package/dist/src/utils/WalletUtils.js +28 -42
  140. package/dist/src/utils/WalletUtils.js.map +1 -1
  141. package/dist/src/utils/index.js +8 -24
  142. package/dist/src/utils/index.js.map +1 -1
  143. package/dist/src/viem/ContractInterface.js +14 -18
  144. package/dist/src/viem/ContractInterface.js.map +1 -1
  145. package/dist/src/viem/Converter.js +15 -20
  146. package/dist/src/viem/Converter.js.map +1 -1
  147. package/dist/src/viem/index.js +2 -18
  148. package/dist/src/viem/index.js.map +1 -1
  149. package/dist/src/wallet/FunWallet.js +141 -142
  150. package/dist/src/wallet/FunWallet.js.map +1 -1
  151. package/dist/src/wallet/index.js +2 -18
  152. package/dist/src/wallet/index.js.map +1 -1
  153. package/dist/src/wallet/types.js +1 -2
  154. package/package.json +4 -2
@@ -5,9 +5,24 @@
5
5
  {
6
6
  "anonymous": false,
7
7
  "inputs": [
8
- { "indexed": true, "internalType": "address", "name": "owner", "type": "address" },
9
- { "indexed": true, "internalType": "address", "name": "approved", "type": "address" },
10
- { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }
8
+ {
9
+ "indexed": true,
10
+ "internalType": "address",
11
+ "name": "owner",
12
+ "type": "address"
13
+ },
14
+ {
15
+ "indexed": true,
16
+ "internalType": "address",
17
+ "name": "approved",
18
+ "type": "address"
19
+ },
20
+ {
21
+ "indexed": true,
22
+ "internalType": "uint256",
23
+ "name": "tokenId",
24
+ "type": "uint256"
25
+ }
11
26
  ],
12
27
  "name": "Approval",
13
28
  "type": "event"
@@ -15,9 +30,24 @@
15
30
  {
16
31
  "anonymous": false,
17
32
  "inputs": [
18
- { "indexed": true, "internalType": "address", "name": "owner", "type": "address" },
19
- { "indexed": true, "internalType": "address", "name": "operator", "type": "address" },
20
- { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" }
33
+ {
34
+ "indexed": true,
35
+ "internalType": "address",
36
+ "name": "owner",
37
+ "type": "address"
38
+ },
39
+ {
40
+ "indexed": true,
41
+ "internalType": "address",
42
+ "name": "operator",
43
+ "type": "address"
44
+ },
45
+ {
46
+ "indexed": false,
47
+ "internalType": "bool",
48
+ "name": "approved",
49
+ "type": "bool"
50
+ }
21
51
  ],
22
52
  "name": "ApprovalForAll",
23
53
  "type": "event"
@@ -25,9 +55,24 @@
25
55
  {
26
56
  "anonymous": false,
27
57
  "inputs": [
28
- { "indexed": true, "internalType": "address", "name": "from", "type": "address" },
29
- { "indexed": true, "internalType": "address", "name": "to", "type": "address" },
30
- { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }
58
+ {
59
+ "indexed": true,
60
+ "internalType": "address",
61
+ "name": "from",
62
+ "type": "address"
63
+ },
64
+ {
65
+ "indexed": true,
66
+ "internalType": "address",
67
+ "name": "to",
68
+ "type": "address"
69
+ },
70
+ {
71
+ "indexed": true,
72
+ "internalType": "uint256",
73
+ "name": "tokenId",
74
+ "type": "uint256"
75
+ }
31
76
  ],
32
77
  "name": "Transfer",
33
78
  "type": "event"
@@ -43,14 +88,18 @@
43
88
  "type": "function"
44
89
  },
45
90
  {
46
- "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }],
91
+ "inputs": [
92
+ { "internalType": "address", "name": "owner", "type": "address" }
93
+ ],
47
94
  "name": "balanceOf",
48
95
  "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
49
96
  "stateMutability": "view",
50
97
  "type": "function"
51
98
  },
52
99
  {
53
- "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }],
100
+ "inputs": [
101
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
102
+ ],
54
103
  "name": "getApproved",
55
104
  "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
56
105
  "stateMutability": "view",
@@ -84,7 +133,9 @@
84
133
  "type": "function"
85
134
  },
86
135
  {
87
- "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }],
136
+ "inputs": [
137
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
138
+ ],
88
139
  "name": "ownerOf",
89
140
  "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
90
141
  "stateMutability": "view",
@@ -124,7 +175,9 @@
124
175
  "type": "function"
125
176
  },
126
177
  {
127
- "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }],
178
+ "inputs": [
179
+ { "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }
180
+ ],
128
181
  "name": "supportsInterface",
129
182
  "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
130
183
  "stateMutability": "view",
@@ -138,7 +191,9 @@
138
191
  "type": "function"
139
192
  },
140
193
  {
141
- "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }],
194
+ "inputs": [
195
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
196
+ ],
142
197
  "name": "tokenURI",
143
198
  "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
144
199
  "stateMutability": "view",
@@ -165,6 +220,7 @@
165
220
  "36865": "0x25E07d90a4e2e9fb627FcF5f4FAd5165dDA6d592",
166
221
  "42161": "0x25E07d90a4e2e9fb627FcF5f4FAd5165dDA6d592",
167
222
  "421614": "0x837bF17d01aF15A9EA8BA76ccfd59B7F562CA590",
168
- "5000": "0xA025B11cf8CCA0a330bD409B3cE3d355C9f3916a"
223
+ "5000": "0xA025B11cf8CCA0a330bD409B3cE3d355C9f3916a",
224
+ "534352": "0xA0B0c6590f43951d4112092640eFb702d7b15FDD"
169
225
  }
170
226
  }
@@ -17,14 +17,26 @@
17
17
  },
18
18
  {
19
19
  "inputs": [
20
- { "internalType": "address", "name": "aggregatorOrToken", "type": "address" },
20
+ {
21
+ "internalType": "address",
22
+ "name": "aggregatorOrToken",
23
+ "type": "address"
24
+ },
21
25
  { "internalType": "uint256", "name": "ethAmount", "type": "uint256" },
22
26
  { "internalType": "uint8", "name": "tokenDecimals", "type": "uint8" }
23
27
  ],
24
28
  "name": "getTokenValueOfEth",
25
29
  "outputs": [
26
- { "internalType": "uint256", "name": "tokenValueOfEth", "type": "uint256" },
27
- { "internalType": "uint256", "name": "oracleValidUntil", "type": "uint256" }
30
+ {
31
+ "internalType": "uint256",
32
+ "name": "tokenValueOfEth",
33
+ "type": "uint256"
34
+ },
35
+ {
36
+ "internalType": "uint256",
37
+ "name": "oracleValidUntil",
38
+ "type": "uint256"
39
+ }
28
40
  ],
29
41
  "stateMutability": "view",
30
42
  "type": "function"
@@ -39,6 +51,7 @@
39
51
  "36865": "0x302275dcF9919c5449F2d53253ACD06315385272",
40
52
  "42161": "0x302275dcF9919c5449F2d53253ACD06315385272",
41
53
  "421614": "0x33CE83528023d9aee4e6321250514741F00976DB",
42
- "5000": "0x46B1Aee819Af33fa9617059A3D54e5352793473B"
54
+ "5000": "0x46B1Aee819Af33fa9617059A3D54e5352793473B",
55
+ "534352": "0x3053451A384524C57dAF9420f8d8b8464555E1e8"
43
56
  }
44
57
  }
@@ -4,12 +4,30 @@
4
4
  {
5
5
  "anonymous": false,
6
6
  "inputs": [
7
- { "indexed": true, "internalType": "address", "name": "wallet", "type": "address" },
8
- { "indexed": true, "internalType": "bytes32", "name": "groupId", "type": "bytes32" },
7
+ {
8
+ "indexed": true,
9
+ "internalType": "address",
10
+ "name": "wallet",
11
+ "type": "address"
12
+ },
13
+ {
14
+ "indexed": true,
15
+ "internalType": "bytes32",
16
+ "name": "groupId",
17
+ "type": "bytes32"
18
+ },
9
19
  {
10
20
  "components": [
11
- { "internalType": "bytes32[]", "name": "userIds", "type": "bytes32[]" },
12
- { "internalType": "uint256", "name": "threshold", "type": "uint256" }
21
+ {
22
+ "internalType": "bytes32[]",
23
+ "name": "userIds",
24
+ "type": "bytes32[]"
25
+ },
26
+ {
27
+ "internalType": "uint256",
28
+ "name": "threshold",
29
+ "type": "uint256"
30
+ }
13
31
  ],
14
32
  "indexed": false,
15
33
  "internalType": "structMultiSigGroup",
@@ -23,8 +41,18 @@
23
41
  {
24
42
  "anonymous": false,
25
43
  "inputs": [
26
- { "indexed": true, "internalType": "address", "name": "wallet", "type": "address" },
27
- { "indexed": true, "internalType": "bytes32", "name": "groupId", "type": "bytes32" }
44
+ {
45
+ "indexed": true,
46
+ "internalType": "address",
47
+ "name": "wallet",
48
+ "type": "address"
49
+ },
50
+ {
51
+ "indexed": true,
52
+ "internalType": "bytes32",
53
+ "name": "groupId",
54
+ "type": "bytes32"
55
+ }
28
56
  ],
29
57
  "name": "MultiSigGroupDeleted",
30
58
  "type": "event"
@@ -32,12 +60,30 @@
32
60
  {
33
61
  "anonymous": false,
34
62
  "inputs": [
35
- { "indexed": true, "internalType": "address", "name": "wallet", "type": "address" },
36
- { "indexed": true, "internalType": "bytes32", "name": "groupId", "type": "bytes32" },
63
+ {
64
+ "indexed": true,
65
+ "internalType": "address",
66
+ "name": "wallet",
67
+ "type": "address"
68
+ },
69
+ {
70
+ "indexed": true,
71
+ "internalType": "bytes32",
72
+ "name": "groupId",
73
+ "type": "bytes32"
74
+ },
37
75
  {
38
76
  "components": [
39
- { "internalType": "bytes32[]", "name": "userIds", "type": "bytes32[]" },
40
- { "internalType": "uint256", "name": "threshold", "type": "uint256" }
77
+ {
78
+ "internalType": "bytes32[]",
79
+ "name": "userIds",
80
+ "type": "bytes32[]"
81
+ },
82
+ {
83
+ "internalType": "uint256",
84
+ "name": "threshold",
85
+ "type": "uint256"
86
+ }
41
87
  ],
42
88
  "indexed": false,
43
89
  "internalType": "structMultiSigGroup",
@@ -51,8 +97,18 @@
51
97
  {
52
98
  "anonymous": false,
53
99
  "inputs": [
54
- { "indexed": true, "internalType": "address", "name": "wallet", "type": "address" },
55
- { "indexed": false, "internalType": "bytes", "name": "multiSigInitData", "type": "bytes" }
100
+ {
101
+ "indexed": true,
102
+ "internalType": "address",
103
+ "name": "wallet",
104
+ "type": "address"
105
+ },
106
+ {
107
+ "indexed": false,
108
+ "internalType": "bytes",
109
+ "name": "multiSigInitData",
110
+ "type": "bytes"
111
+ }
56
112
  ],
57
113
  "name": "UserAuthenticationInitialized",
58
114
  "type": "event"
@@ -86,12 +142,36 @@
86
142
  { "internalType": "uint256", "name": "nonce", "type": "uint256" },
87
143
  { "internalType": "bytes", "name": "initCode", "type": "bytes" },
88
144
  { "internalType": "bytes", "name": "callData", "type": "bytes" },
89
- { "internalType": "uint256", "name": "callGasLimit", "type": "uint256" },
90
- { "internalType": "uint256", "name": "verificationGasLimit", "type": "uint256" },
91
- { "internalType": "uint256", "name": "preVerificationGas", "type": "uint256" },
92
- { "internalType": "uint256", "name": "maxFeePerGas", "type": "uint256" },
93
- { "internalType": "uint256", "name": "maxPriorityFeePerGas", "type": "uint256" },
94
- { "internalType": "bytes", "name": "paymasterAndData", "type": "bytes" },
145
+ {
146
+ "internalType": "uint256",
147
+ "name": "callGasLimit",
148
+ "type": "uint256"
149
+ },
150
+ {
151
+ "internalType": "uint256",
152
+ "name": "verificationGasLimit",
153
+ "type": "uint256"
154
+ },
155
+ {
156
+ "internalType": "uint256",
157
+ "name": "preVerificationGas",
158
+ "type": "uint256"
159
+ },
160
+ {
161
+ "internalType": "uint256",
162
+ "name": "maxFeePerGas",
163
+ "type": "uint256"
164
+ },
165
+ {
166
+ "internalType": "uint256",
167
+ "name": "maxPriorityFeePerGas",
168
+ "type": "uint256"
169
+ },
170
+ {
171
+ "internalType": "bytes",
172
+ "name": "paymasterAndData",
173
+ "type": "bytes"
174
+ },
95
175
  { "internalType": "bytes", "name": "signature", "type": "bytes" }
96
176
  ],
97
177
  "internalType": "structUserOperation",
@@ -102,7 +182,9 @@
102
182
  { "internalType": "bytes", "name": "", "type": "bytes" }
103
183
  ],
104
184
  "name": "authenticateUserOp",
105
- "outputs": [{ "internalType": "uint256", "name": "sigTimeRange", "type": "uint256" }],
185
+ "outputs": [
186
+ { "internalType": "uint256", "name": "sigTimeRange", "type": "uint256" }
187
+ ],
106
188
  "stateMutability": "view",
107
189
  "type": "function"
108
190
  },
@@ -111,8 +193,16 @@
111
193
  { "internalType": "bytes32", "name": "groupId", "type": "bytes32" },
112
194
  {
113
195
  "components": [
114
- { "internalType": "bytes32[]", "name": "userIds", "type": "bytes32[]" },
115
- { "internalType": "uint256", "name": "threshold", "type": "uint256" }
196
+ {
197
+ "internalType": "bytes32[]",
198
+ "name": "userIds",
199
+ "type": "bytes32[]"
200
+ },
201
+ {
202
+ "internalType": "uint256",
203
+ "name": "threshold",
204
+ "type": "uint256"
205
+ }
116
206
  ],
117
207
  "internalType": "structMultiSigGroup",
118
208
  "name": "group",
@@ -125,28 +215,40 @@
125
215
  "type": "function"
126
216
  },
127
217
  {
128
- "inputs": [{ "internalType": "bytes32", "name": "groupId", "type": "bytes32" }],
218
+ "inputs": [
219
+ { "internalType": "bytes32", "name": "groupId", "type": "bytes32" }
220
+ ],
129
221
  "name": "deleteMultiSigGroup",
130
222
  "outputs": [],
131
223
  "stateMutability": "nonpayable",
132
224
  "type": "function"
133
225
  },
134
226
  {
135
- "inputs": [{ "internalType": "bytes32", "name": "key", "type": "bytes32" }],
227
+ "inputs": [
228
+ { "internalType": "bytes32", "name": "key", "type": "bytes32" }
229
+ ],
136
230
  "name": "getState",
137
- "outputs": [{ "internalType": "bytes", "name": "state", "type": "bytes" }],
231
+ "outputs": [
232
+ { "internalType": "bytes", "name": "state", "type": "bytes" }
233
+ ],
138
234
  "stateMutability": "view",
139
235
  "type": "function"
140
236
  },
141
237
  {
142
- "inputs": [{ "internalType": "bytes32", "name": "key", "type": "bytes32" }],
238
+ "inputs": [
239
+ { "internalType": "bytes32", "name": "key", "type": "bytes32" }
240
+ ],
143
241
  "name": "getState32",
144
- "outputs": [{ "internalType": "bytes32", "name": "state", "type": "bytes32" }],
242
+ "outputs": [
243
+ { "internalType": "bytes32", "name": "state", "type": "bytes32" }
244
+ ],
145
245
  "stateMutability": "view",
146
246
  "type": "function"
147
247
  },
148
248
  {
149
- "inputs": [{ "internalType": "bytes", "name": "multiSigInitData", "type": "bytes" }],
249
+ "inputs": [
250
+ { "internalType": "bytes", "name": "multiSigInitData", "type": "bytes" }
251
+ ],
150
252
  "name": "init",
151
253
  "outputs": [],
152
254
  "stateMutability": "nonpayable",
@@ -173,7 +275,9 @@
173
275
  "type": "function"
174
276
  },
175
277
  {
176
- "inputs": [{ "internalType": "bytes[]", "name": "calls", "type": "bytes[]" }],
278
+ "inputs": [
279
+ { "internalType": "bytes[]", "name": "calls", "type": "bytes[]" }
280
+ ],
177
281
  "name": "multiCall",
178
282
  "outputs": [],
179
283
  "stateMutability": "nonpayable",
@@ -186,7 +290,9 @@
186
290
  { "internalType": "bytes32", "name": "userId", "type": "bytes32" }
187
291
  ],
188
292
  "name": "subValidateSignatureECDSA",
189
- "outputs": [{ "internalType": "uint256", "name": "sigTimeRange", "type": "uint256" }],
293
+ "outputs": [
294
+ { "internalType": "uint256", "name": "sigTimeRange", "type": "uint256" }
295
+ ],
190
296
  "stateMutability": "pure",
191
297
  "type": "function"
192
298
  },
@@ -195,8 +301,16 @@
195
301
  { "internalType": "bytes32", "name": "groupId", "type": "bytes32" },
196
302
  {
197
303
  "components": [
198
- { "internalType": "bytes32[]", "name": "userIds", "type": "bytes32[]" },
199
- { "internalType": "uint256", "name": "threshold", "type": "uint256" }
304
+ {
305
+ "internalType": "bytes32[]",
306
+ "name": "userIds",
307
+ "type": "bytes32[]"
308
+ },
309
+ {
310
+ "internalType": "uint256",
311
+ "name": "threshold",
312
+ "type": "uint256"
313
+ }
200
314
  ],
201
315
  "internalType": "structMultiSigGroup",
202
316
  "name": "group",
@@ -218,6 +332,7 @@
218
332
  "36865": "0xb3DeA1dd1d9aC323041850c0A15C578C883F3f6F",
219
333
  "42161": "0xb3DeA1dd1d9aC323041850c0A15C578C883F3f6F",
220
334
  "421614": "0x81C464389b2ac51D39aD934732bd172c4126773b",
221
- "5000": "0x73dBAFFa2B1E93D4c824B70DE8CA8926b9F18339"
335
+ "5000": "0x73dBAFFa2B1E93D4c824B70DE8CA8926b9F18339",
336
+ "534352": "0xe6e015a9C1A06D348A94e964dA27CdC34CaF36E6"
222
337
  }
223
338
  }
@@ -1,49 +1,44 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeOwnerTxParams = exports.addOwnerTxParams = exports.createSessionUser = exports.createSessionKeyTransactionParams = exports.createTargetSelectorMerkleTree = exports.createFeeRecipientAndTokenMerkleTree = void 0;
4
- const viem_1 = require("viem");
5
- const auth_1 = require("../auth");
6
- const common_1 = require("../common");
7
- const data_1 = require("../data");
8
- const Token_1 = require("../data/Token");
9
- const errors_1 = require("../errors");
10
- const MerkleUtils_1 = require("../utils/MerkleUtils");
11
- const ViemUtils_1 = require("../utils/ViemUtils");
12
- const createFeeRecipientAndTokenMerkleTree = async (params) => {
13
- const recipients = (params.feeRecipientWhitelist ?? []).map((recipient) => (0, viem_1.getAddress)(recipient));
1
+ import { getAddress, pad } from 'viem';
2
+ import { SessionKeyAuth } from '../auth';
3
+ import { RBAC_CONTRACT_INTERFACE } from '../common';
4
+ import { Chain } from '../data';
5
+ import { Token } from '../data/Token';
6
+ import { ErrorCode, InvalidParameterError } from '../errors';
7
+ import { MerkleTree } from '../utils/MerkleUtils';
8
+ import { getSigHash } from '../utils/ViemUtils';
9
+ export const createFeeRecipientAndTokenMerkleTree = async (params) => {
10
+ const recipients = (params.feeRecipientWhitelist ?? []).map((recipient) => getAddress(recipient));
14
11
  // TODO: Temporary fallback, remove after refactoring -- Panda
15
12
  const options = globalThis.globalEnvOption;
16
- const chain = await data_1.Chain.getChain({ chainIdentifier: options.chain });
17
- const tokens = await Promise.all((params.feeTokenWhitelist ?? []).map((token) => Token_1.Token.getAddress(token, chain)));
18
- const feeRecipientAndTokenMerkleTree = new MerkleUtils_1.MerkleTree([
13
+ const chain = await Chain.getChain({ chainIdentifier: options.chain });
14
+ const tokens = await Promise.all((params.feeTokenWhitelist ?? []).map((token) => Token.getAddress(token, chain)));
15
+ const feeRecipientAndTokenMerkleTree = new MerkleTree([
19
16
  ...recipients,
20
17
  ...tokens,
21
18
  ]);
22
19
  return feeRecipientAndTokenMerkleTree;
23
20
  };
24
- exports.createFeeRecipientAndTokenMerkleTree = createFeeRecipientAndTokenMerkleTree;
25
- const createTargetSelectorMerkleTree = (params) => {
21
+ export const createTargetSelectorMerkleTree = (params) => {
26
22
  const selectors = [];
27
23
  params.actionWhitelist.forEach((actionWhitelistItem) => {
28
- selectors.push(...actionWhitelistItem.functionWhitelist.map((functionName) => (0, ViemUtils_1.getSigHash)(actionWhitelistItem.abi, functionName)));
24
+ selectors.push(...actionWhitelistItem.functionWhitelist.map((functionName) => getSigHash(actionWhitelistItem.abi, functionName)));
29
25
  });
30
- const targets = params.targetWhitelist.map((target) => (0, viem_1.getAddress)(target));
31
- const targetSelectorMerkleTree = new MerkleUtils_1.MerkleTree([...targets, ...selectors]);
26
+ const targets = params.targetWhitelist.map((target) => getAddress(target));
27
+ const targetSelectorMerkleTree = new MerkleTree([...targets, ...selectors]);
32
28
  return targetSelectorMerkleTree;
33
29
  };
34
- exports.createTargetSelectorMerkleTree = createTargetSelectorMerkleTree;
35
- const createSessionKeyTransactionParams = async (params, txOptions = globalThis.globalEnvOption) => {
30
+ export const createSessionKeyTransactionParams = async (params, txOptions = globalThis.globalEnvOption) => {
36
31
  if (params.targetWhitelist.length === 0) {
37
- throw new errors_1.InvalidParameterError(errors_1.ErrorCode.MissingParameter, 'targetWhitelist is required', { params }, 'Provide targetWhitelist when creating a session key.', 'https://docs.fun.xyz');
32
+ throw new InvalidParameterError(ErrorCode.MissingParameter, 'targetWhitelist is required', { params }, 'Provide targetWhitelist when creating a session key.', 'https://docs.fun.xyz');
38
33
  }
39
34
  if (params.userId === undefined) {
40
- throw new errors_1.InvalidParameterError(errors_1.ErrorCode.MissingParameter, 'userId is required', { params }, 'Provide userId when creating a session key.', 'https://docs.fun.xyz');
35
+ throw new InvalidParameterError(ErrorCode.MissingParameter, 'userId is required', { params }, 'Provide userId when creating a session key.', 'https://docs.fun.xyz');
41
36
  }
42
37
  let { actionValueLimit, feeValueLimit } = params;
43
- actionValueLimit ?? (actionValueLimit = 0n);
44
- feeValueLimit ?? (feeValueLimit = 0n);
45
- const targetSelectorMerkleTree = (0, exports.createTargetSelectorMerkleTree)(params);
46
- const feeRecipientTokenMerkleTree = await (0, exports.createFeeRecipientAndTokenMerkleTree)(params);
38
+ actionValueLimit ??= 0n;
39
+ feeValueLimit ??= 0n;
40
+ const targetSelectorMerkleTree = createTargetSelectorMerkleTree(params);
41
+ const feeRecipientTokenMerkleTree = await createFeeRecipientAndTokenMerkleTree(params);
47
42
  const ruleStruct = {
48
43
  deadline: convertTimestampToBigInt(params.deadline),
49
44
  targetSelectorMerkleRootHash: targetSelectorMerkleTree.getRootHash(),
@@ -54,35 +49,31 @@ const createSessionKeyTransactionParams = async (params, txOptions = globalThis.
54
49
  const roleId = params.roleId;
55
50
  const ruleId = params.ruleId;
56
51
  const userId = params.userId;
57
- const setRuleCallData = common_1.RBAC_CONTRACT_INTERFACE.encodeData('setRule', [
52
+ const setRuleCallData = RBAC_CONTRACT_INTERFACE.encodeData('setRule', [
58
53
  ruleId,
59
54
  ruleStruct,
60
55
  ]);
61
- const connectRuleAndRoleCallData = common_1.RBAC_CONTRACT_INTERFACE.encodeData('addRuleToRole', [roleId, ruleId]);
62
- const connectUserToRoleCallData = common_1.RBAC_CONTRACT_INTERFACE.encodeData('addUserToRole', [roleId, userId]);
63
- const chain = await data_1.Chain.getChain({ chainIdentifier: txOptions.chain });
56
+ const connectRuleAndRoleCallData = RBAC_CONTRACT_INTERFACE.encodeData('addRuleToRole', [roleId, ruleId]);
57
+ const connectUserToRoleCallData = RBAC_CONTRACT_INTERFACE.encodeData('addUserToRole', [roleId, userId]);
58
+ const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
64
59
  const rbacAddress = await chain.getAddress('rbacAddress');
65
- return common_1.RBAC_CONTRACT_INTERFACE.encodeTransactionParams(rbacAddress, 'multiCall', [[setRuleCallData, connectRuleAndRoleCallData, connectUserToRoleCallData]]);
60
+ return RBAC_CONTRACT_INTERFACE.encodeTransactionParams(rbacAddress, 'multiCall', [[setRuleCallData, connectRuleAndRoleCallData, connectUserToRoleCallData]]);
66
61
  };
67
- exports.createSessionKeyTransactionParams = createSessionKeyTransactionParams;
68
- const createSessionUser = async (auth, params) => {
69
- const targetSelectorMerkleTree = (0, exports.createTargetSelectorMerkleTree)(params);
70
- const feeRecipientAndTokenMerkleTree = await (0, exports.createFeeRecipientAndTokenMerkleTree)(params);
71
- return new auth_1.SessionKeyAuth(auth, params.ruleId, params.roleId, targetSelectorMerkleTree, feeRecipientAndTokenMerkleTree);
62
+ export const createSessionUser = async (auth, params) => {
63
+ const targetSelectorMerkleTree = createTargetSelectorMerkleTree(params);
64
+ const feeRecipientAndTokenMerkleTree = await createFeeRecipientAndTokenMerkleTree(params);
65
+ return new SessionKeyAuth(auth, params.ruleId, params.roleId, targetSelectorMerkleTree, feeRecipientAndTokenMerkleTree);
72
66
  };
73
- exports.createSessionUser = createSessionUser;
74
- const addOwnerTxParams = async (params, txOptions = globalThis.globalEnvOption) => {
75
- const chain = await data_1.Chain.getChain({ chainIdentifier: txOptions.chain });
67
+ export const addOwnerTxParams = async (params, txOptions = globalThis.globalEnvOption) => {
68
+ const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
76
69
  const rbacAddress = await chain.getAddress('rbacAddress');
77
- return common_1.RBAC_CONTRACT_INTERFACE.encodeTransactionParams(rbacAddress, 'addOwner', [(0, viem_1.pad)(params.ownerId, { size: 32 })]);
70
+ return RBAC_CONTRACT_INTERFACE.encodeTransactionParams(rbacAddress, 'addOwner', [pad(params.ownerId, { size: 32 })]);
78
71
  };
79
- exports.addOwnerTxParams = addOwnerTxParams;
80
- const removeOwnerTxParams = async (params, txOptions = globalThis.globalEnvOption) => {
81
- const chain = await data_1.Chain.getChain({ chainIdentifier: txOptions.chain });
72
+ export const removeOwnerTxParams = async (params, txOptions = globalThis.globalEnvOption) => {
73
+ const chain = await Chain.getChain({ chainIdentifier: txOptions.chain });
82
74
  const rbacAddress = await chain.getAddress('rbacAddress');
83
- return common_1.RBAC_CONTRACT_INTERFACE.encodeTransactionParams(rbacAddress, 'removeOwner', [(0, viem_1.pad)(params.ownerId, { size: 32 })]);
75
+ return RBAC_CONTRACT_INTERFACE.encodeTransactionParams(rbacAddress, 'removeOwner', [pad(params.ownerId, { size: 32 })]);
84
76
  };
85
- exports.removeOwnerTxParams = removeOwnerTxParams;
86
77
  const convertTimestampToBigInt = (timestamp) => {
87
78
  if (Math.abs(Date.now() - timestamp) < Math.abs(Date.now() - timestamp * 1000)) {
88
79
  // timestamp is in mills
@@ -1 +1 @@
1
- {"version":3,"file":"AccessControl.js","sourceRoot":"","sources":["../../../src/actions/AccessControl.ts"],"names":[],"mappings":";;;AAAA,+BAA2C;AAE3C,kCAAwC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CAAA;IACxE,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;IACzD,OAAO,uBAAuB,CAAC,uBAAuB,CACpD,WAAW,EACX,aAAa,EACb,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CACpC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,wBAAwB,GAAG,CAAC,SAAiB,EAAU,EAAE;IAC7D,IACE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,GAAG,IAAI,CAAC,EAC1E,CAAC;QACD,wBAAwB;QACxB,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAA;IAC9C,CAAC;SAAM,CAAC;QACN,uBAAuB;QACvB,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAA;IACtC,CAAC;AACH,CAAC,CAAA"}
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createExecuteBatchTxParams = void 0;
4
- const common_1 = require("../common");
5
- const createExecuteBatchTxParams = (params, walletAddress) => {
1
+ import { WALLET_CONTRACT_INTERFACE } from '../common';
2
+ export const createExecuteBatchTxParams = (params, walletAddress) => {
6
3
  const targets = params.map((param) => param.to);
7
4
  const values = params.map((param) => param.value ?? 0n);
8
5
  const datas = params.map((param) => param.data ?? '0x');
9
- return common_1.WALLET_CONTRACT_INTERFACE.encodeTransactionParams(walletAddress, 'executeBatch', [targets, values, datas]);
6
+ return WALLET_CONTRACT_INTERFACE.encodeTransactionParams(walletAddress, 'executeBatch', [targets, values, datas]);
10
7
  };
11
- exports.createExecuteBatchTxParams = createExecuteBatchTxParams;
12
8
  //# sourceMappingURL=BatchActions.js.map