@crossmint/wallets-sdk 0.19.0 → 0.20.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.
Files changed (93) hide show
  1. package/dist/api/__tests__/test-utils.cjs +5 -5
  2. package/dist/api/__tests__/test-utils.js +3 -3
  3. package/dist/api/client.cjs +4 -4
  4. package/dist/api/client.js +3 -3
  5. package/dist/api/index.cjs +5 -5
  6. package/dist/api/index.js +4 -4
  7. package/dist/chains/chains.cjs +11 -3
  8. package/dist/chains/chains.d.cts +13 -1
  9. package/dist/chains/chains.d.ts +13 -1
  10. package/dist/chains/chains.js +12 -4
  11. package/dist/chains/definitions/tempoTestnet.cjs +2 -2
  12. package/dist/chains/definitions/tempoTestnet.d.cts +4 -4
  13. package/dist/chains/definitions/tempoTestnet.d.ts +4 -4
  14. package/dist/chains/definitions/tempoTestnet.js +1 -1
  15. package/dist/{chunk-57HPJVTI.js → chunk-24DGWV3E.js} +5 -5
  16. package/dist/{chunk-XEZBA7I2.js → chunk-2APY4BUJ.js} +19 -6
  17. package/dist/{chunk-YFOUZXSM.cjs → chunk-2XDIXELO.cjs} +6 -6
  18. package/dist/{chunk-NXST74TX.cjs → chunk-4ID6ZK4A.cjs} +58 -45
  19. package/dist/{chunk-XQSMZXBR.cjs → chunk-6LVFMXDR.cjs} +24 -24
  20. package/dist/{chunk-TCNXKNBQ.cjs → chunk-6S7BKBVM.cjs} +7 -7
  21. package/dist/{chunk-YF4DYTBM.js → chunk-7EXE5FZJ.js} +2 -2
  22. package/dist/{chunk-L5IMC3NM.js → chunk-7OW5LYR6.js} +2 -2
  23. package/dist/{chunk-IZJUOXOZ.js → chunk-AXQLP7Z6.js} +4 -4
  24. package/dist/{chunk-N65K6TUY.js → chunk-AZQFMK3I.js} +2 -2
  25. package/dist/{chunk-KE6LX37B.js → chunk-BQN5PNZK.js} +1 -1
  26. package/dist/{chunk-S2AKC2CK.js → chunk-DF3SZX2E.js} +1 -1
  27. package/dist/{chunk-DIM3X4IX.cjs → chunk-GEHZRAAJ.cjs} +61 -3
  28. package/dist/{chunk-W3OYA42M.js → chunk-GWLAO3PX.js} +1 -1
  29. package/dist/{chunk-VWENCGQO.cjs → chunk-GXEWWYHT.cjs} +6 -6
  30. package/dist/{chunk-BBYNVHFR.js → chunk-IAZHXIFV.js} +3 -3
  31. package/dist/{chunk-REP547HH.cjs → chunk-KVYY4QDB.cjs} +18 -18
  32. package/dist/{chunk-7NKX266V.js → chunk-MUIINXJY.js} +11 -33
  33. package/dist/{chunk-6EP3PLGP.js → chunk-MZBMV54C.js} +2 -2
  34. package/dist/{chunk-6H6ZBJC2.cjs → chunk-NN2NBBTN.cjs} +4 -4
  35. package/dist/{chunk-JZQYCISB.cjs → chunk-PRNZJUHI.cjs} +9 -9
  36. package/dist/{chunk-VNPL3HFN.cjs → chunk-RJY4GT2D.cjs} +6 -6
  37. package/dist/{chunk-SUJQZWLJ.js → chunk-SAZ76VGQ.js} +2 -2
  38. package/dist/{chunk-EIZVQAZO.cjs → chunk-SEV3UBGK.cjs} +24 -46
  39. package/dist/{chunk-YXFIZNFL.cjs → chunk-TNASR6QE.cjs} +9 -9
  40. package/dist/{chunk-5CBGJLA4.cjs → chunk-TQKCX7VN.cjs} +1 -1
  41. package/dist/{chunk-FQV77LH4.cjs → chunk-VKXKQ5YI.cjs} +3 -3
  42. package/dist/{chunk-XSMIDXUA.js → chunk-WBTM7E5O.js} +61 -3
  43. package/dist/{chunk-JLW3Q65G.cjs → chunk-XM4Y4HS5.cjs} +6 -6
  44. package/dist/{chunk-ETCH6L2Y.js → chunk-YDFIY5ER.js} +3 -3
  45. package/dist/{chunk-7EZZGCYI.js → chunk-ZKWJY2VO.js} +2 -2
  46. package/dist/{chunk-C5F6IECX.cjs → chunk-ZLPFQ56Q.cjs} +12 -12
  47. package/dist/index.cjs +18 -18
  48. package/dist/index.js +17 -17
  49. package/dist/logger/index.cjs +3 -3
  50. package/dist/logger/index.js +2 -2
  51. package/dist/logger/init.cjs +3 -3
  52. package/dist/logger/init.js +2 -2
  53. package/dist/sdk.cjs +15 -15
  54. package/dist/sdk.js +14 -14
  55. package/dist/signers/index.cjs +8 -8
  56. package/dist/signers/index.d.cts +1 -1
  57. package/dist/signers/index.d.ts +1 -1
  58. package/dist/signers/index.js +7 -7
  59. package/dist/signers/non-custodial/index.cjs +7 -7
  60. package/dist/signers/non-custodial/index.js +6 -6
  61. package/dist/signers/non-custodial/ncs-evm-signer.cjs +5 -5
  62. package/dist/signers/non-custodial/ncs-evm-signer.js +4 -4
  63. package/dist/signers/non-custodial/ncs-signer.cjs +4 -4
  64. package/dist/signers/non-custodial/ncs-signer.js +3 -3
  65. package/dist/signers/non-custodial/ncs-solana-signer.cjs +5 -5
  66. package/dist/signers/non-custodial/ncs-solana-signer.js +4 -4
  67. package/dist/signers/non-custodial/ncs-stellar-signer.cjs +5 -5
  68. package/dist/signers/non-custodial/ncs-stellar-signer.js +4 -4
  69. package/dist/utils/constants.cjs +2 -2
  70. package/dist/utils/constants.js +1 -1
  71. package/dist/wallets/__tests__/test-helpers.cjs +13 -8
  72. package/dist/wallets/__tests__/test-helpers.js +12 -7
  73. package/dist/wallets/evm.cjs +12 -12
  74. package/dist/wallets/evm.js +11 -11
  75. package/dist/wallets/solana.cjs +14 -9
  76. package/dist/wallets/solana.d.cts +1 -1
  77. package/dist/wallets/solana.d.ts +1 -1
  78. package/dist/wallets/solana.js +13 -8
  79. package/dist/wallets/stellar.cjs +14 -9
  80. package/dist/wallets/stellar.d.cts +1 -1
  81. package/dist/wallets/stellar.d.ts +1 -1
  82. package/dist/wallets/stellar.js +13 -8
  83. package/dist/wallets/types.d.cts +1 -1
  84. package/dist/wallets/types.d.ts +1 -1
  85. package/dist/wallets/wallet-factory.cjs +13 -13
  86. package/dist/wallets/wallet-factory.d.cts +0 -1
  87. package/dist/wallets/wallet-factory.d.ts +0 -1
  88. package/dist/wallets/wallet-factory.js +12 -12
  89. package/dist/wallets/wallet.cjs +13 -8
  90. package/dist/wallets/wallet.d.cts +1 -0
  91. package/dist/wallets/wallet.d.ts +1 -0
  92. package/dist/wallets/wallet.js +12 -7
  93. package/package.json +6 -6
