@crossmint/wallets-sdk 0.18.4 → 0.18.6
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/client.cjs +4 -3
- package/dist/api/client.js +3 -2
- package/dist/api/gen/index.cjs +1 -1
- package/dist/api/gen/index.js +1 -1
- package/dist/api/index.cjs +4 -3
- package/dist/api/index.js +3 -2
- package/dist/{chunk-HNRM45KF.cjs → chunk-34FDYDOM.cjs} +4 -4
- package/dist/{chunk-COVOGZ4S.js → chunk-454RYNSZ.js} +1 -1
- package/dist/chunk-455NK5LB.js +0 -0
- package/dist/{chunk-XH3ARVJG.cjs → chunk-5BP6CVYY.cjs} +12 -12
- package/dist/{chunk-DPERJZBG.js → chunk-5YR2ILEW.js} +8 -2
- package/dist/{chunk-5H5YHSCK.js → chunk-6G7ZWCCG.js} +54 -7
- package/dist/{chunk-E4LJ7252.cjs → chunk-B6JOIWRH.cjs} +1 -1
- package/dist/chunk-CCIGWTAO.cjs +1 -0
- package/dist/{chunk-BAULM7A2.js → chunk-CL44FTXR.js} +1 -1
- package/dist/{chunk-BFAU2NL6.js → chunk-E3OS753T.js} +1 -1
- package/dist/{chunk-PSPNZEG4.cjs → chunk-F6E3ZDRG.cjs} +4 -4
- package/dist/chunk-G3LEJR3P.cjs +53 -0
- package/dist/{chunk-OD5RGQ4Z.js → chunk-GLRDLJS5.js} +1 -1
- package/dist/{chunk-SG7WIZLK.cjs → chunk-GNF2U7IX.cjs} +10 -4
- package/dist/{chunk-RSPJPRQW.cjs → chunk-GQIZWD4F.cjs} +46 -7
- package/dist/{chunk-BAHU3KZE.cjs → chunk-HYKMSBCT.cjs} +3 -3
- package/dist/{chunk-YOJETSLN.cjs → chunk-IVNYZDI5.cjs} +3 -3
- package/dist/{chunk-AJCWEEWH.js → chunk-K3HFAPSV.js} +1 -1
- package/dist/{chunk-MYKPHXUR.cjs → chunk-LGONZW4W.cjs} +6 -6
- package/dist/{chunk-MPGPBFUZ.cjs → chunk-LHYSCUKJ.cjs} +1 -1
- package/dist/{chunk-EM6H7EUU.cjs → chunk-LKAO2MV2.cjs} +3 -3
- package/dist/{chunk-FK23BDCU.js → chunk-OKXSUK63.js} +1 -1
- package/dist/chunk-RAWKXOHR.js +53 -0
- package/dist/{chunk-7GHQBCRV.cjs → chunk-RBHGZDDX.cjs} +2 -1
- package/dist/{chunk-7QL5JVK4.js → chunk-S5YXROL6.js} +44 -5
- package/dist/{chunk-2DHIAP2S.js → chunk-TOHXQVLS.js} +10 -10
- package/dist/{chunk-4QGBVHV3.js → chunk-UKBWSQ7R.js} +4 -4
- package/dist/{chunk-4BMNDPJ4.cjs → chunk-UMGB3Q7I.cjs} +4 -4
- package/dist/{chunk-FAGFW4AR.js → chunk-WQVJM3PG.js} +1 -1
- package/dist/{chunk-HHDDI3CS.js → chunk-XRA5GFH3.js} +1 -1
- package/dist/{chunk-JICSSJOK.js → chunk-ZP4ZZCIE.js} +1 -0
- package/dist/{chunk-2VOEAAFA.cjs → chunk-ZZJ7U5G3.cjs} +53 -6
- package/dist/index.cjs +19 -17
- package/dist/index.js +18 -16
- package/dist/logger/index.cjs +11 -0
- package/dist/logger/index.d.cts +2 -0
- package/dist/logger/index.d.ts +2 -0
- package/dist/logger/index.js +11 -0
- package/dist/logger/init.cjs +10 -0
- package/dist/logger/init.d.cts +15 -0
- package/dist/logger/init.d.ts +15 -0
- package/dist/logger/init.js +10 -0
- package/dist/sdk.cjs +16 -14
- package/dist/sdk.js +15 -13
- package/dist/signers/index.cjs +8 -8
- package/dist/signers/index.js +7 -7
- package/dist/signers/non-custodial/index.cjs +5 -5
- package/dist/signers/non-custodial/index.js +6 -6
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +3 -3
- package/dist/signers/non-custodial/ncs-evm-signer.js +2 -2
- package/dist/signers/non-custodial/ncs-signer.cjs +2 -2
- package/dist/signers/non-custodial/ncs-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +3 -3
- package/dist/signers/non-custodial/ncs-solana-signer.js +2 -2
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +3 -3
- package/dist/signers/non-custodial/ncs-stellar-signer.js +2 -2
- package/dist/utils/constants.cjs +2 -2
- package/dist/utils/constants.js +1 -1
- package/dist/utils/signer-validation.cjs +4 -2
- package/dist/utils/signer-validation.d.cts +7 -1
- package/dist/utils/signer-validation.d.ts +7 -1
- package/dist/utils/signer-validation.js +5 -3
- package/dist/wallets/evm.cjs +8 -8
- package/dist/wallets/evm.js +7 -7
- package/dist/wallets/solana.cjs +8 -8
- package/dist/wallets/solana.js +7 -7
- package/dist/wallets/stellar.cjs +8 -8
- package/dist/wallets/stellar.js +7 -7
- package/dist/wallets/wallet-factory.cjs +14 -12
- package/dist/wallets/wallet-factory.js +13 -11
- package/dist/wallets/wallet.cjs +7 -7
- package/dist/wallets/wallet.js +6 -6
- package/package.json +6 -5
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkB6JOIWRHcjs = require('./chunk-B6JOIWRH.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var _chunkMPGPBFUZcjs = require('./chunk-MPGPBFUZ.cjs');
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
|
|
@@ -16,9 +15,10 @@ var _chunkMPGPBFUZcjs = require('./chunk-MPGPBFUZ.cjs');
|
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
|
|
18
|
+
var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkLHYSCUKJcjs = require('./chunk-LHYSCUKJ.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -394,7 +394,7 @@ var Wallet = class {
|
|
|
394
394
|
}
|
|
395
395
|
preAuthIfNeeded() {
|
|
396
396
|
return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
|
|
397
|
-
if (this.signer instanceof
|
|
397
|
+
if (this.signer instanceof _chunkB6JOIWRHcjs.NonCustodialSigner) {
|
|
398
398
|
yield this.signer.ensureAuthenticated();
|
|
399
399
|
}
|
|
400
400
|
});
|
|
@@ -525,7 +525,7 @@ var Wallet = class {
|
|
|
525
525
|
return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
|
|
526
526
|
let signatureResponse = null;
|
|
527
527
|
do {
|
|
528
|
-
yield new Promise((resolve) => setTimeout(resolve,
|
|
528
|
+
yield new Promise((resolve) => setTimeout(resolve, _chunkLHYSCUKJcjs.STATUS_POLLING_INTERVAL_MS));
|
|
529
529
|
signatureResponse = yield _chunkG5NYLGM5cjs.__privateGet.call(void 0, this, _apiClient).getSignature(this.walletLocator, signatureId);
|
|
530
530
|
if ("error" in signatureResponse) {
|
|
531
531
|
throw new (0, _chunkXC2V34TScjs.SignatureNotAvailableError)(JSON.stringify(signatureResponse));
|
|
@@ -547,7 +547,7 @@ var Wallet = class {
|
|
|
547
547
|
return _chunkG5NYLGM5cjs.__async.call(void 0, this, arguments, function* (transactionId, timeoutMs = 6e4, {
|
|
548
548
|
backoffMultiplier = 1.1,
|
|
549
549
|
maxBackoffMs = 2e3,
|
|
550
|
-
initialBackoffMs =
|
|
550
|
+
initialBackoffMs = _chunkLHYSCUKJcjs.STATUS_POLLING_INTERVAL_MS
|
|
551
551
|
} = {}) {
|
|
552
552
|
var _a;
|
|
553
553
|
const startTime = Date.now();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkB6JOIWRHcjs = require('./chunk-B6JOIWRH.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkG5NYLGM5cjs = require('./chunk-G5NYLGM5.cjs');
|
|
@@ -9,7 +9,7 @@ var _chunkG5NYLGM5cjs = require('./chunk-G5NYLGM5.cjs');
|
|
|
9
9
|
// src/signers/non-custodial/ncs-evm-signer.ts
|
|
10
10
|
var _ox = require('ox');
|
|
11
11
|
var _viem = require('viem');
|
|
12
|
-
var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends
|
|
12
|
+
var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends _chunkB6JOIWRHcjs.NonCustodialSigner {
|
|
13
13
|
constructor(config) {
|
|
14
14
|
super(config);
|
|
15
15
|
}
|
|
@@ -45,7 +45,7 @@ var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends _chunkE4LJ7252c
|
|
|
45
45
|
encoding: "hex"
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
options:
|
|
48
|
+
options: _chunkB6JOIWRHcjs.DEFAULT_EVENT_OPTIONS
|
|
49
49
|
});
|
|
50
50
|
if ((res == null ? void 0 : res.status) === "error") {
|
|
51
51
|
throw new Error(res.error);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SDK_NAME,
|
|
3
|
+
SDK_VERSION
|
|
4
|
+
} from "./chunk-WQVJM3PG.js";
|
|
5
|
+
|
|
6
|
+
// src/logger/init.ts
|
|
7
|
+
import {
|
|
8
|
+
SdkLogger,
|
|
9
|
+
BrowserDatadogSink,
|
|
10
|
+
detectPlatform,
|
|
11
|
+
validateAPIKey,
|
|
12
|
+
ServerDatadogSink
|
|
13
|
+
} from "@crossmint/common-sdk-base";
|
|
14
|
+
import * as datadogLogger from "@datadog/browser-logs";
|
|
15
|
+
var walletsLogger = new SdkLogger();
|
|
16
|
+
function initWalletsLogger(apiKey) {
|
|
17
|
+
const platform = detectPlatform();
|
|
18
|
+
const validationResult = validateAPIKey(apiKey);
|
|
19
|
+
if (!validationResult.isValid) {
|
|
20
|
+
throw new Error(`Invalid API key: ${validationResult.message}`);
|
|
21
|
+
}
|
|
22
|
+
const { environment, projectId } = validationResult;
|
|
23
|
+
walletsLogger.init({
|
|
24
|
+
packageName: SDK_NAME,
|
|
25
|
+
packageVersion: SDK_VERSION,
|
|
26
|
+
environment,
|
|
27
|
+
projectId,
|
|
28
|
+
platform
|
|
29
|
+
});
|
|
30
|
+
switch (platform) {
|
|
31
|
+
case "browser": {
|
|
32
|
+
const sink = new BrowserDatadogSink(environment, datadogLogger);
|
|
33
|
+
walletsLogger.addSink(sink);
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
case "react-native": {
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
case "server": {
|
|
40
|
+
const sink = new ServerDatadogSink(environment);
|
|
41
|
+
walletsLogger.addSink(sink);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
default: {
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
walletsLogger,
|
|
52
|
+
initWalletsLogger
|
|
53
|
+
};
|
|
@@ -54,4 +54,5 @@ function compareSignerConfigs(newSignerConfig, existingSignerConfig, path = "")
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
|
|
58
|
+
exports.normalizeValueForComparison = normalizeValueForComparison; exports.compareSignerConfigs = compareSignerConfigs;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
|
-
compareSignerConfigs
|
|
3
|
-
|
|
2
|
+
compareSignerConfigs,
|
|
3
|
+
normalizeValueForComparison
|
|
4
|
+
} from "./chunk-ZP4ZZCIE.js";
|
|
4
5
|
import {
|
|
5
6
|
Wallet
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UKBWSQ7R.js";
|
|
7
8
|
import {
|
|
8
9
|
assembleSigner
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-TOHXQVLS.js";
|
|
10
11
|
import {
|
|
11
12
|
WalletCreationError,
|
|
12
13
|
WalletNotAvailableError
|
|
13
14
|
} from "./chunk-SGINWAB6.js";
|
|
15
|
+
import {
|
|
16
|
+
walletsLogger
|
|
17
|
+
} from "./chunk-RAWKXOHR.js";
|
|
14
18
|
import {
|
|
15
19
|
__async,
|
|
16
20
|
__spreadValues
|
|
@@ -31,10 +35,21 @@ var WalletFactory = class {
|
|
|
31
35
|
);
|
|
32
36
|
}
|
|
33
37
|
const locator = this.getWalletLocator(args);
|
|
38
|
+
walletsLogger.info("wallet.getOrCreate.start", {
|
|
39
|
+
chain: args.chain,
|
|
40
|
+
signerType: args.signer.type
|
|
41
|
+
});
|
|
34
42
|
const existingWallet = yield this.apiClient.getWallet(locator);
|
|
35
43
|
if (existingWallet != null && !("error" in existingWallet)) {
|
|
44
|
+
walletsLogger.info("wallet.getOrCreate.existing", {
|
|
45
|
+
chain: args.chain,
|
|
46
|
+
address: existingWallet.address
|
|
47
|
+
});
|
|
36
48
|
return this.createWalletInstance(existingWallet, args);
|
|
37
49
|
}
|
|
50
|
+
walletsLogger.info("wallet.getOrCreate.creating", {
|
|
51
|
+
chain: args.chain
|
|
52
|
+
});
|
|
38
53
|
return this.createWallet(args);
|
|
39
54
|
});
|
|
40
55
|
}
|
|
@@ -43,10 +58,22 @@ var WalletFactory = class {
|
|
|
43
58
|
if (!this.apiClient.isServerSide) {
|
|
44
59
|
throw new WalletCreationError("getWallet is not supported on client side, use getOrCreateWallet instead");
|
|
45
60
|
}
|
|
61
|
+
walletsLogger.info("wallet.get.start", {
|
|
62
|
+
walletLocator,
|
|
63
|
+
chain: args.chain
|
|
64
|
+
});
|
|
46
65
|
const existingWallet = yield this.apiClient.getWallet(walletLocator);
|
|
47
66
|
if ("error" in existingWallet) {
|
|
67
|
+
walletsLogger.warn("wallet.get.notFound", {
|
|
68
|
+
walletLocator,
|
|
69
|
+
error: existingWallet.error
|
|
70
|
+
});
|
|
48
71
|
throw new WalletNotAvailableError(JSON.stringify(existingWallet));
|
|
49
72
|
}
|
|
73
|
+
walletsLogger.info("wallet.get.success", {
|
|
74
|
+
walletLocator,
|
|
75
|
+
address: existingWallet.address
|
|
76
|
+
});
|
|
50
77
|
return this.createWalletInstance(existingWallet, args);
|
|
51
78
|
});
|
|
52
79
|
}
|
|
@@ -54,6 +81,10 @@ var WalletFactory = class {
|
|
|
54
81
|
return __async(this, null, function* () {
|
|
55
82
|
var _a, _b, _c, _d, _e;
|
|
56
83
|
yield (_c = (_b = (_a = args.options) == null ? void 0 : _a.experimental_callbacks) == null ? void 0 : _b.onWalletCreationStart) == null ? void 0 : _c.call(_b);
|
|
84
|
+
walletsLogger.info("wallet.create.start", {
|
|
85
|
+
chain: args.chain,
|
|
86
|
+
signerType: args.signer.type
|
|
87
|
+
});
|
|
57
88
|
this.mutateSignerFromCustomAuth(args, true);
|
|
58
89
|
const adminSigner = args.signer.type === "passkey" ? yield this.createPasskeyAdminSigner(args.signer) : args.signer;
|
|
59
90
|
const walletResponse = yield this.apiClient.createWallet({
|
|
@@ -66,8 +97,16 @@ var WalletFactory = class {
|
|
|
66
97
|
alias: (_e = args.alias) != null ? _e : void 0
|
|
67
98
|
});
|
|
68
99
|
if ("error" in walletResponse) {
|
|
100
|
+
walletsLogger.error("wallet.create.error", {
|
|
101
|
+
chain: args.chain,
|
|
102
|
+
error: walletResponse.error
|
|
103
|
+
});
|
|
69
104
|
throw new WalletCreationError(JSON.stringify(walletResponse));
|
|
70
105
|
}
|
|
106
|
+
walletsLogger.info("wallet.create.success", {
|
|
107
|
+
chain: args.chain,
|
|
108
|
+
address: walletResponse.address
|
|
109
|
+
});
|
|
71
110
|
return this.createWalletInstance(walletResponse, args);
|
|
72
111
|
});
|
|
73
112
|
}
|
|
@@ -198,7 +237,7 @@ var WalletFactory = class {
|
|
|
198
237
|
validateExistingWalletConfig(existingWallet, args) {
|
|
199
238
|
var _a;
|
|
200
239
|
this.mutateSignerFromCustomAuth(args);
|
|
201
|
-
if (args.owner != null && existingWallet.owner != null && args.owner !== existingWallet.owner) {
|
|
240
|
+
if (args.owner != null && existingWallet.owner != null && normalizeValueForComparison(args.owner) !== normalizeValueForComparison(existingWallet.owner)) {
|
|
202
241
|
throw new WalletCreationError("Wallet owner does not match existing wallet's linked user");
|
|
203
242
|
}
|
|
204
243
|
if (args.chain === "solana" && existingWallet.chainType !== "solana" || args.chain !== "solana" && existingWallet.chainType === "solana" || args.chain === "stellar" && existingWallet.chainType !== "stellar" || args.chain !== "stellar" && existingWallet.chainType === "stellar") {
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EVMNonCustodialSigner
|
|
3
|
+
} from "./chunk-454RYNSZ.js";
|
|
1
4
|
import {
|
|
2
5
|
SolanaNonCustodialSigner
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XRA5GFH3.js";
|
|
4
7
|
import {
|
|
5
8
|
StellarNonCustodialSigner
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-K3HFAPSV.js";
|
|
7
10
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./chunk-
|
|
11
|
+
EVMApiKeySigner
|
|
12
|
+
} from "./chunk-AL77JANE.js";
|
|
13
|
+
import {
|
|
14
|
+
EVMExternalWalletSigner
|
|
15
|
+
} from "./chunk-MZBFXUHT.js";
|
|
10
16
|
import {
|
|
11
17
|
PasskeySigner
|
|
12
18
|
} from "./chunk-EYJQSDDI.js";
|
|
@@ -19,12 +25,6 @@ import {
|
|
|
19
25
|
import {
|
|
20
26
|
StellarExternalWalletSigner
|
|
21
27
|
} from "./chunk-WC7T2CR4.js";
|
|
22
|
-
import {
|
|
23
|
-
EVMApiKeySigner
|
|
24
|
-
} from "./chunk-AL77JANE.js";
|
|
25
|
-
import {
|
|
26
|
-
EVMExternalWalletSigner
|
|
27
|
-
} from "./chunk-MZBFXUHT.js";
|
|
28
28
|
|
|
29
29
|
// src/signers/index.ts
|
|
30
30
|
function assembleSigner(chain, config) {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NonCustodialSigner
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
STATUS_POLLING_INTERVAL_MS
|
|
6
|
-
} from "./chunk-FAGFW4AR.js";
|
|
3
|
+
} from "./chunk-CL44FTXR.js";
|
|
7
4
|
import {
|
|
8
5
|
InvalidSignerError,
|
|
9
6
|
SignatureFailedError,
|
|
@@ -19,6 +16,9 @@ import {
|
|
|
19
16
|
WalletNotAvailableError,
|
|
20
17
|
WalletTypeNotSupportedError
|
|
21
18
|
} from "./chunk-SGINWAB6.js";
|
|
19
|
+
import {
|
|
20
|
+
STATUS_POLLING_INTERVAL_MS
|
|
21
|
+
} from "./chunk-WQVJM3PG.js";
|
|
22
22
|
import {
|
|
23
23
|
__async,
|
|
24
24
|
__privateAdd,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkLGONZW4Wcjs = require('./chunk-LGONZW4W.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkR2OY54EJcjs = require('./chunk-R2OY54EJ.cjs');
|
|
@@ -14,7 +14,7 @@ var _chunkG5NYLGM5cjs = require('./chunk-G5NYLGM5.cjs');
|
|
|
14
14
|
// src/wallets/solana.ts
|
|
15
15
|
var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);
|
|
16
16
|
var _commonsdkbase = require('@crossmint/common-sdk-base');
|
|
17
|
-
var SolanaWallet = class _SolanaWallet extends
|
|
17
|
+
var SolanaWallet = class _SolanaWallet extends _chunkLGONZW4Wcjs.Wallet {
|
|
18
18
|
constructor(wallet) {
|
|
19
19
|
super(
|
|
20
20
|
{
|
|
@@ -22,10 +22,10 @@ var SolanaWallet = class _SolanaWallet extends _chunkMYKPHXURcjs.Wallet {
|
|
|
22
22
|
address: wallet.address,
|
|
23
23
|
owner: wallet.owner,
|
|
24
24
|
signer: wallet.signer,
|
|
25
|
-
options:
|
|
25
|
+
options: _chunkLGONZW4Wcjs.Wallet.getOptions(wallet),
|
|
26
26
|
alias: wallet.alias
|
|
27
27
|
},
|
|
28
|
-
|
|
28
|
+
_chunkLGONZW4Wcjs.Wallet.getApiClient(wallet)
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
static from(wallet) {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
+
var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
var _chunkG3LEJR3Pcjs = require('./chunk-G3LEJR3P.cjs');
|
|
5
7
|
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
|
|
10
|
+
var _chunkLHYSCUKJcjs = require('./chunk-LHYSCUKJ.cjs');
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
var _chunkG5NYLGM5cjs = require('./chunk-G5NYLGM5.cjs');
|
|
@@ -19,7 +22,7 @@ var ApiClient = class extends _commonsdkbase.CrossmintApiClient {
|
|
|
19
22
|
constructor(crossmint) {
|
|
20
23
|
super(crossmint, {
|
|
21
24
|
internalConfig: {
|
|
22
|
-
sdkMetadata: { name:
|
|
25
|
+
sdkMetadata: { name: _chunkLHYSCUKJcjs.SDK_NAME, version: _chunkLHYSCUKJcjs.SDK_VERSION }
|
|
23
26
|
}
|
|
24
27
|
});
|
|
25
28
|
this.apiPrefix = "api/2025-06-09/wallets";
|
|
@@ -28,19 +31,45 @@ var ApiClient = class extends _commonsdkbase.CrossmintApiClient {
|
|
|
28
31
|
createWallet(params) {
|
|
29
32
|
return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
|
|
30
33
|
const path = this.isServerSide ? `${this.apiPrefix}` : `${this.apiPrefix}/me`;
|
|
34
|
+
_chunkG3LEJR3Pcjs.walletsLogger.info("wallets.api.createWallet", {
|
|
35
|
+
chainType: params.chainType,
|
|
36
|
+
walletType: params.type
|
|
37
|
+
});
|
|
31
38
|
const response = yield this.post(path, {
|
|
32
39
|
body: JSON.stringify(params),
|
|
33
40
|
headers: this.headers
|
|
34
41
|
});
|
|
35
|
-
|
|
42
|
+
const result = yield response.json();
|
|
43
|
+
if ("error" in result) {
|
|
44
|
+
_chunkG3LEJR3Pcjs.walletsLogger.error("wallets.api.createWallet.error", {
|
|
45
|
+
error: result.error,
|
|
46
|
+
chainType: params.chainType
|
|
47
|
+
});
|
|
48
|
+
} else if ("address" in result) {
|
|
49
|
+
_chunkG3LEJR3Pcjs.walletsLogger.info("wallets.api.createWallet.success", {
|
|
50
|
+
address: result.address,
|
|
51
|
+
chainType: params.chainType
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
36
55
|
});
|
|
37
56
|
}
|
|
38
57
|
getWallet(locator) {
|
|
39
58
|
return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
|
|
59
|
+
_chunkG3LEJR3Pcjs.walletsLogger.info("wallets.api.getWallet", { locator });
|
|
40
60
|
const response = yield this.get(`${this.apiPrefix}/${locator}`, {
|
|
41
61
|
headers: this.headers
|
|
42
62
|
});
|
|
43
|
-
|
|
63
|
+
const result = yield response.json();
|
|
64
|
+
if ("error" in result) {
|
|
65
|
+
_chunkG3LEJR3Pcjs.walletsLogger.warn("wallets.api.getWallet.error", {
|
|
66
|
+
locator,
|
|
67
|
+
error: result.error
|
|
68
|
+
});
|
|
69
|
+
} else if ("address" in result) {
|
|
70
|
+
_chunkG3LEJR3Pcjs.walletsLogger.info("wallets.api.getWallet.success", result);
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
44
73
|
});
|
|
45
74
|
}
|
|
46
75
|
createTransaction(walletLocator, params) {
|
|
@@ -171,11 +200,29 @@ var ApiClient = class extends _commonsdkbase.CrossmintApiClient {
|
|
|
171
200
|
}
|
|
172
201
|
send(walletLocator, tokenLocator, params) {
|
|
173
202
|
return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
|
|
203
|
+
_chunkG3LEJR3Pcjs.walletsLogger.info("wallets.api.send", {
|
|
204
|
+
walletLocator,
|
|
205
|
+
tokenLocator,
|
|
206
|
+
recipient: params.recipient
|
|
207
|
+
});
|
|
174
208
|
const response = yield this.post(`${this.apiPrefix}/${walletLocator}/tokens/${tokenLocator}/transfers`, {
|
|
175
209
|
body: JSON.stringify(params),
|
|
176
210
|
headers: this.headers
|
|
177
211
|
});
|
|
178
|
-
|
|
212
|
+
const result = yield response.json();
|
|
213
|
+
if ("error" in result) {
|
|
214
|
+
_chunkG3LEJR3Pcjs.walletsLogger.error("wallets.api.send.error", {
|
|
215
|
+
walletLocator,
|
|
216
|
+
tokenLocator,
|
|
217
|
+
error: result.error
|
|
218
|
+
});
|
|
219
|
+
} else if ("id" in result) {
|
|
220
|
+
_chunkG3LEJR3Pcjs.walletsLogger.info("wallets.api.send.success", {
|
|
221
|
+
walletLocator,
|
|
222
|
+
transactionId: result.id
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
return result;
|
|
179
226
|
});
|
|
180
227
|
}
|
|
181
228
|
get isServerSide() {
|
package/dist/index.cjs
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkF6E3ZDRGcjs = require('./chunk-F6E3ZDRG.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkUMGB3Q7Icjs = require('./chunk-UMGB3Q7I.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk34FDYDOMcjs = require('./chunk-34FDYDOM.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
14
|
-
require('./chunk-
|
|
15
|
-
require('./chunk-
|
|
13
|
+
var _chunkGNF2U7IXcjs = require('./chunk-GNF2U7IX.cjs');
|
|
14
|
+
require('./chunk-GQIZWD4F.cjs');
|
|
15
|
+
require('./chunk-RBHGZDDX.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
19
|
-
require('./chunk-
|
|
18
|
+
var _chunkLGONZW4Wcjs = require('./chunk-LGONZW4W.cjs');
|
|
19
|
+
require('./chunk-5BP6CVYY.cjs');
|
|
20
20
|
require('./chunk-PO6S7UR3.cjs');
|
|
21
|
-
require('./chunk-
|
|
22
|
-
require('./chunk-
|
|
23
|
-
require('./chunk-
|
|
24
|
-
require('./chunk-
|
|
21
|
+
require('./chunk-LKAO2MV2.cjs');
|
|
22
|
+
require('./chunk-HYKMSBCT.cjs');
|
|
23
|
+
require('./chunk-IVNYZDI5.cjs');
|
|
24
|
+
require('./chunk-B6JOIWRH.cjs');
|
|
25
25
|
require('./chunk-TK3EUCQ4.cjs');
|
|
26
|
+
require('./chunk-CHGPNMRL.cjs');
|
|
27
|
+
require('./chunk-7ECQJFYM.cjs');
|
|
26
28
|
require('./chunk-BSC55MYK.cjs');
|
|
27
29
|
require('./chunk-LLFD22UQ.cjs');
|
|
28
30
|
require('./chunk-R2OY54EJ.cjs');
|
|
@@ -33,15 +35,15 @@ var _chunkRHR6P2KPcjs = require('./chunk-RHR6P2KP.cjs');
|
|
|
33
35
|
require('./chunk-6HXIZLEQ.cjs');
|
|
34
36
|
|
|
35
37
|
|
|
36
|
-
var
|
|
37
|
-
require('./chunk-MPGPBFUZ.cjs');
|
|
38
|
+
var _chunkZZJ7U5G3cjs = require('./chunk-ZZJ7U5G3.cjs');
|
|
38
39
|
require('./chunk-XC2V34TS.cjs');
|
|
39
40
|
require('./chunk-ECAM5KTH.cjs');
|
|
40
41
|
require('./chunk-CN2GVFBU.cjs');
|
|
41
42
|
require('./chunk-NIBKCMQ2.cjs');
|
|
42
43
|
require('./chunk-55V4VMTX.cjs');
|
|
43
|
-
require('./chunk-
|
|
44
|
-
require('./chunk-
|
|
44
|
+
require('./chunk-CCIGWTAO.cjs');
|
|
45
|
+
require('./chunk-G3LEJR3P.cjs');
|
|
46
|
+
require('./chunk-LHYSCUKJ.cjs');
|
|
45
47
|
require('./chunk-G5NYLGM5.cjs');
|
|
46
48
|
|
|
47
49
|
|
|
@@ -52,4 +54,4 @@ require('./chunk-G5NYLGM5.cjs');
|
|
|
52
54
|
|
|
53
55
|
|
|
54
56
|
|
|
55
|
-
exports.CrossmintWallets =
|
|
57
|
+
exports.CrossmintWallets = _chunkGNF2U7IXcjs.CrossmintWallets; exports.EVMWallet = _chunkF6E3ZDRGcjs.EVMWallet; exports.SolanaWallet = _chunkUMGB3Q7Icjs.SolanaWallet; exports.StellarWallet = _chunk34FDYDOMcjs.StellarWallet; exports.Wallet = _chunkLGONZW4Wcjs.Wallet; exports.WalletsApiClient = _chunkZZJ7U5G3cjs.ApiClient; exports.createCrossmint = _chunkGNF2U7IXcjs.createCrossmint; exports.isExportableSigner = _chunkRHR6P2KPcjs.isExportableSigner;
|
package/dist/index.js
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EVMWallet
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-E3OS753T.js";
|
|
4
4
|
import {
|
|
5
5
|
SolanaWallet
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GLRDLJS5.js";
|
|
7
7
|
import {
|
|
8
8
|
StellarWallet
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OKXSUK63.js";
|
|
10
10
|
import {
|
|
11
11
|
CrossmintWallets,
|
|
12
12
|
createCrossmint
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-5YR2ILEW.js";
|
|
14
|
+
import "./chunk-S5YXROL6.js";
|
|
15
|
+
import "./chunk-ZP4ZZCIE.js";
|
|
16
16
|
import {
|
|
17
17
|
Wallet
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-UKBWSQ7R.js";
|
|
19
|
+
import "./chunk-TOHXQVLS.js";
|
|
20
20
|
import "./chunk-YDZRBHS3.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-454RYNSZ.js";
|
|
22
|
+
import "./chunk-XRA5GFH3.js";
|
|
23
|
+
import "./chunk-K3HFAPSV.js";
|
|
24
|
+
import "./chunk-CL44FTXR.js";
|
|
25
25
|
import "./chunk-7JFVG4IY.js";
|
|
26
|
+
import "./chunk-AL77JANE.js";
|
|
27
|
+
import "./chunk-MZBFXUHT.js";
|
|
26
28
|
import "./chunk-EYJQSDDI.js";
|
|
27
29
|
import "./chunk-ZTGRDOOH.js";
|
|
28
30
|
import "./chunk-DQCXGBZM.js";
|
|
@@ -33,15 +35,15 @@ import {
|
|
|
33
35
|
import "./chunk-5IFDVB4Y.js";
|
|
34
36
|
import {
|
|
35
37
|
ApiClient
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-FAGFW4AR.js";
|
|
38
|
+
} from "./chunk-6G7ZWCCG.js";
|
|
38
39
|
import "./chunk-SGINWAB6.js";
|
|
39
40
|
import "./chunk-KBJA7JDT.js";
|
|
40
41
|
import "./chunk-KS63YEQ4.js";
|
|
41
42
|
import "./chunk-2T5HHKUI.js";
|
|
42
43
|
import "./chunk-3U6UAYOV.js";
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
44
|
+
import "./chunk-455NK5LB.js";
|
|
45
|
+
import "./chunk-RAWKXOHR.js";
|
|
46
|
+
import "./chunk-WQVJM3PG.js";
|
|
45
47
|
import "./chunk-FPMW7Q5O.js";
|
|
46
48
|
export {
|
|
47
49
|
CrossmintWallets,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-CCIGWTAO.cjs');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkG3LEJR3Pcjs = require('../chunk-G3LEJR3P.cjs');
|
|
6
|
+
require('../chunk-LHYSCUKJ.cjs');
|
|
7
|
+
require('../chunk-G5NYLGM5.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.initWalletsLogger = _chunkG3LEJR3Pcjs.initWalletsLogger; exports.walletsLogger = _chunkG3LEJR3Pcjs.walletsLogger;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkG3LEJR3Pcjs = require('../chunk-G3LEJR3P.cjs');
|
|
5
|
+
require('../chunk-LHYSCUKJ.cjs');
|
|
6
|
+
require('../chunk-G5NYLGM5.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.initWalletsLogger = _chunkG3LEJR3Pcjs.initWalletsLogger; exports.walletsLogger = _chunkG3LEJR3Pcjs.walletsLogger;
|