@crossmint/wallets-sdk 0.20.0 → 0.20.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/types.gen.d.cts +35 -35
- package/dist/api/gen/types.gen.d.ts +35 -35
- package/dist/api/index.cjs +4 -4
- package/dist/api/index.js +3 -3
- package/dist/chains/chains.cjs +6 -5
- package/dist/chains/chains.d.cts +1 -1
- package/dist/chains/chains.d.ts +1 -1
- package/dist/chains/chains.js +5 -4
- package/dist/chains/definitions/tempo.cjs +7 -0
- package/dist/chains/definitions/tempo.d.cts +39 -0
- package/dist/chains/definitions/tempo.d.ts +39 -0
- package/dist/chains/definitions/tempo.js +7 -0
- package/dist/chains/definitions/tempoTestnet.cjs +2 -2
- package/dist/chains/definitions/tempoTestnet.d.cts +1 -5
- package/dist/chains/definitions/tempoTestnet.d.ts +1 -5
- package/dist/chains/definitions/tempoTestnet.js +1 -1
- package/dist/{chunk-KVYY4QDB.cjs → chunk-3ASKCQJN.cjs} +18 -18
- package/dist/{chunk-AZQFMK3I.js → chunk-3G4P2NHM.js} +2 -2
- package/dist/{chunk-GWLAO3PX.js → chunk-3KEY2NLC.js} +1 -1
- package/dist/{chunk-YDFIY5ER.js → chunk-3SYMIYEW.js} +5 -5
- package/dist/{chunk-6LVFMXDR.cjs → chunk-3WF7K4KF.cjs} +23 -23
- package/dist/chunk-7USEVMTW.cjs +21 -0
- package/dist/{chunk-RJY4GT2D.cjs → chunk-AEGU53OM.cjs} +6 -6
- package/dist/{chunk-MUIINXJY.js → chunk-AYE7XUR2.js} +4 -4
- package/dist/{chunk-IAZHXIFV.js → chunk-DENEF27X.js} +3 -3
- package/dist/{chunk-2APY4BUJ.js → chunk-DPZIHSN7.js} +4 -4
- package/dist/{chunk-DF3SZX2E.js → chunk-DZ6MCPD3.js} +1 -1
- package/dist/{chunk-NN2NBBTN.cjs → chunk-F7L2TZ3I.cjs} +1 -5
- package/dist/{chunk-WBTM7E5O.js → chunk-FGGGBNUF.js} +10 -3
- package/dist/{chunk-GEHZRAAJ.cjs → chunk-H3XAAMD3.cjs} +13 -6
- package/dist/{chunk-TQKCX7VN.cjs → chunk-HH3MM7IJ.cjs} +1 -1
- package/dist/{chunk-24DGWV3E.js → chunk-IBV7DELQ.js} +3 -3
- package/dist/{chunk-SAZ76VGQ.js → chunk-J45OIOTF.js} +2 -2
- package/dist/{chunk-AXQLP7Z6.js → chunk-JWMQALLN.js} +1 -5
- package/dist/{chunk-MZBMV54C.js → chunk-KD6N62YZ.js} +2 -2
- package/dist/{chunk-GXEWWYHT.cjs → chunk-KN3AKBVY.cjs} +6 -6
- package/dist/{chunk-XM4Y4HS5.cjs → chunk-LONKAMXJ.cjs} +6 -6
- package/dist/{chunk-2XDIXELO.cjs → chunk-LPR7BODP.cjs} +6 -6
- package/dist/chunk-MMISP35W.js +21 -0
- package/dist/{chunk-ZLPFQ56Q.cjs → chunk-NFV5K2D2.cjs} +12 -12
- package/dist/{chunk-BQN5PNZK.js → chunk-NPTNXK47.js} +1 -1
- package/dist/{chunk-TNASR6QE.cjs → chunk-O42BRSEX.cjs} +9 -9
- package/dist/{chunk-4ID6ZK4A.cjs → chunk-SJSXTTSY.cjs} +44 -44
- package/dist/{chunk-VKXKQ5YI.cjs → chunk-TC6ITDWV.cjs} +3 -3
- package/dist/{chunk-ZKWJY2VO.js → chunk-TPW2OJIB.js} +2 -2
- package/dist/{chunk-7OW5LYR6.js → chunk-TYRXXYHP.js} +2 -2
- package/dist/{chunk-6S7BKBVM.cjs → chunk-XMVAZ7EW.cjs} +7 -7
- package/dist/{chunk-7EXE5FZJ.js → chunk-XTKNO44C.js} +2 -2
- package/dist/{chunk-SEV3UBGK.cjs → chunk-Y35UJFTB.cjs} +23 -23
- package/dist/{chunk-PRNZJUHI.cjs → chunk-ZZLEVK2P.cjs} +9 -9
- package/dist/index.cjs +18 -17
- package/dist/index.js +17 -16
- 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 +15 -14
- package/dist/sdk.js +14 -13
- 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 +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/utils/constants.cjs +2 -2
- package/dist/utils/constants.js +1 -1
- package/dist/wallets/__tests__/test-helpers.cjs +11 -10
- package/dist/wallets/__tests__/test-helpers.js +10 -9
- package/dist/wallets/evm.cjs +12 -11
- package/dist/wallets/evm.js +11 -10
- package/dist/wallets/solana.cjs +12 -11
- package/dist/wallets/solana.js +11 -10
- package/dist/wallets/stellar.cjs +12 -11
- package/dist/wallets/stellar.js +11 -10
- package/dist/wallets/wallet-factory.cjs +13 -12
- package/dist/wallets/wallet-factory.js +12 -11
- package/dist/wallets/wallet.cjs +11 -10
- package/dist/wallets/wallet.js +10 -9
- package/package.json +4 -4
package/dist/chains/chains.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
|
|
|
2
2
|
import { Chain as Chain$1 } from 'viem';
|
|
3
3
|
|
|
4
4
|
declare const TESTNET_AA_CHAINS: readonly ["abstract-testnet", "arbitrum-sepolia", "base-sepolia", "curtis", "ethereum-sepolia", "flow-testnet", "mantle-sepolia", "mode-sepolia", "optimism-sepolia", "plume-testnet", "polygon-amoy", "scroll-sepolia", "sei-atlantic-2-testnet", "story-testnet", "world-chain-sepolia", "zora-sepolia", "arc-testnet", "tempo-testnet"];
|
|
5
|
-
declare const PRODUCTION_AA_CHAINS: readonly ["abstract", "apechain", "arbitrum", "arbitrumnova", "base", "bsc", "flow", "mantle", "mode", "optimism", "plume", "polygon", "scroll", "sei-pacific-1", "shape", "story", "world-chain", "zora"];
|
|
5
|
+
declare const PRODUCTION_AA_CHAINS: readonly ["abstract", "apechain", "arbitrum", "arbitrumnova", "base", "bsc", "flow", "mantle", "mode", "optimism", "plume", "polygon", "scroll", "sei-pacific-1", "shape", "story", "tempo", "world-chain", "zora"];
|
|
6
6
|
type EVMSmartWalletTestnet = (typeof TESTNET_AA_CHAINS)[number];
|
|
7
7
|
type EVMSmartWalletMainnet = (typeof PRODUCTION_AA_CHAINS)[number];
|
|
8
8
|
type EVMSmartWalletChain = EVMSmartWalletTestnet | EVMSmartWalletMainnet;
|
package/dist/chains/chains.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
|
|
|
2
2
|
import { Chain as Chain$1 } from 'viem';
|
|
3
3
|
|
|
4
4
|
declare const TESTNET_AA_CHAINS: readonly ["abstract-testnet", "arbitrum-sepolia", "base-sepolia", "curtis", "ethereum-sepolia", "flow-testnet", "mantle-sepolia", "mode-sepolia", "optimism-sepolia", "plume-testnet", "polygon-amoy", "scroll-sepolia", "sei-atlantic-2-testnet", "story-testnet", "world-chain-sepolia", "zora-sepolia", "arc-testnet", "tempo-testnet"];
|
|
5
|
-
declare const PRODUCTION_AA_CHAINS: readonly ["abstract", "apechain", "arbitrum", "arbitrumnova", "base", "bsc", "flow", "mantle", "mode", "optimism", "plume", "polygon", "scroll", "sei-pacific-1", "shape", "story", "world-chain", "zora"];
|
|
5
|
+
declare const PRODUCTION_AA_CHAINS: readonly ["abstract", "apechain", "arbitrum", "arbitrumnova", "base", "bsc", "flow", "mantle", "mode", "optimism", "plume", "polygon", "scroll", "sei-pacific-1", "shape", "story", "tempo", "world-chain", "zora"];
|
|
6
6
|
type EVMSmartWalletTestnet = (typeof TESTNET_AA_CHAINS)[number];
|
|
7
7
|
type EVMSmartWalletMainnet = (typeof PRODUCTION_AA_CHAINS)[number];
|
|
8
8
|
type EVMSmartWalletChain = EVMSmartWalletTestnet | EVMSmartWalletMainnet;
|
package/dist/chains/chains.js
CHANGED
|
@@ -4,15 +4,16 @@ import {
|
|
|
4
4
|
mainnetToTestnet,
|
|
5
5
|
toViemChain,
|
|
6
6
|
validateChainForEnvironment
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-FGGGBNUF.js";
|
|
8
8
|
import "../chunk-2T5HHKUI.js";
|
|
9
9
|
import "../chunk-3U6UAYOV.js";
|
|
10
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-MMISP35W.js";
|
|
11
|
+
import "../chunk-JWMQALLN.js";
|
|
11
12
|
import "../chunk-ZBLW42YE.js";
|
|
12
13
|
import "../chunk-SGINWAB6.js";
|
|
13
14
|
import "../chunk-455NK5LB.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-DZ6MCPD3.js";
|
|
16
|
+
import "../chunk-NPTNXK47.js";
|
|
16
17
|
import "../chunk-ASE2FXWP.js";
|
|
17
18
|
export {
|
|
18
19
|
isMainnetChain,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as viem from 'viem';
|
|
2
|
+
|
|
3
|
+
declare const tempo: {
|
|
4
|
+
blockExplorers: {
|
|
5
|
+
readonly default: {
|
|
6
|
+
readonly name: "Tempo Explorer";
|
|
7
|
+
readonly url: "https://explore.mainnet.tempo.xyz";
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
blockTime?: number | undefined;
|
|
11
|
+
contracts?: viem.Prettify<{
|
|
12
|
+
[key: string]: viem.ChainContract | {
|
|
13
|
+
[sourceId: number]: viem.ChainContract | undefined;
|
|
14
|
+
} | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
ensRegistry?: viem.ChainContract | undefined;
|
|
17
|
+
ensUniversalResolver?: viem.ChainContract | undefined;
|
|
18
|
+
multicall3?: viem.ChainContract | undefined;
|
|
19
|
+
universalSignatureVerifier?: viem.ChainContract | undefined;
|
|
20
|
+
}> | undefined;
|
|
21
|
+
ensTlds?: readonly string[] | undefined;
|
|
22
|
+
id: 4217;
|
|
23
|
+
name: "Tempo";
|
|
24
|
+
experimental_preconfirmationTime?: number | undefined;
|
|
25
|
+
rpcUrls: {
|
|
26
|
+
readonly default: {
|
|
27
|
+
readonly http: readonly ["https://rpc.tempo.xyz"];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
sourceId?: number | undefined;
|
|
31
|
+
testnet: false;
|
|
32
|
+
custom?: Record<string, unknown> | undefined;
|
|
33
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
34
|
+
formatters?: undefined;
|
|
35
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
36
|
+
readonly nativeCurrency: never;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { tempo };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as viem from 'viem';
|
|
2
|
+
|
|
3
|
+
declare const tempo: {
|
|
4
|
+
blockExplorers: {
|
|
5
|
+
readonly default: {
|
|
6
|
+
readonly name: "Tempo Explorer";
|
|
7
|
+
readonly url: "https://explore.mainnet.tempo.xyz";
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
blockTime?: number | undefined;
|
|
11
|
+
contracts?: viem.Prettify<{
|
|
12
|
+
[key: string]: viem.ChainContract | {
|
|
13
|
+
[sourceId: number]: viem.ChainContract | undefined;
|
|
14
|
+
} | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
ensRegistry?: viem.ChainContract | undefined;
|
|
17
|
+
ensUniversalResolver?: viem.ChainContract | undefined;
|
|
18
|
+
multicall3?: viem.ChainContract | undefined;
|
|
19
|
+
universalSignatureVerifier?: viem.ChainContract | undefined;
|
|
20
|
+
}> | undefined;
|
|
21
|
+
ensTlds?: readonly string[] | undefined;
|
|
22
|
+
id: 4217;
|
|
23
|
+
name: "Tempo";
|
|
24
|
+
experimental_preconfirmationTime?: number | undefined;
|
|
25
|
+
rpcUrls: {
|
|
26
|
+
readonly default: {
|
|
27
|
+
readonly http: readonly ["https://rpc.tempo.xyz"];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
sourceId?: number | undefined;
|
|
31
|
+
testnet: false;
|
|
32
|
+
custom?: Record<string, unknown> | undefined;
|
|
33
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
34
|
+
formatters?: undefined;
|
|
35
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
36
|
+
readonly nativeCurrency: never;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { tempo };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkF7L2TZ3Icjs = require('../../chunk-F7L2TZ3I.cjs');
|
|
4
4
|
require('../../chunk-UO2J2ZB2.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.tempoTestnet =
|
|
7
|
+
exports.tempoTestnet = _chunkF7L2TZ3Icjs.tempoTestnet;
|
|
@@ -21,11 +21,6 @@ declare const tempoTestnet: {
|
|
|
21
21
|
ensTlds?: readonly string[] | undefined;
|
|
22
22
|
id: 42431;
|
|
23
23
|
name: "Tempo Testnet";
|
|
24
|
-
nativeCurrency: {
|
|
25
|
-
readonly decimals: 6;
|
|
26
|
-
readonly name: "pathUSD";
|
|
27
|
-
readonly symbol: "pathUSD";
|
|
28
|
-
};
|
|
29
24
|
experimental_preconfirmationTime?: number | undefined;
|
|
30
25
|
rpcUrls: {
|
|
31
26
|
readonly default: {
|
|
@@ -38,6 +33,7 @@ declare const tempoTestnet: {
|
|
|
38
33
|
fees?: viem.ChainFees<undefined> | undefined;
|
|
39
34
|
formatters?: undefined;
|
|
40
35
|
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
36
|
+
readonly nativeCurrency: never;
|
|
41
37
|
};
|
|
42
38
|
|
|
43
39
|
export { tempoTestnet };
|
|
@@ -21,11 +21,6 @@ declare const tempoTestnet: {
|
|
|
21
21
|
ensTlds?: readonly string[] | undefined;
|
|
22
22
|
id: 42431;
|
|
23
23
|
name: "Tempo Testnet";
|
|
24
|
-
nativeCurrency: {
|
|
25
|
-
readonly decimals: 6;
|
|
26
|
-
readonly name: "pathUSD";
|
|
27
|
-
readonly symbol: "pathUSD";
|
|
28
|
-
};
|
|
29
24
|
experimental_preconfirmationTime?: number | undefined;
|
|
30
25
|
rpcUrls: {
|
|
31
26
|
readonly default: {
|
|
@@ -38,6 +33,7 @@ declare const tempoTestnet: {
|
|
|
38
33
|
fees?: viem.ChainFees<undefined> | undefined;
|
|
39
34
|
formatters?: undefined;
|
|
40
35
|
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
36
|
+
readonly nativeCurrency: never;
|
|
41
37
|
};
|
|
42
38
|
|
|
43
39
|
export { tempoTestnet };
|
|
@@ -6,7 +6,7 @@ var _chunk4GFSUI2Icjs = require('./chunk-4GFSUI2I.cjs');
|
|
|
6
6
|
var _chunkRHR6P2KPcjs = require('./chunk-RHR6P2KP.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkTC6ITDWVcjs = require('./chunk-TC6ITDWV.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -64,7 +64,7 @@ var NonCustodialSigner = class {
|
|
|
64
64
|
}
|
|
65
65
|
initializeTEEConnection() {
|
|
66
66
|
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
67
|
-
|
|
67
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("TEE connection not initialized, initializing now");
|
|
68
68
|
const parsedAPIKey = _commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);
|
|
69
69
|
if (!parsedAPIKey.isValid) {
|
|
70
70
|
throw new Error("Invalid API key");
|
|
@@ -76,7 +76,7 @@ var NonCustodialSigner = class {
|
|
|
76
76
|
if (this.config.clientTEEConnection == null) {
|
|
77
77
|
throw new Error("Failed to initialize TEE connection");
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("TEE connection initialized successfully");
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
handleAuthRequired() {
|
|
@@ -88,7 +88,7 @@ var NonCustodialSigner = class {
|
|
|
88
88
|
`${this.type} signer requires the onAuthRequired callback to handle OTP verification. This callback manages the authentication flow (sending OTP and verifying user input). If using our React/React Native SDK, this is handled automatically by the provider. For other environments, implement: onAuthRequired: (needsAuth, sendEmailWithOtp, verifyOtp, reject) => { /* your UI logic */ }`
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("get-status: sending request");
|
|
92
92
|
const startTime = Date.now();
|
|
93
93
|
const signerResponse = yield clientTEEConnection.sendAction({
|
|
94
94
|
event: "request:get-status",
|
|
@@ -103,14 +103,14 @@ var NonCustodialSigner = class {
|
|
|
103
103
|
});
|
|
104
104
|
const durationMs = Date.now() - startTime;
|
|
105
105
|
if ((signerResponse == null ? void 0 : signerResponse.status) !== "success") {
|
|
106
|
-
|
|
106
|
+
_chunkTC6ITDWVcjs.walletsLogger.error("get-status: failed", {
|
|
107
107
|
status: signerResponse == null ? void 0 : signerResponse.status,
|
|
108
108
|
error: signerResponse == null ? void 0 : signerResponse.error,
|
|
109
109
|
durationMs
|
|
110
110
|
});
|
|
111
111
|
throw new Error(signerResponse == null ? void 0 : signerResponse.error);
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("get-status: response received", {
|
|
114
114
|
signerStatus: signerResponse.signerStatus,
|
|
115
115
|
durationMs
|
|
116
116
|
});
|
|
@@ -120,7 +120,7 @@ var NonCustodialSigner = class {
|
|
|
120
120
|
} else {
|
|
121
121
|
this._needsAuth = true;
|
|
122
122
|
}
|
|
123
|
-
|
|
123
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("Auth required, initiating OTP flow", { needsAuth: this._needsAuth });
|
|
124
124
|
const { promise, resolve, reject } = this.createAuthPromise();
|
|
125
125
|
this._authPromise = { promise, resolve, reject };
|
|
126
126
|
if (this.config.onAuthRequired) {
|
|
@@ -130,7 +130,7 @@ var NonCustodialSigner = class {
|
|
|
130
130
|
() => this.sendMessageWithOtp(),
|
|
131
131
|
(otp) => this.verifyOtp(otp),
|
|
132
132
|
() => _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
133
|
-
|
|
133
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("Auth rejected", { authRejected: true });
|
|
134
134
|
this._needsAuth = false;
|
|
135
135
|
if (this.config.onAuthRequired != null) {
|
|
136
136
|
yield this.config.onAuthRequired(
|
|
@@ -147,14 +147,14 @@ var NonCustodialSigner = class {
|
|
|
147
147
|
})
|
|
148
148
|
);
|
|
149
149
|
} catch (error) {
|
|
150
|
-
|
|
150
|
+
_chunkTC6ITDWVcjs.walletsLogger.error("handleAuthRequired error", { error });
|
|
151
151
|
reject(error);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
try {
|
|
155
155
|
yield promise;
|
|
156
156
|
} catch (error) {
|
|
157
|
-
|
|
157
|
+
_chunkTC6ITDWVcjs.walletsLogger.error("handleAuthRequired promise error", { error });
|
|
158
158
|
throw error;
|
|
159
159
|
}
|
|
160
160
|
});
|
|
@@ -186,7 +186,7 @@ var NonCustodialSigner = class {
|
|
|
186
186
|
var _a, _b, _c;
|
|
187
187
|
const handshakeParent = yield this.getTEEConnection();
|
|
188
188
|
const authId = this.getAuthId();
|
|
189
|
-
|
|
189
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("start-onboarding: sending request");
|
|
190
190
|
const startTime = Date.now();
|
|
191
191
|
const response = yield handshakeParent.sendAction({
|
|
192
192
|
event: "request:start-onboarding",
|
|
@@ -201,7 +201,7 @@ var NonCustodialSigner = class {
|
|
|
201
201
|
options: DEFAULT_EVENT_OPTIONS
|
|
202
202
|
});
|
|
203
203
|
const durationMs = Date.now() - startTime;
|
|
204
|
-
|
|
204
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("start-onboarding: response received", {
|
|
205
205
|
status: response == null ? void 0 : response.status,
|
|
206
206
|
durationMs
|
|
207
207
|
});
|
|
@@ -210,7 +210,7 @@ var NonCustodialSigner = class {
|
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
212
|
if ((response == null ? void 0 : response.status) === "error") {
|
|
213
|
-
|
|
213
|
+
_chunkTC6ITDWVcjs.walletsLogger.error("start-onboarding: failed", { error: response.error });
|
|
214
214
|
(_c = this._authPromise) == null ? void 0 : _c.reject(new Error(response.error || "Failed to initiate OTP process."));
|
|
215
215
|
}
|
|
216
216
|
});
|
|
@@ -227,7 +227,7 @@ var NonCustodialSigner = class {
|
|
|
227
227
|
let response;
|
|
228
228
|
try {
|
|
229
229
|
const handshakeParent = yield this.getTEEConnection();
|
|
230
|
-
|
|
230
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("complete-onboarding: sending request");
|
|
231
231
|
const startTime = Date.now();
|
|
232
232
|
response = yield handshakeParent.sendAction({
|
|
233
233
|
event: "request:complete-onboarding",
|
|
@@ -243,12 +243,12 @@ var NonCustodialSigner = class {
|
|
|
243
243
|
},
|
|
244
244
|
options: DEFAULT_EVENT_OPTIONS
|
|
245
245
|
});
|
|
246
|
-
|
|
246
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("complete-onboarding: response received", {
|
|
247
247
|
status: response == null ? void 0 : response.status,
|
|
248
248
|
durationMs: Date.now() - startTime
|
|
249
249
|
});
|
|
250
250
|
} catch (err) {
|
|
251
|
-
|
|
251
|
+
_chunkTC6ITDWVcjs.walletsLogger.error("complete-onboarding: error", { error: err });
|
|
252
252
|
this._needsAuth = true;
|
|
253
253
|
(_c = this._authPromise) == null ? void 0 : _c.reject(err);
|
|
254
254
|
throw err;
|
|
@@ -269,7 +269,7 @@ var NonCustodialSigner = class {
|
|
|
269
269
|
(_d = this._authPromise) == null ? void 0 : _d.resolve();
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
|
-
|
|
272
|
+
_chunkTC6ITDWVcjs.walletsLogger.error("complete-onboarding: OTP validation failed", { status: response == null ? void 0 : response.status });
|
|
273
273
|
this._needsAuth = true;
|
|
274
274
|
const errorMessage = (response == null ? void 0 : response.status) === "error" ? response.error : "Failed to validate encrypted OTP";
|
|
275
275
|
const error = new Error(errorMessage);
|
|
@@ -309,7 +309,7 @@ var NonCustodialSigner = class {
|
|
|
309
309
|
};
|
|
310
310
|
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
311
311
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
312
|
-
logger:
|
|
312
|
+
logger: _chunkTC6ITDWVcjs.walletsLogger,
|
|
313
313
|
methodName: "handleAuthRequired"
|
|
314
314
|
})
|
|
315
315
|
], NonCustodialSigner.prototype, "handleAuthRequired", 1);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_EVENT_OPTIONS,
|
|
3
3
|
NonCustodialSigner
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3KEY2NLC.js";
|
|
5
5
|
import {
|
|
6
6
|
walletsLogger
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DZ6MCPD3.js";
|
|
8
8
|
import {
|
|
9
9
|
__async
|
|
10
10
|
} from "./chunk-ASE2FXWP.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SolanaNonCustodialSigner
|
|
3
|
+
} from "./chunk-TPW2OJIB.js";
|
|
1
4
|
import {
|
|
2
5
|
StellarNonCustodialSigner
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3G4P2NHM.js";
|
|
4
7
|
import {
|
|
5
8
|
EVMNonCustodialSigner
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
SolanaNonCustodialSigner
|
|
9
|
-
} from "./chunk-ZKWJY2VO.js";
|
|
9
|
+
} from "./chunk-XTKNO44C.js";
|
|
10
10
|
import {
|
|
11
11
|
EVMApiKeySigner
|
|
12
12
|
} from "./chunk-7GOUUPS4.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkSJSXTTSYcjs = require('./chunk-SJSXTTSY.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkH3XAAMD3cjs = require('./chunk-H3XAAMD3.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ var _chunkGEHZRAAJcjs = require('./chunk-GEHZRAAJ.cjs');
|
|
|
11
11
|
var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkTC6ITDWVcjs = require('./chunk-TC6ITDWV.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 _chunkSJSXTTSYcjs.Wallet {
|
|
24
24
|
constructor(wallet) {
|
|
25
25
|
super(
|
|
26
26
|
{
|
|
@@ -28,10 +28,10 @@ var _EVMWallet = class _EVMWallet extends _chunk4ID6ZK4Acjs.Wallet {
|
|
|
28
28
|
address: wallet.address,
|
|
29
29
|
owner: wallet.owner,
|
|
30
30
|
signer: wallet.signer,
|
|
31
|
-
options:
|
|
31
|
+
options: _chunkSJSXTTSYcjs.Wallet.getOptions(wallet),
|
|
32
32
|
alias: wallet.alias
|
|
33
33
|
},
|
|
34
|
-
|
|
34
|
+
_chunkSJSXTTSYcjs.Wallet.getApiClient(wallet)
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
static from(wallet) {
|
|
@@ -43,12 +43,12 @@ var _EVMWallet = class _EVMWallet extends _chunk4ID6ZK4Acjs.Wallet {
|
|
|
43
43
|
sendTransaction(params) {
|
|
44
44
|
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
45
45
|
var _a;
|
|
46
|
-
|
|
46
|
+
_chunkTC6ITDWVcjs.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
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("evmWallet.sendTransaction.prepared", {
|
|
52
52
|
transactionId: createdTransaction.id
|
|
53
53
|
});
|
|
54
54
|
return {
|
|
@@ -58,7 +58,7 @@ var _EVMWallet = class _EVMWallet extends _chunk4ID6ZK4Acjs.Wallet {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
const result = yield this.approveTransactionAndWait(createdTransaction.id);
|
|
61
|
-
|
|
61
|
+
_chunkTC6ITDWVcjs.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 _chunk4ID6ZK4Acjs.Wallet {
|
|
|
68
68
|
signMessage(params) {
|
|
69
69
|
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
70
70
|
var _a;
|
|
71
|
-
|
|
71
|
+
_chunkTC6ITDWVcjs.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 _chunk4ID6ZK4Acjs.Wallet {
|
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
81
|
if ("error" in signatureCreationResponse) {
|
|
82
|
-
|
|
82
|
+
_chunkTC6ITDWVcjs.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
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("evmWallet.signMessage.prepared", {
|
|
87
87
|
signatureId: signatureCreationResponse.id
|
|
88
88
|
});
|
|
89
89
|
return {
|
|
@@ -92,23 +92,23 @@ var _EVMWallet = class _EVMWallet extends _chunk4ID6ZK4Acjs.Wallet {
|
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
|
|
95
|
-
|
|
95
|
+
_chunkTC6ITDWVcjs.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
|
+
_chunkTC6ITDWVcjs.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
|
+
_chunkTC6ITDWVcjs.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
|
+
_chunkTC6ITDWVcjs.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 _chunk4ID6ZK4Acjs.Wallet {
|
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
if ("error" in signatureCreationResponse) {
|
|
134
|
-
|
|
134
|
+
_chunkTC6ITDWVcjs.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
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("evmWallet.signTypedData.prepared", {
|
|
139
139
|
signatureId: signatureCreationResponse.id
|
|
140
140
|
});
|
|
141
141
|
return {
|
|
@@ -144,7 +144,7 @@ var _EVMWallet = class _EVMWallet extends _chunk4ID6ZK4Acjs.Wallet {
|
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
146
|
const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
|
|
147
|
-
|
|
147
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("evmWallet.signTypedData.success", { signatureId: signatureCreationResponse.id });
|
|
148
148
|
return result;
|
|
149
149
|
});
|
|
150
150
|
}
|
|
@@ -157,7 +157,7 @@ var _EVMWallet = class _EVMWallet extends _chunk4ID6ZK4Acjs.Wallet {
|
|
|
157
157
|
var _a;
|
|
158
158
|
return _viem.createPublicClient.call(void 0, {
|
|
159
159
|
transport: (_a = params == null ? void 0 : params.transport) != null ? _a : _viem.http.call(void 0, ),
|
|
160
|
-
chain:
|
|
160
|
+
chain: _chunkH3XAAMD3cjs.toViemChain.call(void 0, this.chain)
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
createTransaction(transaction, options) {
|
|
@@ -205,7 +205,7 @@ var _EVMWallet = class _EVMWallet extends _chunk4ID6ZK4Acjs.Wallet {
|
|
|
205
205
|
};
|
|
206
206
|
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
207
207
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
208
|
-
logger:
|
|
208
|
+
logger: _chunkTC6ITDWVcjs.walletsLogger,
|
|
209
209
|
methodName: "evmWallet.sendTransaction",
|
|
210
210
|
buildContext(thisArg) {
|
|
211
211
|
return { chain: thisArg.chain, address: thisArg.address };
|
|
@@ -214,7 +214,7 @@ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
|
214
214
|
], _EVMWallet.prototype, "sendTransaction", 1);
|
|
215
215
|
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
216
216
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
217
|
-
logger:
|
|
217
|
+
logger: _chunkTC6ITDWVcjs.walletsLogger,
|
|
218
218
|
methodName: "evmWallet.signMessage",
|
|
219
219
|
buildContext(thisArg) {
|
|
220
220
|
return { chain: thisArg.chain, address: thisArg.address };
|
|
@@ -223,7 +223,7 @@ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
|
223
223
|
], _EVMWallet.prototype, "signMessage", 1);
|
|
224
224
|
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
225
225
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
226
|
-
logger:
|
|
226
|
+
logger: _chunkTC6ITDWVcjs.walletsLogger,
|
|
227
227
|
methodName: "evmWallet.signTypedData",
|
|
228
228
|
buildContext(thisArg) {
|
|
229
229
|
return { chain: thisArg.chain, address: thisArg.address };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/chains/definitions/tempo.ts
|
|
2
|
+
var _viem = require('viem');
|
|
3
|
+
var tempo = _viem.defineChain.call(void 0, {
|
|
4
|
+
id: 4217,
|
|
5
|
+
name: "Tempo",
|
|
6
|
+
nativeCurrency: void 0,
|
|
7
|
+
rpcUrls: {
|
|
8
|
+
default: { http: ["https://rpc.tempo.xyz"] }
|
|
9
|
+
},
|
|
10
|
+
blockExplorers: {
|
|
11
|
+
default: {
|
|
12
|
+
name: "Tempo Explorer",
|
|
13
|
+
url: "https://explore.mainnet.tempo.xyz"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
testnet: false
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.tempo = tempo;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk3ASKCQJNcjs = require('./chunk-3ASKCQJN.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkTC6ITDWVcjs = require('./chunk-TC6ITDWV.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 _chunk3ASKCQJNcjs.NonCustodialSigner {
|
|
16
16
|
constructor(config) {
|
|
17
17
|
super(config);
|
|
18
18
|
}
|
|
@@ -34,7 +34,7 @@ var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends _chunkKVYY4QDBc
|
|
|
34
34
|
yield this.handleAuthRequired();
|
|
35
35
|
const jwt = this.getJwtOrThrow();
|
|
36
36
|
const hexString = raw.replace("0x", "");
|
|
37
|
-
|
|
37
|
+
_chunkTC6ITDWVcjs.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 _chunkKVYY4QDBc
|
|
|
50
50
|
encoding: "hex"
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
options:
|
|
53
|
+
options: _chunk3ASKCQJNcjs.DEFAULT_EVENT_OPTIONS
|
|
54
54
|
});
|
|
55
|
-
|
|
55
|
+
_chunkTC6ITDWVcjs.walletsLogger.info("sign: response received", {
|
|
56
56
|
status: res == null ? void 0 : res.status,
|
|
57
57
|
durationMs: Date.now() - startTime
|
|
58
58
|
});
|