@@ -9,10 +9,10 @@
9
9
  var _chunkG6QJHFSYcjs = require('../../chunk-G6QJHFSY.cjs');
10
10
 
11
11
 
12
- var _chunkC5F6IECXcjs = require('../../chunk-C5F6IECX.cjs');
12
+ var _chunkZLPFQ56Qcjs = require('../../chunk-ZLPFQ56Q.cjs');
13
13
  require('../../chunk-XC2V34TS.cjs');
14
- require('../../chunk-FQV77LH4.cjs');
15
- require('../../chunk-5CBGJLA4.cjs');
14
+ require('../../chunk-VKXKQ5YI.cjs');
15
+ require('../../chunk-TQKCX7VN.cjs');
16
16
 
17
17
 
18
18
 
@@ -46,7 +46,7 @@ var createMockCrossmint = (overrides = {}) => {
46
46
  });
47
47
  };
48
48
  var createTestApiClient = (crossmint) => {
49
- return new (0, _chunkC5F6IECXcjs.ApiClient)(crossmint || createMockCrossmint());
49
+ return new (0, _chunkZLPFQ56Qcjs.ApiClient)(crossmint || createMockCrossmint());
50
50
  };
51
51
  var createServerSideApiClient = () => {
52
52
  const apiClient = createTestApiClient();
@@ -186,7 +186,7 @@ var createIntegrationApiClient = (apiKey, baseUrl, overrides = {}) => {
186
186
  setJwt: () => crossmint,
187
187
  experimental_setCustomAuth: () => crossmint
188
188
  });
