@crossmint/client-sdk-smart-wallet 0.1.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 (45) hide show
  1. package/LICENSE +201 -0
  2. package/dist/index.cjs +2 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +289 -0
  5. package/dist/index.d.ts +289 -0
  6. package/dist/index.js +2 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +46 -0
  9. package/src/ABI/ERC1155.json +325 -0
  10. package/src/ABI/ERC20.json +222 -0
  11. package/src/ABI/ERC721.json +320 -0
  12. package/src/SmartWalletSDK.test.ts +32 -0
  13. package/src/SmartWalletSDK.ts +75 -0
  14. package/src/api/APIErrorService.ts +72 -0
  15. package/src/api/BaseCrossmintService.ts +82 -0
  16. package/src/api/CrossmintWalletService.test.ts +42 -0
  17. package/src/api/CrossmintWalletService.ts +50 -0
  18. package/src/blockchain/BlockchainNetworks.ts +121 -0
  19. package/src/blockchain/token/index.ts +1 -0
  20. package/src/blockchain/transfer.ts +54 -0
  21. package/src/blockchain/wallets/EVMSmartWallet.ts +109 -0
  22. package/src/blockchain/wallets/clientDecorator.ts +127 -0
  23. package/src/blockchain/wallets/eoa.ts +49 -0
  24. package/src/blockchain/wallets/index.ts +1 -0
  25. package/src/blockchain/wallets/passkey.ts +117 -0
  26. package/src/blockchain/wallets/paymaster.ts +49 -0
  27. package/src/blockchain/wallets/service.ts +193 -0
  28. package/src/error/index.ts +148 -0
  29. package/src/error/processor.ts +36 -0
  30. package/src/index.ts +34 -0
  31. package/src/services/logging/BrowserLoggerInterface.ts +5 -0
  32. package/src/services/logging/ConsoleProvider.ts +24 -0
  33. package/src/services/logging/DatadogProvider.ts +39 -0
  34. package/src/services/logging/index.ts +16 -0
  35. package/src/types/API.ts +40 -0
  36. package/src/types/Config.ts +35 -0
  37. package/src/types/Tokens.ts +27 -0
  38. package/src/types/internal.ts +50 -0
  39. package/src/utils/blockchain.ts +15 -0
  40. package/src/utils/constants.ts +31 -0
  41. package/src/utils/environment.ts +3 -0
  42. package/src/utils/helpers.ts +15 -0
  43. package/src/utils/log.test.ts +76 -0
  44. package/src/utils/log.ts +157 -0
  45. package/src/utils/signer.ts +36 -0
