@crossmint/wallets-sdk 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/__tests__/constants.d.cts +1 -1
- package/dist/api/__tests__/constants.d.ts +1 -1
- package/dist/api/__tests__/test-utils.cjs +1 -1
- package/dist/api/__tests__/test-utils.d.cts +1 -1
- package/dist/api/__tests__/test-utils.d.ts +1 -1
- package/dist/api/__tests__/test-utils.js +1 -1
- package/dist/api/client.cjs +1 -1
- package/dist/api/client.d.cts +1 -1
- package/dist/api/client.d.ts +1 -1
- package/dist/api/client.js +1 -1
- package/dist/api/gen/types.gen.d.cts +24 -0
- package/dist/api/gen/types.gen.d.ts +24 -0
- package/dist/api/index.cjs +1 -1
- package/dist/api/index.d.cts +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/types.d.cts +1 -1
- package/dist/api/types.d.ts +1 -1
- package/dist/chains/chains.cjs +1 -1
- package/dist/chains/chains.js +1 -1
- package/dist/{chunk-3OY2R7OL.js → chunk-4GEG5JA6.js} +1 -1
- package/dist/{chunk-JFGHOWZK.js → chunk-4GHTG2VD.js} +1 -1
- package/dist/{chunk-7WACXZXY.cjs → chunk-4LXI2OQW.cjs} +1 -1
- package/dist/chunk-52I473WC.cjs +1 -0
- package/dist/chunk-6HOOT6LH.js +1 -0
- package/dist/{chunk-IINCFP4K.cjs → chunk-A3J3367O.cjs} +1 -1
- package/dist/{chunk-QJC54AML.cjs → chunk-AAUS7KTR.cjs} +1 -1
- package/dist/{chunk-MXXBDP4U.cjs → chunk-AET7QPSV.cjs} +1 -1
- package/dist/{chunk-ARF3OETV.js → chunk-BAUUDBGT.js} +1 -1
- package/dist/{chunk-VWHGZO7N.cjs → chunk-BI3AUJVK.cjs} +1 -1
- package/dist/chunk-BTMBO7VM.cjs +3 -0
- package/dist/{chunk-QJV6W4U2.cjs → chunk-CFB27BFV.cjs} +1 -1
- package/dist/{chunk-PL6OYURB.js → chunk-EIRVLXOC.js} +1 -1
- package/dist/{chunk-TK2Z4EWO.cjs → chunk-F2HEHICC.cjs} +1 -1
- package/dist/chunk-F5NTM2RX.js +1 -0
- package/dist/{chunk-MILCZTHF.js → chunk-FXCUVWXJ.js} +1 -1
- package/dist/chunk-I3RWATD5.cjs +1 -0
- package/dist/chunk-J4XCFNQH.js +1 -0
- package/dist/{chunk-XHVSF356.cjs → chunk-JFG54X5X.cjs} +1 -1
- package/dist/chunk-KW2623VI.cjs +1 -0
- package/dist/chunk-KXKBZNET.cjs +1 -0
- package/dist/chunk-KZMDZJGM.js +1 -0
- package/dist/{chunk-CT65GLWK.js → chunk-PG7BGWKX.js} +1 -1
- package/dist/{chunk-A73HLVAF.js → chunk-QQ46JY33.js} +1 -1
- package/dist/{chunk-WGDHVUGK.cjs → chunk-RLBY6JO3.cjs} +1 -1
- package/dist/{chunk-J2CTZ3KC.js → chunk-RWQ6ZQST.js} +1 -1
- package/dist/chunk-SI4L3UZ4.cjs +1 -0
- package/dist/{chunk-C73NTGFV.js → chunk-UBDPBFAR.js} +1 -1
- package/dist/chunk-WUNTNM5R.cjs +1 -0
- package/dist/{chunk-NLO5MHPW.cjs → chunk-X7E2YEIV.cjs} +1 -1
- package/dist/{chunk-6LTDAENQ.js → chunk-XCIS2OND.js} +1 -1
- package/dist/chunk-XEL7JKRY.js +1 -0
- package/dist/chunk-XX6FO5QS.js +1 -0
- package/dist/chunk-YSB7XIS7.js +3 -0
- package/dist/{chunk-BQYPF4FS.cjs → chunk-YYFLQQPV.cjs} +1 -1
- package/dist/chunk-ZH3WV7OE.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/logger/index.cjs +1 -1
- package/dist/logger/index.js +1 -1
- package/dist/logger/init.cjs +1 -1
- package/dist/logger/init.js +1 -1
- package/dist/sdk.cjs +1 -1
- package/dist/sdk.d.cts +1 -1
- package/dist/sdk.d.ts +1 -1
- package/dist/sdk.js +1 -1
- package/dist/signers/device.d.cts +1 -1
- package/dist/signers/device.d.ts +1 -1
- package/dist/signers/evm-api-key.d.cts +1 -1
- package/dist/signers/evm-api-key.d.ts +1 -1
- package/dist/signers/evm-external-wallet.d.cts +1 -1
- package/dist/signers/evm-external-wallet.d.ts +1 -1
- package/dist/signers/external-wallet-signer.d.cts +1 -1
- package/dist/signers/external-wallet-signer.d.ts +1 -1
- package/dist/signers/index.cjs +1 -1
- package/dist/signers/index.d.cts +1 -1
- package/dist/signers/index.d.ts +1 -1
- package/dist/signers/index.js +1 -1
- package/dist/signers/non-custodial/index.cjs +1 -1
- package/dist/signers/non-custodial/index.d.cts +1 -1
- package/dist/signers/non-custodial/index.d.ts +1 -1
- package/dist/signers/non-custodial/index.js +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.d.cts +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.d.ts +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-signer.d.cts +1 -1
- package/dist/signers/non-custodial/ncs-signer.d.ts +1 -1
- package/dist/signers/non-custodial/ncs-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.d.cts +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.d.ts +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.d.cts +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.d.ts +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.js +1 -1
- package/dist/signers/passkey.d.cts +1 -1
- package/dist/signers/passkey.d.ts +1 -1
- package/dist/signers/server/assemble-server-signer.cjs +1 -1
- package/dist/signers/server/assemble-server-signer.d.cts +1 -1
- package/dist/signers/server/assemble-server-signer.d.ts +1 -1
- package/dist/signers/server/assemble-server-signer.js +1 -1
- package/dist/signers/server/evm-server-signer.d.cts +1 -1
- package/dist/signers/server/evm-server-signer.d.ts +1 -1
- package/dist/signers/server/helpers/derive-server-signer.cjs +1 -1
- package/dist/signers/server/helpers/derive-server-signer.d.cts +9 -4
- package/dist/signers/server/helpers/derive-server-signer.d.ts +9 -4
- package/dist/signers/server/helpers/derive-server-signer.js +1 -1
- package/dist/signers/server/helpers/index.cjs +1 -1
- package/dist/signers/server/helpers/index.d.cts +2 -2
- package/dist/signers/server/helpers/index.d.ts +2 -2
- package/dist/signers/server/helpers/index.js +1 -1
- package/dist/signers/server/index.cjs +1 -1
- package/dist/signers/server/index.d.cts +2 -2
- package/dist/signers/server/index.d.ts +2 -2
- package/dist/signers/server/index.js +1 -1
- package/dist/signers/server/solana-server-signer.d.cts +1 -1
- package/dist/signers/server/solana-server-signer.d.ts +1 -1
- package/dist/signers/server/stellar-server-signer.d.cts +1 -1
- package/dist/signers/server/stellar-server-signer.d.ts +1 -1
- package/dist/signers/solana-api-key.d.cts +1 -1
- package/dist/signers/solana-api-key.d.ts +1 -1
- package/dist/signers/solana-external-wallet.d.cts +1 -1
- package/dist/signers/solana-external-wallet.d.ts +1 -1
- package/dist/signers/stellar-external-wallet.d.cts +1 -1
- package/dist/signers/stellar-external-wallet.d.ts +1 -1
- package/dist/signers/types.d.cts +1 -1
- package/dist/signers/types.d.ts +1 -1
- package/dist/{types-DZWn68Po.d.cts → types-5kZcVs3E.d.cts} +23 -2
- package/dist/{types-CtOIG5sn.d.ts → types-CRMCeDuN.d.ts} +23 -2
- package/dist/utils/constants.cjs +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.cjs +1 -1
- package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.js +1 -1
- package/dist/utils/device-signers/createDeviceSigner.d.cts +1 -1
- package/dist/utils/device-signers/createDeviceSigner.d.ts +1 -1
- package/dist/utils/device-signers/index.cjs +1 -1
- package/dist/utils/device-signers/index.d.cts +1 -1
- package/dist/utils/device-signers/index.d.ts +1 -1
- package/dist/utils/device-signers/index.js +1 -1
- package/dist/utils/server-key-derivation.d.cts +2 -1
- package/dist/utils/server-key-derivation.d.ts +2 -1
- package/dist/utils/signer-locator.d.cts +1 -1
- package/dist/utils/signer-locator.d.ts +1 -1
- package/dist/utils/signer-mapping.cjs +1 -1
- package/dist/utils/signer-mapping.d.cts +1 -1
- package/dist/utils/signer-mapping.d.ts +1 -1
- package/dist/utils/signer-mapping.js +1 -1
- package/dist/wallets/__tests__/test-helpers.cjs +1 -1
- package/dist/wallets/__tests__/test-helpers.d.cts +1 -1
- package/dist/wallets/__tests__/test-helpers.d.ts +1 -1
- package/dist/wallets/__tests__/test-helpers.js +1 -1
- package/dist/wallets/evm.cjs +1 -1
- package/dist/wallets/evm.d.cts +1 -1
- package/dist/wallets/evm.d.ts +1 -1
- package/dist/wallets/evm.js +1 -1
- package/dist/wallets/solana.cjs +1 -1
- package/dist/wallets/solana.d.cts +1 -1
- package/dist/wallets/solana.d.ts +1 -1
- package/dist/wallets/solana.js +1 -1
- package/dist/wallets/stellar.cjs +1 -1
- package/dist/wallets/stellar.d.cts +1 -1
- package/dist/wallets/stellar.d.ts +1 -1
- package/dist/wallets/stellar.js +1 -1
- package/dist/wallets/types.d.cts +1 -1
- package/dist/wallets/types.d.ts +1 -1
- package/dist/wallets/wallet-factory.cjs +1 -1
- package/dist/wallets/wallet-factory.d.cts +1 -1
- package/dist/wallets/wallet-factory.d.ts +1 -1
- package/dist/wallets/wallet-factory.js +1 -1
- package/dist/wallets/wallet.cjs +1 -1
- package/dist/wallets/wallet.d.cts +29 -1
- package/dist/wallets/wallet.d.ts +29 -1
- package/dist/wallets/wallet.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3VSFHDFH.cjs +0 -1
- package/dist/chunk-7EF275IG.cjs +0 -1
- package/dist/chunk-BA36HJOM.js +0 -1
- package/dist/chunk-D6SLJ5C2.cjs +0 -1
- package/dist/chunk-G4RVBYWJ.cjs +0 -1
- package/dist/chunk-GETUHEQB.cjs +0 -1
- package/dist/chunk-KB32HFUC.js +0 -3
- package/dist/chunk-LPL33F57.js +0 -1
- package/dist/chunk-NFCZBR6G.js +0 -1
- package/dist/chunk-PMM7CHUU.js +0 -1
- package/dist/chunk-RBSMBO4T.js +0 -1
- package/dist/chunk-TM5CSXH4.js +0 -1
- package/dist/chunk-VADIEIDS.js +0 -1
- package/dist/chunk-VJEQU7S4.cjs +0 -3
- package/dist/chunk-YUVIKZL5.cjs +0 -1
package/dist/wallets/solana.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk52I473WCcjs = require('../chunk-52I473WC.cjs');require('../chunk-BTMBO7VM.cjs');require('../chunk-CUHDOBKN.cjs');require('../chunk-YHV3672R.cjs');require('../chunk-A3J3367O.cjs');require('../chunk-3VYGTPRF.cjs');require('../chunk-NX256LAH.cjs');require('../chunk-KXKBZNET.cjs');require('../chunk-AET7QPSV.cjs');require('../chunk-5IC7UWND.cjs');require('../chunk-GZP2JQ6P.cjs');require('../chunk-IGRPHTXZ.cjs');require('../chunk-I3RWATD5.cjs');require('../chunk-ENU3EKBG.cjs');require('../chunk-3SVXPFSP.cjs');require('../chunk-4DJWSV7I.cjs');require('../chunk-YF5G4U6L.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-RLBY6JO3.cjs');require('../chunk-4LXI2OQW.cjs');require('../chunk-BI3AUJVK.cjs');require('../chunk-YYFLQQPV.cjs');require('../chunk-JBP52JOH.cjs');require('../chunk-5FH7WFWL.cjs');require('../chunk-SPTXAOFR.cjs');require('../chunk-AS2YN2YC.cjs');require('../chunk-YGL4ITFK.cjs');require('../chunk-GEY3BU62.cjs');require('../chunk-PHPBBEXU.cjs');require('../chunk-A33BEWR7.cjs');require('../chunk-OGP7B5O3.cjs');require('../chunk-IJ632UXD.cjs');require('../chunk-E4EOD7MP.cjs');require('../chunk-SCEPJO4Q.cjs');require('../chunk-AAUS7KTR.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-UE3WVHTM.cjs');require('../chunk-5X4EOJFG.cjs');require('../chunk-HRUMWG2F.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-OWQZPI3U.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-CFB27BFV.cjs');require('../chunk-X7E2YEIV.cjs');require('../chunk-2GKPWQBQ.cjs');exports.SolanaWallet = _chunk52I473WCcjs.a;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SolanaChain, Chain } from '../chains/chains.cjs';
|
|
2
|
-
import {
|
|
2
|
+
import { Z as TransactionInputOptions, x as SolanaTransactionInput, T as Transaction, V as PrepareOnly } from '../types-5kZcVs3E.cjs';
|
|
3
3
|
import { Wallet } from './wallet.cjs';
|
|
4
4
|
import '@crossmint/common-sdk-base';
|
|
5
5
|
import 'viem';
|
package/dist/wallets/solana.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SolanaChain, Chain } from '../chains/chains.js';
|
|
2
|
-
import {
|
|
2
|
+
import { Z as TransactionInputOptions, x as SolanaTransactionInput, T as Transaction, V as PrepareOnly } from '../types-CRMCeDuN.js';
|
|
3
3
|
import { Wallet } from './wallet.js';
|
|
4
4
|
import '@crossmint/common-sdk-base';
|
|
5
5
|
import 'viem';
|
package/dist/wallets/solana.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-ZH3WV7OE.js";import"../chunk-YSB7XIS7.js";import"../chunk-TOAFCAVT.js";import"../chunk-N4IWDL6M.js";import"../chunk-BAUUDBGT.js";import"../chunk-IOSADDL5.js";import"../chunk-GOXB2RBF.js";import"../chunk-KZMDZJGM.js";import"../chunk-EIRVLXOC.js";import"../chunk-L52GDMSH.js";import"../chunk-6X5JEJD7.js";import"../chunk-QM3BB4E2.js";import"../chunk-F5NTM2RX.js";import"../chunk-OQZTL6ZG.js";import"../chunk-N355UETO.js";import"../chunk-3VRN3GKQ.js";import"../chunk-BITOMWYZ.js";import"../chunk-YDZRBHS3.js";import"../chunk-4GEG5JA6.js";import"../chunk-RWQ6ZQST.js";import"../chunk-PG7BGWKX.js";import"../chunk-QQ46JY33.js";import"../chunk-O6VBO7KG.js";import"../chunk-EM3D5Q3A.js";import"../chunk-EE4ITUGS.js";import"../chunk-6RX65NOA.js";import"../chunk-XNZLCUTY.js";import"../chunk-CKZYSQOK.js";import"../chunk-QVTKTDED.js";import"../chunk-XS5B3TUE.js";import"../chunk-M335XCYO.js";import"../chunk-YH7G2U6V.js";import"../chunk-2O6HQK34.js";import"../chunk-2YLRFJ66.js";import"../chunk-FXCUVWXJ.js";import"../chunk-S3DYQVRD.js";import"../chunk-KUP7H7X2.js";import"../chunk-FT5EVMLB.js";import"../chunk-SVIKBM3S.js";import"../chunk-KKQBZXFE.js";import"../chunk-5OYPWGMX.js";import"../chunk-455NK5LB.js";import"../chunk-UBDPBFAR.js";import"../chunk-XX6FO5QS.js";import"../chunk-J3R36SGJ.js";export{a as SolanaWallet};
|
package/dist/wallets/stellar.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSI4L3UZ4cjs = require('../chunk-SI4L3UZ4.cjs');require('../chunk-BTMBO7VM.cjs');require('../chunk-CUHDOBKN.cjs');require('../chunk-YHV3672R.cjs');require('../chunk-A3J3367O.cjs');require('../chunk-3VYGTPRF.cjs');require('../chunk-NX256LAH.cjs');require('../chunk-KXKBZNET.cjs');require('../chunk-AET7QPSV.cjs');require('../chunk-5IC7UWND.cjs');require('../chunk-GZP2JQ6P.cjs');require('../chunk-IGRPHTXZ.cjs');require('../chunk-I3RWATD5.cjs');require('../chunk-ENU3EKBG.cjs');require('../chunk-3SVXPFSP.cjs');require('../chunk-4DJWSV7I.cjs');require('../chunk-YF5G4U6L.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-RLBY6JO3.cjs');require('../chunk-4LXI2OQW.cjs');require('../chunk-BI3AUJVK.cjs');require('../chunk-YYFLQQPV.cjs');require('../chunk-JBP52JOH.cjs');require('../chunk-5FH7WFWL.cjs');require('../chunk-SPTXAOFR.cjs');require('../chunk-AS2YN2YC.cjs');require('../chunk-YGL4ITFK.cjs');require('../chunk-GEY3BU62.cjs');require('../chunk-PHPBBEXU.cjs');require('../chunk-A33BEWR7.cjs');require('../chunk-OGP7B5O3.cjs');require('../chunk-IJ632UXD.cjs');require('../chunk-E4EOD7MP.cjs');require('../chunk-SCEPJO4Q.cjs');require('../chunk-AAUS7KTR.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-UE3WVHTM.cjs');require('../chunk-5X4EOJFG.cjs');require('../chunk-HRUMWG2F.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-OWQZPI3U.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-CFB27BFV.cjs');require('../chunk-X7E2YEIV.cjs');require('../chunk-2GKPWQBQ.cjs');exports.StellarWallet = _chunkSI4L3UZ4cjs.a;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StellarChain, Chain } from '../chains/chains.cjs';
|
|
2
|
-
import {
|
|
2
|
+
import { Z as TransactionInputOptions, _ as StellarTransactionInput, T as Transaction, V as PrepareOnly, $ as UpgradeOptions, a0 as MigrateOptions } from '../types-5kZcVs3E.cjs';
|
|
3
3
|
import { Wallet } from './wallet.cjs';
|
|
4
4
|
import '@crossmint/common-sdk-base';
|
|
5
5
|
import 'viem';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StellarChain, Chain } from '../chains/chains.js';
|
|
2
|
-
import {
|
|
2
|
+
import { Z as TransactionInputOptions, _ as StellarTransactionInput, T as Transaction, V as PrepareOnly, $ as UpgradeOptions, a0 as MigrateOptions } from '../types-CRMCeDuN.js';
|
|
3
3
|
import { Wallet } from './wallet.js';
|
|
4
4
|
import '@crossmint/common-sdk-base';
|
|
5
5
|
import 'viem';
|
package/dist/wallets/stellar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-6HOOT6LH.js";import"../chunk-YSB7XIS7.js";import"../chunk-TOAFCAVT.js";import"../chunk-N4IWDL6M.js";import"../chunk-BAUUDBGT.js";import"../chunk-IOSADDL5.js";import"../chunk-GOXB2RBF.js";import"../chunk-KZMDZJGM.js";import"../chunk-EIRVLXOC.js";import"../chunk-L52GDMSH.js";import"../chunk-6X5JEJD7.js";import"../chunk-QM3BB4E2.js";import"../chunk-F5NTM2RX.js";import"../chunk-OQZTL6ZG.js";import"../chunk-N355UETO.js";import"../chunk-3VRN3GKQ.js";import"../chunk-BITOMWYZ.js";import"../chunk-YDZRBHS3.js";import"../chunk-4GEG5JA6.js";import"../chunk-RWQ6ZQST.js";import"../chunk-PG7BGWKX.js";import"../chunk-QQ46JY33.js";import"../chunk-O6VBO7KG.js";import"../chunk-EM3D5Q3A.js";import"../chunk-EE4ITUGS.js";import"../chunk-6RX65NOA.js";import"../chunk-XNZLCUTY.js";import"../chunk-CKZYSQOK.js";import"../chunk-QVTKTDED.js";import"../chunk-XS5B3TUE.js";import"../chunk-M335XCYO.js";import"../chunk-YH7G2U6V.js";import"../chunk-2O6HQK34.js";import"../chunk-2YLRFJ66.js";import"../chunk-FXCUVWXJ.js";import"../chunk-S3DYQVRD.js";import"../chunk-KUP7H7X2.js";import"../chunk-FT5EVMLB.js";import"../chunk-SVIKBM3S.js";import"../chunk-KKQBZXFE.js";import"../chunk-5OYPWGMX.js";import"../chunk-455NK5LB.js";import"../chunk-UBDPBFAR.js";import"../chunk-XX6FO5QS.js";import"../chunk-J3R36SGJ.js";export{a as StellarWallet};
|
package/dist/wallets/types.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ import '@crossmint/client-sdk-window';
|
|
|
3
3
|
import '@crossmint/client-signers';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import 'abitype';
|
|
6
|
-
export { A as AddSignerOptions,
|
|
6
|
+
export { A as AddSignerOptions, a8 as AddSignerReturnType, aI as Approval, b as ApproveOptions, c as ApproveParams, a7 as ApproveResult, B as Balances, C as Callbacks, d as ClientSideWalletArgsFor, e as ClientSideWalletCreateArgs, aJ as DeviceSignerDescriptor, E as EVMTransactionInput, aK as FormattedEVMTransaction, a0 as MigrateOptions, aL as PendingApproval, V as PrepareOnly, p as RemoveSignerOptions, a9 as RemoveSignerReturnType, S as Scope, a5 as SendTokenTransactionOptions, aM as SendTokenTransactionType, X as SignMessageInput, Y as SignTypedDataInput, r as Signature, aN as SignatureInputOptions, s as Signer, aO as SignerInput, w as SignerStatus, x as SolanaTransactionInput, _ as StellarTransactionInput, aP as StellarWalletPlugin, aQ as TokenBalance, T as Transaction, Z as TransactionInputOptions, y as TransferScope, z as Transfers, $ as UpgradeOptions, a6 as UserLocator, W as WalletArgsFor, F as WalletCreateArgs, G as WalletOptions, H as WalletPlugin } from '../types-5kZcVs3E.cjs';
|
|
7
7
|
import '../chains/chains.cjs';
|
|
8
8
|
import '../utils/device-signers/DeviceSignerKeyStorage.cjs';
|
|
9
9
|
import '../api/gen/types.gen.cjs';
|
package/dist/wallets/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import '@crossmint/client-sdk-window';
|
|
|
3
3
|
import '@crossmint/client-signers';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import 'abitype';
|
|
6
|
-
export { A as AddSignerOptions,
|
|
6
|
+
export { A as AddSignerOptions, a8 as AddSignerReturnType, aI as Approval, b as ApproveOptions, c as ApproveParams, a7 as ApproveResult, B as Balances, C as Callbacks, d as ClientSideWalletArgsFor, e as ClientSideWalletCreateArgs, aJ as DeviceSignerDescriptor, E as EVMTransactionInput, aK as FormattedEVMTransaction, a0 as MigrateOptions, aL as PendingApproval, V as PrepareOnly, p as RemoveSignerOptions, a9 as RemoveSignerReturnType, S as Scope, a5 as SendTokenTransactionOptions, aM as SendTokenTransactionType, X as SignMessageInput, Y as SignTypedDataInput, r as Signature, aN as SignatureInputOptions, s as Signer, aO as SignerInput, w as SignerStatus, x as SolanaTransactionInput, _ as StellarTransactionInput, aP as StellarWalletPlugin, aQ as TokenBalance, T as Transaction, Z as TransactionInputOptions, y as TransferScope, z as Transfers, $ as UpgradeOptions, a6 as UserLocator, W as WalletArgsFor, F as WalletCreateArgs, G as WalletOptions, H as WalletPlugin } from '../types-CRMCeDuN.js';
|
|
7
7
|
import '../chains/chains.js';
|
|
8
8
|
import '../utils/device-signers/DeviceSignerKeyStorage.js';
|
|
9
9
|
import '../api/gen/types.gen.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKW2623VIcjs = require('../chunk-KW2623VI.cjs');require('../chunk-6EUBBDIV.cjs');require('../chunk-BTMBO7VM.cjs');require('../chunk-CUHDOBKN.cjs');require('../chunk-YHV3672R.cjs');require('../chunk-A3J3367O.cjs');require('../chunk-3VYGTPRF.cjs');require('../chunk-NX256LAH.cjs');require('../chunk-KXKBZNET.cjs');require('../chunk-AET7QPSV.cjs');require('../chunk-5IC7UWND.cjs');require('../chunk-GZP2JQ6P.cjs');require('../chunk-IGRPHTXZ.cjs');require('../chunk-I3RWATD5.cjs');require('../chunk-ENU3EKBG.cjs');require('../chunk-3SVXPFSP.cjs');require('../chunk-4DJWSV7I.cjs');require('../chunk-YF5G4U6L.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-RLBY6JO3.cjs');require('../chunk-4LXI2OQW.cjs');require('../chunk-BI3AUJVK.cjs');require('../chunk-YYFLQQPV.cjs');require('../chunk-JBP52JOH.cjs');require('../chunk-5FH7WFWL.cjs');require('../chunk-SPTXAOFR.cjs');require('../chunk-AS2YN2YC.cjs');require('../chunk-YGL4ITFK.cjs');require('../chunk-GEY3BU62.cjs');require('../chunk-PHPBBEXU.cjs');require('../chunk-A33BEWR7.cjs');require('../chunk-OGP7B5O3.cjs');require('../chunk-IJ632UXD.cjs');require('../chunk-E4EOD7MP.cjs');require('../chunk-SCEPJO4Q.cjs');require('../chunk-AAUS7KTR.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-UE3WVHTM.cjs');require('../chunk-5X4EOJFG.cjs');require('../chunk-HRUMWG2F.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-OWQZPI3U.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-CFB27BFV.cjs');require('../chunk-X7E2YEIV.cjs');require('../chunk-2GKPWQBQ.cjs');exports.WalletFactory = _chunkKW2623VIcjs.a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiClient } from '../api/client.cjs';
|
|
2
2
|
import { Chain } from '../chains/chains.cjs';
|
|
3
|
-
import { W as WalletArgsFor,
|
|
3
|
+
import { W as WalletArgsFor, F as WalletCreateArgs } from '../types-5kZcVs3E.cjs';
|
|
4
4
|
import { Wallet } from './wallet.cjs';
|
|
5
5
|
import '@crossmint/common-sdk-base';
|
|
6
6
|
import 'viem';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiClient } from '../api/client.js';
|
|
2
2
|
import { Chain } from '../chains/chains.js';
|
|
3
|
-
import { W as WalletArgsFor,
|
|
3
|
+
import { W as WalletArgsFor, F as WalletCreateArgs } from '../types-CRMCeDuN.js';
|
|
4
4
|
import { Wallet } from './wallet.js';
|
|
5
5
|
import '@crossmint/common-sdk-base';
|
|
6
6
|
import 'viem';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-XEL7JKRY.js";import"../chunk-JGWGYONV.js";import"../chunk-YSB7XIS7.js";import"../chunk-TOAFCAVT.js";import"../chunk-N4IWDL6M.js";import"../chunk-BAUUDBGT.js";import"../chunk-IOSADDL5.js";import"../chunk-GOXB2RBF.js";import"../chunk-KZMDZJGM.js";import"../chunk-EIRVLXOC.js";import"../chunk-L52GDMSH.js";import"../chunk-6X5JEJD7.js";import"../chunk-QM3BB4E2.js";import"../chunk-F5NTM2RX.js";import"../chunk-OQZTL6ZG.js";import"../chunk-N355UETO.js";import"../chunk-3VRN3GKQ.js";import"../chunk-BITOMWYZ.js";import"../chunk-YDZRBHS3.js";import"../chunk-4GEG5JA6.js";import"../chunk-RWQ6ZQST.js";import"../chunk-PG7BGWKX.js";import"../chunk-QQ46JY33.js";import"../chunk-O6VBO7KG.js";import"../chunk-EM3D5Q3A.js";import"../chunk-EE4ITUGS.js";import"../chunk-6RX65NOA.js";import"../chunk-XNZLCUTY.js";import"../chunk-CKZYSQOK.js";import"../chunk-QVTKTDED.js";import"../chunk-XS5B3TUE.js";import"../chunk-M335XCYO.js";import"../chunk-YH7G2U6V.js";import"../chunk-2O6HQK34.js";import"../chunk-2YLRFJ66.js";import"../chunk-FXCUVWXJ.js";import"../chunk-S3DYQVRD.js";import"../chunk-KUP7H7X2.js";import"../chunk-FT5EVMLB.js";import"../chunk-SVIKBM3S.js";import"../chunk-KKQBZXFE.js";import"../chunk-5OYPWGMX.js";import"../chunk-455NK5LB.js";import"../chunk-UBDPBFAR.js";import"../chunk-XX6FO5QS.js";import"../chunk-J3R36SGJ.js";export{a as WalletFactory};
|
package/dist/wallets/wallet.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBTMBO7VMcjs = require('../chunk-BTMBO7VM.cjs');require('../chunk-CUHDOBKN.cjs');require('../chunk-YHV3672R.cjs');require('../chunk-A3J3367O.cjs');require('../chunk-3VYGTPRF.cjs');require('../chunk-NX256LAH.cjs');require('../chunk-KXKBZNET.cjs');require('../chunk-AET7QPSV.cjs');require('../chunk-5IC7UWND.cjs');require('../chunk-GZP2JQ6P.cjs');require('../chunk-IGRPHTXZ.cjs');require('../chunk-I3RWATD5.cjs');require('../chunk-ENU3EKBG.cjs');require('../chunk-3SVXPFSP.cjs');require('../chunk-4DJWSV7I.cjs');require('../chunk-YF5G4U6L.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-RLBY6JO3.cjs');require('../chunk-4LXI2OQW.cjs');require('../chunk-BI3AUJVK.cjs');require('../chunk-YYFLQQPV.cjs');require('../chunk-JBP52JOH.cjs');require('../chunk-5FH7WFWL.cjs');require('../chunk-SPTXAOFR.cjs');require('../chunk-AS2YN2YC.cjs');require('../chunk-YGL4ITFK.cjs');require('../chunk-GEY3BU62.cjs');require('../chunk-PHPBBEXU.cjs');require('../chunk-A33BEWR7.cjs');require('../chunk-OGP7B5O3.cjs');require('../chunk-IJ632UXD.cjs');require('../chunk-E4EOD7MP.cjs');require('../chunk-SCEPJO4Q.cjs');require('../chunk-AAUS7KTR.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-UE3WVHTM.cjs');require('../chunk-5X4EOJFG.cjs');require('../chunk-HRUMWG2F.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-OWQZPI3U.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-CFB27BFV.cjs');require('../chunk-X7E2YEIV.cjs');require('../chunk-2GKPWQBQ.cjs');exports.Wallet = _chunkBTMBO7VMcjs.a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WalletsTransactionV2025ResponseDtoClass } from '../api/gen/types.gen.cjs';
|
|
2
2
|
import { ApiClient } from '../api/client.cjs';
|
|
3
|
-
import {
|
|
3
|
+
import { G as WalletOptions, a1 as RecoverySignerConfigForChain, u as SignerConfigForChain, t as SignerAdapter, q as ServerSignerConfig, B as Balances, a2 as FundWalletResponse, a3 as GetTransactionsResponse, a4 as GetTransactionSuccessResponse, z as Transfers, a5 as SendTokenTransactionOptions, a6 as UserLocator, T as Transaction, V as PrepareOnly, c as ApproveParams, a7 as ApproveResult, A as AddSignerOptions, k as ExternalWalletRegistrationConfig, a8 as AddSignerReturnType, s as Signer, p as RemoveSignerOptions, a9 as RemoveSignerReturnType, v as SignerLocator, aa as WalletLocator, b as ApproveOptions, ab as ApproveSignatureResponse, r as Signature } from '../types-5kZcVs3E.cjs';
|
|
4
4
|
import { Chain } from '../chains/chains.cjs';
|
|
5
5
|
import '@crossmint/common-sdk-base';
|
|
6
6
|
import 'viem';
|
|
@@ -18,6 +18,8 @@ type WalletContructorType<C extends Chain> = {
|
|
|
18
18
|
alias?: string;
|
|
19
19
|
options?: WalletOptions;
|
|
20
20
|
recovery: RecoverySignerConfigForChain<C>;
|
|
21
|
+
apiRecoveryServerSignerAddress?: string;
|
|
22
|
+
apiDelegatedServerSignerAddresses?: string[];
|
|
21
23
|
signers?: SignerConfigForChain<C>[];
|
|
22
24
|
signer?: SignerAdapter;
|
|
23
25
|
};
|
|
@@ -65,8 +67,28 @@ declare class Wallet<C extends Chain> {
|
|
|
65
67
|
protected static getOptions<C extends Chain>(wallet: Wallet<C>): WalletOptions | undefined;
|
|
66
68
|
protected static getRecovery<C extends Chain>(wallet: Wallet<C>): RecoverySignerConfigForChain<C>;
|
|
67
69
|
protected static getInitialSigners<C extends Chain>(wallet: Wallet<C>): SignerConfigForChain<C>[];
|
|
70
|
+
protected static getApiRecoveryServerSignerAddress<C extends Chain>(wallet: Wallet<C>): string | undefined;
|
|
71
|
+
protected static getApiDelegatedServerSignerAddresses<C extends Chain>(wallet: Wallet<C>): string[];
|
|
68
72
|
get apiClient(): ApiClient;
|
|
69
73
|
protected get options(): WalletOptions | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Derive both primary ("evm") and legacy (chain-specific) server signer candidates.
|
|
76
|
+
*/
|
|
77
|
+
private deriveServerSignerCandidates;
|
|
78
|
+
/**
|
|
79
|
+
* Return the resolved server signer if it matches the given config (i.e. its address
|
|
80
|
+
* matches either the primary or legacy candidate). Returns null otherwise.
|
|
81
|
+
*/
|
|
82
|
+
private matchResolvedServerSigner;
|
|
83
|
+
/**
|
|
84
|
+
* Resolve which derivation (primary "evm" or legacy chain-specific) to use for a server signer.
|
|
85
|
+
* Priority: cached resolution → legacy if it matches a known on-chain address → primary.
|
|
86
|
+
*/
|
|
87
|
+
private resolveServerSignerDerivation;
|
|
88
|
+
/**
|
|
89
|
+
* Resolve a ServerSignerConfig to an API locator string.
|
|
90
|
+
*/
|
|
91
|
+
protected resolveServerSignerApiLocator(signer: ServerSignerConfig): string;
|
|
70
92
|
/**
|
|
71
93
|
* Get the recovery signer config
|
|
72
94
|
* @returns The recovery signer config
|
|
@@ -205,6 +227,12 @@ declare class Wallet<C extends Chain> {
|
|
|
205
227
|
* Returns true if the signer is an admin (recovery) signer.
|
|
206
228
|
*/
|
|
207
229
|
private resolveNonDeviceSigner;
|
|
230
|
+
/**
|
|
231
|
+
* Resolve a server signer: try primary ("evm") derivation first, fall back to legacy
|
|
232
|
+
* (chain-specific) derivation when checking registration. Sets #resolvedServerSigner
|
|
233
|
+
* to whichever derivation is on-chain. Returns true if the signer is the admin (recovery) signer.
|
|
234
|
+
*/
|
|
235
|
+
private resolveServerSigner;
|
|
208
236
|
/**
|
|
209
237
|
* Try to auto-select a passkey credential from registered signers.
|
|
210
238
|
* Returns true if a credential was auto-selected, false if no passkey signers exist.
|
package/dist/wallets/wallet.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WalletsTransactionV2025ResponseDtoClass } from '../api/gen/types.gen.js';
|
|
2
2
|
import { ApiClient } from '../api/client.js';
|
|
3
|
-
import {
|
|
3
|
+
import { G as WalletOptions, a1 as RecoverySignerConfigForChain, u as SignerConfigForChain, t as SignerAdapter, q as ServerSignerConfig, B as Balances, a2 as FundWalletResponse, a3 as GetTransactionsResponse, a4 as GetTransactionSuccessResponse, z as Transfers, a5 as SendTokenTransactionOptions, a6 as UserLocator, T as Transaction, V as PrepareOnly, c as ApproveParams, a7 as ApproveResult, A as AddSignerOptions, k as ExternalWalletRegistrationConfig, a8 as AddSignerReturnType, s as Signer, p as RemoveSignerOptions, a9 as RemoveSignerReturnType, v as SignerLocator, aa as WalletLocator, b as ApproveOptions, ab as ApproveSignatureResponse, r as Signature } from '../types-CRMCeDuN.js';
|
|
4
4
|
import { Chain } from '../chains/chains.js';
|
|
5
5
|
import '@crossmint/common-sdk-base';
|
|
6
6
|
import 'viem';
|
|
@@ -18,6 +18,8 @@ type WalletContructorType<C extends Chain> = {
|
|
|
18
18
|
alias?: string;
|
|
19
19
|
options?: WalletOptions;
|
|
20
20
|
recovery: RecoverySignerConfigForChain<C>;
|
|
21
|
+
apiRecoveryServerSignerAddress?: string;
|
|
22
|
+
apiDelegatedServerSignerAddresses?: string[];
|
|
21
23
|
signers?: SignerConfigForChain<C>[];
|
|
22
24
|
signer?: SignerAdapter;
|
|
23
25
|
};
|
|
@@ -65,8 +67,28 @@ declare class Wallet<C extends Chain> {
|
|
|
65
67
|
protected static getOptions<C extends Chain>(wallet: Wallet<C>): WalletOptions | undefined;
|
|
66
68
|
protected static getRecovery<C extends Chain>(wallet: Wallet<C>): RecoverySignerConfigForChain<C>;
|
|
67
69
|
protected static getInitialSigners<C extends Chain>(wallet: Wallet<C>): SignerConfigForChain<C>[];
|
|
70
|
+
protected static getApiRecoveryServerSignerAddress<C extends Chain>(wallet: Wallet<C>): string | undefined;
|
|
71
|
+
protected static getApiDelegatedServerSignerAddresses<C extends Chain>(wallet: Wallet<C>): string[];
|
|
68
72
|
get apiClient(): ApiClient;
|
|
69
73
|
protected get options(): WalletOptions | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Derive both primary ("evm") and legacy (chain-specific) server signer candidates.
|
|
76
|
+
*/
|
|
77
|
+
private deriveServerSignerCandidates;
|
|
78
|
+
/**
|
|
79
|
+
* Return the resolved server signer if it matches the given config (i.e. its address
|
|
80
|
+
* matches either the primary or legacy candidate). Returns null otherwise.
|
|
81
|
+
*/
|
|
82
|
+
private matchResolvedServerSigner;
|
|
83
|
+
/**
|
|
84
|
+
* Resolve which derivation (primary "evm" or legacy chain-specific) to use for a server signer.
|
|
85
|
+
* Priority: cached resolution → legacy if it matches a known on-chain address → primary.
|
|
86
|
+
*/
|
|
87
|
+
private resolveServerSignerDerivation;
|
|
88
|
+
/**
|
|
89
|
+
* Resolve a ServerSignerConfig to an API locator string.
|
|
90
|
+
*/
|
|
91
|
+
protected resolveServerSignerApiLocator(signer: ServerSignerConfig): string;
|
|
70
92
|
/**
|
|
71
93
|
* Get the recovery signer config
|
|
72
94
|
* @returns The recovery signer config
|
|
@@ -205,6 +227,12 @@ declare class Wallet<C extends Chain> {
|
|
|
205
227
|
* Returns true if the signer is an admin (recovery) signer.
|
|
206
228
|
*/
|
|
207
229
|
private resolveNonDeviceSigner;
|
|
230
|
+
/**
|
|
231
|
+
* Resolve a server signer: try primary ("evm") derivation first, fall back to legacy
|
|
232
|
+
* (chain-specific) derivation when checking registration. Sets #resolvedServerSigner
|
|
233
|
+
* to whichever derivation is on-chain. Returns true if the signer is the admin (recovery) signer.
|
|
234
|
+
*/
|
|
235
|
+
private resolveServerSigner;
|
|
208
236
|
/**
|
|
209
237
|
* Try to auto-select a passkey credential from registered signers.
|
|
210
238
|
* Returns true if a credential was auto-selected, false if no passkey signers exist.
|
package/dist/wallets/wallet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-YSB7XIS7.js";import"../chunk-TOAFCAVT.js";import"../chunk-N4IWDL6M.js";import"../chunk-BAUUDBGT.js";import"../chunk-IOSADDL5.js";import"../chunk-GOXB2RBF.js";import"../chunk-KZMDZJGM.js";import"../chunk-EIRVLXOC.js";import"../chunk-L52GDMSH.js";import"../chunk-6X5JEJD7.js";import"../chunk-QM3BB4E2.js";import"../chunk-F5NTM2RX.js";import"../chunk-OQZTL6ZG.js";import"../chunk-N355UETO.js";import"../chunk-3VRN3GKQ.js";import"../chunk-BITOMWYZ.js";import"../chunk-YDZRBHS3.js";import"../chunk-4GEG5JA6.js";import"../chunk-RWQ6ZQST.js";import"../chunk-PG7BGWKX.js";import"../chunk-QQ46JY33.js";import"../chunk-O6VBO7KG.js";import"../chunk-EM3D5Q3A.js";import"../chunk-EE4ITUGS.js";import"../chunk-6RX65NOA.js";import"../chunk-XNZLCUTY.js";import"../chunk-CKZYSQOK.js";import"../chunk-QVTKTDED.js";import"../chunk-XS5B3TUE.js";import"../chunk-M335XCYO.js";import"../chunk-YH7G2U6V.js";import"../chunk-2O6HQK34.js";import"../chunk-2YLRFJ66.js";import"../chunk-FXCUVWXJ.js";import"../chunk-S3DYQVRD.js";import"../chunk-KUP7H7X2.js";import"../chunk-FT5EVMLB.js";import"../chunk-SVIKBM3S.js";import"../chunk-KKQBZXFE.js";import"../chunk-5OYPWGMX.js";import"../chunk-455NK5LB.js";import"../chunk-UBDPBFAR.js";import"../chunk-XX6FO5QS.js";import"../chunk-J3R36SGJ.js";export{a as Wallet};
|
package/package.json
CHANGED
package/dist/chunk-3VSFHDFH.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkENU3EKBGcjs = require('./chunk-ENU3EKBG.cjs');var _chunk5FH7WFWLcjs = require('./chunk-5FH7WFWL.cjs');var _chunkYGL4ITFKcjs = require('./chunk-YGL4ITFK.cjs');var _accounts = require('viem/accounts');var _utils = require('@noble/hashes/utils');var _web3js = require('@solana/web3.js');function v(r,e){switch(_chunkENU3EKBGcjs.a.call(void 0, e)){case"evm":return _accounts.privateKeyToAccount.call(void 0, `0x${_utils.bytesToHex.call(void 0, r)}`).address;case"solana":return _web3js.Keypair.fromSeed(r).publicKey.toBase58();case"stellar":return _chunk5FH7WFWLcjs.a.call(void 0, _chunk5FH7WFWLcjs.b.call(void 0, r).publicKey)}}function C(r,e,i,a){if(typeof window!="undefined")throw new Error("Server signers can only be used from server-side code.");let p=typeof e=="string"?e:String(e),t=_chunkYGL4ITFKcjs.a.call(void 0, r.secret,i,a,p),c=v(t,e);return{derivedKeyBytes:t,derivedAddress:c}}exports.a = v; exports.b = C;
|
package/dist/chunk-7EF275IG.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVJEQU7S4cjs = require('./chunk-VJEQU7S4.cjs');var _chunk3VSFHDFHcjs = require('./chunk-3VSFHDFH.cjs');var _chunkOWQZPI3Ucjs = require('./chunk-OWQZPI3U.cjs');var _chunkQJV6W4U2cjs = require('./chunk-QJV6W4U2.cjs');var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var y=409,l=class l extends _chunkVJEQU7S4cjs.a{constructor(e){super({chain:e.chain,address:e.address,owner:e.owner,options:_chunkVJEQU7S4cjs.a.getOptions(e),alias:e.alias,recovery:_chunkVJEQU7S4cjs.a.getRecovery(e),signer:e.signer,signers:_chunkVJEQU7S4cjs.a.getInitialSigners(e)},_chunkVJEQU7S4cjs.a.getApiClient(e))}static from(e){if(!_commonsdkbase.isValidStellarAddress.call(void 0, e.address))throw new Error("Wallet is not a Stellar wallet");return new l(e)}sendTransaction(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var d;_chunkQJV6W4U2cjs.a.info("stellarWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let a=yield this.createTransaction(e);if((d=e.options)!=null&&d.prepareOnly)return _chunkQJV6W4U2cjs.a.info("stellarWallet.sendTransaction.prepared",{transactionId:a.id}),{hash:void 0,explorerLink:void 0,transactionId:a.id};let r={},n=yield this.approveTransactionAndWait(a.id,r);return _chunkQJV6W4U2cjs.a.info("stellarWallet.sendTransaction.success",{transactionId:a.id,hash:n.hash}),n})}upgrade(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){_chunkQJV6W4U2cjs.a.info("stellarWallet.upgrade.start"),yield this.preAuthIfNeeded();let a=yield this.createWalletLifecycleTransaction("upgrade-wallet",e);if(a!=null){if(e!=null&&e.prepareOnly)return _chunkQJV6W4U2cjs.a.info("stellarWallet.upgrade.prepared",{transactionId:a}),{hash:void 0,explorerLink:void 0,transactionId:a};yield this.approveTransactionAndWait(a),_chunkQJV6W4U2cjs.a.info("stellarWallet.upgrade.phase1.success",{transactionId:a})}else _chunkQJV6W4U2cjs.a.info("stellarWallet.upgrade.phase1.skipped",{reason:"wallet already locked from a prior upgrade"});let r=yield this.migrateInternal({signer:e==null?void 0:e.signer,prepareOnly:e==null?void 0:e.prepareOnly});return _chunkQJV6W4U2cjs.a.info("stellarWallet.upgrade.success",{transactionId:r.transactionId,hash:r.hash}),r})}migrate(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){return yield this.preAuthIfNeeded(),yield this.migrateInternal(e)})}migrateInternal(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){_chunkQJV6W4U2cjs.a.info("stellarWallet.migrate.start");let a=yield this.createWalletLifecycleTransaction("migrate-wallet",e);if(a==null)throw new (0, _chunkOWQZPI3Ucjs.v)("Failed to create migrate-wallet transaction");if(e!=null&&e.prepareOnly)return _chunkQJV6W4U2cjs.a.info("stellarWallet.migrate.prepared",{transactionId:a}),{hash:void 0,explorerLink:void 0,transactionId:a};let r=yield this.approveTransactionAndWait(a);return _chunkQJV6W4U2cjs.a.info("stellarWallet.migrate.success",{transactionId:a,hash:r.hash}),r})}createTransaction(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let{contractId:a,options:r}=e,n=this.resolveStellarSigner(r==null?void 0:r.signer),d="transaction"in e?{type:"serialized-transaction",serializedTransaction:e.transaction,contractId:a}:{type:"contract-call",contractId:a,method:e.method,memo:e.memo!=null?{type:"text",value:e.memo}:void 0,args:e.args},p=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:d,signer:n}});if("error"in p)throw new (0, _chunkOWQZPI3Ucjs.v)(JSON.stringify(p));return p})}createWalletLifecycleTransaction(e,a){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let r=(a==null?void 0:a.signer)!=null?this.resolveStellarSigner(a.signer):void 0,n=yield this.apiClient.createTransaction(this.walletLocator,{params:_chunk2GKPWQBQcjs.a.call(void 0, {transaction:{type:e}},r!=null?{signer:r}:{})});if("error"in n){if(e==="upgrade-wallet"&&S(n))return null;throw new (0, _chunkOWQZPI3Ucjs.v)(JSON.stringify(n))}return n.id})}resolveStellarSigner(e){return e==null?this.requireSigner().locator():typeof e=="string"?e:`server:${_chunk3VSFHDFHcjs.b.call(void 0, e,this.chain,this.apiClient.projectId,this.apiClient.environment).derivedAddress}`}};_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkQJV6W4U2cjs.a,methodName:"stellarWallet.sendTransaction",buildContext(e){return{chain:e.chain,address:e.address}}})],l.prototype,"sendTransaction",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkQJV6W4U2cjs.a,methodName:"stellarWallet.upgrade",buildContext(e){return{chain:e.chain,address:e.address}}})],l.prototype,"upgrade",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkQJV6W4U2cjs.a,methodName:"stellarWallet.migrate",buildContext(e){return{chain:e.chain,address:e.address}}})],l.prototype,"migrate",1);var T=l;function S(o){return typeof o=="object"&&o!==null&&"statusCode"in o&&o.statusCode===y}exports.a = T;
|
package/dist/chunk-BA36HJOM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s="@crossmint/wallets-sdk",t="1.2.0";var c="WALLETS_SDK",r=t,a=s,d=500;export{c as a,r as b,a as c,d};
|
package/dist/chunk-D6SLJ5C2.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');function o(t){switch(t.type){case"passkey":return{type:"passkey",id:t.id,name:t.name,publicKey:t.publicKey,validatorContractVersion:t.validatorContractVersion,locator:t.locator};case"api-key":return{type:"api-key",address:t.address,locator:t.locator};case"external-wallet":return{type:"external-wallet",address:t.address,locator:t.locator};case"email":return{type:"email",email:t.email,address:t.address,locator:t.locator};case"phone":return{type:"phone",phone:t.phone,address:t.address,locator:t.locator};case"device":return{type:"device",publicKey:t.publicKey,locator:t.locator};case"server":return{type:"server",address:t.address,locator:t.locator};default:throw new Error(`Unknown signer type: ${t.type}`)}}function c(t,s){let e=o(t);if(s==="solana"||s==="stellar"){let n="success";return"transaction"in t&&t.transaction!=null&&(n=t.transaction.status),_chunk2GKPWQBQcjs.b.call(void 0, _chunk2GKPWQBQcjs.a.call(void 0, {},e),{status:n})}if("chains"in t&&t.chains!=null&&Object.keys(t.chains).length>0){let n=t.chains[s];return n==null?null:_chunk2GKPWQBQcjs.b.call(void 0, _chunk2GKPWQBQcjs.a.call(void 0, {},e),{status:n.status})}return _chunk2GKPWQBQcjs.b.call(void 0, _chunk2GKPWQBQcjs.a.call(void 0, {},e),{status:"success"})}function u(t,s){if(s==="solana"||s==="stellar")return"transaction"in t&&t.transaction!=null&&(t.transaction.status==="pending"||t.transaction.status==="awaiting-approval")?{type:"transaction",id:t.transaction.id}:null;if("chains"in t&&t.chains!=null){let e=t.chains[s];if(e!=null&&(e.status==="pending"||e.status==="awaiting-approval"))return{type:"signature",id:e.id}}return null}function i(t,s){let e=_chunk2GKPWQBQcjs.b.call(void 0, _chunk2GKPWQBQcjs.a.call(void 0, {},t),{status:s});return t.locator.indexOf(":")===-1&&(t.type==="api-key"?e.locator=t.locator:(e.locator=`external-wallet:${t.locator}`,e.type="external-wallet")),e}exports.a = o; exports.b = c; exports.c = u; exports.d = i;
|
package/dist/chunk-G4RVBYWJ.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6EUBBDIVcjs = require('./chunk-6EUBBDIV.cjs');var _chunkVJEQU7S4cjs = require('./chunk-VJEQU7S4.cjs');var _chunkYHV3672Rcjs = require('./chunk-YHV3672R.cjs');var _chunkNX256LAHcjs = require('./chunk-NX256LAH.cjs');var _chunk3VSFHDFHcjs = require('./chunk-3VSFHDFH.cjs');var _chunkQJC54AMLcjs = require('./chunk-QJC54AML.cjs');var _chunkOWQZPI3Ucjs = require('./chunk-OWQZPI3U.cjs');var _chunkQJV6W4U2cjs = require('./chunk-QJV6W4U2.cjs');var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _ox = require('ox');var D="When 'signers' is provided to a method that may fetch an existing wallet, each specified signer must exist in that wallet's configuration.",h= exports.a =class{constructor(t){this.apiClient=t}getWallet(t,e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let i,a;if(typeof t=="string"){if(!this.apiClient.isServerSide)throw new (0, _chunkOWQZPI3Ucjs.g)("getWallet with walletLocator is only available on the server side. Use getWallet(args) instead.");if(e==null)throw new (0, _chunkOWQZPI3Ucjs.g)("Wallet configuration is required when using walletLocator: https://docs.crossmint.com/sdk-reference/wallets/type-aliases/WalletArgsFor");i=t,a=e}else{if(this.apiClient.isServerSide)throw new (0, _chunkOWQZPI3Ucjs.g)("getWallet on server side requires a walletLocator parameter. Use getWallet(walletLocator, args) instead.");a=t,i=this.getWalletLocator(a)}let n=_chunk2GKPWQBQcjs.b.call(void 0, _chunk2GKPWQBQcjs.a.call(void 0, {},a),{chain:_chunkQJC54AMLcjs.f.call(void 0, a.chain,this.apiClient.environment)});_chunkQJV6W4U2cjs.a.info("walletFactory.getWallet.start");let r=yield this.apiClient.getWallet(i);if("error"in r)throw _chunkQJV6W4U2cjs.a.warn("walletFactory.getWallet.notFound",{error:r.error}),new (0, _chunkOWQZPI3Ucjs.e)(JSON.stringify(r));return _chunkQJV6W4U2cjs.a.info("walletFactory.getWallet.success",{address:r.address}),yield this.createWalletInstance(r,n)})}createWallet(t){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var o,c,w,W,A,k,F,P;let e=_chunk2GKPWQBQcjs.b.call(void 0, _chunk2GKPWQBQcjs.a.call(void 0, {},t),{chain:_chunkQJC54AMLcjs.f.call(void 0, t.chain,this.apiClient.environment)});if(yield(w=(c=(o=e.options)==null?void 0:o.callbacks)==null?void 0:c.onWalletCreationStart)==null?void 0:w.call(c),_chunkQJV6W4U2cjs.a.info("walletFactory.createWallet.start"),!this.apiClient.isServerSide&&e.owner!=null)throw _chunkQJV6W4U2cjs.a.error("walletFactory.createWallet.error",{error:"Owner field cannot be specified in client-side createWallet calls"}),new (0, _chunkOWQZPI3Ucjs.g)("Owner field cannot be specified in client-side createWallet calls. Owner is determined from JWT authentication.");let a=((W=e.options)==null?void 0:W.deviceSignerKeyStorage)!=null&&e.chain!=="solana"?this.ensureDeviceSignerInSigners(e):(A=e.signers)!=null?A:[],n=yield this.registerSigners(a,e.chain,(k=e.options)==null?void 0:k.deviceSignerKeyStorage),r;if(e.recovery.type==="passkey"&&e.recovery.id==null)r=yield this.createPasskeySigner(e.recovery);else if(e.recovery.type==="server"){let{derivedAddress:$}=_chunk3VSFHDFHcjs.b.call(void 0, e.recovery,e.chain,this.apiClient.projectId,this.apiClient.environment);r={type:"server",address:$}}else r=e.recovery;let s=yield this.apiClient.createWallet({type:"smart",chainType:this.getChainType(e.chain),config:_chunk2GKPWQBQcjs.a.call(void 0, _chunk2GKPWQBQcjs.a.call(void 0, {adminSigner:r},e.plugins?{plugins:e.plugins}:{}),n!=null?{delegatedSigners:n}:{}),owner:(F=e.owner)!=null?F:void 0,alias:(P=e.alias)!=null?P:void 0});if("error"in s)throw _chunkQJV6W4U2cjs.a.error("walletFactory.createWallet.error",{error:s.error}),new (0, _chunkOWQZPI3Ucjs.g)(JSON.stringify(s));return _chunkQJV6W4U2cjs.a.info("walletFactory.createWallet.success",{address:s.address}),yield this.createWalletInstance(s,e)})}createWalletInstance(t,e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var o,c;this.validateExistingWalletConfig(t,e);let i=e,a=t.config.adminSigner,n=((o=i.recovery)==null?void 0:o.type)==="server"||((c=i.recovery)==null?void 0:c.type)==="external-wallet"?i.recovery:a,r=t.config.delegatedSigners;r!=null&&r.length===1&&(r[0].type==="server"||r[0].type==="external-wallet")&&(r=i.signers);let s=new (0, _chunkVJEQU7S4cjs.a)({chain:e.chain,address:t.address,owner:t.owner,options:e.options,alias:e.alias,recovery:n,signers:r!=null?r:[]},this.apiClient);return yield s.waitForInit(),s})}getWalletLocator(t){return`me:${this.getChainType(t.chain)}:smart`+(t.alias!=null?`:alias:${t.alias}`:"")}createPasskeySigner(t){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var a;if(t.type!=="passkey")throw new Error("Signer is not a passkey");let e=(a=t.name)!=null?a:`Crossmint Wallet ${Date.now()}`,i=t.onCreatePasskey?yield t.onCreatePasskey(e):yield _ox.WebAuthnP256.createCredential({name:e});return{type:"passkey",id:i.id,name:e,publicKey:{x:i.publicKey.x.toString(),y:i.publicKey.y.toString()}}})}ensureDeviceSignerInSigners(t){var a;let e=(a=t.signers)!=null?a:[];return e.some(n=>n.type==="device")?e:[...e,{type:"device"}]}validateExistingWalletConfig(t,e){if(e.owner!=null&&t.owner!=null&&_chunk6EUBBDIVcjs.a.call(void 0, e.owner)!==_chunk6EUBBDIVcjs.a.call(void 0, t.owner))throw new (0, _chunkOWQZPI3Ucjs.g)("Wallet owner does not match existing wallet's linked user");if(e.chain==="solana"&&t.chainType!=="solana"||e.chain!=="solana"&&t.chainType==="solana"||e.chain==="stellar"&&t.chainType!=="stellar"||e.chain!=="stellar"&&t.chainType==="stellar")throw new (0, _chunkOWQZPI3Ucjs.g)(`Wallet chain does not match existing wallet's chain. You must use chain: ${t.chainType}.`);if(t.type!=="smart")return;let i=e;if(i.recovery!=null||i.signers!=null){let a=t.config,n=a==null?void 0:a.adminSigner;if(i.recovery!=null&&n!=null){if(i.recovery.type!==n.type)throw new (0, _chunkOWQZPI3Ucjs.g)("The wallet recovery signer type does not match the existing wallet's recovery signer type");_chunk6EUBBDIVcjs.b.call(void 0, i.recovery,n)}let r=i.signers;r!=null&&this.validateSigners(t,r,e.chain)}}validateSigners(t,e,i){let a=t.config,n=a==null?void 0:a.delegatedSigners;if(e.length!==0){if(n==null||n.length===0)throw new (0, _chunkOWQZPI3Ucjs.g)(`${e.length} signer(s) specified, but wallet "${t.address}" has no signers. ${D}`);for(let r of e){let s=n.find(o=>{if(this.isMatchingPasskeySigner(r,o,a)||o.type==="device"&&r.type==="device")return!0;if(r.type==="server"){let{derivedAddress:c}=_chunk3VSFHDFHcjs.b.call(void 0, r,i,this.apiClient.projectId,this.apiClient.environment);return o.locator===`server:${c}`}return o.locator===_chunkNX256LAHcjs.a.call(void 0, r)});if(s==null){let o=n.map(c=>c.locator).join(", ");throw new (0, _chunkOWQZPI3Ucjs.g)(`Signer '${r.type}' does not exist in wallet "${t.address}". Available signers: ${o}. ${D}`)}_chunk6EUBBDIVcjs.b.call(void 0, r,s)}}}isMatchingPasskeySigner(t,e,i){var n,r;let a=((r=(n=i.delegatedSigners)==null?void 0:n.filter(s=>s.type==="passkey").length)!=null?r:0)+(i.adminSigner.type==="passkey"?1:0);if(t.type==="passkey"){if(t.id==null&&a===1)return e.type==="passkey";if(t.id==null&&a>1)throw new (0, _chunkOWQZPI3Ucjs.g)("When creating a wallet with multiple passkeys, you must provide the passkey ID for each passkey.")}return!1}registerSigners(t,e,i){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var a;return yield Promise.all((a=t==null?void 0:t.map(n=>_chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){if(n.type==="passkey")return n.id==null?{signer:yield this.createPasskeySigner(n)}:{signer:n};if(n.type==="device"){if(n.publicKey!=null)return{signer:{type:"device",publicKey:n.publicKey,name:n.name}};if(n.locator!=null)return{signer:n.locator};if(i==null)throw new (0, _chunkOWQZPI3Ucjs.g)("Device signer key storage is required for device signers");let r=yield _chunkYHV3672Rcjs.a.call(void 0, i);return{signer:{type:"device",publicKey:r.publicKey,name:r.name}}}if(n.type==="server"&&e!=null){let{derivedAddress:r}=_chunk3VSFHDFHcjs.b.call(void 0, n,e,this.apiClient.projectId,this.apiClient.environment);return{signer:`server:${r}`}}return{signer:_chunkNX256LAHcjs.a.call(void 0, n)}})))!=null?a:[])})}getChainType(t){return t==="solana"?"solana":t==="stellar"?"stellar":"evm"}};_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkQJV6W4U2cjs.a,methodName:"walletFactory.getWallet",buildContext(t,e){if(typeof e[0]=="string"){let a=e[1];return{walletLocator:e[0],chain:a==null?void 0:a.chain}}let i=e[0];return{chain:i==null?void 0:i.chain}}})],h.prototype,"getWallet",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkQJV6W4U2cjs.a,methodName:"walletFactory.createWallet",buildContext(t,e){return{chain:e[0].chain}}})],h.prototype,"createWallet",1);exports.a = h;
|
package/dist/chunk-GETUHEQB.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkVJEQU7S4cjs = require('./chunk-VJEQU7S4.cjs');var _chunk3VSFHDFHcjs = require('./chunk-3VSFHDFH.cjs');var _chunkE4EOD7MPcjs = require('./chunk-E4EOD7MP.cjs');var _chunkOWQZPI3Ucjs = require('./chunk-OWQZPI3U.cjs');var _chunkQJV6W4U2cjs = require('./chunk-QJV6W4U2.cjs');var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _commonsdkbase = require('@crossmint/common-sdk-base');var o=class o extends _chunkVJEQU7S4cjs.a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,options:_chunkVJEQU7S4cjs.a.getOptions(n),alias:n.alias,recovery:_chunkVJEQU7S4cjs.a.getRecovery(n),signer:n.signer,signers:_chunkVJEQU7S4cjs.a.getInitialSigners(n)},_chunkVJEQU7S4cjs.a.getApiClient(n))}static from(n){if(!_commonsdkbase.isValidSolanaAddress.call(void 0, n.address))throw new Error("Wallet is not a Solana wallet");return new o(n)}sendTransaction(n){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var d,p;_chunkQJV6W4U2cjs.a.info("solanaWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let e=yield this.createTransaction(n);if((d=n.options)!=null&&d.prepareOnly)return _chunkQJV6W4U2cjs.a.info("solanaWallet.sendTransaction.prepared",{transactionId:e.id}),{hash:void 0,explorerLink:void 0,transactionId:e.id};let t={additionalSigners:(p=n.additionalSigners)==null?void 0:p.map(c=>new (0, _chunkE4EOD7MPcjs.a)({type:"external-wallet",address:c.publicKey.toString(),locator:`external-wallet:${c.publicKey.toString()}`,onSign:h=>(h.sign([c]),Promise.resolve(h))}))},a=yield this.approveTransactionAndWait(e.id,t);return _chunkQJV6W4U2cjs.a.info("solanaWallet.sendTransaction.success",{transactionId:e.id,hash:a.hash}),a})}createTransaction(n){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var a;let e;((a=n.options)==null?void 0:a.signer)==null?e=this.requireSigner().locator():typeof n.options.signer=="string"?e=n.options.signer:e=`server:${_chunk3VSFHDFHcjs.b.call(void 0, n.options.signer,this.chain,this.apiClient.projectId,this.apiClient.environment).derivedAddress}`;let s;"serializedTransaction"in n?s=n.serializedTransaction:s=_bs582.default.encode(n.transaction.serialize());let t=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:s,signer:e}});if("error"in t)throw new (0, _chunkOWQZPI3Ucjs.v)(JSON.stringify(t));return t})}};_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkQJV6W4U2cjs.a,methodName:"solanaWallet.sendTransaction",buildContext(n){return{chain:n.chain,address:n.address}}})],o.prototype,"sendTransaction",1);var S=o;exports.a = S;
|
package/dist/chunk-KB32HFUC.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as ge}from"./chunk-N4IWDL6M.js";import{a as F}from"./chunk-GOXB2RBF.js";import{b as U,c as M}from"./chunk-VADIEIDS.js";import{a as K}from"./chunk-PL6OYURB.js";import{b as N}from"./chunk-RBSMBO4T.js";import{a as ce}from"./chunk-A73HLVAF.js";import{a as le,b as $}from"./chunk-6RX65NOA.js";import{f as oe}from"./chunk-MILCZTHF.js";import{A as ne,B as ae,D as se,d as V,e as z,j as H,k as Y,l as G,p as Q,s as J,t as X,u as Z,v as ee,w as j,x as re,y as te,z as ie}from"./chunk-5OYPWGMX.js";import{a}from"./chunk-C73NTGFV.js";import{d as _}from"./chunk-BA36HJOM.js";import{a as A,b as W,c as R,d as i,e as T,f as u,g as c}from"./chunk-J3R36SGJ.js";import{isValidAddress as de,WithLoggerContext as x}from"@crossmint/common-sdk-base";var S,b,p,f,k,m,I,O,L,D,E=class{constructor(e,r){T(this,S);T(this,b);T(this,p);T(this,f);T(this,k);T(this,m,!1);T(this,I,!1);T(this,O);T(this,L,null);T(this,D,!1);let{chain:t,address:n,owner:s,options:d,alias:o,recovery:l,signers:g,signer:h}=e;u(this,p,r),this.chain=t,this.address=n,this.owner=s,u(this,b,d),this.alias=o,u(this,f,l),u(this,k,g!=null?g:[]),u(this,S,h),u(this,O,this.initDefaultSigner())}get signer(){return i(this,S)}waitForInit(){return c(this,null,function*(){yield i(this,O)})}initDeviceSigner(){return c(this,null,function*(){var n;let e=(n=i(this,b))==null?void 0:n.deviceSignerKeyStorage;if(e==null||i(this,D))return;let r={type:"device"};try{yield this.resolveDeviceSignerAvailability(r)}catch(s){a.error("wallet.initDeviceSigner.error",{error:s}),u(this,m,!0);return}if(i(this,m))return;let t=this.buildInternalSignerConfig(r);u(this,S,yield this.assembleFullSigner(t,e)),this.isApprovedSignerStatus(i(this,S).status)||(a.info("wallet.initDeviceSigner.pendingApproval",{signerLocator:i(this,S).locator(),status:i(this,S).status}),u(this,m,!0),u(this,I,!1))})}initDefaultSigner(){return c(this,null,function*(){if(i(this,S)!=null||(yield this.initDeviceSigner(),i(this,S)!=null||i(this,m)))return;let e=i(this,k).length===0?i(this,f):i(this,k).length===1?i(this,k)[0]:null;if(e==null||!this.isAutoAssemblableSignerConfig(e))return;let r=e===i(this,f);try{let t=this.buildInternalSignerConfig(e);u(this,S,yield this.assembleFullSigner(t,void 0,{isAdminSigner:r}))}catch(t){a.warn("wallet.initDefaultSigner.autoAssemblyFailed",{recoveryType:i(this,f).type,signerCount:i(this,k).length,error:t})}})}assembleRecoverySignerFallback(){return c(this,null,function*(){if(this.isAutoAssemblableSignerConfig(i(this,f)))try{let e=this.buildInternalSignerConfig(i(this,f));u(this,S,yield this.assembleFullSigner(e,void 0,{isAdminSigner:!0}))}catch(e){a.warn("wallet.recover.device.unsupportedFallback.autoAssemblyFailed",{recoveryType:i(this,f).type,error:e})}})}static getApiClient(e){return e.apiClient}static getOptions(e){return e.options}static getRecovery(e){return i(e,f)}static getInitialSigners(e){return i(e,k)}get apiClient(){return i(this,p)}get options(){return i(this,b)}get recovery(){return i(this,f)}balances(e){return c(this,null,function*(){a.info("wallet.balances.start");let r=this.resolveChainForEnvironment(),t;switch(this.chain){case"solana":t="sol";break;case"stellar":t="xlm";break;default:t="eth";break}let n=[t,"usdc",...e!=null?e:[]],s=yield i(this,p).getBalance(this.address,{chains:[r],tokens:n});if("error"in s)throw a.error("wallet.balances.error",{error:s}),new Error(`Failed to get balances for wallet: ${JSON.stringify(s.message)}`);return a.info("wallet.balances.success"),this.transformBalanceResponse(s,t,e)})}stagingFund(e,r){return c(this,null,function*(){a.info("wallet.stagingFund.start",{amount:e,chain:r!=null?r:this.chain});let t=yield this.apiClient.fundWallet(this.address,{amount:e,token:"usdxm",chain:r!=null?r:this.chain});if("error"in t)throw a.error("wallet.stagingFund.error",{error:t}),new Error(`Failed to fund wallet: ${JSON.stringify(t.message)}`);return a.info("wallet.stagingFund.success"),t})}transformBalanceResponse(e,r,t){let n=g=>{var y,C,P,B,q;let h=(y=g.chains)==null?void 0:y[this.chain],w={};return this.chain==="solana"&&h!=null&&"mintHash"in h?w={mintHash:h.mintHash}:this.chain==="stellar"&&h!=null&&"contractId"in h?w={contractId:h.contractId}:h!=null&&"contractAddress"in h&&(w={contractAddress:h.contractAddress}),A({symbol:(C=g.symbol)!=null?C:"",name:(P=g.name)!=null?P:"",amount:(B=g.amount)!=null?B:"0",decimals:g.decimals,rawAmount:(q=g.rawAmount)!=null?q:"0"},w)},s=e.find(g=>g.symbol===r),d=e.find(g=>g.symbol==="usdc"),o=e.filter(g=>{var h;return g.symbol!==r&&g.symbol!=="usdc"&&(t==null||t.includes((h=g.symbol)!=null?h:""))}),l=g=>{let h={symbol:g,name:g,amount:"0",decimals:0,rawAmount:"0"},w={};return this.chain==="solana"?w={mintHash:void 0}:this.chain==="stellar"?w={contractId:void 0}:w={contractAddress:void 0},A(A({},h),w)};return{nativeToken:s!=null?n(s):l(r),usdc:d!=null?n(d):l("usdc"),tokens:o.map(n)}}nfts(e){return c(this,null,function*(){return yield i(this,p).getNfts(W(A({},e),{chain:this.chain,address:this.address}))})}transactions(){return c(this,null,function*(){let e=yield i(this,p).getTransactions(this.walletLocator);if("error"in e)throw new Error(`Failed to get transactions: ${JSON.stringify(e.message)}`);return e})}transaction(e){return c(this,null,function*(){let r=yield i(this,p).getTransaction(this.walletLocator,e);if("error"in r)throw new Error(`Failed to get transaction: ${JSON.stringify(r.error)}`);return r})}transfers(e){return c(this,null,function*(){let r=this.resolveChainForEnvironment(),t=yield this.apiClient.getTransfers(this.walletLocator,{chain:r,tokens:e.tokens,status:e.status});if("error"in t)throw new Error(`Failed to get transfers: ${JSON.stringify(t.message)}`);return t})}send(e,r,t,n){return c(this,null,function*(){let s=this.resolveChainForEnvironment(),d=pe(e),o=Se(r,s),l=Number(t);if(Number.isNaN(l)||!Number.isFinite(l)||l<=0)throw new Z(`Invalid transfer amount: "${t}". Amount must be a positive number greater than zero.`);a.info("wallet.send.start",A({recipient:d,token:o,amount:t},(n==null?void 0:n.transactionType)!=null?{transactionType:n.transactionType}:{})),yield this.preAuthIfNeeded();let g=this.requireSigner(),h;(n==null?void 0:n.signer)==null?h=g.locator():typeof n.signer=="string"?h=n.signer:h=`server:${N(n.signer,this.chain,i(this,p).projectId,i(this,p).environment).derivedAddress}`;let w=A({recipient:d,amount:t,signer:h},(n==null?void 0:n.transactionType)!=null?{transactionType:n.transactionType}:{}),y=yield i(this,p).send(this.walletLocator,o,w);if("message"in y)throw a.error("wallet.send.error",{error:y}),new ee(`Failed to send token: ${JSON.stringify(y.message)}`);if((n==null?void 0:n.prepareOnly)===!0)return a.info("wallet.send.prepared",{transactionId:y.id}),{hash:void 0,explorerLink:void 0,transactionId:y.id};let C=yield this.approveTransactionAndWait(y.id);return a.info("wallet.send.success",{transactionId:y.id,hash:C.hash}),C})}approveTransaction(e){return c(this,null,function*(){return console.warn("approveTransaction is deprecated. Use approve instead. This method will be removed in the next major version."),yield this.approve(e)})}approve(e){return c(this,null,function*(){if(a.info("wallet.approve.start",{transactionId:e.transactionId,signatureId:e.signatureId}),yield this.preAuthIfNeeded(),e.transactionId!=null){let r=yield this.approveTransactionAndWait(e.transactionId,e.options);return a.info("wallet.approve.success",{transactionId:e.transactionId}),r}if(e.signatureId!=null){let r=yield this.approveSignatureAndWait(e.signatureId,e.options);return a.info("wallet.approve.success",{signatureId:e.signatureId}),r}throw a.error("wallet.approve.error",{error:"Either transactionId or signatureId must be provided"}),new Error("Either transactionId or signatureId must be provided")})}addSigner(e,r){return c(this,null,function*(){a.info("wallet.addSigner.start");let t=typeof e=="object"&&"type"in e&&e.type==="server"?`server:${N(e,this.chain,i(this,p).projectId,i(this,p).environment).derivedAddress}`:e;return this.withRecoverySigner(()=>c(this,null,function*(){var h,w;let n=typeof t=="string"?t:F(t),s=yield this.getSignerState(n);if(s.signer!=null){if(this.isApprovedSignerStatus(s.signer.status))return a.info("wallet.addSigner.alreadyApproved"),this.completeSignerRegistration(s.signer,null,r);if(s.pendingOperation!=null)return a.info("wallet.addSigner.resuming",{operationType:s.pendingOperation.type,operationId:s.pendingOperation.id}),this.completeSignerRegistration(s.signer,s.pendingOperation,r)}let d=typeof t=="string"||t.type==="passkey"?t:t.type==="device"&&"publicKey"in t&&t.publicKey!=null?{type:"device",publicKey:t.publicKey,name:t.name}:F(t),o=yield i(this,p).registerSigner(this.walletLocator,{signer:d,chain:this.getSignerRegistrationChain()});if("error"in o)throw a.error("wallet.addSigner.error",{error:o}),o.code===Y?new G(o.message):new H(`Failed to register signer: ${JSON.stringify(o.message)}`);let l=U(o,this.chain);if(l==null)throw new Error(`No approval found for chain ${this.chain} in register signer response`);let g=null;if(this.chain==="solana"||this.chain==="stellar"){if(!("transaction"in o)||o.transaction==null)throw a.error("wallet.addSigner.error",{error:"Expected transaction in response for Solana/Stellar chain"}),new Error("Expected transaction in response for Solana/Stellar chain");g={type:"transaction",id:o.transaction.id}}else{if(!("chains"in o))throw a.error("wallet.addSigner.error",{error:"Expected chains in response for EVM chain"}),new Error("Expected chains in response for EVM chain");if(((w=(h=o.chains)==null?void 0:h[this.chain])==null?void 0:w.status)==="failed")throw new Error(`Signer registration failed for chain ${this.chain}`);g=M(o,this.chain)}return this.completeSignerRegistration(l,g,r)}))})}completeSignerRegistration(e,r,t){return c(this,null,function*(){if(t!=null&&t.prepareOnly){if(r==null)return A({},e);switch(r.type){case"transaction":{let n={transactionId:r.id};return a.info("wallet.addSigner.prepared",n),A(A({},e),n)}case"signature":{let n={signatureId:r.id};return a.info("wallet.addSigner.prepared",n),A(A({},e),n)}default:{let n=r.type;throw new Error(`Unknown pending operation type: ${n}`)}}}if(r!=null)switch(r.type){case"transaction":yield this.approveTransactionAndWait(r.id),a.info("wallet.addSigner.success",{transactionId:r.id});break;case"signature":yield this.approveSignatureAndWait(r.id),a.info("wallet.addSigner.success",{signatureId:r.id});break;default:{let n=r.type;throw new Error(`Unknown pending operation type: ${n}`)}}else a.info("wallet.addSigner.success");return W(A({},e),{status:"success"})})}removeSigner(e,r){return c(this,null,function*(){let t=this.resolveSignerLocator(e);return a.info("wallet.removeSigner.start",{signerLocator:t}),this.withRecoverySigner(()=>c(this,null,function*(){let n=yield i(this,p).removeSigner(this.walletLocator,t,{chain:this.getSignerRegistrationChain()});if("error"in n)throw a.error("wallet.removeSigner.error",{error:n}),new Error(`Failed to remove signer: ${JSON.stringify(n)}`);let s=n.id;return r!=null&&r.prepareOnly?(a.info("wallet.removeSigner.prepared",{transactionId:s}),{transactionId:s,status:void 0}):(yield this.approveTransactionAndWait(s),a.info("wallet.removeSigner.success",{transactionId:s}),{transactionId:s,status:"success"})}))})}useSigner(e){return c(this,null,function*(){a.info("wallet.useSigner.start"),this.validateSignerInput(e);let r=!1;e.type==="device"?yield this.resolveDeviceSignerAvailability(e):r=yield this.resolveNonDeviceSigner(e);let t=this.buildInternalSignerConfig(e),n=F(e);u(this,S,yield this.assembleFullSigner(t,void 0,{isAdminSigner:r})),a.info("wallet.useSigner.success",{signerLocator:n})})}resolveNonDeviceSigner(e){return c(this,null,function*(){if(e.type!=="passkey"&&this.isRecoverySigner(e))return u(this,m,!1),!0;if(e.type==="passkey"&&this.isPasskeyMissingId(e)&&!(yield this.tryAutoSelectPasskey(e))){if(this.isRecoverySigner(e))return u(this,m,!1),!0;throw new Error("No passkey signer is registered on this wallet.")}let r=this.resolveSignerLocator(e);if(yield this.signerIsRegistered(r))return u(this,m,!1),!1;if(this.isRecoverySigner(e))return u(this,m,!1),!0;throw new Error(`Signer "${r}" is not registered in this wallet.`)})}tryAutoSelectPasskey(e){return c(this,null,function*(){let t=(yield this.signers()).filter(n=>n.type==="passkey");if(t.length===0)return!1;if(t.length>1)throw new Error('Multiple passkey signers are registered on this wallet. Please specify the credential id: wallet.useSigner({ type: "passkey", id: "<credential-id>" })');return e.id=t[0].locator.replace("passkey:",""),!0})}resolveSignerLocator(e){if(e.type==="server"){let{derivedAddress:r}=N(e,this.chain,i(this,p).projectId,i(this,p).environment);return`server:${r}`}return F(e)}getSignerRegistrationChain(){if(!(this.chain==="solana"||this.chain==="stellar"))return this.chain}withRecoverySigner(e){return c(this,null,function*(){var n;let r=this.signer;if($(i(this,f)))throw new Error('Cannot assemble server signer: no secret available. Call wallet.useSigner({ type: "server", secret: ... }) first with the recovery server secret.');if(i(this,f)!=null&&i(this,f).type==="external-wallet"&&!this.isAutoAssemblableSignerConfig(i(this,f)))throw new Error('Cannot assemble external wallet signer: no onSign callback available. Call wallet.useSigner({ type: "external-wallet", address: "0x...", onSign: async (tx) => ... }) first.');let t=this.buildInternalSignerConfig(i(this,f));u(this,S,K(this.chain,t,(n=i(this,b))==null?void 0:n.deviceSignerKeyStorage));try{return yield e()}finally{u(this,S,r)}})}isPasskeyMissingId(e){return e.id==null||e.id===""}signerIsRegistered(e){return c(this,null,function*(){return(yield this.signers()).some(t=>t.locator===e)})}isSignerApproved(e){return c(this,null,function*(){var t;let r=yield this.getSignerState(e);return this.isApprovedSignerStatus((t=r.signer)==null?void 0:t.status)})}isApprovedSignerStatus(e){return e==="success"||e==="active"}needsRecovery(){return i(this,m)}recover(){return c(this,null,function*(){var s,d;if(a.info("wallet.recover.start"),i(this,I)){a.info("wallet.recover.skipped",{reason:"Device signer already approved (cached)"});return}if(i(this,D)){a.info("wallet.recover.skipped",{reason:"device signer not supported (cached)"}),u(this,m,!1),u(this,I,!0);return}let e=()=>{u(this,m,!1),u(this,I,!0)};if(((s=i(this,S))==null?void 0:s.type)==="device"&&(yield this.checkAndResumeDeviceSigner(i(this,S)))){e();return}if(i(this,S)!=null&&i(this,S).type!=="device"){a.warn("wallet.recover.skipped",{reason:"Recovery is only supported for device signers"}),u(this,m,!1);return}let r=(d=i(this,b))==null?void 0:d.deviceSignerKeyStorage;if(r==null){if(!i(this,m))return;throw new Error("Device signer key storage is required to recover a device signer")}let t=yield this.findLocalDeviceSigner(r);if(t!=null&&(yield this.checkAndResumeDeviceSigner(t))){u(this,S,t),e();let o=t.locator().replace("device:","");try{yield r.mapAddressToKey(this.address,o)}catch(l){a.warn("wallet.recover.mapAddressToKey.error",{error:l})}return}let n=yield ge(r,this.address);try{yield this.addSigner(n)}catch(o){let l=o instanceof Error&&o.message.toLowerCase().includes("delegated signer")&&o.message.toLowerCase().includes("already")&&o.message.toLowerCase().includes("approved");if(o instanceof G){a.info("wallet.recover.device.unsupportedFallback",{signerLocator:n.locator}),yield r.deleteKey(this.address),u(this,D,!0),u(this,m,!1),u(this,I,!0),yield this.assembleRecoverySignerFallback();return}else if(l)a.info("wallet.recover.skipped",{reason:"Device signer already approved",signerLocator:n.locator});else throw o instanceof le||o instanceof Error&&o.name==="AuthRejectedError"?(a.info("wallet.recover.device.authRejected",{signerLocator:n.locator}),o):(a.error("wallet.recover.device.error",{error:o}),yield r.deleteKey(this.address),o)}u(this,S,yield this.assembleFullSigner({type:"device",locator:n.locator,address:this.address},r)),i(this,S).type==="device"&&(i(this,S).status="success"),a.info("wallet.recover.device.success",{signerLocator:n.locator}),e()})}checkAndResumeDeviceSigner(e){return c(this,null,function*(){var t;if(this.isApprovedSignerStatus(e.status))return a.info("wallet.recover.skipped",{reason:"Device signer already approved"}),!0;let r=yield this.getSignerState(e.locator());return e.status=(t=r.signer)==null?void 0:t.status,r.pendingOperation!=null?(yield this.resumePendingDeviceSignerApproval(e,r.pendingOperation),!0):this.isApprovedSignerStatus(e.status)?(a.info("wallet.recover.skipped",{reason:"Device signer already approved"}),!0):!1})}resumePendingDeviceSignerApproval(e,r){return c(this,null,function*(){var s;let t=i(this,S);if($(i(this,f)))throw new Error('Cannot resume pending approval: no secret available. Call wallet.useSigner({ type: "server", secret: ... }) first with the recovery server secret.');if(i(this,f)!=null&&i(this,f).type==="external-wallet"&&!this.isAutoAssemblableSignerConfig(i(this,f)))throw new Error('Cannot resume pending approval: no onSign callback available. Call wallet.useSigner({ type: "external-wallet", address: "0x...", onSign: async (tx) => ... }) first.');let n=this.buildInternalSignerConfig(i(this,f));u(this,S,K(this.chain,n,(s=i(this,b))==null?void 0:s.deviceSignerKeyStorage));try{r.type==="signature"?yield this.approveSignatureAndWait(r.id):yield this.approveTransactionAndWait(r.id)}catch(d){throw u(this,S,e),d}finally{i(this,S)!==e&&u(this,S,t)}e.status="success",a.info("wallet.recover.device.success",{signerLocator:e.locator(),resumed:!0})})}findLocalDeviceSigner(e){return c(this,null,function*(){let t=(yield this.signers()).filter(n=>n.locator.startsWith("device:"));for(let n of t){let s=n.locator.replace("device:","");try{if(yield e.hasKey(s)){let o=K(this.chain,{type:"device",locator:n.locator,address:this.address},e);return a.info("wallet.recover.foundLocalDeviceSigner",{signerLocator:n.locator}),o}}catch(d){a.warn("wallet.recover.findLocalDeviceSigner.keyCheckError",{signerLocator:n.locator,error:d})}}return null})}signers(){return c(this,null,function*(){var s,d;a.info("wallet.signers.start");let e=yield i(this,p).getWallet(this.walletLocator);if("error"in e)throw a.error("wallet.signers.error",{error:e}),new z(JSON.stringify(e));if(e.type!=="smart"||e.chainType!=="evm"&&e.chainType!=="solana"&&e.chainType!=="stellar")throw a.error("wallet.signers.error",{error:`Wallet type ${e.type} not supported`}),new V(`Wallet type ${e.type} not supported`);let r=(d=(s=e==null?void 0:e.config)==null?void 0:s.delegatedSigners)!=null?d:[],n=(yield Promise.all(r.map(o=>c(this,null,function*(){try{return(yield this.getSignerState(o.locator)).signer}catch(l){return null}})))).filter(o=>o!=null);return a.info("wallet.signers.success",{count:n.length}),n})}get walletLocator(){if(i(this,p).isServerSide)return this.address;{let e;switch(this.chain){case"stellar":e="me:stellar:smart";break;case"solana":e="me:solana:smart";break;default:e="me:evm:smart";break}let r=this.alias!=null?`:alias:${this.alias}`:"";return e+r}}requireSigner(){if(i(this,S)==null)throw i(this,k).length>1?new Error("No signer is set. This wallet has multiple signers configured. Call wallet.useSigner() to select which signer to use before signing operations."):i(this,f).type==="server"?new Error(`No signer is set. Server wallets require calling wallet.useSigner() with the server secret before signing operations.
|
|
2
|
-
Example: wallet.useSigner({ type: "server", secret: process.env.YOUR_SERVER_SECRET })`):i(this,f).type==="external-wallet"||!this.isAutoAssemblableSignerConfig(i(this,f))?new Error(`No signer is set. External wallet signers require calling wallet.useSigner() with the onSign callback before signing operations.
|
|
3
|
-
Example: wallet.useSigner({ type: "external-wallet", address: "0x...", onSign: async (tx) => ... })`):new Error("This wallet is read-only because no signer was provided. Operations that require signing (send, approve, addSigner, etc.) are not available.");return i(this,S)}preAuthIfNeeded(){return c(this,null,function*(){yield i(this,O),i(this,L)==null&&u(this,L,this.recover());try{yield i(this,L)}finally{u(this,L,null)}let e=this.requireSigner();e instanceof ce&&(yield e.ensureAuthenticated())})}isRecoverySigner(e){let r=i(this,f);if(r==null||r.type!==e.type||e.type==="device")return!1;if(e.type==="passkey")return!0;if(e.type==="server"&&r.type==="server"){let t=d=>$(d)?d.address:N(d,this.chain,i(this,p).projectId,i(this,p).environment).derivedAddress,n=t(e),s=t(r);if(n!==s)return!1}else if(F(e)!==F(r))return!1;return u(this,f,e),!0}validateSignerInput(e){switch(e.type){case"email":if(!("email"in e)||e.email==null)throw new Error("Email signer requires an email address");break;case"phone":if(!("phone"in e)||e.phone==null)throw new Error("Phone signer requires a phone number");break;case"external-wallet":if(!("address"in e)||e.address==null)throw new Error("External wallet signer requires a wallet address");if(!("onSign"in e)||typeof e.onSign!="function")throw new Error("External wallet signer requires an onSign callback");break;case"passkey":case"device":case"api-key":break;default:break}}resolveDeviceSignerAvailability(e){return c(this,null,function*(){var d;let r=(d=i(this,b))==null?void 0:d.deviceSignerKeyStorage;if(r==null)throw new Error("Device signer key storage is required for device signers");let t=yield r.getKey(this.address);if(t!=null){e.locator=`device:${t}`;return}let s=(yield this.signers()).filter(o=>o.locator.startsWith("device:"));for(let o of s){let l=o.locator.replace("device:","");if(yield r.hasKey(l)){yield r.mapAddressToKey(this.address,l),e.locator=o.locator;return}}u(this,m,!0),u(this,I,!1)})}assembleFullSigner(s){return c(this,arguments,function*(e,r=(n=>(n=i(this,b))==null?void 0:n.deviceSignerKeyStorage)(),t){var o;let d=K(this.chain,e,r);if(t!=null&&t.isAdminSigner)d.status="active";else{let l=yield this.getSignerState(d.locator());d.status=(o=l.signer)==null?void 0:o.status}return d})}getSignerState(e){return c(this,null,function*(){let r=null;try{r=yield i(this,p).getSigner(this.walletLocator,e)}catch(n){return{response:null,signer:null,pendingOperation:null}}if(r==null||typeof r!="object"||"error"in r)return{response:null,signer:null,pendingOperation:null};let t=U(r,this.chain);return{response:r,signer:t,pendingOperation:M(r,this.chain)}})}buildInternalSignerConfig(e){var r,t,n,s,d,o;switch(e.type){case"email":return{type:"email",email:e.email,locator:`email:${e.email}`,address:this.address,crossmint:i(this,p).crossmint,clientTEEConnection:(r=i(this,b))==null?void 0:r.clientTEEConnection,onAuthRequired:(n=(t=i(this,b))==null?void 0:t.callbacks)==null?void 0:n.onAuthRequired};case"phone":return{type:"phone",phone:e.phone,locator:`phone:${e.phone}`,address:this.address,crossmint:i(this,p).crossmint,clientTEEConnection:(s=i(this,b))==null?void 0:s.clientTEEConnection,onAuthRequired:(o=(d=i(this,b))==null?void 0:d.callbacks)==null?void 0:o.onAuthRequired};case"passkey":{let l="id"in e&&e.id?e.id:"";return{type:"passkey",id:l,locator:`passkey:${l}`,name:"name"in e?e.name:void 0,publicKey:"publicKey"in e?e.publicKey:void 0,onCreatePasskey:e.onCreatePasskey,onSignWithPasskey:e.onSignWithPasskey}}case"device":return{type:"device",locator:"locator"in e&&e.locator?e.locator:void 0,address:this.address};case"external-wallet":return W(A({},e),{locator:`external-wallet:${e.address}`});case"api-key":return{type:"api-key",locator:"api-key",address:this.address};case"server":{let{derivedKeyBytes:l,derivedAddress:g}=N(e,this.chain,i(this,p).projectId,i(this,p).environment);return{type:"server",derivedKeyBytes:l,locator:`server:${g}`,address:g}}default:throw new Error(`Unknown signer type: ${e==null?void 0:e.type}`)}}isAutoAssemblableSignerConfig(e){var r;switch(e.type){case"email":case"phone":case"passkey":case"api-key":return!0;case"device":return((r=i(this,b))==null?void 0:r.deviceSignerKeyStorage)!=null;case"server":return!$(e);case"external-wallet":return"onSign"in e&&typeof e.onSign=="function";default:return!1}}get isSolanaWallet(){return this.chain==="solana"}resolveChainForEnvironment(){let e=oe(this.chain,i(this,p).environment);return e!==this.chain&&(this.chain=e),this.chain}approveTransactionAndWait(e,r){return c(this,null,function*(){return yield this.approveTransactionInternal(e,r),yield this.sleep(1e3),yield this.waitForTransaction(e)})}approveSignatureAndWait(e,r){return c(this,null,function*(){let t=yield this.approveSignatureInternal(e,r);return!("error"in t)&&t.status==="success"&&t.outputSignature!=null?{signature:t.outputSignature,signatureId:e}:(yield this.sleep(1e3),yield this.waitForSignature(e))})}approveSignatureInternal(e,r){return c(this,null,function*(){var l,g;if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let t=this.requireSigner(),n=yield i(this,p).getSignature(this.walletLocator,e);if("error"in n)throw new J(JSON.stringify(n));if(t.type==="api-key")return n;if((r==null?void 0:r.approval)!=null){let h=[r.approval];return yield this.executeApproveSignatureWithErrorHandling(e,h)}let s=(l=n.approvals)==null?void 0:l.pending;if(s==null||s.length===0)return n;let d=[...(g=r==null?void 0:r.additionalSigners)!=null?g:[],t],o=yield Promise.all(s.map(h=>c(this,null,function*(){let w=d.find(C=>C.locator()===h.signer.locator);if(w==null)throw new H(`Signer ${h.signer.locator} not found in pending approvals`);let y=yield w.signMessage(h.message);return W(A({},y),{signer:w.locator()})})));return yield this.executeApproveSignatureWithErrorHandling(e,o)})}approveTransactionInternal(e,r){return c(this,null,function*(){var l,g,h,w,y;let t=yield i(this,p).getTransaction(this.walletLocator,e);if("error"in t)throw new j(JSON.stringify(t));yield(h=(g=(l=i(this,b))==null?void 0:l.callbacks)==null?void 0:g.onTransactionStart)==null?void 0:h.call(g);let n=this.requireSigner();if(n.type==="api-key")return t;if((r==null?void 0:r.approval)!=null){let C=[r.approval];return yield this.executeApproveTransactionWithErrorHandling(e,C)}let s=(w=t.approvals)==null?void 0:w.pending;if(s==null||s.length===0)return t;let d=[...(y=r==null?void 0:r.additionalSigners)!=null?y:[],n],o=yield Promise.all(s.map(C=>c(this,null,function*(){let P=d.find(he=>he.locator()===C.signer.locator);if(P==null)throw new H(`Signer ${C.signer.locator} not found in pending approvals`);let B=P.type==="device",q=t.chainType==="solana"&&"transaction"in t.onChain&&!B?t.onChain.transaction:C.message,ue=yield P.signTransaction(q);return W(A({},ue),{signer:P.locator()})})));return yield this.executeApproveTransactionWithErrorHandling(e,o)})}executeApproveTransactionWithErrorHandling(e,r){return c(this,null,function*(){a.info("wallet.approve: submitting approval to API",{transactionId:e});let t=yield i(this,p).approveTransaction(this.walletLocator,e,{approvals:r});if(t.error)throw new ae(JSON.stringify(t));return t})}executeApproveSignatureWithErrorHandling(e,r){return c(this,null,function*(){let t=yield i(this,p).approveSignature(this.walletLocator,e,{approvals:r});if(t.error)throw new X(JSON.stringify(t));return t})}waitForSignature(e){return c(this,null,function*(){let r=null;do if(yield new Promise(t=>setTimeout(t,_)),r=yield i(this,p).getSignature(this.walletLocator,e),"error"in r)throw new J(JSON.stringify(r));while(r===null||r.status==="pending");if(r.status==="failed")throw new Q("Signature signing failed");if(!r.outputSignature)throw new J("Signature not available");return{signature:r.outputSignature,signatureId:e}})}waitForTransaction(d){return c(this,arguments,function*(e,r=6e4,{backoffMultiplier:t=1.1,maxBackoffMs:n=2e3,initialBackoffMs:s=_}={}){var w,y;a.info("wallet.approve: waiting for transaction confirmation",{transactionId:e,timeoutMs:r});let o=Date.now(),l;do{if(Date.now()-o>r)throw new re("Transaction confirmation timeout");if(l=yield i(this,p).getTransaction(this.walletLocator,e),l.error)throw new j(JSON.stringify(l));yield this.sleep(s),s=Math.min(s*t,n)}while(l.status==="pending");if(l.status==="failed")throw new te(`Transaction sending failed: ${JSON.stringify(l.error)}`);if(l.status==="awaiting-approval")throw new ie("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let g="txHash"in l.onChain&&typeof l.onChain.txHash=="string"?l.onChain.txHash:void 0,h=(w=l.onChain.txId)!=null?w:g;if(h==null)throw new ne("Transaction hash not found on transaction response");return{hash:h,explorerLink:(y=l.onChain.explorerLink)!=null?y:"",transactionId:l.id}})}sleep(e){return c(this,null,function*(){return new Promise(r=>setTimeout(r,e))})}};S=new WeakMap,b=new WeakMap,p=new WeakMap,f=new WeakMap,k=new WeakMap,m=new WeakMap,I=new WeakMap,O=new WeakMap,L=new WeakMap,D=new WeakMap,R([x({logger:a,methodName:"wallet.balances",buildContext(e){return{chain:e.chain,address:e.address}}})],E.prototype,"balances",1),R([x({logger:a,methodName:"wallet.stagingFund",buildContext(e){return{chain:e.chain,address:e.address}}})],E.prototype,"stagingFund",1),R([x({logger:a,methodName:"wallet.send",buildContext(e){return{chain:e.chain,address:e.address}}})],E.prototype,"send",1),R([x({logger:a,methodName:"wallet.approve",buildContext(e){return{chain:e.chain,address:e.address}}})],E.prototype,"approve",1),R([x({logger:a,methodName:"wallet.addSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],E.prototype,"addSigner",1),R([x({logger:a,methodName:"wallet.removeSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],E.prototype,"removeSigner",1),R([x({logger:a,methodName:"wallet.useSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],E.prototype,"useSigner",1),R([x({logger:a,methodName:"wallet.recover",buildContext(e){return{chain:e.chain,address:e.address}}})],E.prototype,"recover",1),R([x({logger:a,methodName:"wallet.signers",buildContext(e){return{chain:e.chain,address:e.address}}})],E.prototype,"signers",1);function pe(v){if(typeof v=="string"){if(!de(v))throw new se(`Invalid recipient address: "${v}". Expected a valid EVM (0x...), Solana (base58), or Stellar (G.../C...) address.`);return v}if("email"in v)return`email:${v.email}`;if("x"in v)return`x:${v.x}`;if("twitter"in v)return`twitter:${v.twitter}`;if("phone"in v)return`phoneNumber:${v.phone}`;if("userId"in v)return`userId:${v.userId}`;throw new Error("Invalid recipient locator")}function Se(v,e){return de(v)?`${e}:${v}`:`${e}:${v.toLowerCase()}`}export{E as a};
|
package/dist/chunk-LPL33F57.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-KB32HFUC.js";import{b}from"./chunk-RBSMBO4T.js";import{a as W}from"./chunk-MILCZTHF.js";import{n as l,r as h,v as w}from"./chunk-5OYPWGMX.js";import{a as r}from"./chunk-C73NTGFV.js";import{c as g,g as u}from"./chunk-J3R36SGJ.js";import{createPublicClient as x,encodeFunctionData as E,http as N}from"viem";import{isValidEvmAddress as P,WithLoggerContext as f}from"@crossmint/common-sdk-base";var c=class c extends d{constructor(e){super({chain:e.chain,address:e.address,owner:e.owner,options:d.getOptions(e),alias:e.alias,recovery:d.getRecovery(e),signer:e.signer,signers:d.getInitialSigners(e)},d.getApiClient(e))}static from(e){if(!P(e.address))throw new Error("Wallet is not an EVM wallet");return new c(e)}sendTransaction(e){return u(this,null,function*(){var i;r.info("evmWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let n=this.buildTransaction(e),t=yield this.createTransaction(n,e.options);if((i=e.options)!=null&&i.prepareOnly)return r.info("evmWallet.sendTransaction.prepared",{transactionId:t.id}),{hash:void 0,explorerLink:void 0,transactionId:t.id};let a=yield this.approveTransactionAndWait(t.id);return r.info("evmWallet.sendTransaction.success",{transactionId:t.id,hash:a.hash}),a})}signMessage(e){return u(this,null,function*(){var i;r.info("evmWallet.signMessage.start"),yield this.preAuthIfNeeded();let n=this.requireSigner(),t=yield this.apiClient.createSignature(this.walletLocator,{type:"message",params:{message:e.message,signer:n.locator(),chain:this.chain}});if("error"in t)throw r.error("evmWallet.signMessage.error",{error:t}),new h(JSON.stringify(t));if((i=e.options)!=null&&i.prepareOnly)return r.info("evmWallet.signMessage.prepared",{signatureId:t.id}),{signature:void 0,signatureId:t.id};let a=yield this.approveSignatureAndWait(t.id);return r.info("evmWallet.signMessage.success",{signatureId:t.id}),a})}signTypedData(e){return u(this,null,function*(){var S;r.info("evmWallet.signTypedData.start"),yield this.preAuthIfNeeded();let n=this.requireSigner(),{domain:t,message:a,primaryType:i,types:p,chain:m}=e;if(!t||!a||!p||!m)throw r.error("evmWallet.signTypedData.error",{error:"Invalid typed data"}),new l("Invalid typed data");let{name:y,version:v,chainId:I,verifyingContract:C,salt:M}=t;if(!y||!v||!I||!C)throw r.error("evmWallet.signTypedData.error",{error:"Invalid typed data domain"}),new l("Invalid typed data domain");let o=yield this.apiClient.createSignature(this.walletLocator,{type:"typed-data",params:{typedData:{domain:{name:y,version:v,chainId:Number(I),verifyingContract:C,salt:M},message:T(a),primaryType:i,types:p},signer:n.locator(),chain:m}});if("error"in o)throw r.error("evmWallet.signTypedData.error",{error:o}),new h(JSON.stringify(o));if((S=e.options)!=null&&S.prepareOnly)return r.info("evmWallet.signTypedData.prepared",{signatureId:o.id}),{signature:void 0,signatureId:o.id};let O=yield this.approveSignatureAndWait(o.id);return r.info("evmWallet.signTypedData.success",{signatureId:o.id}),O})}getViemClient(e){var n;return x({transport:(n=e==null?void 0:e.transport)!=null?n:N(),chain:W(this.chain)})}createTransaction(e,n){return u(this,null,function*(){let t;(n==null?void 0:n.signer)==null?t=this.requireSigner().locator():typeof n.signer=="string"?t=n.signer:t=`server:${b(n.signer,this.chain,this.apiClient.projectId,this.apiClient.environment).derivedAddress}`;let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:t,chain:this.chain,calls:[e]}});if("error"in a)throw new w(JSON.stringify(a));return a})}buildTransaction(e){var n,t,a,i,p;if("transaction"in e)return{transaction:e.transaction};if(e.abi==null)return{to:e.to,value:(t=(n=e.value)==null?void 0:n.toString())!=null?t:"0",data:(a=e.data)!=null?a:"0x"};if(!e.functionName)throw new Error("Function name is required");return{to:e.to,value:(p=(i=e.value)==null?void 0:i.toString())!=null?p:"0",data:E({abi:e.abi,functionName:e.functionName,args:e.args})}}};g([f({logger:r,methodName:"evmWallet.sendTransaction",buildContext(e){return{chain:e.chain,address:e.address}}})],c.prototype,"sendTransaction",1),g([f({logger:r,methodName:"evmWallet.signMessage",buildContext(e){return{chain:e.chain,address:e.address}}})],c.prototype,"signMessage",1),g([f({logger:r,methodName:"evmWallet.signTypedData",buildContext(e){return{chain:e.chain,address:e.address}}})],c.prototype,"signTypedData",1);var D=c;function T(s){return typeof s=="bigint"?s.toString():Array.isArray(s)?s.map(T):s!==null&&typeof s=="object"?Object.fromEntries(Object.entries(s).map(([e,n])=>[e,T(n)])):s}export{D as a};
|
package/dist/chunk-NFCZBR6G.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./chunk-KB32HFUC.js";import{b as h}from"./chunk-RBSMBO4T.js";import{v as u}from"./chunk-5OYPWGMX.js";import{a as t}from"./chunk-C73NTGFV.js";import{a as g,c,g as i}from"./chunk-J3R36SGJ.js";import{isValidStellarAddress as m,WithLoggerContext as f}from"@crossmint/common-sdk-base";var y=409,l=class l extends s{constructor(e){super({chain:e.chain,address:e.address,owner:e.owner,options:s.getOptions(e),alias:e.alias,recovery:s.getRecovery(e),signer:e.signer,signers:s.getInitialSigners(e)},s.getApiClient(e))}static from(e){if(!m(e.address))throw new Error("Wallet is not a Stellar wallet");return new l(e)}sendTransaction(e){return i(this,null,function*(){var d;t.info("stellarWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let a=yield this.createTransaction(e);if((d=e.options)!=null&&d.prepareOnly)return t.info("stellarWallet.sendTransaction.prepared",{transactionId:a.id}),{hash:void 0,explorerLink:void 0,transactionId:a.id};let r={},n=yield this.approveTransactionAndWait(a.id,r);return t.info("stellarWallet.sendTransaction.success",{transactionId:a.id,hash:n.hash}),n})}upgrade(e){return i(this,null,function*(){t.info("stellarWallet.upgrade.start"),yield this.preAuthIfNeeded();let a=yield this.createWalletLifecycleTransaction("upgrade-wallet",e);if(a!=null){if(e!=null&&e.prepareOnly)return t.info("stellarWallet.upgrade.prepared",{transactionId:a}),{hash:void 0,explorerLink:void 0,transactionId:a};yield this.approveTransactionAndWait(a),t.info("stellarWallet.upgrade.phase1.success",{transactionId:a})}else t.info("stellarWallet.upgrade.phase1.skipped",{reason:"wallet already locked from a prior upgrade"});let r=yield this.migrateInternal({signer:e==null?void 0:e.signer,prepareOnly:e==null?void 0:e.prepareOnly});return t.info("stellarWallet.upgrade.success",{transactionId:r.transactionId,hash:r.hash}),r})}migrate(e){return i(this,null,function*(){return yield this.preAuthIfNeeded(),yield this.migrateInternal(e)})}migrateInternal(e){return i(this,null,function*(){t.info("stellarWallet.migrate.start");let a=yield this.createWalletLifecycleTransaction("migrate-wallet",e);if(a==null)throw new u("Failed to create migrate-wallet transaction");if(e!=null&&e.prepareOnly)return t.info("stellarWallet.migrate.prepared",{transactionId:a}),{hash:void 0,explorerLink:void 0,transactionId:a};let r=yield this.approveTransactionAndWait(a);return t.info("stellarWallet.migrate.success",{transactionId:a,hash:r.hash}),r})}createTransaction(e){return i(this,null,function*(){let{contractId:a,options:r}=e,n=this.resolveStellarSigner(r==null?void 0:r.signer),d="transaction"in e?{type:"serialized-transaction",serializedTransaction:e.transaction,contractId:a}:{type:"contract-call",contractId:a,method:e.method,memo:e.memo!=null?{type:"text",value:e.memo}:void 0,args:e.args},p=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:d,signer:n}});if("error"in p)throw new u(JSON.stringify(p));return p})}createWalletLifecycleTransaction(e,a){return i(this,null,function*(){let r=(a==null?void 0:a.signer)!=null?this.resolveStellarSigner(a.signer):void 0,n=yield this.apiClient.createTransaction(this.walletLocator,{params:g({transaction:{type:e}},r!=null?{signer:r}:{})});if("error"in n){if(e==="upgrade-wallet"&&S(n))return null;throw new u(JSON.stringify(n))}return n.id})}resolveStellarSigner(e){return e==null?this.requireSigner().locator():typeof e=="string"?e:`server:${h(e,this.chain,this.apiClient.projectId,this.apiClient.environment).derivedAddress}`}};c([f({logger:t,methodName:"stellarWallet.sendTransaction",buildContext(e){return{chain:e.chain,address:e.address}}})],l.prototype,"sendTransaction",1),c([f({logger:t,methodName:"stellarWallet.upgrade",buildContext(e){return{chain:e.chain,address:e.address}}})],l.prototype,"upgrade",1),c([f({logger:t,methodName:"stellarWallet.migrate",buildContext(e){return{chain:e.chain,address:e.address}}})],l.prototype,"migrate",1);var T=l;function S(o){return typeof o=="object"&&o!==null&&"statusCode"in o&&o.statusCode===y}export{T as a};
|
package/dist/chunk-PMM7CHUU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as S,b as v}from"./chunk-JGWGYONV.js";import{a as x}from"./chunk-KB32HFUC.js";import{a as R}from"./chunk-N4IWDL6M.js";import{a as m}from"./chunk-GOXB2RBF.js";import{b as y}from"./chunk-RBSMBO4T.js";import{f as u}from"./chunk-MILCZTHF.js";import{e as b,g as l}from"./chunk-5OYPWGMX.js";import{a as g}from"./chunk-C73NTGFV.js";import{a as d,b as C,c as f,g as p}from"./chunk-J3R36SGJ.js";import{WithLoggerContext as E}from"@crossmint/common-sdk-base";import{WebAuthnP256 as I}from"ox";var D="When 'signers' is provided to a method that may fetch an existing wallet, each specified signer must exist in that wallet's configuration.",h=class{constructor(t){this.apiClient=t}getWallet(t,e){return p(this,null,function*(){let i,a;if(typeof t=="string"){if(!this.apiClient.isServerSide)throw new l("getWallet with walletLocator is only available on the server side. Use getWallet(args) instead.");if(e==null)throw new l("Wallet configuration is required when using walletLocator: https://docs.crossmint.com/sdk-reference/wallets/type-aliases/WalletArgsFor");i=t,a=e}else{if(this.apiClient.isServerSide)throw new l("getWallet on server side requires a walletLocator parameter. Use getWallet(walletLocator, args) instead.");a=t,i=this.getWalletLocator(a)}let n=C(d({},a),{chain:u(a.chain,this.apiClient.environment)});g.info("walletFactory.getWallet.start");let r=yield this.apiClient.getWallet(i);if("error"in r)throw g.warn("walletFactory.getWallet.notFound",{error:r.error}),new b(JSON.stringify(r));return g.info("walletFactory.getWallet.success",{address:r.address}),yield this.createWalletInstance(r,n)})}createWallet(t){return p(this,null,function*(){var o,c,w,W,A,k,F,P;let e=C(d({},t),{chain:u(t.chain,this.apiClient.environment)});if(yield(w=(c=(o=e.options)==null?void 0:o.callbacks)==null?void 0:c.onWalletCreationStart)==null?void 0:w.call(c),g.info("walletFactory.createWallet.start"),!this.apiClient.isServerSide&&e.owner!=null)throw g.error("walletFactory.createWallet.error",{error:"Owner field cannot be specified in client-side createWallet calls"}),new l("Owner field cannot be specified in client-side createWallet calls. Owner is determined from JWT authentication.");let a=((W=e.options)==null?void 0:W.deviceSignerKeyStorage)!=null&&e.chain!=="solana"?this.ensureDeviceSignerInSigners(e):(A=e.signers)!=null?A:[],n=yield this.registerSigners(a,e.chain,(k=e.options)==null?void 0:k.deviceSignerKeyStorage),r;if(e.recovery.type==="passkey"&&e.recovery.id==null)r=yield this.createPasskeySigner(e.recovery);else if(e.recovery.type==="server"){let{derivedAddress:$}=y(e.recovery,e.chain,this.apiClient.projectId,this.apiClient.environment);r={type:"server",address:$}}else r=e.recovery;let s=yield this.apiClient.createWallet({type:"smart",chainType:this.getChainType(e.chain),config:d(d({adminSigner:r},e.plugins?{plugins:e.plugins}:{}),n!=null?{delegatedSigners:n}:{}),owner:(F=e.owner)!=null?F:void 0,alias:(P=e.alias)!=null?P:void 0});if("error"in s)throw g.error("walletFactory.createWallet.error",{error:s.error}),new l(JSON.stringify(s));return g.info("walletFactory.createWallet.success",{address:s.address}),yield this.createWalletInstance(s,e)})}createWalletInstance(t,e){return p(this,null,function*(){var o,c;this.validateExistingWalletConfig(t,e);let i=e,a=t.config.adminSigner,n=((o=i.recovery)==null?void 0:o.type)==="server"||((c=i.recovery)==null?void 0:c.type)==="external-wallet"?i.recovery:a,r=t.config.delegatedSigners;r!=null&&r.length===1&&(r[0].type==="server"||r[0].type==="external-wallet")&&(r=i.signers);let s=new x({chain:e.chain,address:t.address,owner:t.owner,options:e.options,alias:e.alias,recovery:n,signers:r!=null?r:[]},this.apiClient);return yield s.waitForInit(),s})}getWalletLocator(t){return`me:${this.getChainType(t.chain)}:smart`+(t.alias!=null?`:alias:${t.alias}`:"")}createPasskeySigner(t){return p(this,null,function*(){var a;if(t.type!=="passkey")throw new Error("Signer is not a passkey");let e=(a=t.name)!=null?a:`Crossmint Wallet ${Date.now()}`,i=t.onCreatePasskey?yield t.onCreatePasskey(e):yield I.createCredential({name:e});return{type:"passkey",id:i.id,name:e,publicKey:{x:i.publicKey.x.toString(),y:i.publicKey.y.toString()}}})}ensureDeviceSignerInSigners(t){var a;let e=(a=t.signers)!=null?a:[];return e.some(n=>n.type==="device")?e:[...e,{type:"device"}]}validateExistingWalletConfig(t,e){if(e.owner!=null&&t.owner!=null&&S(e.owner)!==S(t.owner))throw new l("Wallet owner does not match existing wallet's linked user");if(e.chain==="solana"&&t.chainType!=="solana"||e.chain!=="solana"&&t.chainType==="solana"||e.chain==="stellar"&&t.chainType!=="stellar"||e.chain!=="stellar"&&t.chainType==="stellar")throw new l(`Wallet chain does not match existing wallet's chain. You must use chain: ${t.chainType}.`);if(t.type!=="smart")return;let i=e;if(i.recovery!=null||i.signers!=null){let a=t.config,n=a==null?void 0:a.adminSigner;if(i.recovery!=null&&n!=null){if(i.recovery.type!==n.type)throw new l("The wallet recovery signer type does not match the existing wallet's recovery signer type");v(i.recovery,n)}let r=i.signers;r!=null&&this.validateSigners(t,r,e.chain)}}validateSigners(t,e,i){let a=t.config,n=a==null?void 0:a.delegatedSigners;if(e.length!==0){if(n==null||n.length===0)throw new l(`${e.length} signer(s) specified, but wallet "${t.address}" has no signers. ${D}`);for(let r of e){let s=n.find(o=>{if(this.isMatchingPasskeySigner(r,o,a)||o.type==="device"&&r.type==="device")return!0;if(r.type==="server"){let{derivedAddress:c}=y(r,i,this.apiClient.projectId,this.apiClient.environment);return o.locator===`server:${c}`}return o.locator===m(r)});if(s==null){let o=n.map(c=>c.locator).join(", ");throw new l(`Signer '${r.type}' does not exist in wallet "${t.address}". Available signers: ${o}. ${D}`)}v(r,s)}}}isMatchingPasskeySigner(t,e,i){var n,r;let a=((r=(n=i.delegatedSigners)==null?void 0:n.filter(s=>s.type==="passkey").length)!=null?r:0)+(i.adminSigner.type==="passkey"?1:0);if(t.type==="passkey"){if(t.id==null&&a===1)return e.type==="passkey";if(t.id==null&&a>1)throw new l("When creating a wallet with multiple passkeys, you must provide the passkey ID for each passkey.")}return!1}registerSigners(t,e,i){return p(this,null,function*(){var a;return yield Promise.all((a=t==null?void 0:t.map(n=>p(this,null,function*(){if(n.type==="passkey")return n.id==null?{signer:yield this.createPasskeySigner(n)}:{signer:n};if(n.type==="device"){if(n.publicKey!=null)return{signer:{type:"device",publicKey:n.publicKey,name:n.name}};if(n.locator!=null)return{signer:n.locator};if(i==null)throw new l("Device signer key storage is required for device signers");let r=yield R(i);return{signer:{type:"device",publicKey:r.publicKey,name:r.name}}}if(n.type==="server"&&e!=null){let{derivedAddress:r}=y(n,e,this.apiClient.projectId,this.apiClient.environment);return{signer:`server:${r}`}}return{signer:m(n)}})))!=null?a:[])})}getChainType(t){return t==="solana"?"solana":t==="stellar"?"stellar":"evm"}};f([E({logger:g,methodName:"walletFactory.getWallet",buildContext(t,e){if(typeof e[0]=="string"){let a=e[1];return{walletLocator:e[0],chain:a==null?void 0:a.chain}}let i=e[0];return{chain:i==null?void 0:i.chain}}})],h.prototype,"getWallet",1),f([E({logger:g,methodName:"walletFactory.createWallet",buildContext(t,e){return{chain:e[0].chain}}})],h.prototype,"createWallet",1);export{h as a};
|
package/dist/chunk-RBSMBO4T.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-OQZTL6ZG.js";import{a as o,b as s}from"./chunk-EM3D5Q3A.js";import{a as n}from"./chunk-XNZLCUTY.js";import{privateKeyToAccount as y}from"viem/accounts";import{bytesToHex as m}from"@noble/hashes/utils";import{Keypair as f}from"@solana/web3.js";function v(r,e){switch(d(e)){case"evm":return y(`0x${m(r)}`).address;case"solana":return f.fromSeed(r).publicKey.toBase58();case"stellar":return o(s(r).publicKey)}}function b(r,e,i,a){if(typeof window!="undefined")throw new Error("Server signers can only be used from server-side code.");let p=typeof e=="string"?e:String(e),t=n(r.secret,i,a,p),c=v(t,e);return{derivedKeyBytes:t,derivedAddress:c}}export{v as a,b};
|
package/dist/chunk-TM5CSXH4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as i}from"./chunk-KB32HFUC.js";import{b as T}from"./chunk-RBSMBO4T.js";import{a as f}from"./chunk-2O6HQK34.js";import{v as g}from"./chunk-5OYPWGMX.js";import{a as r}from"./chunk-C73NTGFV.js";import{c as u,g as l}from"./chunk-J3R36SGJ.js";import m from"bs58";import{isValidSolanaAddress as y,WithLoggerContext as C}from"@crossmint/common-sdk-base";var o=class o extends i{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,options:i.getOptions(n),alias:n.alias,recovery:i.getRecovery(n),signer:n.signer,signers:i.getInitialSigners(n)},i.getApiClient(n))}static from(n){if(!y(n.address))throw new Error("Wallet is not a Solana wallet");return new o(n)}sendTransaction(n){return l(this,null,function*(){var d,p;r.info("solanaWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let e=yield this.createTransaction(n);if((d=n.options)!=null&&d.prepareOnly)return r.info("solanaWallet.sendTransaction.prepared",{transactionId:e.id}),{hash:void 0,explorerLink:void 0,transactionId:e.id};let t={additionalSigners:(p=n.additionalSigners)==null?void 0:p.map(c=>new f({type:"external-wallet",address:c.publicKey.toString(),locator:`external-wallet:${c.publicKey.toString()}`,onSign:h=>(h.sign([c]),Promise.resolve(h))}))},a=yield this.approveTransactionAndWait(e.id,t);return r.info("solanaWallet.sendTransaction.success",{transactionId:e.id,hash:a.hash}),a})}createTransaction(n){return l(this,null,function*(){var a;let e;((a=n.options)==null?void 0:a.signer)==null?e=this.requireSigner().locator():typeof n.options.signer=="string"?e=n.options.signer:e=`server:${T(n.options.signer,this.chain,this.apiClient.projectId,this.apiClient.environment).derivedAddress}`;let s;"serializedTransaction"in n?s=n.serializedTransaction:s=m.encode(n.transaction.serialize());let t=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:s,signer:e}});if("error"in t)throw new g(JSON.stringify(t));return t})}};u([C({logger:r,methodName:"solanaWallet.sendTransaction",buildContext(n){return{chain:n.chain,address:n.address}}})],o.prototype,"sendTransaction",1);var S=o;export{S as a};
|
package/dist/chunk-VADIEIDS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r,b as a}from"./chunk-J3R36SGJ.js";function o(t){switch(t.type){case"passkey":return{type:"passkey",id:t.id,name:t.name,publicKey:t.publicKey,validatorContractVersion:t.validatorContractVersion,locator:t.locator};case"api-key":return{type:"api-key",address:t.address,locator:t.locator};case"external-wallet":return{type:"external-wallet",address:t.address,locator:t.locator};case"email":return{type:"email",email:t.email,address:t.address,locator:t.locator};case"phone":return{type:"phone",phone:t.phone,address:t.address,locator:t.locator};case"device":return{type:"device",publicKey:t.publicKey,locator:t.locator};case"server":return{type:"server",address:t.address,locator:t.locator};default:throw new Error(`Unknown signer type: ${t.type}`)}}function u(t,s){let e=o(t);if(s==="solana"||s==="stellar"){let n="success";return"transaction"in t&&t.transaction!=null&&(n=t.transaction.status),a(r({},e),{status:n})}if("chains"in t&&t.chains!=null&&Object.keys(t.chains).length>0){let n=t.chains[s];return n==null?null:a(r({},e),{status:n.status})}return a(r({},e),{status:"success"})}function i(t,s){if(s==="solana"||s==="stellar")return"transaction"in t&&t.transaction!=null&&(t.transaction.status==="pending"||t.transaction.status==="awaiting-approval")?{type:"transaction",id:t.transaction.id}:null;if("chains"in t&&t.chains!=null){let e=t.chains[s];if(e!=null&&(e.status==="pending"||e.status==="awaiting-approval"))return{type:"signature",id:e.id}}return null}function d(t,s){let e=a(r({},t),{status:s});return t.locator.indexOf(":")===-1&&(t.type==="api-key"?e.locator=t.locator:(e.locator=`external-wallet:${t.locator}`,e.type="external-wallet")),e}export{o as a,u as b,i as c,d};
|