@crossmint/wallets-sdk 0.5.2 → 0.6.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 (92) hide show
  1. package/dist/api/client.cjs +1 -1
  2. package/dist/api/client.d.cts +6 -2
  3. package/dist/api/client.d.ts +6 -2
  4. package/dist/api/client.js +1 -1
  5. package/dist/api/gen/types.gen.d.cts +35 -0
  6. package/dist/api/gen/types.gen.d.ts +35 -0
  7. package/dist/api/index.cjs +1 -1
  8. package/dist/api/index.d.cts +1 -1
  9. package/dist/api/index.d.ts +1 -1
  10. package/dist/api/index.js +1 -1
  11. package/dist/api/types.d.cts +4 -1
  12. package/dist/api/types.d.ts +4 -1
  13. package/dist/{chunk-D67AZHCX.cjs → chunk-22NLCTH3.cjs} +1 -1
  14. package/dist/chunk-3LGWGGCM.js +1 -0
  15. package/dist/chunk-62C33UL4.cjs +1 -0
  16. package/dist/chunk-7K5B5Q3Y.cjs +1 -0
  17. package/dist/chunk-BUI2QYUC.js +1 -0
  18. package/dist/chunk-DGPUMPXP.cjs +1 -0
  19. package/dist/chunk-DNWDTJR6.cjs +1 -0
  20. package/dist/{chunk-SYBJ7MT3.js → chunk-EFRCLQXM.js} +1 -1
  21. package/dist/{chunk-FEHPDTLM.js → chunk-NVRT2CJB.js} +1 -1
  22. package/dist/{chunk-NOQASYSI.cjs → chunk-P6OETJSN.cjs} +1 -1
  23. package/dist/{chunk-B62JJITC.cjs → chunk-PQH5C2OM.cjs} +1 -1
  24. package/dist/{chunk-THYR3NRL.js → chunk-QWYYZW5W.js} +1 -1
  25. package/dist/{chunk-USEBBJLH.cjs → chunk-RWMILVIE.cjs} +1 -1
  26. package/dist/{chunk-O3UGYUNV.js → chunk-VORKK52Z.js} +1 -1
  27. package/dist/chunk-W5FFWAOI.js +1 -0
  28. package/dist/{chunk-7QMIL57Y.cjs → chunk-WBLNMQR2.cjs} +1 -1
  29. package/dist/chunk-YLMKJ56K.js +1 -0
  30. package/dist/chunk-ZJL3PQCL.js +1 -0
  31. package/dist/evm/index.cjs +1 -1
  32. package/dist/evm/index.d.cts +1 -1
  33. package/dist/evm/index.d.ts +1 -1
  34. package/dist/evm/index.js +1 -1
  35. package/dist/evm/types/wallet.d.cts +32 -41
  36. package/dist/evm/types/wallet.d.ts +32 -41
  37. package/dist/evm/wallet.cjs +1 -1
  38. package/dist/evm/wallet.d.cts +71 -21
  39. package/dist/evm/wallet.d.ts +71 -21
  40. package/dist/evm/wallet.js +1 -1
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.d.cts +5 -5
  43. package/dist/index.d.ts +5 -5
  44. package/dist/index.js +1 -1
  45. package/dist/{options-DGElO-xR.d.cts → options-BfWQ7h7d.d.cts} +19 -30
  46. package/dist/{options-DmcWBOpe.d.ts → options-Dwn6w8Ar.d.ts} +19 -30
  47. package/dist/sdk.cjs +1 -1
  48. package/dist/sdk.d.cts +1 -1
  49. package/dist/sdk.d.ts +1 -1
  50. package/dist/sdk.js +1 -1
  51. package/dist/services/types.d.cts +1 -2
  52. package/dist/services/types.d.ts +1 -2
  53. package/dist/services/wallet-factory.cjs +1 -1
  54. package/dist/services/wallet-factory.d.cts +1 -1
  55. package/dist/services/wallet-factory.d.ts +1 -1
  56. package/dist/services/wallet-factory.js +1 -1
  57. package/dist/solana/index.cjs +1 -1
  58. package/dist/solana/index.d.cts +2 -2
  59. package/dist/solana/index.d.ts +2 -2
  60. package/dist/solana/index.js +1 -1
  61. package/dist/solana/services/approvals-service.cjs +1 -1
  62. package/dist/solana/services/approvals-service.d.cts +2 -2
  63. package/dist/solana/services/approvals-service.d.ts +2 -2
  64. package/dist/solana/services/approvals-service.js +1 -1
  65. package/dist/solana/services/delegated-signers-service.cjs +1 -1
  66. package/dist/solana/services/delegated-signers-service.d.cts +2 -2
  67. package/dist/solana/services/delegated-signers-service.d.ts +2 -2
  68. package/dist/solana/services/delegated-signers-service.js +1 -1
  69. package/dist/solana/services/transactions-service.cjs +1 -1
  70. package/dist/solana/services/transactions-service.d.cts +1 -1
  71. package/dist/solana/services/transactions-service.d.ts +1 -1
  72. package/dist/solana/services/transactions-service.js +1 -1
  73. package/dist/solana/types/wallet.d.cts +18 -10
  74. package/dist/solana/types/wallet.d.ts +18 -10
  75. package/dist/solana/wallet.cjs +1 -1
  76. package/dist/solana/wallet.d.cts +2 -2
  77. package/dist/solana/wallet.d.ts +2 -2
  78. package/dist/solana/wallet.js +1 -1
  79. package/dist/utils/constants.cjs +1 -1
  80. package/dist/utils/constants.js +1 -1
  81. package/dist/utils/options.d.cts +1 -1
  82. package/dist/utils/options.d.ts +1 -1
  83. package/package.json +4 -4
  84. package/dist/chunk-7IGI7P26.js +0 -1
  85. package/dist/chunk-C4BKKX7I.cjs +0 -1
  86. package/dist/chunk-CKCQ2NTZ.js +0 -1
  87. package/dist/chunk-EOV2V3ZM.cjs +0 -1
  88. package/dist/chunk-FK6GUFCI.js +0 -1
  89. package/dist/chunk-RB66U3DD.cjs +0 -1
  90. package/dist/chunk-RF3DRJOH.js +0 -1
  91. package/dist/chunk-RNRZUJGI.js +0 -1
  92. package/dist/chunk-RWCX6PZU.cjs +0 -1
package/dist/sdk.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Crossmint } from '@crossmint/common-sdk-base';
2
2
  export { Crossmint, createCrossmint } from '@crossmint/common-sdk-base';
3
3
  import { WalletTypeToArgs, WalletTypeToWallet } from './services/types.js';
4
- import { W as WalletOptions } from './options-DmcWBOpe.js';
4
+ import { W as WalletOptions } from './options-Dwn6w8Ar.js';
5
5
  import './evm/types/signers.js';
6
6
  import 'ox';
7
7
  import 'viem';
package/dist/sdk.js CHANGED
@@ -1 +1 @@
1
- import{a,b}from"./chunk-FEHPDTLM.js";import"./chunk-FK6GUFCI.js";import"./chunk-ITCP6W2T.js";import"./chunk-SDH5CVH7.js";import"./chunk-OKXV3IAA.js";import"./chunk-7IGI7P26.js";import"./chunk-RNRZUJGI.js";import"./chunk-O3UGYUNV.js";import"./chunk-SYBJ7MT3.js";import"./chunk-6W35AARC.js";import"./chunk-5IFDVB4Y.js";import"./chunk-RF3DRJOH.js";import"./chunk-KBJA7JDT.js";import"./chunk-CGHMCYX6.js";import"./chunk-7WRWCJJ6.js";import"./chunk-CKCQ2NTZ.js";import"./chunk-HKY6CBZC.js";import"./chunk-DGSYBCLX.js";import"./chunk-SILEK5O4.js";import"./chunk-KVFFSUF4.js";import"./chunk-LX6WD7J6.js";import"./chunk-THYR3NRL.js";import"./chunk-7ENJXL4H.js";import"./chunk-22GIA4MK.js";export{b as CrossmintWallets,a as createCrossmint};
1
+ import{a,b}from"./chunk-NVRT2CJB.js";import"./chunk-W5FFWAOI.js";import"./chunk-ITCP6W2T.js";import"./chunk-SDH5CVH7.js";import"./chunk-OKXV3IAA.js";import"./chunk-BUI2QYUC.js";import"./chunk-YLMKJ56K.js";import"./chunk-VORKK52Z.js";import"./chunk-EFRCLQXM.js";import"./chunk-6W35AARC.js";import"./chunk-5IFDVB4Y.js";import"./chunk-3LGWGGCM.js";import"./chunk-KBJA7JDT.js";import"./chunk-CGHMCYX6.js";import"./chunk-7WRWCJJ6.js";import"./chunk-ZJL3PQCL.js";import"./chunk-HKY6CBZC.js";import"./chunk-DGSYBCLX.js";import"./chunk-SILEK5O4.js";import"./chunk-KVFFSUF4.js";import"./chunk-LX6WD7J6.js";import"./chunk-QWYYZW5W.js";import"./chunk-7ENJXL4H.js";import"./chunk-22GIA4MK.js";export{b as CrossmintWallets,a as createCrossmint};
@@ -1,12 +1,12 @@
1
1
  import { EVMSignerInput } from '../evm/types/signers.cjs';
2
2
  import { EVMSmartWallet } from '../evm/types/wallet.cjs';
3
- import { EVMSmartWalletChain } from '../evm/chains/index.cjs';
4
3
  import { SolanaSignerInput } from '../solana/types/signers.cjs';
5
4
  import { SolanaSmartWallet, SolanaMPCWallet } from '../solana/types/wallet.cjs';
6
5
  import 'ox';
7
6
  import 'viem';
8
7
  import '../api/types.cjs';
9
8
  import '../api/gen/types.gen.cjs';
9
+ import '../evm/chains/index.cjs';
10
10
  import '@solana/web3.js';
11
11
  import '../solana/tokens.cjs';
12
12
 
@@ -20,7 +20,6 @@ type WalletTypeToWallet = {
20
20
  };