189
- return new (0, _chunkC5F6IECXcjs.ApiClient)(crossmint);
189
+ return new (0, _chunkZLPFQ56Qcjs.ApiClient)(crossmint);
190
190
  };
191
191
  var TestDataFactory = class {
192
192
  constructor() {
@@ -9,10 +9,10 @@ import {
9
9
  } from "../../chunk-PJOJIRTY.js";
10
10
  import {
11
11
  ApiClient
12
- } from "../../chunk-6EP3PLGP.js";
12
+ } from "../../chunk-MZBMV54C.js";
13
13
  import "../../chunk-SGINWAB6.js";
14
- import "../../chunk-S2AKC2CK.js";
15
- import "../../chunk-KE6LX37B.js";
14
+ import "../../chunk-DF3SZX2E.js";
15
+ import "../../chunk-BQN5PNZK.js";
16
16
  import {
17
17
  __async,
18
18
  __spreadProps,
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkC5F6IECXcjs = require('../chunk-C5F6IECX.cjs');
3
+ var _chunkZLPFQ56Qcjs = require('../chunk-ZLPFQ56Q.cjs');
4
4
  require('../chunk-XC2V34TS.cjs');
5
- require('../chunk-FQV77LH4.cjs');
6
- require('../chunk-5CBGJLA4.cjs');
5
+ require('../chunk-VKXKQ5YI.cjs');
6
+ require('../chunk-TQKCX7VN.cjs');
7
7
  require('../chunk-UO2J2ZB2.cjs');
8
8
 
9
9
 
10
- exports.ApiClient = _chunkC5F6IECXcjs.ApiClient;
10
+ exports.ApiClient = _chunkZLPFQ56Qcjs.ApiClient;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ApiClient
3
- } from "../chunk-6EP3PLGP.js";
3
+ } from "../chunk-MZBMV54C.js";
4
4
  import "../chunk-SGINWAB6.js";
5
- import "../chunk-S2AKC2CK.js";
6
- import "../chunk-KE6LX37B.js";
5
+ import "../chunk-DF3SZX2E.js";
6
+ import "../chunk-BQN5PNZK.js";
7
7
  import "../chunk-ASE2FXWP.js";
8
8
  export {
9
9
  ApiClient
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-6HXIZLEQ.cjs');
2
2
 
3
3
 
4
- var _chunkC5F6IECXcjs = require('../chunk-C5F6IECX.cjs');
5
- require('../chunk-XC2V34TS.cjs');
4
+ var _chunkZLPFQ56Qcjs = require('../chunk-ZLPFQ56Q.cjs');
6
5
  require('../chunk-ECAM5KTH.cjs');
7
- require('../chunk-FQV77LH4.cjs');
8
- require('../chunk-5CBGJLA4.cjs');
6
+ require('../chunk-XC2V34TS.cjs');
7
+ require('../chunk-VKXKQ5YI.cjs');
8
+ require('../chunk-TQKCX7VN.cjs');
9
9
  require('../chunk-UO2J2ZB2.cjs');
10
10
 
11
11
 
12
- exports.ApiClient = _chunkC5F6IECXcjs.ApiClient;
12
+ exports.ApiClient = _chunkZLPFQ56Qcjs.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-6EP3PLGP.js";
5
- import "../chunk-SGINWAB6.js";
4
+ } from "../chunk-MZBMV54C.js";
6
5
  import "../chunk-KBJA7JDT.js";