@@ -0,0 +1,325 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "string",
6
+ "name": "uri_",
7
+ "type": "string"
8
+ }
9
+ ],
10
+ "stateMutability": "nonpayable",
11
+ "type": "constructor"
12
+ },
13
+ {
14
+ "anonymous": false,
15
+ "inputs": [
16
+ {
17
+ "indexed": true,
18
+ "internalType": "address",
19
+ "name": "account",
20
+ "type": "address"
21
+ },
22
+ {
23
+ "indexed": true,
24
+ "internalType": "address",
25
+ "name": "operator",
26
+ "type": "address"
27
+ },
28
+ {
29
+ "indexed": false,
30
+ "internalType": "bool",
31
+ "name": "approved",
32
+ "type": "bool"
33
+ }
34
+ ],
35
+ "name": "ApprovalForAll",
36
+ "type": "event"
37
+ },
38
+ {
39
+ "anonymous": false,
40
+ "inputs": [
41
+ {
42
+ "indexed": true,
43
+ "internalType": "address",
44
+ "name": "operator",
45
+ "type": "address"
46
+ },
47
+ {
48
+ "indexed": true,
49
+ "internalType": "address",
50
+ "name": "from",
51
+ "type": "address"
52
+ },
53
+ {
54
+ "indexed": true,
55
+ "internalType": "address",
56
+ "name": "to",
57
+ "type": "address"
58
+ },
59
+ {
60
+ "indexed": false,
61
+ "internalType": "uint256[]",
62
+ "name": "ids",
63
+ "type": "uint256[]"
64
+ },
65
+ {
66
+ "indexed": false,
67
+ "internalType": "uint256[]",
68
+ "name": "values",
69
+ "type": "uint256[]"
70
+ }
71
+ ],
72
+ "name": "TransferBatch",
73
+ "type": "event"
74
+ },
75
+ {
76
+ "anonymous": false,
77
+ "inputs": [
78
+ {
79
+ "indexed": true,
80
+ "internalType": "address",
81
+ "name": "operator",
82
+ "type": "address"
83
+ },
84
+ {
85
+ "indexed": true,
86
+ "internalType": "address",
87
+ "name": "from",
88
+ "type": "address"
89
+ },
90
+ {
91
+ "indexed": true,
92
+ "internalType": "address",
93
+ "name": "to",
94
+ "type": "address"
95
+ },
96
+ {
97
+ "indexed": false,
98
+ "internalType": "uint256",
99
+ "name": "id",
100
+ "type": "uint256"
101
+ },
102
+ {
103
+ "indexed": false,
104
+ "internalType": "uint256",
105
+ "name": "value",
106
+ "type": "uint256"
107
+ }
108
+ ],
109
+ "name": "TransferSingle",
110
+ "type": "event"
111
+ },
112
+ {
113
+ "anonymous": false,
114
+ "inputs": [
115
+ {
116
+ "indexed": false,
117
+ "internalType": "string",
118
+ "name": "value",
119
+ "type": "string"
120
+ },
121
+ {
122
+ "indexed": true,
123
+ "internalType": "uint256",
124
+ "name": "id",
125
+ "type": "uint256"
126
+ }
127
+ ],
128
+ "name": "URI",
129
+ "type": "event"
130
+ },
131
+ {
132
+ "inputs": [
133
+ {
134
+ "internalType": "address",
135
+ "name": "account",
136
+ "type": "address"
137
+ },
138
+ {
139
+ "internalType": "uint256",
140
+ "name": "id",
141
+ "type": "uint256"
142
+ }
143
+ ],
144
+ "name": "balanceOf",
145
+ "outputs": [
146
+ {
147
+ "internalType": "uint256",
148
+ "name": "",
149
+ "type": "uint256"
150
+ }
151
+ ],
152
+ "stateMutability": "view",
153
+ "type": "function"
154
+ },
155
+ {
156
+ "inputs": [
157
+ {
158
+ "internalType": "address[]",
159
+ "name": "accounts",
160
+ "type": "address[]"
161
+ },
162
+ {
163
+ "internalType": "uint256[]",
164
+ "name": "ids",
165
+ "type": "uint256[]"
166
+ }
167
+ ],
168
+ "name": "balanceOfBatch",
169
+ "outputs": [
170
+ {
171
+ "internalType": "uint256[]",
172
+ "name": "",
173
+ "type": "uint256[]"
174
+ }
175
+ ],
176
+ "stateMutability": "view",
177
+ "type": "function"
178
+ },
179
+ {
180
+ "inputs": [
181
+ {
182
+ "internalType": "address",
183
+ "name": "account",
184
+ "type": "address"
185
+ },
186
+ {
187
+ "internalType": "address",
188
+ "name": "operator",
189
+ "type": "address"
190
+ }
191
+ ],
192
+ "name": "isApprovedForAll",
193
+ "outputs": [
194
+ {
195
+ "internalType": "bool",
196
+ "name": "",
197
+ "type": "bool"
198
+ }
199
+ ],
200
+ "stateMutability": "view",
201
+ "type": "function"
202
+ },
203
+ {
204
+ "inputs": [
205
+ {
206
+ "internalType": "address",
207
+ "name": "from",
208
+ "type": "address"
209
+ },
210
+ {
211
+ "internalType": "address",
212
+ "name": "to",
213
+ "type": "address"
214
+ },
215
+ {
216
+ "internalType": "uint256[]",
217
+ "name": "ids",
218
+ "type": "uint256[]"
219
+ },
220
+ {
221
+ "internalType": "uint256[]",
222
+ "name": "amounts",
223
+ "type": "uint256[]"
224
+ },
225
+ {
226
+ "internalType": "bytes",
227
+ "name": "data",
228
+ "type": "bytes"
229
+ }
230
+ ],
231
+ "name": "safeBatchTransferFrom",
232
+ "outputs": [],
233
+ "stateMutability": "nonpayable",
234
+ "type": "function"
235
+ },
236
+ {
237
+ "inputs": [
238
+ {
239
+ "internalType": "address",
240
+ "name": "from",
241
+ "type": "address"
242
+ },
243
+ {
244
+ "internalType": "address",
245
+ "name": "to",
246
+ "type": "address"
247
+ },
248
+ {
249
+ "internalType": "uint256",
250
+ "name": "id",
251
+ "type": "uint256"
252
+ },
253
+ {
254
+ "internalType": "uint256",
255
+ "name": "amount",
256
+ "type": "uint256"
257
+ },
258
+ {
259
+ "internalType": "bytes",
260
+ "name": "data",
261
+ "type": "bytes"
262
+ }
263
+ ],
264
+ "name": "safeTransferFrom",
265
+ "outputs": [],
266
+ "stateMutability": "nonpayable",
267
+ "type": "function"
268
+ },
269
+ {
270
+ "inputs": [
271
+ {
272
+ "internalType": "address",
273
+ "name": "operator",
274
+ "type": "address"
275
+ },
276
+ {
277
+ "internalType": "bool",
278
+ "name": "approved",
279
+ "type": "bool"
280
+ }
281
+ ],
282
+ "name": "setApprovalForAll",
283
+ "outputs": [],
284
+ "stateMutability": "nonpayable",
285
+ "type": "function"
286
+ },
287
+ {
288
+ "inputs": [
289
+ {
290
+ "internalType": "bytes4",
291
+ "name": "interfaceId",
292
+ "type": "bytes4"
293
+ }
294
+ ],
295
+ "name": "supportsInterface",
296
+ "outputs": [
297
+ {
298
+ "internalType": "bool",
299
+ "name": "",
300
+ "type": "bool"
301
+ }
302
+ ],
303
+ "stateMutability": "view",
304
+ "type": "function"
305
+ },
306
+ {
307
+ "inputs": [
308
+ {
309
+ "internalType": "uint256",
310
+ "name": "",
311
+ "type": "uint256"
312
+ }
313
+ ],
314
+ "name": "uri",
315
+ "outputs": [
316
+ {
317
+ "internalType": "string",
318
+ "name": "",
319
+ "type": "string"
320
+ }
321
+ ],
322
+ "stateMutability": "view",
323
+ "type": "function"
324
+ }
325
+ ]
@@ -0,0 +1,222 @@
1
+ [
2
+ {
3
+ "constant": true,
4
+ "inputs": [],
5
+ "name": "name",
6
+ "outputs": [
7
+ {
8
+ "name": "",
9
+ "type": "string"
10
+ }
11
+ ],
12
+ "payable": false,
13
+ "stateMutability": "view",
14
+ "type": "function"
15
+ },
16
+ {
17
+ "constant": false,
18
+ "inputs": [
19
+ {
20
+ "name": "_spender",
21
+ "type": "address"
22
+ },
23
+ {
24
+ "name": "_value",
25
+ "type": "uint256"
26
+ }
27
+ ],
28
+ "name": "approve",
29
+ "outputs": [
30
+ {
31
+ "name": "",
32
+ "type": "bool"
33
+ }
34
+ ],
35
+ "payable": false,
36
+ "stateMutability": "nonpayable",
37
+ "type": "function"
38
+ },
39
+ {
40
+ "constant": true,
41
+ "inputs": [],
42
+ "name": "totalSupply",
43
+ "outputs": [
44
+ {
45
+ "name": "",
46
+ "type": "uint256"
47
+ }
48
+ ],
49
+ "payable": false,
50
+ "stateMutability": "view",
51
+ "type": "function"
52
+ },
53
+ {
54
+ "constant": false,
55
+ "inputs": [
56
+ {
57
+ "name": "_from",
58
+ "type": "address"
59
+ },
60
+ {
61
+ "name": "_to",
62
+ "type": "address"
63
+ },
64
+ {
65
+ "name": "_value",
66
+ "type": "uint256"
67
+ }
68
+ ],
69
+ "name": "transferFrom",
70
+ "outputs": [
71
+ {
72
+ "name": "",
73
+ "type": "bool"
74
+ }
75
+ ],
76
+ "payable": false,
77
+ "stateMutability": "nonpayable",
78
+ "type": "function"
79
+ },
80
+ {
81
+ "constant": true,
82
+ "inputs": [],
83
+ "name": "decimals",
84
+ "outputs": [
85
+ {
86
+ "name": "",
87
+ "type": "uint8"
88
+ }
89
+ ],
90
+ "payable": false,
91
+ "stateMutability": "view",
92
+ "type": "function"
93
+ },
94
+ {
95
+ "constant": true,
96
+ "inputs": [
97
+ {
98
+ "name": "_owner",
99
+ "type": "address"
100
+ }
101
+ ],
102
+ "name": "balanceOf",
103
+ "outputs": [
104
+ {
105
+ "name": "balance",
106
+ "type": "uint256"
107
+ }
108
+ ],
109
+ "payable": false,
110
+ "stateMutability": "view",
111
+ "type": "function"
112
+ },
113
+ {
114
+ "constant": true,
115
+ "inputs": [],
116
+ "name": "symbol",
117
+ "outputs": [
118
+ {
119
+ "name": "",
120
+ "type": "string"
121
+ }
122
+ ],
123
+ "payable": false,
124
+ "stateMutability": "view",
125
+ "type": "function"
126
+ },
127
+ {
128
+ "constant": false,
129
+ "inputs": [
130
+ {
131
+ "name": "_to",
132
+ "type": "address"
133
+ },
134
+ {
135
+ "name": "_value",
136
+ "type": "uint256"
137
+ }
138
+ ],
139
+ "name": "transfer",
140
+ "outputs": [
141
+ {
142
+ "name": "",
143
+ "type": "bool"
144
+ }
145
+ ],
146
+ "payable": false,
147
+ "stateMutability": "nonpayable",
148
+ "type": "function"
149
+ },
150
+ {
151
+ "constant": true,
152
+ "inputs": [
153
+ {
154
+ "name": "_owner",
155
+ "type": "address"
156
+ },
157
+ {
158
+ "name": "_spender",
159
+ "type": "address"
160
+ }
161
+ ],
162
+ "name": "allowance",
163
+ "outputs": [
164
+ {
165
+ "name": "",
166
+ "type": "uint256"
167
+ }
168
+ ],
169
+ "payable": false,
170
+ "stateMutability": "view",
171
+ "type": "function"
172
+ },
173
+ {
174
+ "payable": true,
175
+ "stateMutability": "payable",
176
+ "type": "fallback"
177
+ },
178
+ {
179
+ "anonymous": false,
180
+ "inputs": [
181
+ {
182
+ "indexed": true,
183
+ "name": "owner",
184
+ "type": "address"
185
+ },
186
+ {
187
+ "indexed": true,
188
+ "name": "spender",
189
+ "type": "address"
190
+ },
191
+ {
192
+ "indexed": false,
193
+ "name": "value",
194
+ "type": "uint256"
195
+ }
196
+ ],
197
+ "name": "Approval",
198
+ "type": "event"
199
+ },
200
+ {
201
+ "anonymous": false,
202
+ "inputs": [
203
+ {
204
+ "indexed": true,
205
+ "name": "from",
206
+ "type": "address"
207
+ },
208
+ {
209
+ "indexed": true,
210
+ "name": "to",
211
+ "type": "address"
212
+ },
213
+ {
214
+ "indexed": false,
215
+ "name": "value",
216
+ "type": "uint256"
217
+ }
218
+ ],
219
+ "name": "Transfer",
220
+ "type": "event"
221
+ }
222
+ ]