21
21
  type WalletTypeToArgs = {
22
22
  "evm-smart-wallet": {
23
- chain: EVMSmartWalletChain;
24
23
  adminSigner: EVMSignerInput;
25
24
  linkedUser?: string;
26
25
  };
@@ -1,12 +1,12 @@
1
1
  import { EVMSignerInput } from '../evm/types/signers.js';
2
2
  import { EVMSmartWallet } from '../evm/types/wallet.js';
3
- import { EVMSmartWalletChain } from '../evm/chains/index.js';
4
3
  import { SolanaSignerInput } from '../solana/types/signers.js';
5
4
  import { SolanaSmartWallet, SolanaMPCWallet } from '../solana/types/wallet.js';
6
5
  import 'ox';
7
6
  import 'viem';
8
7
  import '../api/types.js';
9
8
  import '../api/gen/types.gen.js';
9
+ import '../evm/chains/index.js';
10
10
  import '@solana/web3.js';
11
11
  import '../solana/tokens.js';
12
12
 
@@ -20,7 +20,6 @@ type WalletTypeToWallet = {
20
20
  };
21
21
  type WalletTypeToArgs = {
22
22
  "evm-smart-wallet": {
23
- chain: EVMSmartWalletChain;
24
23
  adminSigner: EVMSignerInput;
25
24
  linkedUser?: string;
26
25
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkC4BKKX7Icjs = require('../chunk-C4BKKX7I.cjs');require('../chunk-3TTYXSH3.cjs');require('../chunk-F7GTDFYC.cjs');require('../chunk-VDYYOSPR.cjs');require('../chunk-EOV2V3ZM.cjs');require('../chunk-RB66U3DD.cjs');require('../chunk-D67AZHCX.cjs');require('../chunk-B62JJITC.cjs');require('../chunk-6XOH62PV.cjs');require('../chunk-C2WL57HT.cjs');require('../chunk-XKXW2FNY.cjs');require('../chunk-RWCX6PZU.cjs');require('../chunk-6DTBGTSS.cjs');require('../chunk-JFUBHJ2C.cjs');require('../chunk-F2XDGZCB.cjs');require('../chunk-MFUN74KH.cjs');require('../chunk-DANM4IBF.cjs');require('../chunk-NOQASYSI.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-CK4JCQY6.cjs');exports.WalletFactory = _chunkC4BKKX7Icjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkDGPUMPXPcjs = require('../chunk-DGPUMPXP.cjs');require('../chunk-3TTYXSH3.cjs');require('../chunk-F7GTDFYC.cjs');require('../chunk-VDYYOSPR.cjs');require('../chunk-62C33UL4.cjs');require('../chunk-DNWDTJR6.cjs');require('../chunk-22NLCTH3.cjs');require('../chunk-PQH5C2OM.cjs');require('../chunk-6XOH62PV.cjs');require('../chunk-C2WL57HT.cjs');require('../chunk-XKXW2FNY.cjs');require('../chunk-7K5B5Q3Y.cjs');require('../chunk-6DTBGTSS.cjs');require('../chunk-JFUBHJ2C.cjs');require('../chunk-F2XDGZCB.cjs');require('../chunk-MFUN74KH.cjs');require('../chunk-DANM4IBF.cjs');require('../chunk-P6OETJSN.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-CK4JCQY6.cjs');exports.WalletFactory = _chunkDGPUMPXPcjs.a;
@@ -1,6 +1,6 @@
1
1
  import { WalletTypeToArgs, WalletTypeToWallet } from './types.cjs';
2
2
  import { ApiClient } from '../api/client.cjs';
3
- import { W as WalletOptions } from '../options-DGElO-xR.cjs';
3
+ import { W as WalletOptions } from '../options-BfWQ7h7d.cjs';
4
4
  import '../evm/types/signers.cjs';
5
5
  import 'ox';
6
6
  import 'viem';
@@ -1,6 +1,6 @@
1
1
  import { WalletTypeToArgs, WalletTypeToWallet } from './types.js';
2
2
  import { ApiClient } from '../api/client.js';
3
- import { W as WalletOptions } from '../options-DmcWBOpe.js';
3
+ import { W as WalletOptions } from '../options-Dwn6w8Ar.js';
4
4
  import '../evm/types/signers.js';
5
5
  import 'ox';
6
6
  import 'viem';
@@ -1 +1 @@
1
- import{a}from"../chunk-FK6GUFCI.js";import"../chunk-ITCP6W2T.js";import"../chunk-SDH5CVH7.js";import"../chunk-OKXV3IAA.js";import"../chunk-7IGI7P26.js";import"../chunk-RNRZUJGI.js";import"../chunk-O3UGYUNV.js";import"../chunk-SYBJ7MT3.js";import"../chunk-6W35AARC.js";import"../chunk-CGHMCYX6.js";import"../chunk-7WRWCJJ6.js";import"../chunk-CKCQ2NTZ.js";import"../chunk-HKY6CBZC.js";import"../chunk-DGSYBCLX.js";import"../chunk-SILEK5O4.js";import"../chunk-KVFFSUF4.js";import"../chunk-LX6WD7J6.js";import"../chunk-THYR3NRL.js";import"../chunk-7ENJXL4H.js";import"../chunk-22GIA4MK.js";export{a as WalletFactory};
1
+ import{a}from"../chunk-W5FFWAOI.js";import"../chunk-ITCP6W2T.js";import"../chunk-SDH5CVH7.js";import"../chunk-OKXV3IAA.js";import"../chunk-BUI2QYUC.js";import"../chunk-YLMKJ56K.js";import"../chunk-VORKK52Z.js";import"../chunk-EFRCLQXM.js";import"../chunk-6W35AARC.js";import"../chunk-CGHMCYX6.js";import"../chunk-7WRWCJJ6.js";import"../chunk-ZJL3PQCL.js";import"../chunk-HKY6CBZC.js";import"../chunk-DGSYBCLX.js";import"../chunk-SILEK5O4.js";import"../chunk-KVFFSUF4.js";import"../chunk-LX6WD7J6.js";import"../chunk-QWYYZW5W.js";import"../chunk-7ENJXL4H.js";import"../chunk-22GIA4MK.js";export{a as WalletFactory};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-3TTYXSH3.cjs');require('../chunk-F7GTDFYC.cjs');var _chunkEOV2V3ZMcjs = require('../chunk-EOV2V3ZM.cjs');require('../chunk-RB66U3DD.cjs');require('../chunk-D67AZHCX.cjs');require('../chunk-B62JJITC.cjs');var _chunk6XOH62PVcjs = require('../chunk-6XOH62PV.cjs');require('../chunk-DANM4IBF.cjs');require('../chunk-NOQASYSI.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-CK4JCQY6.cjs');exports.SolanaMPCWalletImpl = _chunkEOV2V3ZMcjs.c; exports.SolanaSmartWalletImpl = _chunkEOV2V3ZMcjs.b; exports.SolanaWallet = _chunkEOV2V3ZMcjs.a; exports.isCustodialSigner = _chunk6XOH62PVcjs.b; exports.isNonCustodialSigner = _chunk6XOH62PVcjs.c; exports.parseSolanaNonCustodialSignerInput = _chunk6XOH62PVcjs.a; exports.parseSolanaSignerInput = _chunk6XOH62PVcjs.d;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-3TTYXSH3.cjs');require('../chunk-F7GTDFYC.cjs');var _chunk62C33UL4cjs = require('../chunk-62C33UL4.cjs');require('../chunk-DNWDTJR6.cjs');require('../chunk-22NLCTH3.cjs');require('../chunk-PQH5C2OM.cjs');var _chunk6XOH62PVcjs = require('../chunk-6XOH62PV.cjs');require('../chunk-DANM4IBF.cjs');require('../chunk-P6OETJSN.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-CK4JCQY6.cjs');exports.SolanaMPCWalletImpl = _chunk62C33UL4cjs.c; exports.SolanaSmartWalletImpl = _chunk62C33UL4cjs.b; exports.SolanaWallet = _chunk62C33UL4cjs.a; exports.isCustodialSigner = _chunk6XOH62PVcjs.b; exports.isNonCustodialSigner = _chunk6XOH62PVcjs.c; exports.parseSolanaNonCustodialSignerInput = _chunk6XOH62PVcjs.a; exports.parseSolanaSignerInput = _chunk6XOH62PVcjs.d;
@@ -1,4 +1,4 @@
1
- export { d as SolanaMPCWalletImpl, c as SolanaSmartWalletImpl, b as SolanaWallet, T as Transaction } from '../options-DGElO-xR.cjs';
1
+ export { d as SolanaMPCWalletImpl, c as SolanaSmartWalletImpl, b as SolanaWallet, T as Transaction } from '../options-BfWQ7h7d.cjs';
2
2
  export { SolanaSupportedToken } from './tokens.cjs';
3
3
  export { SolanaAddress, SolanaCustodialSigner, SolanaCustodialSignerInput, SolanaExternalSignerInput, SolanaKeypairSignerInput, SolanaNonCustodialSigner, SolanaNonCustodialSignerInput, SolanaSigner, SolanaSignerInput, isCustodialSigner, isNonCustodialSigner, parseSolanaNonCustodialSignerInput, parseSolanaSignerInput } from './types/signers.cjs';
4
4
  export { SolanaMPCWallet, SolanaSmartWallet } from './types/wallet.cjs';
@@ -7,7 +7,7 @@ import 'viem';
7
7
  import '../api/types.cjs';
8
8
  import '../api/gen/types.gen.cjs';
9
9
  import '../evm/chains/index.cjs';
10
- import '@solana/web3.js';
11
10
  import '../api/client.cjs';
12
11
  import '@crossmint/common-sdk-base';
12
+ import '@solana/web3.js';
13
13
  import './services/approvals-service.cjs';
@@ -1,4 +1,4 @@
1
- export { d as SolanaMPCWalletImpl, c as SolanaSmartWalletImpl, b as SolanaWallet, T as Transaction } from '../options-DmcWBOpe.js';
1
+ export { d as SolanaMPCWalletImpl, c as SolanaSmartWalletImpl, b as SolanaWallet, T as Transaction } from '../options-Dwn6w8Ar.js';
2
2
  export { SolanaSupportedToken } from './tokens.js';
3
3
  export { SolanaAddress, SolanaCustodialSigner, SolanaCustodialSignerInput, SolanaExternalSignerInput, SolanaKeypairSignerInput, SolanaNonCustodialSigner, SolanaNonCustodialSignerInput, SolanaSigner, SolanaSignerInput, isCustodialSigner, isNonCustodialSigner, parseSolanaNonCustodialSignerInput, parseSolanaSignerInput } from './types/signers.js';
4
4
  export { SolanaMPCWallet, SolanaSmartWallet } from './types/wallet.js';
@@ -7,7 +7,7 @@ import 'viem';
7
7
  import '../api/types.js';
8
8
  import '../api/gen/types.gen.js';
9
9
  import '../evm/chains/index.js';
10
- import '@solana/web3.js';
11
10
  import '../api/client.js';
12
11
  import '@crossmint/common-sdk-base';
12
+ import '@solana/web3.js';
13
13
  import './services/approvals-service.js';
@@ -1 +1 @@
1
- import"../chunk-ITCP6W2T.js";import"../chunk-SDH5CVH7.js";import{a as e,b as f,c as g}from"../chunk-7IGI7P26.js";import"../chunk-RNRZUJGI.js";import"../chunk-O3UGYUNV.js";import"../chunk-SYBJ7MT3.js";import{a,b,c,d}from"../chunk-6W35AARC.js";import"../chunk-LX6WD7J6.js";import"../chunk-THYR3NRL.js";import"../chunk-7ENJXL4H.js";import"../chunk-22GIA4MK.js";export{g as SolanaMPCWalletImpl,f as SolanaSmartWalletImpl,e as SolanaWallet,b as isCustodialSigner,c as isNonCustodialSigner,a as parseSolanaNonCustodialSignerInput,d as parseSolanaSignerInput};
1
+ import"../chunk-ITCP6W2T.js";import"../chunk-SDH5CVH7.js";import{a as e,b as f,c as g}from"../chunk-BUI2QYUC.js";import"../chunk-YLMKJ56K.js";import"../chunk-VORKK52Z.js";import"../chunk-EFRCLQXM.js";import{a,b,c,d}from"../chunk-6W35AARC.js";import"../chunk-LX6WD7J6.js";import"../chunk-QWYYZW5W.js";import"../chunk-7ENJXL4H.js";import"../chunk-22GIA4MK.js";export{g as SolanaMPCWalletImpl,f as SolanaSmartWalletImpl,e as SolanaWallet,b as isCustodialSigner,c as isNonCustodialSigner,a as parseSolanaNonCustodialSignerInput,d as parseSolanaSignerInput};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkB62JJITCcjs = require('../../chunk-B62JJITC.cjs');require('../../chunk-CT2UGJEL.cjs');require('../../chunk-CK4JCQY6.cjs');exports.SolanaApprovalsService = _chunkB62JJITCcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPQH5C2OMcjs = require('../../chunk-PQH5C2OM.cjs');require('../../chunk-CT2UGJEL.cjs');require('../../chunk-CK4JCQY6.cjs');exports.SolanaApprovalsService = _chunkPQH5C2OMcjs.a;
@@ -1,7 +1,7 @@
1
+ import { WalletsV1Alpha2TransactionResponseDto } from '../../api/gen/types.gen.cjs';
1
2
  import { ApiClient } from '../../api/client.cjs';
2
3
  import { SolanaWalletLocator, CreateTransactionSuccessResponse } from '../../api/types.cjs';
3
4
  import { SolanaNonCustodialSigner } from '../types/signers.cjs';
4
- import { WalletsV1Alpha2TransactionResponseDto } from '../../api/gen/types.gen.cjs';
5
5
  import '@crossmint/common-sdk-base';
6
6
  import 'viem';
7
7
  import '@solana/web3.js';
@@ -11,7 +11,7 @@ declare class SolanaApprovalsService {
11
11
  private readonly walletLocator;
12
12
  private readonly apiClient;
13
13
  constructor(walletLocator: SolanaWalletLocator, apiClient: ApiClient);
14
- approve(transaction: WalletsV1Alpha2TransactionResponseDto, pendingApprovals: Array<PendingApproval>, signers: Array<SolanaNonCustodialSigner>): Promise<WalletsV1Alpha2TransactionResponseDto>;
14
+ approve(transaction: CreateTransactionSuccessResponse, pendingApprovals: Array<PendingApproval>, signers: Array<SolanaNonCustodialSigner>): Promise<WalletsV1Alpha2TransactionResponseDto>;
15
15
  private retrieveValidSignature;
16
16
  }
17
17
 
@@ -1,7 +1,7 @@
1
+ import { WalletsV1Alpha2TransactionResponseDto } from '../../api/gen/types.gen.js';
1
2
  import { ApiClient } from '../../api/client.js';
2
3
  import { SolanaWalletLocator, CreateTransactionSuccessResponse } from '../../api/types.js';
3
4
  import { SolanaNonCustodialSigner } from '../types/signers.js';
4
- import { WalletsV1Alpha2TransactionResponseDto } from '../../api/gen/types.gen.js';
5
5
  import '@crossmint/common-sdk-base';
6
6
  import 'viem';
7
7
  import '@solana/web3.js';
@@ -11,7 +11,7 @@ declare class SolanaApprovalsService {
11
11
  private readonly walletLocator;
12
12
  private readonly apiClient;
13
13
  constructor(walletLocator: SolanaWalletLocator, apiClient: ApiClient);
14
- approve(transaction: WalletsV1Alpha2TransactionResponseDto, pendingApprovals: Array<PendingApproval>, signers: Array<SolanaNonCustodialSigner>): Promise<WalletsV1Alpha2TransactionResponseDto>;
14
+ approve(transaction: CreateTransactionSuccessResponse, pendingApprovals: Array<PendingApproval>, signers: Array<SolanaNonCustodialSigner>): Promise<WalletsV1Alpha2TransactionResponseDto>;
15
15
  private retrieveValidSignature;
16
16
  }
17
17
 
@@ -1 +1 @@
1
- import{a}from"../../chunk-SYBJ7MT3.js";import"../../chunk-7ENJXL4H.js";import"../../chunk-22GIA4MK.js";export{a as SolanaApprovalsService};
1
+ import{a}from"../../chunk-EFRCLQXM.js";import"../../chunk-7ENJXL4H.js";import"../../chunk-22GIA4MK.js";export{a as SolanaApprovalsService};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkRB66U3DDcjs = require('../../chunk-RB66U3DD.cjs');require('../../chunk-CK4JCQY6.cjs');exports.SolanaDelegatedSignerService = _chunkRB66U3DDcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkDNWDTJR6cjs = require('../../chunk-DNWDTJR6.cjs');require('../../chunk-CT2UGJEL.cjs');require('../../chunk-CK4JCQY6.cjs');exports.SolanaDelegatedSignerService = _chunkDNWDTJR6cjs.a;
@@ -1,10 +1,10 @@
1
+ import '../../api/gen/types.gen.cjs';
1
2
  import '../../api/client.cjs';
2
3
  import '../../api/types.cjs';
3
- export { a as SolanaDelegatedSignerService } from '../../options-DGElO-xR.cjs';
4
+ export { a as SolanaDelegatedSignerService } from '../../options-BfWQ7h7d.cjs';
4
5
  import '../types/signers.cjs';
5
6
  import '@crossmint/common-sdk-base';
6
7
  import 'viem';
7
- import '../../api/gen/types.gen.cjs';
8
8
  import '../tokens.cjs';
9
9
  import '../types/wallet.cjs';
10
10
  import '@solana/web3.js';
@@ -1,10 +1,10 @@
1
+ import '../../api/gen/types.gen.js';
1
2
  import '../../api/client.js';
2
3
  import '../../api/types.js';
3
- export { a as SolanaDelegatedSignerService } from '../../options-DmcWBOpe.js';
4
+ export { a as SolanaDelegatedSignerService } from '../../options-Dwn6w8Ar.js';
4
5
  import '../types/signers.js';
5
6
  import '@crossmint/common-sdk-base';
6
7
  import 'viem';
7
- import '../../api/gen/types.gen.js';
8
8
  import '../tokens.js';
9
9
  import '../types/wallet.js';
10
10
  import '@solana/web3.js';
@@ -1 +1 @@
1
- import{a}from"../../chunk-RNRZUJGI.js";import"../../chunk-22GIA4MK.js";export{a as SolanaDelegatedSignerService};
1
+ import{a}from"../../chunk-YLMKJ56K.js";import"../../chunk-7ENJXL4H.js";import"../../chunk-22GIA4MK.js";export{a as SolanaDelegatedSignerService};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkD67AZHCXcjs = require('../../chunk-D67AZHCX.cjs');require('../../chunk-B62JJITC.cjs');require('../../chunk-DANM4IBF.cjs');require('../../chunk-NOQASYSI.cjs');require('../../chunk-CT2UGJEL.cjs');require('../../chunk-CK4JCQY6.cjs');exports.SolanaTransactionsService = _chunkD67AZHCXcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk22NLCTH3cjs = require('../../chunk-22NLCTH3.cjs');require('../../chunk-PQH5C2OM.cjs');require('../../chunk-DANM4IBF.cjs');require('../../chunk-P6OETJSN.cjs');require('../../chunk-CT2UGJEL.cjs');require('../../chunk-CK4JCQY6.cjs');exports.SolanaTransactionsService = _chunk22NLCTH3cjs.a;
@@ -3,7 +3,7 @@ import '../../api/types.cjs';
3
3
  import '../types/signers.cjs';
4
4
  import '@solana/web3.js';
5
5
  import './approvals-service.cjs';
6
- export { S as SolanaTransactionsService } from '../../options-DGElO-xR.cjs';
6
+ export { S as SolanaTransactionsService } from '../../options-BfWQ7h7d.cjs';
7
7
  import '@crossmint/common-sdk-base';
8
8
  import 'viem';
9
9
  import '../../api/gen/types.gen.cjs';
@@ -3,7 +3,7 @@ import '../../api/types.js';
3
3
  import '../types/signers.js';
4
4
  import '@solana/web3.js';
5
5
  import './approvals-service.js';
6
- export { S as SolanaTransactionsService } from '../../options-DmcWBOpe.js';
6
+ export { S as SolanaTransactionsService } from '../../options-Dwn6w8Ar.js';
7
7
  import '@crossmint/common-sdk-base';
8
8
  import 'viem';
9
9
  import '../../api/gen/types.gen.js';
@@ -1 +1 @@
1
- import{a}from"../../chunk-O3UGYUNV.js";import"../../chunk-SYBJ7MT3.js";import"../../chunk-LX6WD7J6.js";import"../../chunk-THYR3NRL.js";import"../../chunk-7ENJXL4H.js";import"../../chunk-22GIA4MK.js";export{a as SolanaTransactionsService};
1
+ import{a}from"../../chunk-VORKK52Z.js";import"../../chunk-EFRCLQXM.js";import"../../chunk-LX6WD7J6.js";import"../../chunk-QWYYZW5W.js";import"../../chunk-7ENJXL4H.js";import"../../chunk-22GIA4MK.js";export{a as SolanaTransactionsService};
@@ -1,4 +1,4 @@
1
- import { GetBalanceResponse, GetTransactionsResponse, SolanaWalletLocator, GetNftsResponse, GetSignerResponse } from '../../api/types.cjs';
1
+ import { WalletBalance, GetTransactionsResponse, SolanaWalletLocator, GetNftsResponse, GetSignerResponse, DelegatedSigner } from '../../api/types.cjs';
2
2
  import { SolanaSigner, SolanaNonCustodialSignerInput } from './signers.cjs';
3
3
  import { PublicKey, VersionedTransaction } from '@solana/web3.js';
4
4
  import { SolanaSupportedToken } from '../tokens.cjs';
@@ -16,10 +16,13 @@ interface BaseSolanaWallet {
16
16
  address: string;
17
17
  /**
18
18
  * Get the wallet balances
19
- * @param tokens - The tokens
20
- * @returns The balances
19
+ * @param {Object} params - The parameters
20
+ * @param {SolanaSupportedToken[]} params.tokens - The tokens
21
+ * @returns {Promise<WalletBalance>} The balances
21
22
  */
22
- getBalances(tokens: SolanaSupportedToken[]): Promise<GetBalanceResponse>;
23
+ getBalances(params: {
24
+ tokens: SolanaSupportedToken[];
25
+ }): Promise<WalletBalance>;
23
26
  /**
24
27
  * Get the wallet transactions
25
28
  * @returns The transactions
@@ -27,16 +30,21 @@ interface BaseSolanaWallet {
27
30
  getTransactions(): Promise<GetTransactionsResponse>;
28
31
  /**
29
32
  * Get the wallet NFTs
30
- * @param perPage - The number of NFTs per page
31
- * @param page - The page number
32
- * @param locator - The wallet locator
33
- * @returns The NFTs
33
+ * @param {Object} params - The parameters
34
+ * @param {number} params.perPage - The number of NFTs per page
35
+ * @param {number} params.page - The page number
36
+ * @param {SolanaWalletLocator} [params.locator] - The wallet locator
37
+ * @returns {Promise<GetNftsResponse>} The NFTs
34
38
  */
35
- unstable_getNfts(perPage: number, page: number, locator?: SolanaWalletLocator): Promise<GetNftsResponse>;
39
+ unstable_getNfts(params: {
40
+ perPage: number;
41
+ page: number;
42
+ locator?: SolanaWalletLocator;
43
+ }): Promise<GetNftsResponse>;
36
44
  }
37
45
  interface SolanaSmartWallet extends BaseSolanaWallet {
38
46
  addDelegatedSigner(signer: string): Promise<GetSignerResponse>;
39
- getDelegatedSigners(): Promise<GetSignerResponse[]>;
47
+ getDelegatedSigners(): Promise<DelegatedSigner[]>;
40
48
  adminSigner: SolanaSigner;
41
49
  sendTransaction(parameters: SmartWalletTransactionParams): Promise<string>;
42
50
  }
@@ -1,4 +1,4 @@
1
- import { GetBalanceResponse, GetTransactionsResponse, SolanaWalletLocator, GetNftsResponse, GetSignerResponse } from '../../api/types.js';
1
+ import { WalletBalance, GetTransactionsResponse, SolanaWalletLocator, GetNftsResponse, GetSignerResponse, DelegatedSigner } from '../../api/types.js';
2
2
  import { SolanaSigner, SolanaNonCustodialSignerInput } from './signers.js';
3
3
  import { PublicKey, VersionedTransaction } from '@solana/web3.js';
4
4
  import { SolanaSupportedToken } from '../tokens.js';
@@ -16,10 +16,13 @@ interface BaseSolanaWallet {
16
16
  address: string;
17
17
  /**
18
18
  * Get the wallet balances
19
- * @param tokens - The tokens
20
- * @returns The balances
19
+ * @param {Object} params - The parameters
20
+ * @param {SolanaSupportedToken[]} params.tokens - The tokens
21
+ * @returns {Promise<WalletBalance>} The balances
21
22
  */
22
- getBalances(tokens: SolanaSupportedToken[]): Promise<GetBalanceResponse>;
23
+ getBalances(params: {
24
+ tokens: SolanaSupportedToken[];
25
+ }): Promise<WalletBalance>;
23
26
  /**
24
27
  * Get the wallet transactions
25
28
  * @returns The transactions
@@ -27,16 +30,21 @@ interface BaseSolanaWallet {
27
30
  getTransactions(): Promise<GetTransactionsResponse>;
28
31
  /**
29
32
  * Get the wallet NFTs
30
- * @param perPage - The number of NFTs per page
31
- * @param page - The page number
32
- * @param locator - The wallet locator
33
- * @returns The NFTs
33
+ * @param {Object} params - The parameters
34
+ * @param {number} params.perPage - The number of NFTs per page
35
+ * @param {number} params.page - The page number
36
+ * @param {SolanaWalletLocator} [params.locator] - The wallet locator
37
+ * @returns {Promise<GetNftsResponse>} The NFTs
34
38
  */
35
- unstable_getNfts(perPage: number, page: number, locator?: SolanaWalletLocator): Promise<GetNftsResponse>;
39
+ unstable_getNfts(params: {
40
+ perPage: number;
41
+ page: number;
42
+ locator?: SolanaWalletLocator;
43
+ }): Promise<GetNftsResponse>;
36
44
  }
37
45
  interface SolanaSmartWallet extends BaseSolanaWallet {
38
46
  addDelegatedSigner(signer: string): Promise<GetSignerResponse>;
39
- getDelegatedSigners(): Promise<GetSignerResponse[]>;
47
+ getDelegatedSigners(): Promise<DelegatedSigner[]>;
40
48
  adminSigner: SolanaSigner;
41
49
  sendTransaction(parameters: SmartWalletTransactionParams): Promise<string>;
42
50
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEOV2V3ZMcjs = require('../chunk-EOV2V3ZM.cjs');require('../chunk-RB66U3DD.cjs');require('../chunk-D67AZHCX.cjs');require('../chunk-B62JJITC.cjs');require('../chunk-6XOH62PV.cjs');require('../chunk-DANM4IBF.cjs');require('../chunk-NOQASYSI.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-CK4JCQY6.cjs');exports.SolanaMPCWalletImpl = _chunkEOV2V3ZMcjs.c; exports.SolanaSmartWalletImpl = _chunkEOV2V3ZMcjs.b; exports.SolanaWallet = _chunkEOV2V3ZMcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk62C33UL4cjs = require('../chunk-62C33UL4.cjs');require('../chunk-DNWDTJR6.cjs');require('../chunk-22NLCTH3.cjs');require('../chunk-PQH5C2OM.cjs');require('../chunk-6XOH62PV.cjs');require('../chunk-DANM4IBF.cjs');require('../chunk-P6OETJSN.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-CK4JCQY6.cjs');exports.SolanaMPCWalletImpl = _chunk62C33UL4cjs.c; exports.SolanaSmartWalletImpl = _chunk62C33UL4cjs.b; exports.SolanaWallet = _chunk62C33UL4cjs.a;
@@ -1,7 +1,7 @@
1
- import '@solana/web3.js';
2
1
  import '../api/client.cjs';
3
2
  import '../api/types.cjs';
4
- export { d as SolanaMPCWalletImpl, c as SolanaSmartWalletImpl, b as SolanaWallet, T as Transaction } from '../options-DGElO-xR.cjs';
3
+ import '@solana/web3.js';
4
+ export { d as SolanaMPCWalletImpl, c as SolanaSmartWalletImpl, b as SolanaWallet, T as Transaction } from '../options-BfWQ7h7d.cjs';
5
5
  import './tokens.cjs';
6
6
  import './types/signers.cjs';
7
7
  import './types/wallet.cjs';
@@ -1,7 +1,7 @@
1
- import '@solana/web3.js';
2
1
  import '../api/client.js';
3
2
  import '../api/types.js';
4
- export { d as SolanaMPCWalletImpl, c as SolanaSmartWalletImpl, b as SolanaWallet, T as Transaction } from '../options-DmcWBOpe.js';
3
+ import '@solana/web3.js';
4
+ export { d as SolanaMPCWalletImpl, c as SolanaSmartWalletImpl, b as SolanaWallet, T as Transaction } from '../options-Dwn6w8Ar.js';
5
5
  import './tokens.js';
6
6
  import './types/signers.js';
7
7
  import './types/wallet.js';
@@ -1 +1 @@
1
- import{a,b,c}from"../chunk-7IGI7P26.js";import"../chunk-RNRZUJGI.js";import"../chunk-O3UGYUNV.js";import"../chunk-SYBJ7MT3.js";import"../chunk-6W35AARC.js";import"../chunk-LX6WD7J6.js";import"../chunk-THYR3NRL.js";import"../chunk-7ENJXL4H.js";import"../chunk-22GIA4MK.js";export{c as SolanaMPCWalletImpl,b as SolanaSmartWalletImpl,a as SolanaWallet};
1
+ import{a,b,c}from"../chunk-BUI2QYUC.js";import"../chunk-YLMKJ56K.js";import"../chunk-VORKK52Z.js";import"../chunk-EFRCLQXM.js";import"../chunk-6W35AARC.js";import"../chunk-LX6WD7J6.js";import"../chunk-QWYYZW5W.js";import"../chunk-7ENJXL4H.js";import"../chunk-22GIA4MK.js";export{c as SolanaMPCWalletImpl,b as SolanaSmartWalletImpl,a as SolanaWallet};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNOQASYSIcjs = require('../chunk-NOQASYSI.cjs');require('../chunk-CK4JCQY6.cjs');exports.ENTRY_POINT_ADDRESS = _chunkNOQASYSIcjs.d; exports.SDK_NAME = _chunkNOQASYSIcjs.c; exports.SDK_VERSION = _chunkNOQASYSIcjs.b; exports.STATUS_POLLING_INTERVAL_MS = _chunkNOQASYSIcjs.e; exports.WALLETS_SERVICE = _chunkNOQASYSIcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkP6OETJSNcjs = require('../chunk-P6OETJSN.cjs');require('../chunk-CK4JCQY6.cjs');exports.ENTRY_POINT_ADDRESS = _chunkP6OETJSNcjs.d; exports.SDK_NAME = _chunkP6OETJSNcjs.c; exports.SDK_VERSION = _chunkP6OETJSNcjs.b; exports.STATUS_POLLING_INTERVAL_MS = _chunkP6OETJSNcjs.e; exports.WALLETS_SERVICE = _chunkP6OETJSNcjs.a;
@@ -1 +1 @@
1
- import{a,b,c,d,e}from"../chunk-THYR3NRL.js";import"../chunk-22GIA4MK.js";export{d as ENTRY_POINT_ADDRESS,c as SDK_NAME,b as SDK_VERSION,e as STATUS_POLLING_INTERVAL_MS,a as WALLETS_SERVICE};
1
+ import{a,b,c,d,e}from"../chunk-QWYYZW5W.js";import"../chunk-22GIA4MK.js";export{d as ENTRY_POINT_ADDRESS,c as SDK_NAME,b as SDK_VERSION,e as STATUS_POLLING_INTERVAL_MS,a as WALLETS_SERVICE};
@@ -1,4 +1,4 @@
1
- export { C as Callbacks, f as Transaction, e as Wallet, W as WalletOptions } from '../options-DGElO-xR.cjs';
1
+ export { C as Callbacks, f as Transaction, e as Wallet, W as WalletOptions } from '../options-BfWQ7h7d.cjs';
2
2
  import '../evm/types/wallet.cjs';
3
3
  import '../solana/types/wallet.cjs';
4
4
  import '../solana/tokens.cjs';
@@ -1,4 +1,4 @@
1
- export { C as Callbacks, f as Transaction, e as Wallet, W as WalletOptions } from '../options-DmcWBOpe.js';
1
+ export { C as Callbacks, f as Transaction, e as Wallet, W as WalletOptions } from '../options-Dwn6w8Ar.js';
2
2
  import '../evm/types/wallet.js';
3
3
  import '../solana/types/wallet.js';
4
4
  import '../solana/tokens.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossmint/wallets-sdk",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "repository": "https://github.com/Crossmint/crossmint-sdk",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Paella Labs Inc",
@@ -24,11 +24,11 @@
24
24
  "ox": "0.6.9",
25
25
  "tweetnacl": "1.0.3",
26
26
  "viem": "2.23.6",
27
- "@crossmint/common-sdk-auth": "1.0.24",
28
- "@crossmint/common-sdk-base": "0.4.0"
27
+ "@crossmint/common-sdk-base": "0.4.0",
28
+ "@crossmint/common-sdk-auth": "1.0.24"
29
29
  },
30
30
  "devDependencies": {
31
- "@hey-api/openapi-ts": "0.64.5",
31
+ "@hey-api/openapi-ts": "0.66.3",
32
32
  "typedoc": "0.26.5",
33
33
  "typedoc-plugin-frontmatter": "1.0.0",
34
34
  "typedoc-plugin-markdown": "4.2.3"
@@ -1 +0,0 @@
1
- import{a as d}from"./chunk-RNRZUJGI.js";import{a as S}from"./chunk-O3UGYUNV.js";import{a as r,c as o,d as c}from"./chunk-6W35AARC.js";import{c as t}from"./chunk-22GIA4MK.js";var s=class{constructor(e,n,a,i){this.apiClient=e;this.publicKey=n;this.client=a;this.callbacks=i;this.transactionsService=new S(this.walletLocator,this.apiClient),this.delegatedSignerService=new d(this.walletLocator,this.transactionsService,e)}get address(){return this.publicKey.toBase58()}getBalances(e){return t(this,null,function*(){return yield this.apiClient.getBalance(this.address,{tokens:e})})}getTransactions(){return t(this,null,function*(){return yield this.transactionsService.getTransactions()})}unstable_getNfts(e,n,a){return t(this,null,function*(){return yield this.apiClient.unstable_getNfts("solana",a!=null?a:this.walletLocator,e,n)})}get walletLocator(){return this.apiClient.isServerSide?this.address:"me:solana-smart-wallet"}},p=class extends s{constructor(e,n,a,i,u){super(e,n,i,u),this.adminSigner=c(a)}sendTransaction(e){return t(this,null,function*(){var i;let n=this.getEffectiveTransactionSigner(e.delegatedSigner),a=(i=e.additionalSigners)==null?void 0:i.map(r);return yield this.transactionsService.createSignAndConfirm({transaction:e.transaction,signer:n,additionalSigners:a})})}addDelegatedSigner(e){return t(this,null,function*(){return yield this.delegatedSignerService.registerDelegatedSigner(e,o(this.adminSigner)?this.adminSigner:void 0)})}getDelegatedSigners(){return t(this,null,function*(){return yield this.delegatedSignerService.getDelegatedSigners()})}getEffectiveTransactionSigner(e){return e==null?o(this.adminSigner)?this.adminSigner:void 0:r(e)}},g=class extends s{sendTransaction(e){return t(this,null,function*(){var n;return yield this.transactionsService.createSignAndConfirm({transaction:e.transaction,additionalSigners:(n=e.additionalSigners)==null?void 0:n.map(r)})})}};export{s as a,p as b,g as c};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVDYYOSPRcjs = require('./chunk-VDYYOSPR.cjs');var _chunkEOV2V3ZMcjs = require('./chunk-EOV2V3ZM.cjs');var _chunk6XOH62PVcjs = require('./chunk-6XOH62PV.cjs');var _chunkXKXW2FNYcjs = require('./chunk-XKXW2FNY.cjs');var _chunkRWCX6PZUcjs = require('./chunk-RWCX6PZU.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkCK4JCQY6cjs = require('./chunk-CK4JCQY6.cjs');var _web3js = require('@solana/web3.js');var h=class{constructor(n){this.apiClient=n}getOrCreateWallet(n,s,a){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var t,i,p,r;try{let l=yield this.getOrCreateWalletInternal(n,s,a);if("error"in l)throw new (0, _chunkCT2UGJELcjs.f)(JSON.stringify(l));let e=this.createWalletInstance(n,l,s,a);return yield(i=(t=a==null?void 0:a.experimental_callbacks)==null?void 0:t.onWalletCreationComplete)==null?void 0:i.call(t,e),e}catch(l){throw yield(r=(p=a==null?void 0:a.experimental_callbacks)==null?void 0:p.onWalletCreationFail)==null?void 0:r.call(p,l),l}})}getWallet(n,s,a,t){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){let i=this.apiClient.isServerSide?n:`me:${s}`,p=yield this.apiClient.getWallet(i);if("error"in p)throw new (0, _chunkCT2UGJELcjs.d)(JSON.stringify(p));return this.createWalletInstance(s,p,a,t)})}getOrCreateWalletInternal(n,s,a){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var i,p;let t=this.apiClient.isServerSide?null:yield this.apiClient.getWallet(`me:${n}`);if(t&&!("error"in t))return t;if(yield(p=(i=a==null?void 0:a.experimental_callbacks)==null?void 0:i.onWalletCreationStart)==null?void 0:p.call(i),n==="evm-smart-wallet"){let{adminSigner:r,linkedUser:l}=s,e=r.type==="evm-keypair"?r:yield _chunkXKXW2FNYcjs.b.call(void 0, r.name,r.creationCallback);return yield this.apiClient.createWallet({type:"evm-smart-wallet",config:{adminSigner:e},linkedUser:l})}else if(n==="solana-smart-wallet"){let{adminSigner:r,linkedUser:l}=s;return yield this.apiClient.createWallet({type:"solana-smart-wallet",config:{adminSigner:r!=null?(()=>{let e=_chunk6XOH62PVcjs.d.call(void 0, r);return e.type==="solana-keypair"?{type:e.type,address:e.address}:{type:e.type}})():void 0},linkedUser:l})}else if(n==="solana-mpc-wallet"){let{linkedUser:r}=s;return yield this.apiClient.createWallet({type:"solana-mpc-wallet",linkedUser:r})}else throw new (0, _chunkCT2UGJELcjs.c)(`Wallet type ${n} not supported`)})}createWalletInstance(n,s,a,t){switch(this.assertCorrectWalletType(s,n),this.checkWalletConfig(s,a),n){case"evm-smart-wallet":let i=a;return this.createEvmWalletInstance(n,s,i,t);case"solana-smart-wallet":case"solana-mpc-wallet":let r=a;return this.createSolanaWalletInstance(n,s,r,t);default:throw new (0, _chunkCT2UGJELcjs.c)(`Wallet type ${n} not supported`)}}createEvmWalletInstance(n,s,a,t){var i;switch(n){case"evm-smart-wallet":{let{chain:p,adminSigner:r}=a,l=s,e=new (0, _chunkRWCX6PZUcjs.a)(p,l.address,this.apiClient,_chunkXKXW2FNYcjs.a.call(void 0, r,l),(i=t==null?void 0:t.experimental_callbacks)!=null?i:{});return{getBalances:e.getBalances.bind(e),getTransactions:e.getTransactions.bind(e),unstable_getNfts:e.unstable_getNfts.bind(e),getNonce:e.getNonce.bind(e),signMessage:e.signMessage.bind(e),signTypedData:e.signTypedData.bind(e),sendTransaction:e.sendTransaction.bind(e),address:e.address,chain:e.chain,publicClient:e.publicClient}}}}createSolanaWalletInstance(n,s,a,t){var p,r;let i=s;switch(n){case"solana-smart-wallet":{let{adminSigner:l}=a,e=new (0, _chunkEOV2V3ZMcjs.b)(this.apiClient,new (0, _web3js.PublicKey)(i.address),l!=null?l:{type:"solana-fireblocks-custodial"},_chunkVDYYOSPRcjs.a.call(void 0, this.apiClient.environment),(p=t==null?void 0:t.experimental_callbacks)!=null?p:{});return{getDelegatedSigners:e.getDelegatedSigners.bind(e),addDelegatedSigner:e.addDelegatedSigner.bind(e),getBalances:e.getBalances.bind(e),unstable_getNfts:e.unstable_getNfts.bind(e),sendTransaction:e.sendTransaction.bind(e),getTransactions:e.getTransactions.bind(e),address:e.address,publicKey:e.publicKey,adminSigner:e.adminSigner}}case"solana-mpc-wallet":{let l=new (0, _chunkEOV2V3ZMcjs.c)(this.apiClient,new (0, _web3js.PublicKey)(i.address),_chunkVDYYOSPRcjs.a.call(void 0, this.apiClient.environment),(r=t==null?void 0:t.experimental_callbacks)!=null?r:{});return{sendTransaction:l.sendTransaction.bind(l),getBalances:l.getBalances.bind(l),unstable_getNfts:l.unstable_getNfts.bind(l),getTransactions:l.getTransactions.bind(l),address:l.address,publicKey:l.publicKey}}}}checkWalletConfig(n,s){switch(n.type){case"evm-smart-wallet":case"solana-smart-wallet":{let{adminSigner:a}=s;if(a===void 0)return;let t=n.config.adminSigner;if(t.type!==a.type)throw new (0, _chunkCT2UGJELcjs.e)(`Invalid admin signer type: expected "${a.type}", got "${t.type}"`);switch(t.type){case"evm-keypair":case"solana-keypair":{if(a.type!=="evm-keypair"&&a.type!=="solana-keypair")throw new (0, _chunkCT2UGJELcjs.e)(`Invalid admin signer type: expected "${a.type}", got "${t.type}"`);if(t.address!==a.address)throw new (0, _chunkCT2UGJELcjs.e)(`Invalid admin signer address: expected "${t.address}", got "${a.address}"`)}}}}}assertCorrectWalletType(n,s){if("error"in n)throw new (0, _chunkCT2UGJELcjs.f)(`Unable to init wallet: ${JSON.stringify(n)}`);if(n.type!==s)throw new (0, _chunkCT2UGJELcjs.g)("Invalid wallet type")}};exports.a = h;
@@ -1 +0,0 @@
1
- import{a as F}from"./chunk-HKY6CBZC.js";import{c as M}from"./chunk-DGSYBCLX.js";import{a as S}from"./chunk-LX6WD7J6.js";import{d as b,e as u}from"./chunk-THYR3NRL.js";import{i as h,j as C,k as y,l as D,m as A,n as N,o as w,p as E,q as L,r as m,s as k,t as x,u as R,v as I,w as P}from"./chunk-7ENJXL4H.js";import{a as T,c as s}from"./chunk-22GIA4MK.js";import{WebAuthnP256 as W}from"ox";import{http as O,createPublicClient as _,concat as J}from"viem";var H=class{constructor(t,a,i,n,e){this.chain=t;this.address=a;this.apiClient=i;this.adminSigner=n;this.callbacks=e;this.publicClient=_({chain:M(t),transport:O()})}getBalances(t){return s(this,null,function*(){return yield this.apiClient.getBalance(this.address,{chains:[this.chain],tokens:t})})}getTransactions(){return s(this,null,function*(){let t=yield this.apiClient.getTransactions(this.walletLocator);if("error"in t)throw new m(JSON.stringify(t));return t.transactions.filter(a=>a.walletType==="evm-smart-wallet")})}unstable_getNfts(t,a,i,n){return s(this,null,function*(){return yield this.apiClient.unstable_getNfts(i,n!=null?n:this.walletLocator,t,a)})}getNonce(t){return s(this,null,function*(){var i;return yield this.publicClient.readContract({abi:F,address:b,functionName:"getNonce",args:[this.address,(i=t==null?void 0:t.key)!=null?i:BigInt(0)]})})}signMessage(t){return s(this,null,function*(){var r;let a=yield this.createSignature(t.message),i=a.id,n=((r=a.approvals)==null?void 0:r.pending)||[],e=yield this.approveSignature(n,i);return yield this.waitForSignature(i),e})}signTypedData(t){return s(this,null,function*(){var r;let a=yield this.createTypedDataSignature(t),i=a.id,n=((r=a.approvals)==null?void 0:r.pending)||[],e=yield this.approveSignature(n,i);return yield this.waitForSignature(i),e})}sendTransaction(t){return s(this,null,function*(){var n,e,r;yield(e=(n=this.callbacks)==null?void 0:n.onTransactionStart)==null?void 0:e.call(n,t);let a=yield this.createTransaction(t),i=a.id;return yield this.approveTransaction(((r=a.approvals)==null?void 0:r.pending)||[],i),yield this.waitForTransaction(i)})}get walletLocator(){return this.apiClient.isServerSide?this.address:"me:evm-smart-wallet"}get signerLocator(){return this.adminSigner.locator}signWithAdminSigner(t){return s(this,null,function*(){switch(this.adminSigner.type){case"evm-passkey":{if(this.adminSigner.signingCallback)return this.adminSigner.signingCallback(t);let{metadata:a,signature:i}=yield W.sign({credentialId:this.adminSigner.id,challenge:t});return{signature:J([`0x${i.r.toString(16)}`,`0x${i.s.toString(16)}`]),metadata:a}}case"evm-keypair":{let a=this.adminSigner.address;if(this.adminSigner.signer.type==="viem_v2"){let i=this.adminSigner.signer.account;if(!i.signMessage)throw new N("Account does not support signMessage");return{signature:yield i.signMessage({message:{raw:t}})}}else return{signature:yield this.adminSigner.signer.provider.request({method:"personal_sign",params:[t,a]})}}}})}createTransaction(t){return s(this,null,function*(){var i;let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:this.signerLocator,chain:this.chain,calls:[{to:t.to,value:t.value?t.value.toString():"0",data:(i=t.data)!=null?i:"0x"}]}});if("error"in a)throw new L(JSON.stringify(a));return a})}approveTransaction(t,a){return s(this,null,function*(){var c,g;let i=t.find(l=>l.signer===this.signerLocator);if(!i){let l=new h(`Signer ${this.signerLocator} not found in pending approvals`);throw yield(g=(c=this.callbacks)==null?void 0:c.onTransactionFail)==null?void 0:g.call(c,l),l}let n=i.message,{signature:e,metadata:r}=yield this.signWithAdminSigner(n),p=yield this.apiClient.approveTransaction(this.walletLocator,a,{approvals:[T({signer:this.signerLocator,signature:this.adminSigner.type==="evm-passkey"?{r:e.slice(0,66),s:`0x${e.slice(66)}`}:e},r&&{metadata:r})]});if("error"in p)throw new P(JSON.stringify(p))})}waitForTransaction(t,a=6e4){return s(this,null,function*(){var r,p,c,g,l,d,f,v;let i=Date.now(),n;do{if(Date.now()-i>a){let o=new k("Transaction confirmation timeout");throw yield(p=(r=this.callbacks).onTransactionFail)==null?void 0:p.call(r,o),o}if(n=yield this.apiClient.getTransaction(this.walletLocator,t),"error"in n)throw new m(JSON.stringify(n));yield S(u)}while(n.status==="pending");if(n.status==="failed"){let o=new x(`Transaction sending failed: ${JSON.stringify(n.error)}`);throw yield(g=(c=this.callbacks).onTransactionFail)==null?void 0:g.call(c,o),o}if(n.status==="awaiting-approval"){let o=new R("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");throw yield(d=(l=this.callbacks).onTransactionFail)==null?void 0:d.call(l,o),o}let e=n.onChain.txId;if(e==null){let o=new I("Transaction hash not found on transaction response");throw yield(v=(f=this.callbacks).onTransactionFail)==null?void 0:v.call(f,o),o}return e})}createSignature(t){return s(this,null,function*(){if(typeof t!="string")throw new C("Message must be a string");let a=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-message",params:{message:t,signer:this.signerLocator,chain:this.chain}});if("error"in a)throw new w(JSON.stringify(a));return a})}createTypedDataSignature(t){return s(this,null,function*(){let{domain:a,message:i,primaryType:n,types:e}=t;if(!a||!i||!e)throw new y("Invalid typed data");let{name:r,version:p,chainId:c,verifyingContract:g,salt:l}=a;if(!r||!p||!c||!g)throw new y("Invalid typed data domain");let d=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-typed-data",params:{typedData:{domain:{name:r,version:p,chainId:Number(c),verifyingContract:g,salt:l},message:i,primaryType:n,types:e},signer:this.signerLocator,chain:this.chain,isSmartWalletSignature:!1}});if("error"in d)throw new w(JSON.stringify(d));return d})}approveSignature(t,a){return s(this,null,function*(){let i=t.find(p=>p.signer===this.signerLocator);if(!i)throw new h(`Signer ${this.signerLocator} not found in pending approvals`);let n=i.message,{signature:e,metadata:r}=yield this.signWithAdminSigner(n);if(e===void 0)throw new D("Signature not available");return yield this.apiClient.approveSignature(this.walletLocator,a,{approvals:[{signer:this.signerLocator,signature:this.adminSigner.type==="evm-passkey"?{r:e.slice(0,66),s:`0x${e.slice(66)}`}:e,metadata:r}]}),e})}waitForSignature(t){return s(this,null,function*(){let a=null;do if(yield S(u),a=yield this.apiClient.getSignature(this.walletLocator,t),"error"in a)throw new E(JSON.stringify(a));while(a===null||a.status==="pending");if(a.status==="failed")throw new A("Signature signing failed")})}};export{H as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkRB66U3DDcjs = require('./chunk-RB66U3DD.cjs');var _chunkD67AZHCXcjs = require('./chunk-D67AZHCX.cjs');var _chunk6XOH62PVcjs = require('./chunk-6XOH62PV.cjs');var _chunkCK4JCQY6cjs = require('./chunk-CK4JCQY6.cjs');var s=class{constructor(e,n,a,i){this.apiClient=e;this.publicKey=n;this.client=a;this.callbacks=i;this.transactionsService=new (0, _chunkD67AZHCXcjs.a)(this.walletLocator,this.apiClient),this.delegatedSignerService=new (0, _chunkRB66U3DDcjs.a)(this.walletLocator,this.transactionsService,e)}get address(){return this.publicKey.toBase58()}getBalances(e){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){return yield this.apiClient.getBalance(this.address,{tokens:e})})}getTransactions(){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){return yield this.transactionsService.getTransactions()})}unstable_getNfts(e,n,a){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){return yield this.apiClient.unstable_getNfts("solana",a!=null?a:this.walletLocator,e,n)})}get walletLocator(){return this.apiClient.isServerSide?this.address:"me:solana-smart-wallet"}},p= exports.b =class extends s{constructor(e,n,a,i,u){super(e,n,i,u),this.adminSigner=_chunk6XOH62PVcjs.d.call(void 0, a)}sendTransaction(e){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var i;let n=this.getEffectiveTransactionSigner(e.delegatedSigner),a=(i=e.additionalSigners)==null?void 0:i.map(_chunk6XOH62PVcjs.a);return yield this.transactionsService.createSignAndConfirm({transaction:e.transaction,signer:n,additionalSigners:a})})}addDelegatedSigner(e){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){return yield this.delegatedSignerService.registerDelegatedSigner(e,_chunk6XOH62PVcjs.c.call(void 0, this.adminSigner)?this.adminSigner:void 0)})}getDelegatedSigners(){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){return yield this.delegatedSignerService.getDelegatedSigners()})}getEffectiveTransactionSigner(e){return e==null?_chunk6XOH62PVcjs.c.call(void 0, this.adminSigner)?this.adminSigner:void 0:_chunk6XOH62PVcjs.a.call(void 0, e)}},g= exports.c =class extends s{sendTransaction(e){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var n;return yield this.transactionsService.createSignAndConfirm({transaction:e.transaction,additionalSigners:(n=e.additionalSigners)==null?void 0:n.map(_chunk6XOH62PVcjs.a)})})}};exports.a = s; exports.b = p; exports.c = g;
@@ -1 +0,0 @@
1
- import{a as d}from"./chunk-OKXV3IAA.js";import{b as f,c as u}from"./chunk-7IGI7P26.js";import{d as S}from"./chunk-6W35AARC.js";import{a as g,b as w}from"./chunk-7WRWCJJ6.js";import{a as C}from"./chunk-CKCQ2NTZ.js";import{c as W,d as m,e as c,f as y,g as T}from"./chunk-7ENJXL4H.js";import{c as o}from"./chunk-22GIA4MK.js";import{PublicKey as b}from"@solana/web3.js";var h=class{constructor(n){this.apiClient=n}getOrCreateWallet(n,s,a){return o(this,null,function*(){var t,i,p,r;try{let l=yield this.getOrCreateWalletInternal(n,s,a);if("error"in l)throw new y(JSON.stringify(l));let e=this.createWalletInstance(n,l,s,a);return yield(i=(t=a==null?void 0:a.experimental_callbacks)==null?void 0:t.onWalletCreationComplete)==null?void 0:i.call(t,e),e}catch(l){throw yield(r=(p=a==null?void 0:a.experimental_callbacks)==null?void 0:p.onWalletCreationFail)==null?void 0:r.call(p,l),l}})}getWallet(n,s,a,t){return o(this,null,function*(){let i=this.apiClient.isServerSide?n:`me:${s}`,p=yield this.apiClient.getWallet(i);if("error"in p)throw new m(JSON.stringify(p));return this.createWalletInstance(s,p,a,t)})}getOrCreateWalletInternal(n,s,a){return o(this,null,function*(){var i,p;let t=this.apiClient.isServerSide?null:yield this.apiClient.getWallet(`me:${n}`);if(t&&!("error"in t))return t;if(yield(p=(i=a==null?void 0:a.experimental_callbacks)==null?void 0:i.onWalletCreationStart)==null?void 0:p.call(i),n==="evm-smart-wallet"){let{adminSigner:r,linkedUser:l}=s,e=r.type==="evm-keypair"?r:yield w(r.name,r.creationCallback);return yield this.apiClient.createWallet({type:"evm-smart-wallet",config:{adminSigner:e},linkedUser:l})}else if(n==="solana-smart-wallet"){let{adminSigner:r,linkedUser:l}=s;return yield this.apiClient.createWallet({type:"solana-smart-wallet",config:{adminSigner:r!=null?(()=>{let e=S(r);return e.type==="solana-keypair"?{type:e.type,address:e.address}:{type:e.type}})():void 0},linkedUser:l})}else if(n==="solana-mpc-wallet"){let{linkedUser:r}=s;return yield this.apiClient.createWallet({type:"solana-mpc-wallet",linkedUser:r})}else throw new W(`Wallet type ${n} not supported`)})}createWalletInstance(n,s,a,t){switch(this.assertCorrectWalletType(s,n),this.checkWalletConfig(s,a),n){case"evm-smart-wallet":let i=a;return this.createEvmWalletInstance(n,s,i,t);case"solana-smart-wallet":case"solana-mpc-wallet":let r=a;return this.createSolanaWalletInstance(n,s,r,t);default:throw new W(`Wallet type ${n} not supported`)}}createEvmWalletInstance(n,s,a,t){var i;switch(n){case"evm-smart-wallet":{let{chain:p,adminSigner:r}=a,l=s,e=new C(p,l.address,this.apiClient,g(r,l),(i=t==null?void 0:t.experimental_callbacks)!=null?i:{});return{getBalances:e.getBalances.bind(e),getTransactions:e.getTransactions.bind(e),unstable_getNfts:e.unstable_getNfts.bind(e),getNonce:e.getNonce.bind(e),signMessage:e.signMessage.bind(e),signTypedData:e.signTypedData.bind(e),sendTransaction:e.sendTransaction.bind(e),address:e.address,chain:e.chain,publicClient:e.publicClient}}}}createSolanaWalletInstance(n,s,a,t){var p,r;let i=s;switch(n){case"solana-smart-wallet":{let{adminSigner:l}=a,e=new f(this.apiClient,new b(i.address),l!=null?l:{type:"solana-fireblocks-custodial"},d(this.apiClient.environment),(p=t==null?void 0:t.experimental_callbacks)!=null?p:{});return{getDelegatedSigners:e.getDelegatedSigners.bind(e),addDelegatedSigner:e.addDelegatedSigner.bind(e),getBalances:e.getBalances.bind(e),unstable_getNfts:e.unstable_getNfts.bind(e),sendTransaction:e.sendTransaction.bind(e),getTransactions:e.getTransactions.bind(e),address:e.address,publicKey:e.publicKey,adminSigner:e.adminSigner}}case"solana-mpc-wallet":{let l=new u(this.apiClient,new b(i.address),d(this.apiClient.environment),(r=t==null?void 0:t.experimental_callbacks)!=null?r:{});return{sendTransaction:l.sendTransaction.bind(l),getBalances:l.getBalances.bind(l),unstable_getNfts:l.unstable_getNfts.bind(l),getTransactions:l.getTransactions.bind(l),address:l.address,publicKey:l.publicKey}}}}checkWalletConfig(n,s){switch(n.type){case"evm-smart-wallet":case"solana-smart-wallet":{let{adminSigner:a}=s;if(a===void 0)return;let t=n.config.adminSigner;if(t.type!==a.type)throw new c(`Invalid admin signer type: expected "${a.type}", got "${t.type}"`);switch(t.type){case"evm-keypair":case"solana-keypair":{if(a.type!=="evm-keypair"&&a.type!=="solana-keypair")throw new c(`Invalid admin signer type: expected "${a.type}", got "${t.type}"`);if(t.address!==a.address)throw new c(`Invalid admin signer address: expected "${t.address}", got "${a.address}"`)}}}}}assertCorrectWalletType(n,s){if("error"in n)throw new y(`Unable to init wallet: ${JSON.stringify(n)}`);if(n.type!==s)throw new T("Invalid wallet type")}};export{h as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCK4JCQY6cjs = require('./chunk-CK4JCQY6.cjs');var r=class{constructor(t,e,n){this.walletLocator=t;this.transactionsService=e;this.apiClient=n}registerDelegatedSigner(t,e){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){let i=(yield this.apiClient.registerSigner(this.walletLocator,{signer:t})).transaction.id;return yield this.transactionsService.approveTransaction(i,e?[e]:[]),yield this.transactionsService.waitForTransaction(i),this.getDelegatedSigner(t)})}getDelegatedSigner(t){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){return yield this.apiClient.getSigner(this.walletLocator,t)})}getDelegatedSigners(){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){return yield this.apiClient.getDelegatedSigners(this.walletLocator)})}};exports.a = r;
@@ -1 +0,0 @@
1
- import{b as o,c as p}from"./chunk-THYR3NRL.js";import{a as c}from"./chunk-7ENJXL4H.js";import{c as r}from"./chunk-22GIA4MK.js";import{APIKeyUsageOrigin as g,CrossmintApiClient as l}from"@crossmint/common-sdk-base";var h=class extends l{constructor(e,s){super(e,{internalConfig:{sdkMetadata:{name:p,version:o}}});this.appId=s;this.apiPrefix="api/2022-06-09/wallets"}createWallet(e){return r(this,null,function*(){let s=this.isServerSide?`${this.apiPrefix}`:`${this.apiPrefix}/me`;return(yield this.post(s,{body:JSON.stringify(e),headers:this.headers})).json()})}getWallet(e){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json()})}createTransaction(e,s){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveTransaction(e,s,t){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getTransaction(e,s){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions/${s}`,{headers:this.headers})).json()})}createSignature(e,s){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveSignature(e,s,t){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getSignature(e,s){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signatures/${s}`,{headers:this.headers})).json()})}getTransactions(e){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions`,{headers:this.headers})).json()})}unstable_getNfts(e,s,t,n){return r(this,null,function*(){let a=new URLSearchParams;a.append("page",n.toString()),a.append("perPage",t.toString());let i=`${e}:${s}`;return(yield this.get(`${this.apiPrefix}/${i}/nfts?${a.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return r(this,null,function*(){let t=new URLSearchParams;return s.chains&&s.chains.forEach(a=>t.append("chains",a)),t.append("tokens",s.tokens.join(",")),(yield this.get(`api/v1-alpha2/wallets/${e}/balances?${t.toString()}`,{headers:this.headers})).json()})}registerSigner(e,s){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signers`,{body:JSON.stringify(s),headers:this.headers})).json()})}getSigner(e,s){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signers/${s}`,{headers:this.headers})).json()})}getDelegatedSigners(e){return r(this,null,function*(){var a,i;return(i=(a=(yield(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json()).config)==null?void 0:a.delegatedSigners)!=null?i:[]})}get isServerSide(){return this.parsedAPIKey.usageOrigin===g.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new c("Invalid API key");return this.parsedAPIKey.environment}get headers(){let e={"Content-Type":"application/json"};return this.appId&&(e["X-App-Identifier"]=this.appId),e}};export{h as a};
@@ -1 +0,0 @@
1
- import{c as a}from"./chunk-22GIA4MK.js";var r=class{constructor(t,e,n){this.walletLocator=t;this.transactionsService=e;this.apiClient=n}registerDelegatedSigner(t,e){return a(this,null,function*(){let i=(yield this.apiClient.registerSigner(this.walletLocator,{signer:t})).transaction.id;return yield this.transactionsService.approveTransaction(i,e?[e]:[]),yield this.transactionsService.waitForTransaction(i),this.getDelegatedSigner(t)})}getDelegatedSigner(t){return a(this,null,function*(){return yield this.apiClient.getSigner(this.walletLocator,t)})}getDelegatedSigners(){return a(this,null,function*(){return yield this.apiClient.getDelegatedSigners(this.walletLocator)})}};export{r as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6DTBGTSScjs = require('./chunk-6DTBGTSS.cjs');var _chunkJFUBHJ2Ccjs = require('./chunk-JFUBHJ2C.cjs');var _chunkDANM4IBFcjs = require('./chunk-DANM4IBF.cjs');var _chunkNOQASYSIcjs = require('./chunk-NOQASYSI.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkCK4JCQY6cjs = require('./chunk-CK4JCQY6.cjs');var _ox = require('ox');var _viem = require('viem');var H=class{constructor(t,a,i,n,e){this.chain=t;this.address=a;this.apiClient=i;this.adminSigner=n;this.callbacks=e;this.publicClient=_viem.createPublicClient.call(void 0, {chain:_chunkJFUBHJ2Ccjs.c.call(void 0, t),transport:_viem.http.call(void 0, )})}getBalances(t){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){return yield this.apiClient.getBalance(this.address,{chains:[this.chain],tokens:t})})}getTransactions(){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){let t=yield this.apiClient.getTransactions(this.walletLocator);if("error"in t)throw new (0, _chunkCT2UGJELcjs.r)(JSON.stringify(t));return t.transactions.filter(a=>a.walletType==="evm-smart-wallet")})}unstable_getNfts(t,a,i,n){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){return yield this.apiClient.unstable_getNfts(i,n!=null?n:this.walletLocator,t,a)})}getNonce(t){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var i;return yield this.publicClient.readContract({abi:_chunk6DTBGTSScjs.a,address:_chunkNOQASYSIcjs.d,functionName:"getNonce",args:[this.address,(i=t==null?void 0:t.key)!=null?i:BigInt(0)]})})}signMessage(t){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var r;let a=yield this.createSignature(t.message),i=a.id,n=((r=a.approvals)==null?void 0:r.pending)||[],e=yield this.approveSignature(n,i);return yield this.waitForSignature(i),e})}signTypedData(t){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var r;let a=yield this.createTypedDataSignature(t),i=a.id,n=((r=a.approvals)==null?void 0:r.pending)||[],e=yield this.approveSignature(n,i);return yield this.waitForSignature(i),e})}sendTransaction(t){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var n,e,r;yield(e=(n=this.callbacks)==null?void 0:n.onTransactionStart)==null?void 0:e.call(n,t);let a=yield this.createTransaction(t),i=a.id;return yield this.approveTransaction(((r=a.approvals)==null?void 0:r.pending)||[],i),yield this.waitForTransaction(i)})}get walletLocator(){return this.apiClient.isServerSide?this.address:"me:evm-smart-wallet"}get signerLocator(){return this.adminSigner.locator}signWithAdminSigner(t){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){switch(this.adminSigner.type){case"evm-passkey":{if(this.adminSigner.signingCallback)return this.adminSigner.signingCallback(t);let{metadata:a,signature:i}=yield _ox.WebAuthnP256.sign({credentialId:this.adminSigner.id,challenge:t});return{signature:_viem.concat.call(void 0, [`0x${i.r.toString(16)}`,`0x${i.s.toString(16)}`]),metadata:a}}case"evm-keypair":{let a=this.adminSigner.address;if(this.adminSigner.signer.type==="viem_v2"){let i=this.adminSigner.signer.account;if(!i.signMessage)throw new (0, _chunkCT2UGJELcjs.n)("Account does not support signMessage");return{signature:yield i.signMessage({message:{raw:t}})}}else return{signature:yield this.adminSigner.signer.provider.request({method:"personal_sign",params:[t,a]})}}}})}createTransaction(t){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var i;let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:this.signerLocator,chain:this.chain,calls:[{to:t.to,value:t.value?t.value.toString():"0",data:(i=t.data)!=null?i:"0x"}]}});if("error"in a)throw new (0, _chunkCT2UGJELcjs.q)(JSON.stringify(a));return a})}approveTransaction(t,a){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var c,g;let i=t.find(l=>l.signer===this.signerLocator);if(!i){let l=new (0, _chunkCT2UGJELcjs.i)(`Signer ${this.signerLocator} not found in pending approvals`);throw yield(g=(c=this.callbacks)==null?void 0:c.onTransactionFail)==null?void 0:g.call(c,l),l}let n=i.message,{signature:e,metadata:r}=yield this.signWithAdminSigner(n),p=yield this.apiClient.approveTransaction(this.walletLocator,a,{approvals:[_chunkCK4JCQY6cjs.a.call(void 0, {signer:this.signerLocator,signature:this.adminSigner.type==="evm-passkey"?{r:e.slice(0,66),s:`0x${e.slice(66)}`}:e},r&&{metadata:r})]});if("error"in p)throw new (0, _chunkCT2UGJELcjs.w)(JSON.stringify(p))})}waitForTransaction(t,a=6e4){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var r,p,c,g,l,d,f,v;let i=Date.now(),n;do{if(Date.now()-i>a){let o=new (0, _chunkCT2UGJELcjs.s)("Transaction confirmation timeout");throw yield(p=(r=this.callbacks).onTransactionFail)==null?void 0:p.call(r,o),o}if(n=yield this.apiClient.getTransaction(this.walletLocator,t),"error"in n)throw new (0, _chunkCT2UGJELcjs.r)(JSON.stringify(n));yield _chunkDANM4IBFcjs.a.call(void 0, _chunkNOQASYSIcjs.e)}while(n.status==="pending");if(n.status==="failed"){let o=new (0, _chunkCT2UGJELcjs.t)(`Transaction sending failed: ${JSON.stringify(n.error)}`);throw yield(g=(c=this.callbacks).onTransactionFail)==null?void 0:g.call(c,o),o}if(n.status==="awaiting-approval"){let o=new (0, _chunkCT2UGJELcjs.u)("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");throw yield(d=(l=this.callbacks).onTransactionFail)==null?void 0:d.call(l,o),o}let e=n.onChain.txId;if(e==null){let o=new (0, _chunkCT2UGJELcjs.v)("Transaction hash not found on transaction response");throw yield(v=(f=this.callbacks).onTransactionFail)==null?void 0:v.call(f,o),o}return e})}createSignature(t){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){if(typeof t!="string")throw new (0, _chunkCT2UGJELcjs.j)("Message must be a string");let a=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-message",params:{message:t,signer:this.signerLocator,chain:this.chain}});if("error"in a)throw new (0, _chunkCT2UGJELcjs.o)(JSON.stringify(a));return a})}createTypedDataSignature(t){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){let{domain:a,message:i,primaryType:n,types:e}=t;if(!a||!i||!e)throw new (0, _chunkCT2UGJELcjs.k)("Invalid typed data");let{name:r,version:p,chainId:c,verifyingContract:g,salt:l}=a;if(!r||!p||!c||!g)throw new (0, _chunkCT2UGJELcjs.k)("Invalid typed data domain");let d=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-typed-data",params:{typedData:{domain:{name:r,version:p,chainId:Number(c),verifyingContract:g,salt:l},message:i,primaryType:n,types:e},signer:this.signerLocator,chain:this.chain,isSmartWalletSignature:!1}});if("error"in d)throw new (0, _chunkCT2UGJELcjs.o)(JSON.stringify(d));return d})}approveSignature(t,a){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){let i=t.find(p=>p.signer===this.signerLocator);if(!i)throw new (0, _chunkCT2UGJELcjs.i)(`Signer ${this.signerLocator} not found in pending approvals`);let n=i.message,{signature:e,metadata:r}=yield this.signWithAdminSigner(n);if(e===void 0)throw new (0, _chunkCT2UGJELcjs.l)("Signature not available");return yield this.apiClient.approveSignature(this.walletLocator,a,{approvals:[{signer:this.signerLocator,signature:this.adminSigner.type==="evm-passkey"?{r:e.slice(0,66),s:`0x${e.slice(66)}`}:e,metadata:r}]}),e})}waitForSignature(t){return _chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){let a=null;do if(yield _chunkDANM4IBFcjs.a.call(void 0, _chunkNOQASYSIcjs.e),a=yield this.apiClient.getSignature(this.walletLocator,t),"error"in a)throw new (0, _chunkCT2UGJELcjs.p)(JSON.stringify(a));while(a===null||a.status==="pending");if(a.status==="failed")throw new (0, _chunkCT2UGJELcjs.m)("Signature signing failed")})}};exports.a = H;