@crossmint/wallets-sdk 0.18.13 → 0.18.14
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 -4
- package/dist/api/client.js +3 -3
- package/dist/api/index.cjs +4 -4
- package/dist/api/index.js +3 -3
- package/dist/{chunk-MNJA5EPY.cjs → chunk-2RVPHSR5.cjs} +3 -3
- package/dist/{chunk-JZLD56DI.js → chunk-3PI54IUS.js} +2 -2
- package/dist/{chunk-NHOA33JP.js → chunk-5CTWIW7X.js} +3 -3
- package/dist/{chunk-WFGKVGZ2.cjs → chunk-5TYDRD6D.cjs} +3 -3
- package/dist/{chunk-JX4TJWJW.cjs → chunk-5WJE5X7V.cjs} +21 -21
- package/dist/{chunk-LCE4ULCI.js → chunk-AAESOWQL.js} +2 -2
- package/dist/{chunk-OKQ5QPXT.cjs → chunk-ADCODBBF.cjs} +1 -1
- package/dist/{chunk-JISEH6WV.js → chunk-B24CPC6Y.js} +1 -1
- package/dist/{chunk-HJSOHFJU.cjs → chunk-BEJB6ZUK.cjs} +7 -7
- package/dist/{chunk-Y65TSCBL.js → chunk-CEFMURL3.js} +2 -2
- package/dist/{chunk-AJYIGJX4.cjs → chunk-FUMQWMQR.cjs} +9 -9
- package/dist/{chunk-6Z5QSTIS.cjs → chunk-FV4PV7HU.cjs} +6 -6
- package/dist/{chunk-AN7MHABM.cjs → chunk-G7TC2YMQ.cjs} +3 -3
- package/dist/{chunk-SYZKDDGK.js → chunk-KIS2P5DM.js} +1 -1
- package/dist/{chunk-RCK3ZEP7.js → chunk-LKAE7D7W.js} +18 -2
- package/dist/{chunk-JVQJG2ZF.cjs → chunk-OPKBL6A2.cjs} +19 -19
- package/dist/{chunk-I4CWGAHI.js → chunk-PCZDMOJH.js} +2 -2
- package/dist/{chunk-67UIXCUO.cjs → chunk-PST7R25G.cjs} +40 -40
- package/dist/{chunk-QQYGLANV.cjs → chunk-PUXRHELK.cjs} +12 -12
- package/dist/{chunk-VURM6PSV.cjs → chunk-SB5FTFPM.cjs} +9 -9
- package/dist/{chunk-SOCAHGD5.js → chunk-SEGDDAL2.js} +1 -1
- package/dist/{chunk-TEQYWMHS.cjs → chunk-SGKMU5NX.cjs} +16 -0
- package/dist/{chunk-TGD5JBGG.cjs → chunk-SWPJZ5JX.cjs} +3 -3
- package/dist/{chunk-DWFSHFFE.js → chunk-THLRRDVV.js} +3 -3
- package/dist/{chunk-UPS2UQJO.js → chunk-UWKMOJ4D.js} +1 -1
- package/dist/{chunk-UZN67GMO.js → chunk-VJ2ZKU3R.js} +3 -3
- package/dist/{chunk-3RSZDA3X.js → chunk-ZJZO6LQ3.js} +1 -1
- package/dist/{chunk-L43QEK3D.js → chunk-ZQACPBUW.js} +3 -3
- package/dist/index.cjs +15 -15
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -14
- 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 +12 -12
- package/dist/sdk.js +11 -11
- package/dist/signers/index.cjs +9 -6
- package/dist/signers/index.js +8 -5
- package/dist/signers/non-custodial/index.cjs +8 -5
- package/dist/signers/non-custodial/index.js +7 -4
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +6 -3
- package/dist/signers/non-custodial/ncs-evm-signer.js +5 -2
- package/dist/signers/non-custodial/ncs-signer.cjs +5 -2
- package/dist/signers/non-custodial/ncs-signer.js +4 -1
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +6 -3
- package/dist/signers/non-custodial/ncs-solana-signer.js +5 -2
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +6 -3
- package/dist/signers/non-custodial/ncs-stellar-signer.js +5 -2
- package/dist/utils/constants.cjs +2 -2
- package/dist/utils/constants.js +1 -1
- package/dist/wallets/__tests__/test-helpers.cjs +8 -8
- package/dist/wallets/__tests__/test-helpers.js +7 -7
- package/dist/wallets/evm.cjs +9 -9
- package/dist/wallets/evm.js +8 -8
- package/dist/wallets/solana.cjs +9 -9
- package/dist/wallets/solana.js +8 -8
- package/dist/wallets/stellar.cjs +9 -9
- package/dist/wallets/stellar.js +8 -8
- package/dist/wallets/wallet-factory.cjs +10 -10
- package/dist/wallets/wallet-factory.js +9 -9
- package/dist/wallets/wallet.cjs +8 -8
- package/dist/wallets/wallet.js +7 -7
- package/package.json +1 -1
package/dist/api/client.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkPUXRHELKcjs = require('../chunk-PUXRHELK.cjs');
|
|
4
4
|
require('../chunk-XC2V34TS.cjs');
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
5
|
+
require('../chunk-SWPJZ5JX.cjs');
|
|
6
|
+
require('../chunk-ADCODBBF.cjs');
|
|
7
7
|
require('../chunk-UO2J2ZB2.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.ApiClient =
|
|
10
|
+
exports.ApiClient = _chunkPUXRHELKcjs.ApiClient;
|
package/dist/api/client.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ApiClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-CEFMURL3.js";
|
|
4
4
|
import "../chunk-SGINWAB6.js";
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-B24CPC6Y.js";
|
|
6
|
+
import "../chunk-SEGDDAL2.js";
|
|
7
7
|
import "../chunk-ASE2FXWP.js";
|
|
8
8
|
export {
|
|
9
9
|
ApiClient
|
package/dist/api/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-6HXIZLEQ.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkPUXRHELKcjs = require('../chunk-PUXRHELK.cjs');
|
|
5
5
|
require('../chunk-XC2V34TS.cjs');
|
|
6
6
|
require('../chunk-ECAM5KTH.cjs');
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-SWPJZ5JX.cjs');
|
|
8
|
+
require('../chunk-ADCODBBF.cjs');
|
|
9
9
|
require('../chunk-UO2J2ZB2.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.ApiClient =
|
|
12
|
+
exports.ApiClient = _chunkPUXRHELKcjs.ApiClient;
|
package/dist/api/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "../chunk-5IFDVB4Y.js";
|
|
2
2
|
import {
|
|
3
3
|
ApiClient
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-CEFMURL3.js";
|
|
5
5
|
import "../chunk-SGINWAB6.js";
|
|
6
6
|
import "../chunk-KBJA7JDT.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-B24CPC6Y.js";
|
|
8
|
+
import "../chunk-SEGDDAL2.js";
|
|
9
9
|
import "../chunk-ASE2FXWP.js";
|
|
10
10
|
export {
|
|
11
11
|
ApiClient
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkSGKMU5NXcjs = require('./chunk-SGKMU5NX.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
8
8
|
|
|
9
9
|
// src/signers/non-custodial/ncs-stellar-signer.ts
|
|
10
|
-
var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends
|
|
10
|
+
var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends _chunkSGKMU5NXcjs.NonCustodialSigner {
|
|
11
11
|
constructor(config) {
|
|
12
12
|
super(config);
|
|
13
13
|
}
|
|
@@ -35,7 +35,7 @@ var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends _chunkT
|
|
|
35
35
|
encoding: "base64"
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
options:
|
|
38
|
+
options: _chunkSGKMU5NXcjs.DEFAULT_EVENT_OPTIONS
|
|
39
39
|
});
|
|
40
40
|
if ((res == null ? void 0 : res.status) === "error") {
|
|
41
41
|
throw new Error(res.error);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Wallet
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZQACPBUW.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-B24CPC6Y.js";
|
|
10
10
|
import {
|
|
11
11
|
__async,
|
|
12
12
|
__decorateClass
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WalletFactory
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-THLRRDVV.js";
|
|
4
4
|
import {
|
|
5
5
|
ApiClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CEFMURL3.js";
|
|
7
7
|
import {
|
|
8
8
|
initWalletsLogger,
|
|
9
9
|
walletsLogger
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-B24CPC6Y.js";
|
|
11
11
|
import {
|
|
12
12
|
__async
|
|
13
13
|
} from "./chunk-ASE2FXWP.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkSGKMU5NXcjs = require('./chunk-SGKMU5NX.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
@@ -9,7 +9,7 @@ var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.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 _chunkSGKMU5NXcjs.NonCustodialSigner {
|
|
13
13
|
constructor(config) {
|
|
14
14
|
super(config);
|
|
15
15
|
}
|
|
@@ -45,7 +45,7 @@ var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends _chunkTEQYWMHSc
|
|
|
45
45
|
encoding: "hex"
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
options:
|
|
48
|
+
options: _chunkSGKMU5NXcjs.DEFAULT_EVENT_OPTIONS
|
|
49
49
|
});
|
|
50
50
|
if ((res == null ? void 0 : res.status) === "error") {
|
|
51
51
|
throw new Error(res.error);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkPST7R25Gcjs = require('./chunk-PST7R25G.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
|
|
|
11
11
|
var _chunkGROJZ247cjs = require('./chunk-GROJZ247.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkSWPJZ5JXcjs = require('./chunk-SWPJZ5JX.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -20,7 +20,7 @@ var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
|
20
20
|
// src/wallets/evm.ts
|
|
21
21
|
var _viem = require('viem');
|
|
22
22
|
var _commonsdkbase = require('@crossmint/common-sdk-base');
|
|
23
|
-
var _EVMWallet = class _EVMWallet extends
|
|
23
|
+
var _EVMWallet = class _EVMWallet extends _chunkPST7R25Gcjs.Wallet {
|
|
24
24
|
constructor(wallet) {
|
|
25
25
|
super(
|
|
26
26
|
{
|
|
@@ -28,10 +28,10 @@ var _EVMWallet = class _EVMWallet extends _chunk67UIXCUOcjs.Wallet {
|
|
|
28
28
|
address: wallet.address,
|
|
29
29
|
owner: wallet.owner,
|
|
30
30
|
signer: wallet.signer,
|
|
31
|
-
options:
|
|
31
|
+
options: _chunkPST7R25Gcjs.Wallet.getOptions(wallet),
|
|
32
32
|
alias: wallet.alias
|
|
33
33
|
},
|
|
34
|
-
|
|
34
|
+
_chunkPST7R25Gcjs.Wallet.getApiClient(wallet)
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
static from(wallet) {
|
|
@@ -43,12 +43,12 @@ var _EVMWallet = class _EVMWallet extends _chunk67UIXCUOcjs.Wallet {
|
|
|
43
43
|
sendTransaction(params) {
|
|
44
44
|
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
45
45
|
var _a;
|
|
46
|
-
|
|
46
|
+
_chunkSWPJZ5JXcjs.walletsLogger.info("evmWallet.sendTransaction.start");
|
|
47
47
|
yield this.preAuthIfNeeded();
|
|
48
48
|
const builtTransaction = this.buildTransaction(params);
|
|
49
49
|
const createdTransaction = yield this.createTransaction(builtTransaction, params.options);
|
|
50
50
|
if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
|
|
51
|
-
|
|
51
|
+
_chunkSWPJZ5JXcjs.walletsLogger.info("evmWallet.sendTransaction.prepared", {
|
|
52
52
|
transactionId: createdTransaction.id
|
|
53
53
|
});
|
|
54
54
|
return {
|
|
@@ -58,7 +58,7 @@ var _EVMWallet = class _EVMWallet extends _chunk67UIXCUOcjs.Wallet {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
const result = yield this.approveTransactionAndWait(createdTransaction.id);
|
|
61
|
-
|
|
61
|
+
_chunkSWPJZ5JXcjs.walletsLogger.info("evmWallet.sendTransaction.success", {
|
|
62
62
|
transactionId: createdTransaction.id,
|
|
63
63
|
hash: result.hash
|
|
64
64
|
});
|
|
@@ -68,7 +68,7 @@ var _EVMWallet = class _EVMWallet extends _chunk67UIXCUOcjs.Wallet {
|
|
|
68
68
|
signMessage(params) {
|
|
69
69
|
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
70
70
|
var _a;
|
|
71
|
-
|
|
71
|
+
_chunkSWPJZ5JXcjs.walletsLogger.info("evmWallet.signMessage.start");
|
|
72
72
|
yield this.preAuthIfNeeded();
|
|
73
73
|
const signatureCreationResponse = yield this.apiClient.createSignature(this.walletLocator, {
|
|
74
74
|
type: "message",
|
|
@@ -79,11 +79,11 @@ var _EVMWallet = class _EVMWallet extends _chunk67UIXCUOcjs.Wallet {
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
if ("error" in signatureCreationResponse) {
|
|
82
|
-
|
|
82
|
+
_chunkSWPJZ5JXcjs.walletsLogger.error("evmWallet.signMessage.error", { error: signatureCreationResponse });
|
|
83
83
|
throw new (0, _chunkXC2V34TScjs.SignatureNotCreatedError)(JSON.stringify(signatureCreationResponse));
|
|
84
84
|
}
|
|
85
85
|
if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
|
|
86
|
-
|
|
86
|
+
_chunkSWPJZ5JXcjs.walletsLogger.info("evmWallet.signMessage.prepared", {
|
|
87
87
|
signatureId: signatureCreationResponse.id
|
|
88
88
|
});
|
|
89
89
|
return {
|
|
@@ -92,23 +92,23 @@ var _EVMWallet = class _EVMWallet extends _chunk67UIXCUOcjs.Wallet {
|
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
|
|
95
|
-
|
|
95
|
+
_chunkSWPJZ5JXcjs.walletsLogger.info("evmWallet.signMessage.success", { signatureId: signatureCreationResponse.id });
|
|
96
96
|
return result;
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
signTypedData(params) {
|
|
100
100
|
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
101
101
|
var _a;
|
|
102
|
-
|
|
102
|
+
_chunkSWPJZ5JXcjs.walletsLogger.info("evmWallet.signTypedData.start");
|
|
103
103
|
yield this.preAuthIfNeeded();
|
|
104
104
|
const { domain, message, primaryType, types, chain } = params;
|
|
105
105
|
if (!domain || !message || !types || !chain) {
|
|
106
|
-
|
|
106
|
+
_chunkSWPJZ5JXcjs.walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data" });
|
|
107
107
|
throw new (0, _chunkXC2V34TScjs.InvalidTypedDataError)("Invalid typed data");
|
|
108
108
|
}
|
|
109
109
|
const { name, version, chainId, verifyingContract, salt } = domain;
|
|
110
110
|
if (!name || !version || !chainId || !verifyingContract) {
|
|
111
|
-
|
|
111
|
+
_chunkSWPJZ5JXcjs.walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data domain" });
|
|
112
112
|
throw new (0, _chunkXC2V34TScjs.InvalidTypedDataError)("Invalid typed data domain");
|
|
113
113
|
}
|
|
114
114
|
const signatureCreationResponse = yield this.apiClient.createSignature(this.walletLocator, {
|
|
@@ -131,11 +131,11 @@ var _EVMWallet = class _EVMWallet extends _chunk67UIXCUOcjs.Wallet {
|
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
if ("error" in signatureCreationResponse) {
|
|
134
|
-
|
|
134
|
+
_chunkSWPJZ5JXcjs.walletsLogger.error("evmWallet.signTypedData.error", { error: signatureCreationResponse });
|
|
135
135
|
throw new (0, _chunkXC2V34TScjs.SignatureNotCreatedError)(JSON.stringify(signatureCreationResponse));
|
|
136
136
|
}
|
|
137
137
|
if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
|
|
138
|
-
|
|
138
|
+
_chunkSWPJZ5JXcjs.walletsLogger.info("evmWallet.signTypedData.prepared", {
|
|
139
139
|
signatureId: signatureCreationResponse.id
|
|
140
140
|
});
|
|
141
141
|
return {
|
|
@@ -144,7 +144,7 @@ var _EVMWallet = class _EVMWallet extends _chunk67UIXCUOcjs.Wallet {
|
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
146
|
const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
|
|
147
|
-
|
|
147
|
+
_chunkSWPJZ5JXcjs.walletsLogger.info("evmWallet.signTypedData.success", { signatureId: signatureCreationResponse.id });
|
|
148
148
|
return result;
|
|
149
149
|
});
|
|
150
150
|
}
|
|
@@ -200,7 +200,7 @@ var _EVMWallet = class _EVMWallet extends _chunk67UIXCUOcjs.Wallet {
|
|
|
200
200
|
};
|
|
201
201
|
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
202
202
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
203
|
-
logger:
|
|
203
|
+
logger: _chunkSWPJZ5JXcjs.walletsLogger,
|
|
204
204
|
methodName: "evmWallet.sendTransaction",
|
|
205
205
|
buildContext(thisArg) {
|
|
206
206
|
return { chain: thisArg.chain, address: thisArg.address };
|
|
@@ -209,7 +209,7 @@ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
|
209
209
|
], _EVMWallet.prototype, "sendTransaction", 1);
|
|
210
210
|
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
211
211
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
212
|
-
logger:
|
|
212
|
+
logger: _chunkSWPJZ5JXcjs.walletsLogger,
|
|
213
213
|
methodName: "evmWallet.signMessage",
|
|
214
214
|
buildContext(thisArg) {
|
|
215
215
|
return { chain: thisArg.chain, address: thisArg.address };
|
|
@@ -218,7 +218,7 @@ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
|
218
218
|
], _EVMWallet.prototype, "signMessage", 1);
|
|
219
219
|
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
220
220
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
221
|
-
logger:
|
|
221
|
+
logger: _chunkSWPJZ5JXcjs.walletsLogger,
|
|
222
222
|
methodName: "evmWallet.signTypedData",
|
|
223
223
|
buildContext(thisArg) {
|
|
224
224
|
return { chain: thisArg.chain, address: thisArg.address };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Wallet
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZQACPBUW.js";
|
|
4
4
|
import {
|
|
5
5
|
InvalidTypedDataError,
|
|
6
6
|
SignatureNotCreatedError,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-NJTKHWXR.js";
|
|
12
12
|
import {
|
|
13
13
|
walletsLogger
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-B24CPC6Y.js";
|
|
15
15
|
import {
|
|
16
16
|
__async,
|
|
17
17
|
__decorateClass
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkOPKBL6A2cjs = require('./chunk-OPKBL6A2.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkPUXRHELKcjs = require('./chunk-PUXRHELK.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkSWPJZ5JXcjs = require('./chunk-SWPJZ5JX.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
|
+
_chunkSWPJZ5JXcjs.initWalletsLogger.call(void 0, crossmint.apiKey);
|
|
20
|
+
const apiClient = new (0, _chunkPUXRHELKcjs.ApiClient)(crossmint);
|
|
21
|
+
this.walletFactory = new (0, _chunkOPKBL6A2cjs.WalletFactory)(apiClient);
|
|
22
|
+
_chunkSWPJZ5JXcjs.walletsLogger.info("wallets.sdk.initialized");
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Initialize the Wallets SDK
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-SGINWAB6.js";
|
|
4
4
|
import {
|
|
5
5
|
walletsLogger
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-B24CPC6Y.js";
|
|
7
7
|
import {
|
|
8
8
|
SDK_NAME,
|
|
9
9
|
SDK_VERSION
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SEGDDAL2.js";
|
|
11
11
|
import {
|
|
12
12
|
__async
|
|
13
13
|
} from "./chunk-ASE2FXWP.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkPST7R25Gcjs = require('./chunk-PST7R25G.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkSWPJZ5JXcjs = require('./chunk-SWPJZ5JX.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 _chunkPST7R25Gcjs.Wallet {
|
|
18
18
|
constructor(wallet) {
|
|
19
19
|
super(
|
|
20
20
|
{
|
|
@@ -22,10 +22,10 @@ var _StellarWallet = class _StellarWallet extends _chunk67UIXCUOcjs.Wallet {
|
|
|
22
22
|
address: wallet.address,
|
|
23
23
|
owner: wallet.owner,
|
|
24
24
|
signer: wallet.signer,
|
|
25
|
-
options:
|
|
25
|
+
options: _chunkPST7R25Gcjs.Wallet.getOptions(wallet),
|
|
26
26
|
alias: wallet.alias
|
|
27
27
|
},
|
|
28
|
-
|
|
28
|
+
_chunkPST7R25Gcjs.Wallet.getApiClient(wallet)
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
static from(wallet) {
|
|
@@ -37,11 +37,11 @@ var _StellarWallet = class _StellarWallet extends _chunk67UIXCUOcjs.Wallet {
|
|
|
37
37
|
sendTransaction(params) {
|
|
38
38
|
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
39
39
|
var _a;
|
|
40
|
-
|
|
40
|
+
_chunkSWPJZ5JXcjs.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
|
+
_chunkSWPJZ5JXcjs.walletsLogger.info("stellarWallet.sendTransaction.prepared", {
|
|
45
45
|
transactionId: createdTransaction.id
|
|
46
46
|
});
|
|
47
47
|
return {
|
|
@@ -52,7 +52,7 @@ var _StellarWallet = class _StellarWallet extends _chunk67UIXCUOcjs.Wallet {
|
|
|
52
52
|
}
|
|
53
53
|
const options = {};
|
|
54
54
|
const result = yield this.approveTransactionAndWait(createdTransaction.id, options);
|
|
55
|
-
|
|
55
|
+
_chunkSWPJZ5JXcjs.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 _chunk67UIXCUOcjs.Wallet {
|
|
|
96
96
|
};
|
|
97
97
|
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
98
98
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
99
|
-
logger:
|
|
99
|
+
logger: _chunkSWPJZ5JXcjs.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
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk5TYDRD6Dcjs = require('./chunk-5TYDRD6D.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkG7TC2YMQcjs = require('./chunk-G7TC2YMQ.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk2RVPHSR5cjs = require('./chunk-2RVPHSR5.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, _chunkG7TC2YMQcjs.SolanaNonCustodialSigner)(config);
|
|
36
36
|
}
|
|
37
37
|
if (chain === "stellar") {
|
|
38
|
-
return new (0,
|
|
38
|
+
return new (0, _chunk2RVPHSR5cjs.StellarNonCustodialSigner)(config);
|
|
39
39
|
}
|
|
40
|
-
return new (0,
|
|
40
|
+
return new (0, _chunk5TYDRD6Dcjs.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,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkSGKMU5NXcjs = require('./chunk-SGKMU5NX.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
@@ -9,7 +9,7 @@ var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
|
9
9
|
// src/signers/non-custodial/ncs-solana-signer.ts
|
|
10
10
|
var _web3js = require('@solana/web3.js');
|
|
11
11
|
var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);
|
|
12
|
-
var SolanaNonCustodialSigner = class _SolanaNonCustodialSigner extends
|
|
12
|
+
var SolanaNonCustodialSigner = class _SolanaNonCustodialSigner extends _chunkSGKMU5NXcjs.NonCustodialSigner {
|
|
13
13
|
constructor(config) {
|
|
14
14
|
super(config);
|
|
15
15
|
}
|
|
@@ -40,7 +40,7 @@ var SolanaNonCustodialSigner = class _SolanaNonCustodialSigner extends _chunkTEQ
|
|
|
40
40
|
encoding: "base58"
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
options:
|
|
43
|
+
options: _chunkSGKMU5NXcjs.DEFAULT_EVENT_OPTIONS
|
|
44
44
|
});
|
|
45
45
|
if ((res == null ? void 0 : res.status) === "error") {
|
|
46
46
|
throw new Error(res.error);
|
|
@@ -5,11 +5,15 @@ import {
|
|
|
5
5
|
AuthRejectedError
|
|
6
6
|
} from "./chunk-WJUPOCKJ.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
8
|
+
walletsLogger
|
|
9
|
+
} from "./chunk-B24CPC6Y.js";
|
|
10
|
+
import {
|
|
11
|
+
__async,
|
|
12
|
+
__decorateClass
|
|
9
13
|
} from "./chunk-ASE2FXWP.js";
|
|
10
14
|
|
|
11
15
|
// src/signers/non-custodial/ncs-signer.ts
|
|
12
|
-
import { validateAPIKey } from "@crossmint/common-sdk-base";
|
|
16
|
+
import { validateAPIKey, WithLoggerContext } from "@crossmint/common-sdk-base";
|
|
13
17
|
var NonCustodialSigner = class {
|
|
14
18
|
constructor(config) {
|
|
15
19
|
this.config = config;
|
|
@@ -104,6 +108,9 @@ var NonCustodialSigner = class {
|
|
|
104
108
|
} else {
|
|
105
109
|
this._needsAuth = true;
|
|
106
110
|
}
|
|
111
|
+
walletsLogger.info("Handling auth required", { signerResponse });
|
|
112
|
+
walletsLogger.info("Needs auth", { needsAuth: this._needsAuth });
|
|
113
|
+
walletsLogger.info("Config onAuthRequired", { onAuthRequired: this.config.onAuthRequired });
|
|
107
114
|
const { promise, resolve, reject } = this.createAuthPromise();
|
|
108
115
|
this._authPromise = { promise, resolve, reject };
|
|
109
116
|
if (this.config.onAuthRequired) {
|
|
@@ -113,6 +120,7 @@ var NonCustodialSigner = class {
|
|
|
113
120
|
() => this.sendMessageWithOtp(),
|
|
114
121
|
(otp) => this.verifyOtp(otp),
|
|
115
122
|
() => __async(this, null, function* () {
|
|
123
|
+
walletsLogger.info("Auth rejected", { authRejected: true });
|
|
116
124
|
this._needsAuth = false;
|
|
117
125
|
if (this.config.onAuthRequired != null) {
|
|
118
126
|
yield this.config.onAuthRequired(
|
|
@@ -129,12 +137,14 @@ var NonCustodialSigner = class {
|
|
|
129
137
|
})
|
|
130
138
|
);
|
|
131
139
|
} catch (error) {
|
|
140
|
+
walletsLogger.error("handleAuthRequired error", { error });
|
|
132
141
|
reject(error);
|
|
133
142
|
}
|
|
134
143
|
}
|
|
135
144
|
try {
|
|
136
145
|
yield promise;
|
|
137
146
|
} catch (error) {
|
|
147
|
+
walletsLogger.error("handleAuthRequired promise error", { error });
|
|
138
148
|
throw error;
|
|
139
149
|
}
|
|
140
150
|
});
|
|
@@ -274,6 +284,12 @@ var NonCustodialSigner = class {
|
|
|
274
284
|
});
|
|
275
285
|
}
|
|
276
286
|
};
|
|
287
|
+
__decorateClass([
|
|
288
|
+
WithLoggerContext({
|
|
289
|
+
logger: walletsLogger,
|
|
290
|
+
methodName: "handleAuthRequired"
|
|
291
|
+
})
|
|
292
|
+
], NonCustodialSigner.prototype, "handleAuthRequired", 1);
|
|
277
293
|
var DEFAULT_EVENT_OPTIONS = {
|
|
278
294
|
timeoutMs: 3e4
|
|
279
295
|
};
|