@crossmint/wallets-sdk 0.18.15 → 0.19.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.
- 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/types.gen.d.cts +8 -0
- package/dist/api/gen/types.gen.d.ts +8 -0
- package/dist/api/index.cjs +4 -4
- package/dist/api/index.js +3 -3
- package/dist/chains/chains.cjs +6 -2
- package/dist/chains/chains.d.cts +3 -1
- package/dist/chains/chains.d.ts +3 -1
- package/dist/chains/chains.js +5 -1
- package/dist/{chunk-5YX2BE4I.js → chunk-57HPJVTI.js} +8 -3
- package/dist/{chunk-PJTTM5QQ.cjs → chunk-5CBGJLA4.cjs} +1 -1
- package/dist/{chunk-YZOPFNY3.js → chunk-6EP3PLGP.js} +2 -2
- package/dist/{chunk-4ZFP3ST7.js → chunk-7EZZGCYI.js} +10 -1
- package/dist/{chunk-ZM437XPQ.js → chunk-7NKX266V.js} +39 -5
- package/dist/{chunk-GSDBCRGH.js → chunk-BBYNVHFR.js} +3 -3
- package/dist/{chunk-NFQT5TFO.cjs → chunk-C5F6IECX.cjs} +12 -12
- package/dist/{chunk-OWRKZD7H.cjs → chunk-DIM3X4IX.cjs} +9 -1
- package/dist/{chunk-QCTTQ4XE.cjs → chunk-EIZVQAZO.cjs} +54 -20
- package/dist/{chunk-V65OBC5I.js → chunk-ETCH6L2Y.js} +3 -3
- package/dist/{chunk-WMUNQJYD.cjs → chunk-FQV77LH4.cjs} +3 -3
- package/dist/{chunk-YT64AZL6.cjs → chunk-JLW3Q65G.cjs} +6 -6
- package/dist/{chunk-AKJOFUXU.cjs → chunk-JZQYCISB.cjs} +9 -9
- package/dist/{chunk-CJWHHO4B.js → chunk-KE6LX37B.js} +1 -1
- package/dist/{chunk-WQDGFD34.js → chunk-L5IMC3NM.js} +2 -2
- package/dist/{chunk-PHIXNAMT.js → chunk-N65K6TUY.js} +10 -1
- package/dist/{chunk-PADJ2CIV.cjs → chunk-NXST74TX.cjs} +80 -43
- package/dist/{chunk-BMXG52BZ.cjs → chunk-REP547HH.cjs} +36 -13
- package/dist/{chunk-LFUXRLJR.js → chunk-S2AKC2CK.js} +1 -1
- package/dist/{chunk-TOTOITTM.js → chunk-SUJQZWLJ.js} +2 -2
- package/dist/{chunk-AUNZEGWS.cjs → chunk-TCNXKNBQ.cjs} +7 -7
- package/dist/{chunk-AKAJ7UHQ.cjs → chunk-VNPL3HFN.cjs} +12 -3
- package/dist/{chunk-77HEKAFB.cjs → chunk-VWENCGQO.cjs} +12 -3
- package/dist/{chunk-VM6OLXBS.js → chunk-W3OYA42M.js} +32 -9
- package/dist/{chunk-OOVNMAQF.js → chunk-XEZBA7I2.js} +58 -21
- package/dist/{chunk-JDAWNKQ7.cjs → chunk-XQSMZXBR.cjs} +28 -23
- package/dist/{chunk-XVFUAZJY.js → chunk-XSMIDXUA.js} +9 -1
- package/dist/{chunk-SCU5YLUT.js → chunk-YF4DYTBM.js} +10 -1
- package/dist/{chunk-PRQOFWLH.cjs → chunk-YFOUZXSM.cjs} +12 -3
- package/dist/{chunk-OTI3LX45.cjs → chunk-YXFIZNFL.cjs} +9 -9
- package/dist/index.cjs +16 -16
- package/dist/index.js +15 -15
- 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 +17 -12
- package/dist/sdk.js +16 -11
- package/dist/signers/index.cjs +8 -8
- package/dist/signers/index.js +7 -7
- package/dist/signers/non-custodial/index.cjs +7 -7
- package/dist/signers/non-custodial/index.js +6 -6
- 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/utils/constants.cjs +2 -2
- package/dist/utils/constants.js +1 -1
- package/dist/wallets/__tests__/test-helpers.cjs +10 -8
- package/dist/wallets/__tests__/test-helpers.d.cts +2 -1
- package/dist/wallets/__tests__/test-helpers.d.ts +2 -1
- package/dist/wallets/__tests__/test-helpers.js +9 -7
- package/dist/wallets/evm.cjs +10 -10
- package/dist/wallets/evm.d.cts +20 -0
- package/dist/wallets/evm.d.ts +20 -0
- package/dist/wallets/evm.js +9 -9
- package/dist/wallets/solana.cjs +9 -9
- package/dist/wallets/solana.d.cts +5 -0
- package/dist/wallets/solana.d.ts +5 -0
- package/dist/wallets/solana.js +8 -8
- package/dist/wallets/stellar.cjs +9 -9
- package/dist/wallets/stellar.d.cts +5 -0
- package/dist/wallets/stellar.d.ts +5 -0
- package/dist/wallets/stellar.js +8 -8
- package/dist/wallets/types.d.cts +5 -1
- package/dist/wallets/types.d.ts +5 -1
- package/dist/wallets/wallet-factory.cjs +15 -10
- package/dist/wallets/wallet-factory.d.cts +2 -0
- package/dist/wallets/wallet-factory.d.ts +2 -0
- package/dist/wallets/wallet-factory.js +14 -9
- package/dist/wallets/wallet.cjs +8 -8
- package/dist/wallets/wallet.d.cts +6 -2
- package/dist/wallets/wallet.d.ts +6 -2
- package/dist/wallets/wallet.js +7 -7
- package/package.json +4 -4
|
@@ -4,17 +4,21 @@
|
|
|
4
4
|
var _chunkRBHGZDDXcjs = require('./chunk-RBHGZDDX.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkNXST74TXcjs = require('./chunk-NXST74TX.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkJLW3Q65Gcjs = require('./chunk-JLW3Q65G.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
var _chunkDIM3X4IXcjs = require('./chunk-DIM3X4IX.cjs');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
var _chunkFQV77LH4cjs = require('./chunk-FQV77LH4.cjs');
|
|
18
22
|
|
|
19
23
|
|
|
20
24
|
|
|
@@ -32,53 +36,61 @@ var WalletFactory = class {
|
|
|
32
36
|
getOrCreateWallet(args) {
|
|
33
37
|
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
34
38
|
if (this.apiClient.isServerSide) {
|
|
35
|
-
|
|
39
|
+
_chunkFQV77LH4cjs.walletsLogger.error("walletFactory.getOrCreateWallet.error", {
|
|
36
40
|
error: "getOrCreateWallet can only be called from client-side code"
|
|
37
41
|
});
|
|
38
42
|
throw new (0, _chunkXC2V34TScjs.WalletCreationError)(
|
|
39
43
|
"getOrCreateWallet can only be called from client-side code.\n- Make sure you're running this in the browser (or another client environment), not on your server.\n- Use your Crossmint Client API Key (not a server key)."
|
|
40
44
|
);
|
|
41
45
|
}
|
|
46
|
+
this.validateChainEnvironment(args.chain);
|
|
42
47
|
const locator = this.getWalletLocator(args);
|
|
43
|
-
|
|
48
|
+
_chunkFQV77LH4cjs.walletsLogger.info("walletFactory.getOrCreateWallet.start");
|
|
44
49
|
const existingWallet = yield this.apiClient.getWallet(locator);
|
|
45
50
|
if (existingWallet != null && !("error" in existingWallet)) {
|
|
46
|
-
|
|
51
|
+
_chunkFQV77LH4cjs.walletsLogger.info("walletFactory.getOrCreateWallet.existing", {
|
|
47
52
|
address: existingWallet.address
|
|
48
53
|
});
|
|
49
54
|
return this.createWalletInstance(existingWallet, args);
|
|
50
55
|
}
|
|
51
|
-
|
|
52
|
-
return this.
|
|
56
|
+
_chunkFQV77LH4cjs.walletsLogger.info("walletFactory.getOrCreateWallet.creating");
|
|
57
|
+
return this.createWalletInternal(args);
|
|
53
58
|
});
|
|
54
59
|
}
|
|
55
60
|
getWallet(walletLocator, args) {
|
|
56
61
|
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
57
62
|
if (!this.apiClient.isServerSide) {
|
|
58
|
-
|
|
63
|
+
_chunkFQV77LH4cjs.walletsLogger.error("walletFactory.getWallet.error", {
|
|
59
64
|
error: "getWallet is not supported on client side"
|
|
60
65
|
});
|
|
61
66
|
throw new (0, _chunkXC2V34TScjs.WalletCreationError)("getWallet is not supported on client side, use getOrCreateWallet instead");
|
|
62
67
|
}
|
|
63
|
-
|
|
68
|
+
this.validateChainEnvironment(args.chain);
|
|
69
|
+
_chunkFQV77LH4cjs.walletsLogger.info("walletFactory.getWallet.start");
|
|
64
70
|
const existingWallet = yield this.apiClient.getWallet(walletLocator);
|
|
65
71
|
if ("error" in existingWallet) {
|
|
66
|
-
|
|
72
|
+
_chunkFQV77LH4cjs.walletsLogger.warn("walletFactory.getWallet.notFound", {
|
|
67
73
|
error: existingWallet.error
|
|
68
74
|
});
|
|
69
75
|
throw new (0, _chunkXC2V34TScjs.WalletNotAvailableError)(JSON.stringify(existingWallet));
|
|
70
76
|
}
|
|
71
|
-
|
|
77
|
+
_chunkFQV77LH4cjs.walletsLogger.info("walletFactory.getWallet.success", {
|
|
72
78
|
address: existingWallet.address
|
|
73
79
|
});
|
|
74
80
|
return this.createWalletInstance(existingWallet, args);
|
|
75
81
|
});
|
|
76
82
|
}
|
|
77
83
|
createWallet(args) {
|
|
84
|
+
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
85
|
+
this.validateChainEnvironment(args.chain);
|
|
86
|
+
return this.createWalletInternal(args);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
createWalletInternal(args) {
|
|
78
90
|
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
79
91
|
var _a, _b, _c, _d, _e;
|
|
80
92
|
yield (_c = (_b = (_a = args.options) == null ? void 0 : _a.experimental_callbacks) == null ? void 0 : _b.onWalletCreationStart) == null ? void 0 : _c.call(_b);
|
|
81
|
-
|
|
93
|
+
_chunkFQV77LH4cjs.walletsLogger.info("walletFactory.createWallet.start");
|
|
82
94
|
this.mutateSignerFromCustomAuth(args, true);
|
|
83
95
|
const adminSigner = args.signer.type === "passkey" ? yield this.createPasskeyAdminSigner(args.signer) : args.signer;
|
|
84
96
|
const walletResponse = yield this.apiClient.createWallet({
|
|
@@ -91,12 +103,12 @@ var WalletFactory = class {
|
|
|
91
103
|
alias: (_e = args.alias) != null ? _e : void 0
|
|
92
104
|
});
|
|
93
105
|
if ("error" in walletResponse) {
|
|
94
|
-
|
|
106
|
+
_chunkFQV77LH4cjs.walletsLogger.error("walletFactory.createWallet.error", {
|
|
95
107
|
error: walletResponse.error
|
|
96
108
|
});
|
|
97
109
|
throw new (0, _chunkXC2V34TScjs.WalletCreationError)(JSON.stringify(walletResponse));
|
|
98
110
|
}
|
|
99
|
-
|
|
111
|
+
_chunkFQV77LH4cjs.walletsLogger.info("walletFactory.createWallet.success", {
|
|
100
112
|
address: walletResponse.address
|
|
101
113
|
});
|
|
102
114
|
return this.createWalletInstance(walletResponse, args);
|
|
@@ -105,12 +117,12 @@ var WalletFactory = class {
|
|
|
105
117
|
createWalletInstance(walletResponse, args) {
|
|
106
118
|
this.validateExistingWalletConfig(walletResponse, args);
|
|
107
119
|
const signerConfig = this.toInternalSignerConfig(walletResponse, args.signer, args.options);
|
|
108
|
-
return new (0,
|
|
120
|
+
return new (0, _chunkNXST74TXcjs.Wallet)(
|
|
109
121
|
{
|
|
110
122
|
chain: args.chain,
|
|
111
123
|
address: walletResponse.address,
|
|
112
124
|
owner: walletResponse.owner,
|
|
113
|
-
signer:
|
|
125
|
+
signer: _chunkJLW3Q65Gcjs.assembleSigner.call(void 0, args.chain, signerConfig),
|
|
114
126
|
options: args.options,
|
|
115
127
|
alias: args.alias
|
|
116
128
|
},
|
|
@@ -286,10 +298,32 @@ var WalletFactory = class {
|
|
|
286
298
|
}
|
|
287
299
|
return "evm";
|
|
288
300
|
}
|
|
301
|
+
validateChainEnvironment(chain) {
|
|
302
|
+
if (chain === "solana" || chain === "stellar") {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
const evmChain = chain;
|
|
306
|
+
const environment = this.apiClient.environment;
|
|
307
|
+
const isProduction = environment === _commonsdkbase.APIKeyEnvironmentPrefix.PRODUCTION;
|
|
308
|
+
if (isProduction && _chunkDIM3X4IXcjs.isTestnetChain.call(void 0, evmChain)) {
|
|
309
|
+
_chunkFQV77LH4cjs.walletsLogger.warn("walletFactory.validateChainEnvironment.mismatch", {
|
|
310
|
+
chain,
|
|
311
|
+
environment,
|
|
312
|
+
message: `Chain "${chain}" is a testnet chain and should not be used in production environment. Please use a mainnet chain instead.`
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
if (!isProduction && _chunkDIM3X4IXcjs.isMainnetChain.call(void 0, evmChain)) {
|
|
316
|
+
_chunkFQV77LH4cjs.walletsLogger.warn("walletFactory.validateChainEnvironment.mismatch", {
|
|
317
|
+
chain,
|
|
318
|
+
environment,
|
|
319
|
+
message: `Chain "${chain}" is a mainnet chain and should not be used in ${environment} environment. Please use a testnet chain instead.`
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
}
|
|
289
323
|
};
|
|
290
324
|
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
291
325
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
292
|
-
logger:
|
|
326
|
+
logger: _chunkFQV77LH4cjs.walletsLogger,
|
|
293
327
|
methodName: "walletFactory.getOrCreateWallet",
|
|
294
328
|
buildContext(_thisArg, args) {
|
|
295
329
|
const walletArgs = args[0];
|
|
@@ -299,7 +333,7 @@ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
|
299
333
|
], WalletFactory.prototype, "getOrCreateWallet", 1);
|
|
300
334
|
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
301
335
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
302
|
-
logger:
|
|
336
|
+
logger: _chunkFQV77LH4cjs.walletsLogger,
|
|
303
337
|
methodName: "walletFactory.getWallet",
|
|
304
338
|
buildContext(_thisArg, args) {
|
|
305
339
|
const walletLocator = args[0];
|
|
@@ -310,7 +344,7 @@ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
|
310
344
|
], WalletFactory.prototype, "getWallet", 1);
|
|
311
345
|
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
312
346
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
313
|
-
logger:
|
|
347
|
+
logger: _chunkFQV77LH4cjs.walletsLogger,
|
|
314
348
|
methodName: "walletFactory.createWallet",
|
|
315
349
|
buildContext(_thisArg, args) {
|
|
316
350
|
const walletArgs = args[0];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StellarNonCustodialSigner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N65K6TUY.js";
|
|
4
4
|
import {
|
|
5
5
|
EVMNonCustodialSigner
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YF4DYTBM.js";
|
|
7
7
|
import {
|
|
8
8
|
SolanaNonCustodialSigner
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7EZZGCYI.js";
|
|
10
10
|
import {
|
|
11
11
|
EVMApiKeySigner
|
|
12
12
|
} from "./chunk-7GOUUPS4.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk5CBGJLA4cjs = require('./chunk-5CBGJLA4.cjs');
|
|
5
5
|
|
|
6
6
|
// src/logger/init.ts
|
|
7
7
|
|
|
@@ -20,8 +20,8 @@ function initWalletsLogger(apiKey) {
|
|
|
20
20
|
}
|
|
21
21
|
const { environment, projectId } = validationResult;
|
|
22
22
|
walletsLogger.init({
|
|
23
|
-
packageName:
|
|
24
|
-
packageVersion:
|
|
23
|
+
packageName: _chunk5CBGJLA4cjs.SDK_NAME,
|
|
24
|
+
packageVersion: _chunk5CBGJLA4cjs.SDK_VERSION,
|
|
25
25
|
environment,
|
|
26
26
|
projectId,
|
|
27
27
|
platform
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYFOUZXSMcjs = require('./chunk-YFOUZXSM.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkVNPL3HFNcjs = require('./chunk-VNPL3HFN.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkVWENCGQOcjs = require('./chunk-VWENCGQO.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkJSWTGW46cjs = require('./chunk-JSWTGW46.cjs');
|
|
@@ -32,12 +32,12 @@ function assembleSigner(chain, config) {
|
|
|
32
32
|
case "email":
|
|
33
33
|
case "phone":
|
|
34
34
|
if (chain === "solana") {
|
|
35
|
-
return new (0,
|
|
35
|
+
return new (0, _chunkVWENCGQOcjs.SolanaNonCustodialSigner)(config);
|
|
36
36
|
}
|
|
37
37
|
if (chain === "stellar") {
|
|
38
|
-
return new (0,
|
|
38
|
+
return new (0, _chunkYFOUZXSMcjs.StellarNonCustodialSigner)(config);
|
|
39
39
|
}
|
|
40
|
-
return new (0,
|
|
40
|
+
return new (0, _chunkVNPL3HFNcjs.EVMNonCustodialSigner)(config);
|
|
41
41
|
case "api-key":
|
|
42
42
|
return chain === "solana" ? new (0, _chunkXOCC3MPKcjs.SolanaApiKeySigner)(config) : new (0, _chunkJSWTGW46cjs.EVMApiKeySigner)(config);
|
|
43
43
|
case "external-wallet":
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNXST74TXcjs = require('./chunk-NXST74TX.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkFQV77LH4cjs = require('./chunk-FQV77LH4.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
|
14
14
|
|
|
15
15
|
// src/wallets/stellar.ts
|
|
16
16
|
var _commonsdkbase = require('@crossmint/common-sdk-base');
|
|
17
|
-
var _StellarWallet = class _StellarWallet extends
|
|
17
|
+
var _StellarWallet = class _StellarWallet extends _chunkNXST74TXcjs.Wallet {
|
|
18
18
|
constructor(wallet) {
|
|
19
19
|
super(
|
|
20
20
|
{
|
|
@@ -22,10 +22,10 @@ var _StellarWallet = class _StellarWallet extends _chunkPADJ2CIVcjs.Wallet {
|
|
|
22
22
|
address: wallet.address,
|
|
23
23
|
owner: wallet.owner,
|
|
24
24
|
signer: wallet.signer,
|
|
25
|
-
options:
|
|
25
|
+
options: _chunkNXST74TXcjs.Wallet.getOptions(wallet),
|
|
26
26
|
alias: wallet.alias
|
|
27
27
|
},
|
|
28
|
-
|
|
28
|
+
_chunkNXST74TXcjs.Wallet.getApiClient(wallet)
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
static from(wallet) {
|
|
@@ -37,11 +37,11 @@ var _StellarWallet = class _StellarWallet extends _chunkPADJ2CIVcjs.Wallet {
|
|
|
37
37
|
sendTransaction(params) {
|
|
38
38
|
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
39
39
|
var _a;
|
|
40
|
-
|
|
40
|
+
_chunkFQV77LH4cjs.walletsLogger.info("stellarWallet.sendTransaction.start");
|
|
41
41
|
yield this.preAuthIfNeeded();
|
|
42
42
|
const createdTransaction = yield this.createTransaction(params);
|
|
43
43
|
if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
|
|
44
|
-
|
|
44
|
+
_chunkFQV77LH4cjs.walletsLogger.info("stellarWallet.sendTransaction.prepared", {
|
|
45
45
|
transactionId: createdTransaction.id
|
|
46
46
|
});
|
|
47
47
|
return {
|
|
@@ -52,7 +52,7 @@ var _StellarWallet = class _StellarWallet extends _chunkPADJ2CIVcjs.Wallet {
|
|
|
52
52
|
}
|
|
53
53
|
const options = {};
|
|
54
54
|
const result = yield this.approveTransactionAndWait(createdTransaction.id, options);
|
|
55
|
-
|
|
55
|
+
_chunkFQV77LH4cjs.walletsLogger.info("stellarWallet.sendTransaction.success", {
|
|
56
56
|
transactionId: createdTransaction.id,
|
|
57
57
|
hash: result.hash
|
|
58
58
|
});
|
|
@@ -96,7 +96,7 @@ var _StellarWallet = class _StellarWallet extends _chunkPADJ2CIVcjs.Wallet {
|
|
|
96
96
|
};
|
|
97
97
|
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
98
98
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
99
|
-
logger:
|
|
99
|
+
logger: _chunkFQV77LH4cjs.walletsLogger,
|
|
100
100
|
methodName: "stellarWallet.sendTransaction",
|
|
101
101
|
buildContext(thisArg) {
|
|
102
102
|
return { chain: thisArg.chain, address: thisArg.address };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Wallet
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XEZBA7I2.js";
|
|
4
4
|
import {
|
|
5
5
|
TransactionNotCreatedError
|
|
6
6
|
} from "./chunk-SGINWAB6.js";
|
|
7
7
|
import {
|
|
8
8
|
walletsLogger
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-S2AKC2CK.js";
|
|
10
10
|
import {
|
|
11
11
|
__async,
|
|
12
12
|
__decorateClass
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_EVENT_OPTIONS,
|
|
3
3
|
NonCustodialSigner
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-W3OYA42M.js";
|
|
5
|
+
import {
|
|
6
|
+
walletsLogger
|
|
7
|
+
} from "./chunk-S2AKC2CK.js";
|
|
5
8
|
import {
|
|
6
9
|
__async
|
|
7
10
|
} from "./chunk-ASE2FXWP.js";
|
|
@@ -21,6 +24,8 @@ var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends NonCust
|
|
|
21
24
|
var _a;
|
|
22
25
|
yield this.handleAuthRequired();
|
|
23
26
|
const jwt = this.getJwtOrThrow();
|
|
27
|
+
walletsLogger.info("sign: sending request", { keyType: "ed25519" });
|
|
28
|
+
const startTime = Date.now();
|
|
24
29
|
const res = yield (_a = this.config.clientTEEConnection) == null ? void 0 : _a.sendAction({
|
|
25
30
|
event: "request:sign",
|
|
26
31
|
responseEvent: "response:sign",
|
|
@@ -37,6 +42,10 @@ var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends NonCust
|
|
|
37
42
|
},
|
|
38
43
|
options: DEFAULT_EVENT_OPTIONS
|
|
39
44
|
});
|
|
45
|
+
walletsLogger.info("sign: response received", {
|
|
46
|
+
status: res == null ? void 0 : res.status,
|
|
47
|
+
durationMs: Date.now() - startTime
|
|
48
|
+
});
|
|
40
49
|
if ((res == null ? void 0 : res.status) === "error") {
|
|
41
50
|
throw new Error(res.error);
|
|
42
51
|
}
|