@crossmint/wallets-sdk 0.21.0 → 0.21.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.
- package/dist/api/__tests__/test-utils.cjs +5 -5
- package/dist/api/__tests__/test-utils.js +3 -3
- package/dist/api/client.cjs +4 -4
- package/dist/api/client.js +3 -3
- package/dist/api/gen/index.cjs +2 -2
- package/dist/api/gen/index.js +1 -1
- package/dist/api/index.cjs +4 -4
- package/dist/api/index.js +3 -3
- package/dist/chains/chains.cjs +5 -5
- package/dist/chains/chains.js +4 -4
- package/dist/{chunk-M4HCASMG.cjs → chunk-2YGFMFQH.cjs} +11 -11
- package/dist/{chunk-7W4HGN3H.cjs → chunk-357M7AYZ.cjs} +8 -8
- package/dist/{chunk-S2L5Z2ZT.js → chunk-4MEGQR3I.js} +5 -2
- package/dist/{chunk-QQNDLR6E.cjs → chunk-5NWGYER3.cjs} +18 -18
- package/dist/{chunk-P4XJHOLW.cjs → chunk-67C2QSRT.cjs} +12 -12
- package/dist/{chunk-HYA3ESUA.js → chunk-772Z6PBD.js} +3 -3
- package/dist/{chunk-2M32LBCA.cjs → chunk-BJQHHI7K.cjs} +3 -3
- package/dist/{chunk-VVPGO564.js → chunk-CUE4X7Y4.js} +5 -5
- package/dist/{chunk-HFEF2URB.js → chunk-FBUGIHIP.js} +2 -2
- package/dist/{chunk-65KPNJ77.js → chunk-GIHJEXL7.js} +3 -3
- package/dist/{chunk-NO2KMGS2.cjs → chunk-I3KIMQEV.cjs} +28 -28
- package/dist/{chunk-7EZDSDKA.cjs → chunk-IL6J7SYU.cjs} +11 -11
- package/dist/chunk-IXDC5JR2.js +316 -0
- package/dist/{chunk-VTF3WCXG.cjs → chunk-IZQHJM2P.cjs} +6 -6
- package/dist/{chunk-OPKFMXPI.cjs → chunk-J65ILI3Y.cjs} +10 -5
- package/dist/{chunk-KHY5FXO4.cjs → chunk-JD77GNRZ.cjs} +5 -2
- package/dist/{chunk-T5NKL6F4.js → chunk-JO7QKDU4.js} +2 -2
- package/dist/{chunk-2PSAUSOG.js → chunk-JP6227LZ.js} +5 -5
- package/dist/{chunk-4ZWUI6LE.cjs → chunk-JUS5BKF2.cjs} +47 -47
- package/dist/{chunk-M6IPPGXQ.cjs → chunk-KEDMRERX.cjs} +4 -4
- package/dist/{chunk-VLZ5ZS5U.js → chunk-KSN7G2DH.js} +2 -2
- package/dist/{chunk-FZQG6OX2.js → chunk-LDVEJ2XZ.js} +1 -1
- package/dist/{chunk-7SUWMK4J.cjs → chunk-LIUDLEBE.cjs} +25 -25
- package/dist/{chunk-4Z3YDHHG.js → chunk-LQWOPRRW.js} +2 -2
- package/dist/chunk-M6E6A543.cjs +316 -0
- package/dist/{chunk-X4SPF4KJ.js → chunk-NBBOYFQW.js} +4 -4
- package/dist/{chunk-M47ZHA7Q.js → chunk-OBKOVQQJ.js} +4 -4
- package/dist/{chunk-GLUD6EBN.js → chunk-PC3YMFJM.js} +1 -1
- package/dist/{chunk-M7OPRXZH.cjs → chunk-QMSFEJPD.cjs} +7 -7
- package/dist/{chunk-EVR4CD53.js → chunk-QPVKMB34.js} +6 -6
- package/dist/{chunk-U56Z2EOR.cjs → chunk-RZYHYTWY.cjs} +6 -6
- package/dist/{chunk-XEPUH4XH.js → chunk-SIP7NNGL.js} +1 -1
- package/dist/{chunk-MIKWTXUA.cjs → chunk-UBWFRFQ6.cjs} +6 -6
- package/dist/{chunk-3WZUNLYI.cjs → chunk-WATHSVAQ.cjs} +1 -1
- package/dist/{chunk-2RG6642I.js → chunk-WQZLYIIG.js} +10 -5
- package/dist/{chunk-CTOLL4BK.js → chunk-WXIYTJDM.js} +3 -3
- package/dist/{chunk-OXB6RTW7.js → chunk-Y2DLCE7H.js} +3 -3
- package/dist/{chunk-CPZQ7BK5.cjs → chunk-ZXQHWKZN.cjs} +6 -6
- package/dist/index.cjs +21 -20
- package/dist/index.js +20 -19
- package/dist/logger/index.cjs +3 -3
- package/dist/logger/index.js +2 -2
- package/dist/logger/init.cjs +3 -3
- package/dist/logger/init.js +2 -2
- package/dist/sdk.cjs +18 -17
- package/dist/sdk.js +17 -16
- package/dist/signers/index.cjs +12 -11
- package/dist/signers/index.js +11 -10
- package/dist/signers/non-custodial/index.cjs +7 -7
- package/dist/signers/non-custodial/index.js +8 -8
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +5 -5
- package/dist/signers/non-custodial/ncs-evm-signer.js +4 -4
- package/dist/signers/non-custodial/ncs-signer.cjs +4 -4
- package/dist/signers/non-custodial/ncs-signer.js +3 -3
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +5 -5
- package/dist/signers/non-custodial/ncs-solana-signer.js +4 -4
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +5 -5
- package/dist/signers/non-custodial/ncs-stellar-signer.js +4 -4
- package/dist/signers/server/assemble-server-signer.cjs +5 -4
- package/dist/signers/server/assemble-server-signer.js +4 -3
- package/dist/signers/server/helpers/derive-server-signer.cjs +3 -2
- package/dist/signers/server/helpers/derive-server-signer.js +2 -1
- package/dist/signers/server/helpers/index.cjs +3 -2
- package/dist/signers/server/helpers/index.js +2 -1
- package/dist/signers/server/index.cjs +7 -6
- package/dist/signers/server/index.js +6 -5
- package/dist/signers/server/stellar-server-signer.cjs +3 -2
- package/dist/signers/server/stellar-server-signer.d.cts +1 -1
- package/dist/signers/server/stellar-server-signer.d.ts +1 -1
- package/dist/signers/server/stellar-server-signer.js +2 -1
- package/dist/utils/constants.cjs +2 -2
- package/dist/utils/constants.js +1 -1
- package/dist/utils/stellar.cjs +11 -0
- package/dist/utils/stellar.d.cts +18 -0
- package/dist/utils/stellar.d.ts +18 -0
- package/dist/utils/stellar.js +11 -0
- package/dist/wallets/__tests__/test-helpers.cjs +14 -13
- package/dist/wallets/__tests__/test-helpers.js +13 -12
- package/dist/wallets/evm.cjs +15 -14
- package/dist/wallets/evm.js +14 -13
- package/dist/wallets/solana.cjs +15 -14
- package/dist/wallets/solana.js +14 -13
- package/dist/wallets/stellar.cjs +15 -14
- package/dist/wallets/stellar.js +14 -13
- package/dist/wallets/wallet-factory.cjs +16 -15
- package/dist/wallets/wallet-factory.js +15 -14
- package/dist/wallets/wallet.cjs +14 -13
- package/dist/wallets/wallet.js +13 -12
- package/package.json +1 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_EVENT_OPTIONS,
|
|
3
3
|
NonCustodialSigner
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LDVEJ2XZ.js";
|
|
5
5
|
import {
|
|
6
6
|
walletsLogger
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SIP7NNGL.js";
|
|
8
8
|
import {
|
|
9
9
|
__async
|
|
10
10
|
} from "./chunk-ASE2FXWP.js";
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/utils/stellar.ts
|
|
2
|
+
var _tweetnacl = require('tweetnacl'); var _tweetnacl2 = _interopRequireDefault(_tweetnacl);
|
|
3
|
+
var ED25519_PUBLIC_KEY_VERSION_BYTE = 6 << 3;
|
|
4
|
+
var BASE32_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
5
|
+
var CRC16_TABLE = [
|
|
6
|
+
0,
|
|
7
|
+
4129,
|
|
8
|
+
8258,
|
|
9
|
+
12387,
|
|
10
|
+
16516,
|
|
11
|
+
20645,
|
|
12
|
+
24774,
|
|
13
|
+
28903,
|
|
14
|
+
33032,
|
|
15
|
+
37161,
|
|
16
|
+
41290,
|
|
17
|
+
45419,
|
|
18
|
+
49548,
|
|
19
|
+
53677,
|
|
20
|
+
57806,
|
|
21
|
+
61935,
|
|
22
|
+
4657,
|
|
23
|
+
528,
|
|
24
|
+
12915,
|
|
25
|
+
8786,
|
|
26
|
+
21173,
|
|
27
|
+
17044,
|
|
28
|
+
29431,
|
|
29
|
+
25302,
|
|
30
|
+
37689,
|
|
31
|
+
33560,
|
|
32
|
+
45947,
|
|
33
|
+
41818,
|
|
34
|
+
54205,
|
|
35
|
+
50076,
|
|
36
|
+
62463,
|
|
37
|
+
58334,
|
|
38
|
+
9314,
|
|
39
|
+
13379,
|
|
40
|
+
1056,
|
|
41
|
+
5121,
|
|
42
|
+
25830,
|
|
43
|
+
29895,
|
|
44
|
+
17572,
|
|
45
|
+
21637,
|
|
46
|
+
42346,
|
|
47
|
+
46411,
|
|
48
|
+
34088,
|
|
49
|
+
38153,
|
|
50
|
+
58862,
|
|
51
|
+
62927,
|
|
52
|
+
50604,
|
|
53
|
+
54669,
|
|
54
|
+
13907,
|
|
55
|
+
9842,
|
|
56
|
+
5649,
|
|
57
|
+
1584,
|
|
58
|
+
30423,
|
|
59
|
+
26358,
|
|
60
|
+
22165,
|
|
61
|
+
18100,
|
|
62
|
+
46939,
|
|
63
|
+
42874,
|
|
64
|
+
38681,
|
|
65
|
+
34616,
|
|
66
|
+
63455,
|
|
67
|
+
59390,
|
|
68
|
+
55197,
|
|
69
|
+
51132,
|
|
70
|
+
18628,
|
|
71
|
+
22757,
|
|
72
|
+
26758,
|
|
73
|
+
30887,
|
|
74
|
+
2112,
|
|
75
|
+
6241,
|
|
76
|
+
10242,
|
|
77
|
+
14371,
|
|
78
|
+
51660,
|
|
79
|
+
55789,
|
|
80
|
+
59790,
|
|
81
|
+
63919,
|
|
82
|
+
35144,
|
|
83
|
+
39273,
|
|
84
|
+
43274,
|
|
85
|
+
47403,
|
|
86
|
+
23285,
|
|
87
|
+
19156,
|
|
88
|
+
31415,
|
|
89
|
+
27286,
|
|
90
|
+
6769,
|
|
91
|
+
2640,
|
|
92
|
+
14899,
|
|
93
|
+
10770,
|
|
94
|
+
56317,
|
|
95
|
+
52188,
|
|
96
|
+
64447,
|
|
97
|
+
60318,
|
|
98
|
+
39801,
|
|
99
|
+
35672,
|
|
100
|
+
47931,
|
|
101
|
+
43802,
|
|
102
|
+
27814,
|
|
103
|
+
31879,
|
|
104
|
+
19684,
|
|
105
|
+
23749,
|
|
106
|
+
11298,
|
|
107
|
+
15363,
|
|
108
|
+
3168,
|
|
109
|
+
7233,
|
|
110
|
+
60846,
|
|
111
|
+
64911,
|
|
112
|
+
52716,
|
|
113
|
+
56781,
|
|
114
|
+
44330,
|
|
115
|
+
48395,
|
|
116
|
+
36200,
|
|
117
|
+
40265,
|
|
118
|
+
32407,
|
|
119
|
+
28342,
|
|
120
|
+
24277,
|
|
121
|
+
20212,
|
|
122
|
+
15891,
|
|
123
|
+
11826,
|
|
124
|
+
7761,
|
|
125
|
+
3696,
|
|
126
|
+
65439,
|
|
127
|
+
61374,
|
|
128
|
+
57309,
|
|
129
|
+
53244,
|
|
130
|
+
48923,
|
|
131
|
+
44858,
|
|
132
|
+
40793,
|
|
133
|
+
36728,
|
|
134
|
+
37256,
|
|
135
|
+
33193,
|
|
136
|
+
45514,
|
|
137
|
+
41451,
|
|
138
|
+
53516,
|
|
139
|
+
49453,
|
|
140
|
+
61774,
|
|
141
|
+
57711,
|
|
142
|
+
4224,
|
|
143
|
+
161,
|
|
144
|
+
12482,
|
|
145
|
+
8419,
|
|
146
|
+
20484,
|
|
147
|
+
16421,
|
|
148
|
+
28742,
|
|
149
|
+
24679,
|
|
150
|
+
33721,
|
|
151
|
+
37784,
|
|
152
|
+
41979,
|
|
153
|
+
46042,
|
|
154
|
+
49981,
|
|
155
|
+
54044,
|
|
156
|
+
58239,
|
|
157
|
+
62302,
|
|
158
|
+
689,
|
|
159
|
+
4752,
|
|
160
|
+
8947,
|
|
161
|
+
13010,
|
|
162
|
+
16949,
|
|
163
|
+
21012,
|
|
164
|
+
25207,
|
|
165
|
+
29270,
|
|
166
|
+
46570,
|
|
167
|
+
42443,
|
|
168
|
+
38312,
|
|
169
|
+
34185,
|
|
170
|
+
62830,
|
|
171
|
+
58703,
|
|
172
|
+
54572,
|
|
173
|
+
50445,
|
|
174
|
+
13538,
|
|
175
|
+
9411,
|
|
176
|
+
5280,
|
|
177
|
+
1153,
|
|
178
|
+
29798,
|
|
179
|
+
25671,
|
|
180
|
+
21540,
|
|
181
|
+
17413,
|
|
182
|
+
42971,
|
|
183
|
+
47098,
|
|
184
|
+
34713,
|
|
185
|
+
38840,
|
|
186
|
+
59231,
|
|
187
|
+
63358,
|
|
188
|
+
50973,
|
|
189
|
+
55100,
|
|
190
|
+
9939,
|
|
191
|
+
14066,
|
|
192
|
+
1681,
|
|
193
|
+
5808,
|
|
194
|
+
26199,
|
|
195
|
+
30326,
|
|
196
|
+
17941,
|
|
197
|
+
22068,
|
|
198
|
+
55628,
|
|
199
|
+
51565,
|
|
200
|
+
63758,
|
|
201
|
+
59695,
|
|
202
|
+
39368,
|
|
203
|
+
35305,
|
|
204
|
+
47498,
|
|
205
|
+
43435,
|
|
206
|
+
22596,
|
|
207
|
+
18533,
|
|
208
|
+
30726,
|
|
209
|
+
26663,
|
|
210
|
+
6336,
|
|
211
|
+
2273,
|
|
212
|
+
14466,
|
|
213
|
+
10403,
|
|
214
|
+
52093,
|
|
215
|
+
56156,
|
|
216
|
+
60223,
|
|
217
|
+
64286,
|
|
218
|
+
35833,
|
|
219
|
+
39896,
|
|
220
|
+
43963,
|
|
221
|
+
48026,
|
|
222
|
+
19061,
|
|
223
|
+
23124,
|
|
224
|
+
27191,
|
|
225
|
+
31254,
|
|
226
|
+
2801,
|
|
227
|
+
6864,
|
|
228
|
+
10931,
|
|
229
|
+
14994,
|
|
230
|
+
64814,
|
|
231
|
+
60687,
|
|
232
|
+
56684,
|
|
233
|
+
52557,
|
|
234
|
+
48554,
|
|
235
|
+
44427,
|
|
236
|
+
40424,
|
|
237
|
+
36297,
|
|
238
|
+
31782,
|
|
239
|
+
27655,
|
|
240
|
+
23652,
|
|
241
|
+
19525,
|
|
242
|
+
15522,
|
|
243
|
+
11395,
|
|
244
|
+
7392,
|
|
245
|
+
3265,
|
|
246
|
+
61215,
|
|
247
|
+
65342,
|
|
248
|
+
53085,
|
|
249
|
+
57212,
|
|
250
|
+
44955,
|
|
251
|
+
49082,
|
|
252
|
+
36825,
|
|
253
|
+
40952,
|
|
254
|
+
28183,
|
|
255
|
+
32310,
|
|
256
|
+
20053,
|
|
257
|
+
24180,
|
|
258
|
+
11923,
|
|
259
|
+
16050,
|
|
260
|
+
3793,
|
|
261
|
+
7920
|
|
262
|
+
];
|
|
263
|
+
function crc16Xmodem(data) {
|
|
264
|
+
let crc = 0;
|
|
265
|
+
for (let i = 0; i < data.length; i++) {
|
|
266
|
+
const byte = data[i];
|
|
267
|
+
crc = (crc << 8 ^ CRC16_TABLE[crc >> 8 ^ byte]) & 65535;
|
|
268
|
+
}
|
|
269
|
+
const checksum = new Uint8Array(2);
|
|
270
|
+
checksum[0] = crc & 255;
|
|
271
|
+
checksum[1] = crc >> 8 & 255;
|
|
272
|
+
return checksum;
|
|
273
|
+
}
|
|
274
|
+
function base32Encode(data) {
|
|
275
|
+
let bits = 0;
|
|
276
|
+
let value = 0;
|
|
277
|
+
let output = "";
|
|
278
|
+
for (let i = 0; i < data.length; i++) {
|
|
279
|
+
value = value << 8 | data[i];
|
|
280
|
+
bits += 8;
|
|
281
|
+
while (bits >= 5) {
|
|
282
|
+
output += BASE32_ALPHABET[value >>> bits - 5 & 31];
|
|
283
|
+
bits -= 5;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (bits > 0) {
|
|
287
|
+
output += BASE32_ALPHABET[value << 5 - bits & 31];
|
|
288
|
+
}
|
|
289
|
+
while (output.length % 8 !== 0) {
|
|
290
|
+
output += "=";
|
|
291
|
+
}
|
|
292
|
+
return output;
|
|
293
|
+
}
|
|
294
|
+
function encodeStellarPublicKey(publicKeyBytes) {
|
|
295
|
+
const payload = new Uint8Array(1 + publicKeyBytes.length);
|
|
296
|
+
payload[0] = ED25519_PUBLIC_KEY_VERSION_BYTE;
|
|
297
|
+
payload.set(publicKeyBytes, 1);
|
|
298
|
+
const checksum = crc16Xmodem(payload);
|
|
299
|
+
const unencoded = new Uint8Array(payload.length + 2);
|
|
300
|
+
unencoded.set(payload, 0);
|
|
301
|
+
unencoded.set(checksum, payload.length);
|
|
302
|
+
return base32Encode(unencoded);
|
|
303
|
+
}
|
|
304
|
+
function ed25519KeypairFromSeed(seed) {
|
|
305
|
+
const keypair = _tweetnacl2.default.sign.keyPair.fromSeed(seed);
|
|
306
|
+
return { publicKey: keypair.publicKey, secretKey: keypair.secretKey };
|
|
307
|
+
}
|
|
308
|
+
function ed25519Sign(message, secretKey) {
|
|
309
|
+
return _tweetnacl2.default.sign.detached(message, secretKey);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
exports.encodeStellarPublicKey = encodeStellarPublicKey; exports.ed25519KeypairFromSeed = ed25519KeypairFromSeed; exports.ed25519Sign = ed25519Sign;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
arcTestnet
|
|
3
|
-
} from "./chunk-ZBLW42YE.js";
|
|
4
1
|
import {
|
|
5
2
|
story
|
|
6
3
|
} from "./chunk-2T5HHKUI.js";
|
|
@@ -13,12 +10,15 @@ import {
|
|
|
13
10
|
import {
|
|
14
11
|
tempoTestnet
|
|
15
12
|
} from "./chunk-JWMQALLN.js";
|
|
13
|
+
import {
|
|
14
|
+
arcTestnet
|
|
15
|
+
} from "./chunk-ZBLW42YE.js";
|
|
16
16
|
import {
|
|
17
17
|
InvalidEnvironmentError
|
|
18
18
|
} from "./chunk-SGINWAB6.js";
|
|
19
19
|
import {
|
|
20
20
|
walletsLogger
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-SIP7NNGL.js";
|
|
22
22
|
|
|
23
23
|
// src/chains/chains.ts
|
|
24
24
|
import { APIKeyEnvironmentPrefix, BlockchainIncludingTestnet as Blockchain } from "@crossmint/common-sdk-base";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Wallet
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CUE4X7Y4.js";
|
|
4
4
|
import {
|
|
5
5
|
deriveServerSignerDetails
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4MEGQR3I.js";
|
|
7
7
|
import {
|
|
8
8
|
toViemChain
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NBBOYFQW.js";
|
|
10
10
|
import {
|
|
11
11
|
InvalidTypedDataError,
|
|
12
12
|
SignatureNotCreatedError,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-SGINWAB6.js";
|
|
15
15
|
import {
|
|
16
16
|
walletsLogger
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-SIP7NNGL.js";
|
|
18
18
|
import {
|
|
19
19
|
__async,
|
|
20
20
|
__decorateClass
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkI3KIMQEVcjs = require('./chunk-I3KIMQEV.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk67C2QSRTcjs = require('./chunk-67C2QSRT.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkBJQHHI7Kcjs = require('./chunk-BJQHHI7K.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
@@ -16,10 +16,10 @@ var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
|
16
16
|
var _commonsdkbase = require('@crossmint/common-sdk-base');
|
|
17
17
|
var CrossmintWallets = class _CrossmintWallets {
|
|
18
18
|
constructor(crossmint) {
|
|
19
|
-
|
|
20
|
-
const apiClient = new (0,
|
|
21
|
-
this.walletFactory = new (0,
|
|
22
|
-
|
|
19
|
+
_chunkBJQHHI7Kcjs.initWalletsLogger.call(void 0, crossmint.apiKey);
|
|
20
|
+
const apiClient = new (0, _chunk67C2QSRTcjs.ApiClient)(crossmint);
|
|
21
|
+
this.walletFactory = new (0, _chunkI3KIMQEVcjs.WalletFactory)(apiClient);
|
|
22
|
+
_chunkBJQHHI7Kcjs.walletsLogger.info("wallets.sdk.initialized");
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Initialize the Wallets SDK
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assembleServerSigner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WXIYTJDM.js";
|
|
4
|
+
import {
|
|
5
|
+
EVMNonCustodialSigner
|
|
6
|
+
} from "./chunk-JO7QKDU4.js";
|
|
4
7
|
import {
|
|
5
8
|
SolanaNonCustodialSigner
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FBUGIHIP.js";
|
|
7
10
|
import {
|
|
8
11
|
StellarNonCustodialSigner
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
EVMNonCustodialSigner
|
|
12
|
-
} from "./chunk-T5NKL6F4.js";
|
|
12
|
+
} from "./chunk-LQWOPRRW.js";
|
|
13
13
|
import {
|
|
14
14
|
EVMApiKeySigner
|
|
15
15
|
} from "./chunk-7GOUUPS4.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk5NWGYER3cjs = require('./chunk-5NWGYER3.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkBJQHHI7Kcjs = require('./chunk-BJQHHI7K.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
@@ -12,7 +12,7 @@ var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
|
12
12
|
// src/signers/non-custodial/ncs-evm-signer.ts
|
|
13
13
|
var _ox = require('ox');
|
|
14
14
|
var _viem = require('viem');
|
|
15
|
-
var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends
|
|
15
|
+
var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends _chunk5NWGYER3cjs.NonCustodialSigner {
|
|
16
16
|
constructor(config) {
|
|
17
17
|
super(config);
|
|
18
18
|
}
|
|
@@ -34,7 +34,7 @@ var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends _chunkQQNDLR6Ec
|
|
|
34
34
|
yield this.handleAuthRequired();
|
|
35
35
|
const jwt = this.getJwtOrThrow();
|
|
36
36
|
const hexString = raw.replace("0x", "");
|
|
37
|
-
|
|
37
|
+
_chunkBJQHHI7Kcjs.walletsLogger.info("sign: sending request", { keyType: "secp256k1" });
|
|
38
38
|
const startTime = Date.now();
|
|
39
39
|
const res = yield (_a = this.config.clientTEEConnection) == null ? void 0 : _a.sendAction({
|
|
40
40
|
event: "request:sign",
|
|
@@ -50,9 +50,9 @@ var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends _chunkQQNDLR6Ec
|
|
|
50
50
|
encoding: "hex"
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
options:
|
|
53
|
+
options: _chunk5NWGYER3cjs.DEFAULT_EVENT_OPTIONS
|
|
54
54
|
});
|
|
55
|
-
|
|
55
|
+
_chunkBJQHHI7Kcjs.walletsLogger.info("sign: response received", {
|
|
56
56
|
status: res == null ? void 0 : res.status,
|
|
57
57
|
durationMs: Date.now() - startTime
|
|
58
58
|
});
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _chunkHTSQPZHWcjs = require('./chunk-HTSQPZHW.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
3
|
var _chunkNIBKCMQ2cjs = require('./chunk-NIBKCMQ2.cjs');
|
|
7
4
|
|
|
8
5
|
|
|
@@ -15,10 +12,13 @@ var _chunk7USEVMTWcjs = require('./chunk-7USEVMTW.cjs');
|
|
|
15
12
|
var _chunkF7L2TZ3Icjs = require('./chunk-F7L2TZ3I.cjs');
|
|
16
13
|
|
|
17
14
|
|
|
15
|
+
var _chunkHTSQPZHWcjs = require('./chunk-HTSQPZHW.cjs');
|
|
16
|
+
|
|
17
|
+
|
|
18
18
|
var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkBJQHHI7Kcjs = require('./chunk-BJQHHI7K.cjs');
|
|
22
22
|
|
|
23
23
|
// src/chains/chains.ts
|
|
24
24
|
var _commonsdkbase = require('@crossmint/common-sdk-base');
|
|
@@ -197,7 +197,7 @@ function validateChainForEnvironment(chain, environment) {
|
|
|
197
197
|
if (!isProductionEnv && isMainnetChain(evmChain)) {
|
|
198
198
|
const testnetEquivalent = mainnetToTestnet(evmChain);
|
|
199
199
|
if (testnetEquivalent != null) {
|
|
200
|
-
|
|
200
|
+
_chunkBJQHHI7Kcjs.walletsLogger.debug("validateChainForEnvironment.autoConverted", {
|
|
201
201
|
chain,
|
|
202
202
|
convertedTo: testnetEquivalent,
|
|
203
203
|
environment,
|
|
@@ -205,7 +205,7 @@ function validateChainForEnvironment(chain, environment) {
|
|
|
205
205
|
});
|
|
206
206
|
return testnetEquivalent;
|
|
207
207
|
}
|
|
208
|
-
|
|
208
|
+
_chunkBJQHHI7Kcjs.walletsLogger.debug("validateChainForEnvironment.mismatch", {
|
|
209
209
|
chain,
|
|
210
210
|
environment,
|
|
211
211
|
message: `Chain "${chain}" is a mainnet chain and should not be used in ${environment} environment. No testnet equivalent is available. Please use a testnet chain instead.`
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ed25519KeypairFromSeed,
|
|
3
|
+
ed25519Sign,
|
|
4
|
+
encodeStellarPublicKey
|
|
5
|
+
} from "./chunk-IXDC5JR2.js";
|
|
1
6
|
import {
|
|
2
7
|
__async
|
|
3
8
|
} from "./chunk-ASE2FXWP.js";
|
|
4
9
|
|
|
5
10
|
// src/signers/server/stellar-server-signer.ts
|
|
6
|
-
import { Keypair } from "@stellar/stellar-sdk";
|
|
7
11
|
var StellarServerSigner = class {
|
|
8
12
|
constructor(config) {
|
|
9
13
|
this.type = "server";
|
|
10
|
-
|
|
11
|
-
this._address =
|
|
14
|
+
const keypair = ed25519KeypairFromSeed(config.derivedKeyBytes);
|
|
15
|
+
this._address = encodeStellarPublicKey(keypair.publicKey);
|
|
12
16
|
this._locator = config.locator;
|
|
17
|
+
this.secretKey = keypair.secretKey;
|
|
13
18
|
}
|
|
14
19
|
address() {
|
|
15
20
|
return this._address;
|
|
@@ -23,8 +28,8 @@ var StellarServerSigner = class {
|
|
|
23
28
|
throw new Error("StellarServerSigner.signMessage: expected a base64-encoded string");
|
|
24
29
|
}
|
|
25
30
|
const messageBytes = Buffer.from(message, "base64");
|
|
26
|
-
const signatureBytes = this.
|
|
27
|
-
return { signature: signatureBytes.toString("base64") };
|
|
31
|
+
const signatureBytes = ed25519Sign(messageBytes, this.secretKey);
|
|
32
|
+
return { signature: Buffer.from(signatureBytes).toString("base64") };
|
|
28
33
|
});
|
|
29
34
|
}
|
|
30
35
|
signTransaction(transaction) {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StellarServerSigner
|
|
3
|
+
} from "./chunk-WQZLYIIG.js";
|
|
1
4
|
import {
|
|
2
5
|
getChainType
|
|
3
6
|
} from "./chunk-H6WV5NRT.js";
|
|
@@ -7,9 +10,6 @@ import {
|
|
|
7
10
|
import {
|
|
8
11
|
SolanaServerSigner
|
|
9
12
|
} from "./chunk-K6LSGLG6.js";
|
|
10
|
-
import {
|
|
11
|
-
StellarServerSigner
|
|
12
|
-
} from "./chunk-2RG6642I.js";
|
|
13
13
|
|
|
14
14
|
// src/signers/server/assemble-server-signer.ts
|
|
15
15
|
function assembleServerSigner(chain, config) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Wallet
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CUE4X7Y4.js";
|
|
4
4
|
import {
|
|
5
5
|
deriveServerSignerDetails
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4MEGQR3I.js";
|
|
7
7
|
import {
|
|
8
8
|
SolanaExternalWalletSigner
|
|
9
9
|
} from "./chunk-PIFD6KNH.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-SGINWAB6.js";
|
|
13
13
|
import {
|
|
14
14
|
walletsLogger
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SIP7NNGL.js";
|
|
16
16
|
import {
|
|
17
17
|
__async,
|
|
18
18
|
__decorateClass
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk5NWGYER3cjs = require('./chunk-5NWGYER3.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkBJQHHI7Kcjs = require('./chunk-BJQHHI7K.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
11
11
|
|
|
12
12
|
// src/signers/non-custodial/ncs-stellar-signer.ts
|
|
13
|
-
var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends
|
|
13
|
+
var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends _chunk5NWGYER3cjs.NonCustodialSigner {
|
|
14
14
|
constructor(config) {
|
|
15
15
|
super(config);
|
|
16
16
|
}
|
|
@@ -24,7 +24,7 @@ var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends _chunkQ
|
|
|
24
24
|
var _a;
|
|
25
25
|
yield this.handleAuthRequired();
|
|
26
26
|
const jwt = this.getJwtOrThrow();
|
|
27
|
-
|
|
27
|
+
_chunkBJQHHI7Kcjs.walletsLogger.info("sign: sending request", { keyType: "ed25519" });
|
|
28
28
|
const startTime = Date.now();
|
|
29
29
|
const res = yield (_a = this.config.clientTEEConnection) == null ? void 0 : _a.sendAction({
|
|
30
30
|
event: "request:sign",
|
|
@@ -40,9 +40,9 @@ var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends _chunkQ
|
|
|
40
40
|
encoding: "base64"
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
options:
|
|
43
|
+
options: _chunk5NWGYER3cjs.DEFAULT_EVENT_OPTIONS
|
|
44
44
|
});
|
|
45
|
-
|
|
45
|
+
_chunkBJQHHI7Kcjs.walletsLogger.info("sign: response received", {
|
|
46
46
|
status: res == null ? void 0 : res.status,
|
|
47
47
|
durationMs: Date.now() - startTime
|
|
48
48
|
});
|