7
- import "../chunk-S2AKC2CK.js";
8
- import "../chunk-KE6LX37B.js";
6
+ import "../chunk-SGINWAB6.js";
7
+ import "../chunk-DF3SZX2E.js";
8
+ import "../chunk-BQN5PNZK.js";
9
9
  import "../chunk-ASE2FXWP.js";
10
10
  export {
11
11
  ApiClient
@@ -2,14 +2,22 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkDIM3X4IXcjs = require('../chunk-DIM3X4IX.cjs');
5
+
6
+
7
+ var _chunkGEHZRAAJcjs = require('../chunk-GEHZRAAJ.cjs');
6
8
  require('../chunk-NIBKCMQ2.cjs');
7
9
  require('../chunk-55V4VMTX.cjs');
8
- require('../chunk-6H6ZBJC2.cjs');
10
+ require('../chunk-NN2NBBTN.cjs');
9
11
  require('../chunk-HTSQPZHW.cjs');
12
+ require('../chunk-XC2V34TS.cjs');
13
+ require('../chunk-CCIGWTAO.cjs');
14
+ require('../chunk-VKXKQ5YI.cjs');
15
+ require('../chunk-TQKCX7VN.cjs');
10
16
  require('../chunk-UO2J2ZB2.cjs');
11
17
 
12
18
 
13
19
 
14
20
 
15
- exports.isMainnetChain = _chunkDIM3X4IXcjs.isMainnetChain; exports.isTestnetChain = _chunkDIM3X4IXcjs.isTestnetChain; exports.toViemChain = _chunkDIM3X4IXcjs.toViemChain;
21
+
22
+
23
+ exports.isMainnetChain = _chunkGEHZRAAJcjs.isMainnetChain; exports.isTestnetChain = _chunkGEHZRAAJcjs.isTestnetChain; exports.mainnetToTestnet = _chunkGEHZRAAJcjs.mainnetToTestnet; exports.toViemChain = _chunkGEHZRAAJcjs.toViemChain; exports.validateChainForEnvironment = _chunkGEHZRAAJcjs.validateChainForEnvironment;
@@ -1,3 +1,4 @@
1
+ import { APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
1
2
  import { Chain as Chain$1 } from 'viem';
2
3
 
3
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"];
@@ -12,5 +13,16 @@ type EVMChain = EVMSmartWalletChain;
12
13
  type Chain = SolanaChain | EVMChain | StellarChain;
13
14
  declare function isTestnetChain(chain: EVMSmartWalletChain): chain is EVMSmartWalletTestnet;
14
15
  declare function isMainnetChain(chain: EVMSmartWalletChain): chain is EVMSmartWalletMainnet;
16
+ declare function mainnetToTestnet(chain: EVMSmartWalletMainnet): EVMSmartWalletTestnet | undefined;
17
+ /**
18
+ * Validates that a chain is appropriate for the given environment.
19
+ * In production, only mainnet chains are allowed - throws if a testnet chain is used.
20
+ * In non-production environments, mainnet chains are automatically converted to their testnet equivalent.
21
+ *
22
+ * @param chain - The chain to validate
23
+ * @param environment - The API key environment prefix
24
+ * @returns The validated (and potentially converted) chain
25
+ */
26
+ declare function validateChainForEnvironment<C extends Chain>(chain: C, environment: APIKeyEnvironmentPrefix): C;
15
27
 
16
- export { type Chain, type EVMChain, type EVMSmartWalletChain, type EVMSmartWalletMainnet, type EVMSmartWalletTestnet, type SolanaChain, type StellarChain, isMainnetChain, isTestnetChain, toViemChain };
28
+ export { type Chain, type EVMChain, type EVMSmartWalletChain, type EVMSmartWalletMainnet, type EVMSmartWalletTestnet, type SolanaChain, type StellarChain, isMainnetChain, isTestnetChain, mainnetToTestnet, toViemChain, validateChainForEnvironment };
@@ -1,3 +1,4 @@
1
+ import { APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
1
2
  import { Chain as Chain$1 } from 'viem';
2
3
 
3
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"];
@@ -12,5 +13,16 @@ type EVMChain = EVMSmartWalletChain;
12
13
  type Chain = SolanaChain | EVMChain | StellarChain;
13
14
  declare function isTestnetChain(chain: EVMSmartWalletChain): chain is EVMSmartWalletTestnet;
14
15
  declare function isMainnetChain(chain: EVMSmartWalletChain): chain is EVMSmartWalletMainnet;
16
+ declare function mainnetToTestnet(chain: EVMSmartWalletMainnet): EVMSmartWalletTestnet | undefined;
17
+ /**
18
+ * Validates that a chain is appropriate for the given environment.
19
+ * In production, only mainnet chains are allowed - throws if a testnet chain is used.
20
+ * In non-production environments, mainnet chains are automatically converted to their testnet equivalent.
21
+ *
22
+ * @param chain - The chain to validate
23
+ * @param environment - The API key environment prefix
24
+ * @returns The validated (and potentially converted) chain
25
+ */
26
+ declare function validateChainForEnvironment<C extends Chain>(chain: C, environment: APIKeyEnvironmentPrefix): C;
15
27
 
16
- export { type Chain, type EVMChain, type EVMSmartWalletChain, type EVMSmartWalletMainnet, type EVMSmartWalletTestnet, type SolanaChain, type StellarChain, isMainnetChain, isTestnetChain, toViemChain };
28
+ export { type Chain, type EVMChain, type EVMSmartWalletChain, type EVMSmartWalletMainnet, type EVMSmartWalletTestnet, type SolanaChain, type StellarChain, isMainnetChain, isTestnetChain, mainnetToTestnet, toViemChain, validateChainForEnvironment };
@@ -1,15 +1,23 @@
1
1
  import {
2
2
  isMainnetChain,
3
3
  isTestnetChain,
4
- toViemChain
5
- } from "../chunk-XSMIDXUA.js";
4
+ mainnetToTestnet,
5
+ toViemChain,
6
+ validateChainForEnvironment
7
+ } from "../chunk-WBTM7E5O.js";
6
8
  import "../chunk-2T5HHKUI.js";
7
9
  import "../chunk-3U6UAYOV.js";
8
- import "../chunk-IZJUOXOZ.js";
10
+ import "../chunk-AXQLP7Z6.js";
9
11
  import "../chunk-ZBLW42YE.js";
12
+ import "../chunk-SGINWAB6.js";
13
+ import "../chunk-455NK5LB.js";
14
+ import "../chunk-DF3SZX2E.js";
15
+ import "../chunk-BQN5PNZK.js";
10
16
  import "../chunk-ASE2FXWP.js";
11
17
  export {
12
18
  isMainnetChain,
13
19
  isTestnetChain,
14
- toViemChain
20
+ mainnetToTestnet,
21
+ toViemChain,
22
+ validateChainForEnvironment
15
23
  };
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk6H6ZBJC2cjs = require('../../chunk-6H6ZBJC2.cjs');
3
+ var _chunkNN2NBBTNcjs = require('../../chunk-NN2NBBTN.cjs');
4
4
  require('../../chunk-UO2J2ZB2.cjs');
5
5
 
6
6
 
7
- exports.tempoTestnet = _chunk6H6ZBJC2cjs.tempoTestnet;
7
+ exports.tempoTestnet = _chunkNN2NBBTNcjs.tempoTestnet;
@@ -3,8 +3,8 @@ import * as viem from 'viem';
3
3
  declare const tempoTestnet: {
4
4
  blockExplorers: {
5
5
  readonly default: {
6
- readonly name: "Tempo Scout";
7
- readonly url: "https://scout.tempo.xyz";
6
+ readonly name: "Tempo Explorer";
7
+ readonly url: "https://explore.tempo.xyz";
8
8
  };
9
9
  };
10
10
  blockTime?: number | undefined;
@@ -19,7 +19,7 @@ declare const tempoTestnet: {
19
19
  universalSignatureVerifier?: viem.ChainContract | undefined;
20
20
  }> | undefined;
21
21
  ensTlds?: readonly string[] | undefined;
22
- id: 42429;
22
+ id: 42431;
23
23
  name: "Tempo Testnet";
24
24
  nativeCurrency: {
25
25
  readonly decimals: 6;
@@ -29,7 +29,7 @@ declare const tempoTestnet: {
29
29
  experimental_preconfirmationTime?: number | undefined;
30
30
  rpcUrls: {
31
31
  readonly default: {
32
- readonly http: readonly ["https://rpc.testnet.tempo.xyz"];
32
+ readonly http: readonly ["https://rpc.moderato.tempo.xyz"];
33
33
  };
34
34
  };
35
35
  sourceId?: number | undefined;
@@ -3,8 +3,8 @@ import * as viem from 'viem';
3
3
  declare const tempoTestnet: {
4
4
  blockExplorers: {
5
5
  readonly default: {
6
- readonly name: "Tempo Scout";
7
- readonly url: "https://scout.tempo.xyz";
6
+ readonly name: "Tempo Explorer";
7
+ readonly url: "https://explore.tempo.xyz";
8
8
  };
9
9
  };
10
10
  blockTime?: number | undefined;
@@ -19,7 +19,7 @@ declare const tempoTestnet: {
19
19
  universalSignatureVerifier?: viem.ChainContract | undefined;
20
20
  }> | undefined;
21
21
  ensTlds?: readonly string[] | undefined;
22
- id: 42429;
22
+ id: 42431;
23
23
  name: "Tempo Testnet";
24
24
  nativeCurrency: {
25
25
  readonly decimals: 6;
@@ -29,7 +29,7 @@ declare const tempoTestnet: {
29
29
  experimental_preconfirmationTime?: number | undefined;
30
30
  rpcUrls: {
31
31
  readonly default: {
32
- readonly http: readonly ["https://rpc.testnet.tempo.xyz"];
32
+ readonly http: readonly ["https://rpc.moderato.tempo.xyz"];
33
33
  };
34
34
  };
35
35
  sourceId?: number | undefined;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  tempoTestnet
3
- } from "../../chunk-IZJUOXOZ.js";
3
+ } from "../../chunk-AXQLP7Z6.js";
4
4
  import "../../chunk-ASE2FXWP.js";
5
5
  export {
6
6
  tempoTestnet
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  Wallet
3
- } from "./chunk-XEZBA7I2.js";
3
+ } from "./chunk-2APY4BUJ.js";
4
+ import {
5
+ toViemChain
6
+ } from "./chunk-WBTM7E5O.js";
4
7
  import {
5
8
  InvalidTypedDataError,
6
9
  SignatureNotCreatedError,
7
10
  TransactionNotCreatedError
8
11
  } from "./chunk-SGINWAB6.js";
9
- import {
10
- toViemChain
11
- } from "./chunk-XSMIDXUA.js";
12
12
  import {
13
13
  walletsLogger
14
- } from "./chunk-S2AKC2CK.js";
14
+ } from "./chunk-DF3SZX2E.js";
15
15
  import {
16
16
  __async,
17
17
  __decorateClass
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  NonCustodialSigner
3
- } from "./chunk-W3OYA42M.js";
3
+ } from "./chunk-GWLAO3PX.js";
4
+ import {
5
+ validateChainForEnvironment
6
+ } from "./chunk-WBTM7E5O.js";
4
7
  import {
5
8
  InvalidSignerError,
6
9
  SignatureFailedError,
@@ -18,10 +21,10 @@ import {
18
21
  } from "./chunk-SGINWAB6.js";
19
22
  import {
20
23
  walletsLogger
21
- } from "./chunk-S2AKC2CK.js";
24
+ } from "./chunk-DF3SZX2E.js";
22
25
  import {
23
26
  STATUS_POLLING_INTERVAL_MS
24
- } from "./chunk-KE6LX37B.js";
27
+ } from "./chunk-BQN5PNZK.js";
25
28
  import {
26
29
  __async,
27
30
  __decorateClass,
@@ -71,6 +74,7 @@ var Wallet = class {
71
74
  balances(tokens) {
72
75
  return __async(this, null, function* () {
73
76
  walletsLogger.info("wallet.balances.start");
77
+ const resolvedChain = this.resolveChainForEnvironment();
74
78
  let nativeToken;
75
79
  switch (this.chain) {
76
80
  case "solana":
@@ -85,7 +89,7 @@ var Wallet = class {
85
89
  }
86
90
  const allTokens = [nativeToken, "usdc", ...tokens != null ? tokens : []];
87
91
  const response = yield __privateGet(this, _apiClient).getBalance(this.address, {
88
- chains: [this.chain],
92
+ chains: [resolvedChain],
89
93
  tokens: allTokens
90
94
  });
91
95
  if ("error" in response) {
@@ -227,7 +231,8 @@ var Wallet = class {
227
231
  */
228
232
  experimental_activity() {
229
233
  return __async(this, null, function* () {
230
- const response = yield this.apiClient.experimental_activity(this.walletLocator, { chain: this.chain });
234
+ const resolvedChain = this.resolveChainForEnvironment();
235
+ const response = yield this.apiClient.experimental_activity(this.walletLocator, { chain: resolvedChain });
231
236
  if ("error" in response) {
232
237
  throw new Error(`Failed to get activity: ${JSON.stringify(response.message)}`);
233
238
  }
@@ -236,8 +241,9 @@ var Wallet = class {
236
241
  }
237
242
  send(to, token, amount, options) {
238
243
  return __async(this, null, function* () {
244
+ const resolvedChain = this.resolveChainForEnvironment();
239
245
  const recipient = toRecipientLocator(to);
240
- const tokenLocator = toTokenLocator(token, this.chain);
246
+ const tokenLocator = toTokenLocator(token, resolvedChain);
241
247
  walletsLogger.info("wallet.send.start", __spreadValues({
242
248
  recipient,
243
249
  token: tokenLocator,
@@ -449,6 +455,13 @@ var Wallet = class {
449
455
  get isSolanaWallet() {
450
456
  return this.chain === "solana";
451
457
  }
458
+ resolveChainForEnvironment() {
459
+ const resolvedChain = validateChainForEnvironment(this.chain, __privateGet(this, _apiClient).environment);
460
+ if (resolvedChain !== this.chain) {
461
+ this.chain = resolvedChain;
462
+ }
463
+ return this.chain;
464
+ }
452
465
  approveTransactionAndWait(transactionId, options) {
453
466
  return __async(this, null, function* () {
454
467
  yield this.approveTransactionInternal(transactionId, options);
@@ -1,16 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkREP547HHcjs = require('./chunk-REP547HH.cjs');
4
+ var _chunkKVYY4QDBcjs = require('./chunk-KVYY4QDB.cjs');
5
5
 
6
6
 
7
- var _chunkFQV77LH4cjs = require('./chunk-FQV77LH4.cjs');
7
+ var _chunkVKXKQ5YIcjs = require('./chunk-VKXKQ5YI.cjs');
8
8
 
9
9
 
10
10
  var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
11
11
 
12
12
  // src/signers/non-custodial/ncs-stellar-signer.ts
13
- var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends _chunkREP547HHcjs.NonCustodialSigner {
13
+ var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends _chunkKVYY4QDBcjs.NonCustodialSigner {
14
14
  constructor(config) {
15
15
  super(config);
16
16
  }
@@ -24,7 +24,7 @@ var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends _chunkR
24
24
  var _a;
25
25
  yield this.handleAuthRequired();
26
26
  const jwt = this.getJwtOrThrow();
27
- _chunkFQV77LH4cjs.walletsLogger.info("sign: sending request", { keyType: "ed25519" });
27
+ _chunkVKXKQ5YIcjs.walletsLogger.info("sign: sending request", { keyType: "ed25519" });
28
28
  const startTime = Date.now();
29
29
  const res = yield (_a = this.config.clientTEEConnection) == null ? void 0 : _a.sendAction({
30
30
  event: "request:sign",
@@ -40,9 +40,9 @@ var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends _chunkR
40
40
  encoding: "base64"
41
41
  }
42
42
  },
43
- options: _chunkREP547HHcjs.DEFAULT_EVENT_OPTIONS
43
+ options: _chunkKVYY4QDBcjs.DEFAULT_EVENT_OPTIONS
44
44
  });
45
- _chunkFQV77LH4cjs.walletsLogger.info("sign: response received", {
45
+ _chunkVKXKQ5YIcjs.walletsLogger.info("sign: response received", {
46
46
  status: res == null ? void 0 : res.status,
47
47
  durationMs: Date.now() - startTime
48
48
  });