@crossmint/wallets-sdk 0.20.2 → 0.21.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__/test-utils.cjs +8 -8
- package/dist/api/__tests__/test-utils.d.cts +3 -3
- package/dist/api/__tests__/test-utils.d.ts +3 -3
- package/dist/api/__tests__/test-utils.js +6 -6
- package/dist/api/client.cjs +4 -4
- package/dist/api/client.d.cts +1 -0
- package/dist/api/client.d.ts +1 -0
- package/dist/api/client.js +3 -3
- package/dist/api/gen/index.cjs +3 -103
- package/dist/api/gen/index.d.cts +2 -2
- package/dist/api/gen/index.d.ts +2 -2
- package/dist/api/gen/index.js +6 -106
- package/dist/api/gen/sdk.gen.cjs +2 -102
- package/dist/api/gen/sdk.gen.d.cts +22 -370
- package/dist/api/gen/sdk.gen.d.ts +22 -370
- package/dist/api/gen/sdk.gen.js +5 -105
- package/dist/api/gen/types.gen.d.cts +2558 -5712
- package/dist/api/gen/types.gen.d.ts +2558 -5712
- package/dist/api/index.cjs +4 -4
- package/dist/api/index.js +3 -3
- package/dist/api/types.d.cts +12 -12
- package/dist/api/types.d.ts +12 -12
- package/dist/chains/chains.cjs +5 -5
- package/dist/chains/chains.js +4 -4
- package/dist/{chunk-JREZWZ2S.cjs → chunk-2M32LBCA.cjs} +3 -3
- package/dist/{chunk-KQH5ZXJ4.js → chunk-2PSAUSOG.js} +61 -18
- package/dist/chunk-2RG6642I.js +39 -0
- package/dist/{chunk-R4AW5ADG.cjs → chunk-3WZUNLYI.cjs} +1 -1
- package/dist/{chunk-6UMJYMAY.js → chunk-4Z3YDHHG.js} +2 -2
- package/dist/{chunk-POG76HDD.cjs → chunk-4ZWUI6LE.cjs} +64 -48
- package/dist/chunk-5IC7UWND.cjs +1 -0
- package/dist/{chunk-HXJ3YPAN.js → chunk-65KPNJ77.js} +13 -4
- package/dist/{chunk-IDKGJO2G.cjs → chunk-7EZDSDKA.cjs} +21 -11
- package/dist/{chunk-PM7BGATN.cjs → chunk-7SUWMK4J.cjs} +34 -25
- package/dist/{chunk-47R3UV3J.cjs → chunk-7W4HGN3H.cjs} +11 -6
- package/dist/chunk-BR4UVMIC.js +332 -0
- package/dist/chunk-BUBSPQ7U.cjs +332 -0
- package/dist/{chunk-MRZXYVQO.cjs → chunk-CPZQ7BK5.cjs} +6 -6
- package/dist/chunk-CTOLL4BK.js +29 -0
- package/dist/chunk-DDNG224J.cjs +45 -0
- package/dist/{chunk-T2XUADHW.js → chunk-EVR4CD53.js} +8 -3
- package/dist/{chunk-U3NV7UY7.js → chunk-FZQG6OX2.js} +1 -1
- package/dist/chunk-GJT2JD3E.js +45 -0
- package/dist/{chunk-TYQ4YIP7.js → chunk-GLUD6EBN.js} +1 -1
- package/dist/chunk-H6WV5NRT.js +10 -0
- package/dist/{chunk-FICVKSXZ.js → chunk-HFEF2URB.js} +2 -2
- package/dist/chunk-HWTWDQYT.cjs +42 -0
- package/dist/{chunk-CMBFV325.js → chunk-HYA3ESUA.js} +3 -3
- package/dist/chunk-IGRPHTXZ.cjs +1 -0
- package/dist/chunk-K6LSGLG6.js +42 -0
- package/dist/chunk-KHY5FXO4.cjs +37 -0
- package/dist/chunk-L52GDMSH.js +0 -0
- package/dist/{chunk-A6E67ZZP.js → chunk-M47ZHA7Q.js} +14 -5
- package/dist/{chunk-6FG5QXII.cjs → chunk-M4HCASMG.cjs} +20 -11
- package/dist/chunk-M6IPPGXQ.cjs +29 -0
- package/dist/{chunk-R6DH4V7S.cjs → chunk-M7OPRXZH.cjs} +7 -7
- package/dist/{chunk-WDZY4PP4.cjs → chunk-MIKWTXUA.cjs} +6 -6
- package/dist/chunk-MNHK6EQK.cjs +57 -0
- package/dist/{chunk-66UY53KP.cjs → chunk-NO2KMGS2.cjs} +80 -37
- package/dist/chunk-OPKFMXPI.cjs +39 -0
- package/dist/{chunk-WWW6IGZ7.js → chunk-OXB6RTW7.js} +14 -4
- package/dist/{chunk-RYQI3RXL.cjs → chunk-P4XJHOLW.cjs} +18 -12
- package/dist/chunk-Q52MMQSC.js +57 -0
- package/dist/chunk-QM3BB4E2.js +0 -0
- package/dist/{chunk-ZAX22GSI.cjs → chunk-QQNDLR6E.cjs} +18 -18
- package/dist/chunk-RUQYXEEG.cjs +10 -0
- package/dist/chunk-S2L5Z2ZT.js +37 -0
- package/dist/{chunk-PUO4QNXH.js → chunk-T5NKL6F4.js} +2 -2
- package/dist/{chunk-WHTECI7J.cjs → chunk-U56Z2EOR.cjs} +6 -6
- package/dist/{chunk-W7K5E64Q.js → chunk-VLZ5ZS5U.js} +8 -2
- package/dist/{chunk-7TT3VUDF.cjs → chunk-VTF3WCXG.cjs} +6 -6
- package/dist/{chunk-FHMKNG62.js → chunk-VVPGO564.js} +24 -8
- package/dist/{chunk-2WBSPOWU.js → chunk-X4SPF4KJ.js} +4 -4
- package/dist/{chunk-ABMZ3ZVN.js → chunk-XEPUH4XH.js} +1 -1
- package/dist/index.cjs +26 -17
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -16
- package/dist/logger/index.cjs +3 -3
- package/dist/logger/index.js +2 -2
- package/dist/logger/init.cjs +3 -3
- package/dist/logger/init.js +2 -2
- package/dist/sdk.cjs +23 -14
- package/dist/sdk.js +22 -13
- package/dist/signers/index.cjs +17 -8
- package/dist/signers/index.js +16 -7
- package/dist/signers/non-custodial/index.cjs +7 -7
- package/dist/signers/non-custodial/index.js +6 -6
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +5 -5
- package/dist/signers/non-custodial/ncs-evm-signer.js +4 -4
- package/dist/signers/non-custodial/ncs-signer.cjs +4 -4
- package/dist/signers/non-custodial/ncs-signer.js +3 -3
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +5 -5
- package/dist/signers/non-custodial/ncs-solana-signer.js +4 -4
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +5 -5
- package/dist/signers/non-custodial/ncs-stellar-signer.js +4 -4
- package/dist/signers/server/assemble-server-signer.cjs +14 -0
- package/dist/signers/server/assemble-server-signer.d.cts +11 -0
- package/dist/signers/server/assemble-server-signer.d.ts +11 -0
- package/dist/signers/server/assemble-server-signer.js +14 -0
- package/dist/signers/server/evm-server-signer.cjs +7 -0
- package/dist/signers/server/evm-server-signer.d.cts +25 -0
- package/dist/signers/server/evm-server-signer.d.ts +25 -0
- package/dist/signers/server/evm-server-signer.js +7 -0
- package/dist/signers/server/helpers/derive-server-signer.cjs +11 -0
- package/dist/signers/server/helpers/derive-server-signer.d.cts +15 -0
- package/dist/signers/server/helpers/derive-server-signer.d.ts +15 -0
- package/dist/signers/server/helpers/derive-server-signer.js +11 -0
- package/dist/signers/server/helpers/get-chain-type.cjs +7 -0
- package/dist/signers/server/helpers/get-chain-type.d.cts +7 -0
- package/dist/signers/server/helpers/get-chain-type.d.ts +7 -0
- package/dist/signers/server/helpers/get-chain-type.js +7 -0
- package/dist/signers/server/helpers/index.cjs +15 -0
- package/dist/signers/server/helpers/index.d.cts +9 -0
- package/dist/signers/server/helpers/index.d.ts +9 -0
- package/dist/signers/server/helpers/index.js +15 -0
- package/dist/signers/server/index.cjs +29 -0
- package/dist/signers/server/index.d.cts +12 -0
- package/dist/signers/server/index.d.ts +12 -0
- package/dist/signers/server/index.js +29 -0
- package/dist/signers/server/solana-server-signer.cjs +7 -0
- package/dist/signers/server/solana-server-signer.d.cts +25 -0
- package/dist/signers/server/solana-server-signer.d.ts +25 -0
- package/dist/signers/server/solana-server-signer.js +7 -0
- package/dist/signers/server/stellar-server-signer.cjs +7 -0
- package/dist/signers/server/stellar-server-signer.d.cts +25 -0
- package/dist/signers/server/stellar-server-signer.d.ts +25 -0
- package/dist/signers/server/stellar-server-signer.js +7 -0
- package/dist/signers/types.d.cts +15 -3
- package/dist/signers/types.d.ts +15 -3
- package/dist/utils/constants.cjs +2 -2
- package/dist/utils/constants.js +1 -1
- package/dist/utils/server-key-derivation.cjs +9 -0
- package/dist/utils/server-key-derivation.d.cts +20 -0
- package/dist/utils/server-key-derivation.d.ts +20 -0
- package/dist/utils/server-key-derivation.js +9 -0
- package/dist/wallets/__tests__/test-helpers.cjs +19 -10
- package/dist/wallets/__tests__/test-helpers.js +18 -9
- package/dist/wallets/evm.cjs +20 -11
- package/dist/wallets/evm.js +19 -10
- package/dist/wallets/solana.cjs +20 -11
- package/dist/wallets/solana.js +19 -10
- package/dist/wallets/stellar.cjs +20 -11
- package/dist/wallets/stellar.js +19 -10
- package/dist/wallets/types.d.cts +7 -4
- package/dist/wallets/types.d.ts +7 -4
- package/dist/wallets/wallet-factory.cjs +21 -12
- package/dist/wallets/wallet-factory.js +20 -11
- package/dist/wallets/wallet.cjs +19 -10
- package/dist/wallets/wallet.d.cts +2 -2
- package/dist/wallets/wallet.d.ts +2 -2
- package/dist/wallets/wallet.js +18 -9
- package/package.json +3 -2
- package/dist/chunk-BMMZIPXT.js +0 -778
- package/dist/chunk-COR3CNRW.cjs +0 -778
package/dist/api/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-6HXIZLEQ.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkP4XJHOLWcjs = require('../chunk-P4XJHOLW.cjs');
|
|
5
5
|
require('../chunk-ECAM5KTH.cjs');
|
|
6
6
|
require('../chunk-XC2V34TS.cjs');
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-2M32LBCA.cjs');
|
|
8
|
+
require('../chunk-3WZUNLYI.cjs');
|
|
9
9
|
require('../chunk-UO2J2ZB2.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.ApiClient =
|
|
12
|
+
exports.ApiClient = _chunkP4XJHOLWcjs.ApiClient;
|
package/dist/api/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "../chunk-5IFDVB4Y.js";
|
|
2
2
|
import {
|
|
3
3
|
ApiClient
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-VLZ5ZS5U.js";
|
|
5
5
|
import "../chunk-KBJA7JDT.js";
|
|
6
6
|
import "../chunk-SGINWAB6.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-XEPUH4XH.js";
|
|
8
|
+
import "../chunk-GLUD6EBN.js";
|
|
9
9
|
import "../chunk-ASE2FXWP.js";
|
|
10
10
|
export {
|
|
11
11
|
ApiClient
|
package/dist/api/types.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address } from 'viem';
|
|
2
|
-
import { CreateWalletV2025Dto, WalletV2025ResponseDto, WalletV1Alpha2ErrorDto, CreateTransactionV2025Dto, WalletsTransactionV2025ResponseDto, WalletV1Alpha2TransactionErrorDto, SubmitApprovalV2025Dto,
|
|
2
|
+
import { CreateWalletV2025Dto, WalletV2025ResponseDto, WalletV1Alpha2ErrorDto, CreateTransactionV2025Dto, WalletsTransactionV2025ResponseDto, WalletV1Alpha2TransactionErrorDto, SubmitApprovalV2025Dto, WalletsV2025ControllerSubmitApprovals2Error, WalletsV2025ControllerGetTransaction2Error, CreateSignatureV2025Dto, WalletsSignatureV2025ResponseDto, WalletsV2025ControllerCreateSignatureRequest2Error, WalletsV2025ControllerSubmitSignatureApprovals2Error, WalletsV2025ControllerGetSignature2Error, WalletsMultipleTransactionV2025ResponseDto, WalletsV2025ControllerGetTransactionsWithoutChain2Error, WalletNftsResponseDto, WalletsActivityResponseUnstableDto, WalletBalanceV20250609ResponseDto, BalanceControllerGetBalanceForLocator2Error, FundWalletAmountDto, BalanceControllerFundWallet2Responses, BalanceControllerFundWallet2Error, CreateSignerV2025InputDto, DelegatedSignerV2025Dto, WalletsV2025ControllerCreateDelegatedSigner2Error, WalletsV2025ControllerGetDelegatedSigner2Error, SendTokenDto, WalletsSendTokenControllerSendToken2Response } from './gen/types.gen.cjs';
|
|
3
3
|
|
|
4
4
|
type CreateWalletParams = CreateWalletV2025Dto;
|
|
5
5
|
type GetWalletSuccessResponse = WalletV2025ResponseDto;
|
|
@@ -14,20 +14,20 @@ type CreateTransactionParams = CreateTransactionV2025Dto;
|
|
|
14
14
|
type CreateTransactionSuccessResponse = WalletsTransactionV2025ResponseDto;
|
|
15
15
|
type CreateTransactionResponse = CreateTransactionSuccessResponse | WalletV1Alpha2TransactionErrorDto;
|
|
16
16
|
type ApproveTransactionParams = SubmitApprovalV2025Dto;
|
|
17
|
-
type ApproveTransactionResponse = WalletsTransactionV2025ResponseDto |
|
|
18
|
-
type GetTransactionResponse = WalletsTransactionV2025ResponseDto |
|
|
17
|
+
type ApproveTransactionResponse = WalletsTransactionV2025ResponseDto | WalletsV2025ControllerSubmitApprovals2Error;
|
|
18
|
+
type GetTransactionResponse = WalletsTransactionV2025ResponseDto | WalletsV2025ControllerGetTransaction2Error;
|
|
19
19
|
type GetTransactionSuccessResponse = WalletsTransactionV2025ResponseDto;
|
|
20
20
|
type CreateSignatureParams = CreateSignatureV2025Dto;
|
|
21
|
-
type CreateSignatureResponse = WalletsSignatureV2025ResponseDto |
|
|
21
|
+
type CreateSignatureResponse = WalletsSignatureV2025ResponseDto | WalletsV2025ControllerCreateSignatureRequest2Error;
|
|
22
22
|
type ApproveSignatureParams = SubmitApprovalV2025Dto;
|
|
23
|
-
type ApproveSignatureResponse = WalletsSignatureV2025ResponseDto |
|
|
24
|
-
type GetSignatureResponse = WalletsSignatureV2025ResponseDto |
|
|
25
|
-
type GetTransactionsResponse = WalletsMultipleTransactionV2025ResponseDto |
|
|
23
|
+
type ApproveSignatureResponse = WalletsSignatureV2025ResponseDto | WalletsV2025ControllerSubmitSignatureApprovals2Error;
|
|
24
|
+
type GetSignatureResponse = WalletsSignatureV2025ResponseDto | WalletsV2025ControllerGetSignature2Error;
|
|
25
|
+
type GetTransactionsResponse = WalletsMultipleTransactionV2025ResponseDto | WalletsV2025ControllerGetTransactionsWithoutChain2Error;
|
|
26
26
|
type GetNftsResponse = WalletNftsResponseDto;
|
|
27
27
|
type GetBalanceResponse = WalletBalanceV20250609ResponseDto | BalanceControllerGetBalanceForLocator2Error;
|
|
28
28
|
type GetBalanceSuccessResponse = WalletBalanceV20250609ResponseDto;
|
|
29
|
-
type GetActivityResponse =
|
|
30
|
-
type Activity =
|
|
29
|
+
type GetActivityResponse = WalletsActivityResponseUnstableDto | WalletV1Alpha2ErrorDto;
|
|
30
|
+
type Activity = WalletsActivityResponseUnstableDto;
|
|
31
31
|
type FundWalletParams = FundWalletAmountDto;
|
|
32
32
|
type FundWalletResponse = BalanceControllerFundWallet2Responses | BalanceControllerFundWallet2Error;
|
|
33
33
|
type RegisterSignerChain = Extract<CreateSignerV2025InputDto, {
|
|
@@ -40,9 +40,9 @@ type RegisterSignerParams = {
|
|
|
40
40
|
signer: string | RegisterSignerPasskeyParams;
|
|
41
41
|
chain?: RegisterSignerChain;
|
|
42
42
|
};
|
|
43
|
-
type RegisterSignerResponse = DelegatedSignerV2025Dto |
|
|
44
|
-
type GetSignerResponse = DelegatedSignerV2025Dto |
|
|
45
|
-
type GetDelegatedSignersResponse = Array<DelegatedSignerV2025Dto> |
|
|
43
|
+
type RegisterSignerResponse = DelegatedSignerV2025Dto | WalletsV2025ControllerCreateDelegatedSigner2Error;
|
|
44
|
+
type GetSignerResponse = DelegatedSignerV2025Dto | WalletsV2025ControllerGetDelegatedSigner2Error;
|
|
45
|
+
type GetDelegatedSignersResponse = Array<DelegatedSignerV2025Dto> | WalletsV2025ControllerGetDelegatedSigner2Error;
|
|
46
46
|
type DelegatedSigner = DelegatedSignerV2025Dto;
|
|
47
47
|
type SendParams = SendTokenDto;
|
|
48
48
|
type SendResponse = WalletsSendTokenControllerSendToken2Response;
|
package/dist/api/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address } from 'viem';
|
|
2
|
-
import { CreateWalletV2025Dto, WalletV2025ResponseDto, WalletV1Alpha2ErrorDto, CreateTransactionV2025Dto, WalletsTransactionV2025ResponseDto, WalletV1Alpha2TransactionErrorDto, SubmitApprovalV2025Dto,
|
|
2
|
+
import { CreateWalletV2025Dto, WalletV2025ResponseDto, WalletV1Alpha2ErrorDto, CreateTransactionV2025Dto, WalletsTransactionV2025ResponseDto, WalletV1Alpha2TransactionErrorDto, SubmitApprovalV2025Dto, WalletsV2025ControllerSubmitApprovals2Error, WalletsV2025ControllerGetTransaction2Error, CreateSignatureV2025Dto, WalletsSignatureV2025ResponseDto, WalletsV2025ControllerCreateSignatureRequest2Error, WalletsV2025ControllerSubmitSignatureApprovals2Error, WalletsV2025ControllerGetSignature2Error, WalletsMultipleTransactionV2025ResponseDto, WalletsV2025ControllerGetTransactionsWithoutChain2Error, WalletNftsResponseDto, WalletsActivityResponseUnstableDto, WalletBalanceV20250609ResponseDto, BalanceControllerGetBalanceForLocator2Error, FundWalletAmountDto, BalanceControllerFundWallet2Responses, BalanceControllerFundWallet2Error, CreateSignerV2025InputDto, DelegatedSignerV2025Dto, WalletsV2025ControllerCreateDelegatedSigner2Error, WalletsV2025ControllerGetDelegatedSigner2Error, SendTokenDto, WalletsSendTokenControllerSendToken2Response } from './gen/types.gen.js';
|
|
3
3
|
|
|
4
4
|
type CreateWalletParams = CreateWalletV2025Dto;
|
|
5
5
|
type GetWalletSuccessResponse = WalletV2025ResponseDto;
|
|
@@ -14,20 +14,20 @@ type CreateTransactionParams = CreateTransactionV2025Dto;
|
|
|
14
14
|
type CreateTransactionSuccessResponse = WalletsTransactionV2025ResponseDto;
|
|
15
15
|
type CreateTransactionResponse = CreateTransactionSuccessResponse | WalletV1Alpha2TransactionErrorDto;
|
|
16
16
|
type ApproveTransactionParams = SubmitApprovalV2025Dto;
|
|
17
|
-
type ApproveTransactionResponse = WalletsTransactionV2025ResponseDto |
|
|
18
|
-
type GetTransactionResponse = WalletsTransactionV2025ResponseDto |
|
|
17
|
+
type ApproveTransactionResponse = WalletsTransactionV2025ResponseDto | WalletsV2025ControllerSubmitApprovals2Error;
|
|
18
|
+
type GetTransactionResponse = WalletsTransactionV2025ResponseDto | WalletsV2025ControllerGetTransaction2Error;
|
|
19
19
|
type GetTransactionSuccessResponse = WalletsTransactionV2025ResponseDto;
|
|
20
20
|
type CreateSignatureParams = CreateSignatureV2025Dto;
|
|
21
|
-
type CreateSignatureResponse = WalletsSignatureV2025ResponseDto |
|
|
21
|
+
type CreateSignatureResponse = WalletsSignatureV2025ResponseDto | WalletsV2025ControllerCreateSignatureRequest2Error;
|
|
22
22
|
type ApproveSignatureParams = SubmitApprovalV2025Dto;
|
|
23
|
-
type ApproveSignatureResponse = WalletsSignatureV2025ResponseDto |
|
|
24
|
-
type GetSignatureResponse = WalletsSignatureV2025ResponseDto |
|
|
25
|
-
type GetTransactionsResponse = WalletsMultipleTransactionV2025ResponseDto |
|
|
23
|
+
type ApproveSignatureResponse = WalletsSignatureV2025ResponseDto | WalletsV2025ControllerSubmitSignatureApprovals2Error;
|
|
24
|
+
type GetSignatureResponse = WalletsSignatureV2025ResponseDto | WalletsV2025ControllerGetSignature2Error;
|
|
25
|
+
type GetTransactionsResponse = WalletsMultipleTransactionV2025ResponseDto | WalletsV2025ControllerGetTransactionsWithoutChain2Error;
|
|
26
26
|
type GetNftsResponse = WalletNftsResponseDto;
|
|
27
27
|
type GetBalanceResponse = WalletBalanceV20250609ResponseDto | BalanceControllerGetBalanceForLocator2Error;
|
|
28
28
|
type GetBalanceSuccessResponse = WalletBalanceV20250609ResponseDto;
|
|
29
|
-
type GetActivityResponse =
|
|
30
|
-
type Activity =
|
|
29
|
+
type GetActivityResponse = WalletsActivityResponseUnstableDto | WalletV1Alpha2ErrorDto;
|
|
30
|
+
type Activity = WalletsActivityResponseUnstableDto;
|
|
31
31
|
type FundWalletParams = FundWalletAmountDto;
|
|
32
32
|
type FundWalletResponse = BalanceControllerFundWallet2Responses | BalanceControllerFundWallet2Error;
|
|
33
33
|
type RegisterSignerChain = Extract<CreateSignerV2025InputDto, {
|
|
@@ -40,9 +40,9 @@ type RegisterSignerParams = {
|
|
|
40
40
|
signer: string | RegisterSignerPasskeyParams;
|
|
41
41
|
chain?: RegisterSignerChain;
|
|
42
42
|
};
|
|
43
|
-
type RegisterSignerResponse = DelegatedSignerV2025Dto |
|
|
44
|
-
type GetSignerResponse = DelegatedSignerV2025Dto |
|
|
45
|
-
type GetDelegatedSignersResponse = Array<DelegatedSignerV2025Dto> |
|
|
43
|
+
type RegisterSignerResponse = DelegatedSignerV2025Dto | WalletsV2025ControllerCreateDelegatedSigner2Error;
|
|
44
|
+
type GetSignerResponse = DelegatedSignerV2025Dto | WalletsV2025ControllerGetDelegatedSigner2Error;
|
|
45
|
+
type GetDelegatedSignersResponse = Array<DelegatedSignerV2025Dto> | WalletsV2025ControllerGetDelegatedSigner2Error;
|
|
46
46
|
type DelegatedSigner = DelegatedSignerV2025Dto;
|
|
47
47
|
type SendParams = SendTokenDto;
|
|
48
48
|
type SendResponse = WalletsSendTokenControllerSendToken2Response;
|
package/dist/chains/chains.cjs
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkMIKWTXUAcjs = require('../chunk-MIKWTXUA.cjs');
|
|
8
|
+
require('../chunk-HTSQPZHW.cjs');
|
|
8
9
|
require('../chunk-NIBKCMQ2.cjs');
|
|
9
10
|
require('../chunk-55V4VMTX.cjs');
|
|
10
11
|
require('../chunk-7USEVMTW.cjs');
|
|
11
12
|
require('../chunk-F7L2TZ3I.cjs');
|
|
12
|
-
require('../chunk-HTSQPZHW.cjs');
|
|
13
13
|
require('../chunk-XC2V34TS.cjs');
|
|
14
14
|
require('../chunk-CCIGWTAO.cjs');
|
|
15
|
-
require('../chunk-
|
|
16
|
-
require('../chunk-
|
|
15
|
+
require('../chunk-2M32LBCA.cjs');
|
|
16
|
+
require('../chunk-3WZUNLYI.cjs');
|
|
17
17
|
require('../chunk-UO2J2ZB2.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
@@ -21,4 +21,4 @@ require('../chunk-UO2J2ZB2.cjs');
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
exports.isMainnetChain =
|
|
24
|
+
exports.isMainnetChain = _chunkMIKWTXUAcjs.isMainnetChain; exports.isTestnetChain = _chunkMIKWTXUAcjs.isTestnetChain; exports.mainnetToTestnet = _chunkMIKWTXUAcjs.mainnetToTestnet; exports.toViemChain = _chunkMIKWTXUAcjs.toViemChain; exports.validateChainForEnvironment = _chunkMIKWTXUAcjs.validateChainForEnvironment;
|
package/dist/chains/chains.js
CHANGED
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
mainnetToTestnet,
|
|
5
5
|
toViemChain,
|
|
6
6
|
validateChainForEnvironment
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-X4SPF4KJ.js";
|
|
8
|
+
import "../chunk-ZBLW42YE.js";
|
|
8
9
|
import "../chunk-2T5HHKUI.js";
|
|
9
10
|
import "../chunk-3U6UAYOV.js";
|
|
10
11
|
import "../chunk-MMISP35W.js";
|
|
11
12
|
import "../chunk-JWMQALLN.js";
|
|
12
|
-
import "../chunk-ZBLW42YE.js";
|
|
13
13
|
import "../chunk-SGINWAB6.js";
|
|
14
14
|
import "../chunk-455NK5LB.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-XEPUH4XH.js";
|
|
16
|
+
import "../chunk-GLUD6EBN.js";
|
|
17
17
|
import "../chunk-ASE2FXWP.js";
|
|
18
18
|
export {
|
|
19
19
|
isMainnetChain,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk3WZUNLYIcjs = require('./chunk-3WZUNLYI.cjs');
|
|
5
5
|
|
|
6
6
|
// src/logger/init.ts
|
|
7
7
|
|
|
@@ -20,8 +20,8 @@ function initWalletsLogger(apiKey) {
|
|
|
20
20
|
}
|
|
21
21
|
const { environment, projectId } = validationResult;
|
|
22
22
|
walletsLogger.init({
|
|
23
|
-
packageName:
|
|
24
|
-
packageVersion:
|
|
23
|
+
packageName: _chunk3WZUNLYIcjs.SDK_NAME,
|
|
24
|
+
packageVersion: _chunk3WZUNLYIcjs.SDK_VERSION,
|
|
25
25
|
environment,
|
|
26
26
|
projectId,
|
|
27
27
|
platform
|
|
@@ -4,20 +4,23 @@ import {
|
|
|
4
4
|
} from "./chunk-ZP4ZZCIE.js";
|
|
5
5
|
import {
|
|
6
6
|
Wallet
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VVPGO564.js";
|
|
8
8
|
import {
|
|
9
9
|
assembleSigner
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EVR4CD53.js";
|
|
11
|
+
import {
|
|
12
|
+
deriveServerSignerDetails
|
|
13
|
+
} from "./chunk-S2L5Z2ZT.js";
|
|
11
14
|
import {
|
|
12
15
|
validateChainForEnvironment
|
|
13
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-X4SPF4KJ.js";
|
|
14
17
|
import {
|
|
15
18
|
WalletCreationError,
|
|
16
19
|
WalletNotAvailableError
|
|
17
20
|
} from "./chunk-SGINWAB6.js";
|
|
18
21
|
import {
|
|
19
22
|
walletsLogger
|
|
20
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-XEPUH4XH.js";
|
|
21
24
|
import {
|
|
22
25
|
__async,
|
|
23
26
|
__decorateClass,
|
|
@@ -88,19 +91,35 @@ var WalletFactory = class {
|
|
|
88
91
|
}
|
|
89
92
|
createWalletInternal(args) {
|
|
90
93
|
return __async(this, null, function* () {
|
|
91
|
-
var _a, _b, _c, _d, _e;
|
|
94
|
+
var _a, _b, _c, _d, _e, _f;
|
|
92
95
|
yield (_c = (_b = (_a = args.options) == null ? void 0 : _a.experimental_callbacks) == null ? void 0 : _b.onWalletCreationStart) == null ? void 0 : _c.call(_b);
|
|
93
96
|
walletsLogger.info("walletFactory.createWallet.start");
|
|
94
97
|
this.mutateSignerFromCustomAuth(args, true);
|
|
95
|
-
|
|
98
|
+
let adminSigner;
|
|
99
|
+
const delegatedSigners = (_d = args.delegatedSigners) == null ? void 0 : _d.map((ds) => ({
|
|
100
|
+
signer: typeof ds.signer === "object" && ds.signer.type === "server" ? `server:${deriveServerSignerDetails(ds.signer, args.chain, this.apiClient.projectId, this.apiClient.environment).derivedAddress}` : ds.signer
|
|
101
|
+
}));
|
|
102
|
+
if (args.signer.type === "passkey") {
|
|
103
|
+
adminSigner = yield this.createPasskeyAdminSigner(args.signer);
|
|
104
|
+
} else if (args.signer.type === "server") {
|
|
105
|
+
const { derivedAddress } = deriveServerSignerDetails(
|
|
106
|
+
args.signer,
|
|
107
|
+
args.chain,
|
|
108
|
+
this.apiClient.projectId,
|
|
109
|
+
this.apiClient.environment
|
|
110
|
+
);
|
|
111
|
+
adminSigner = { type: "server", address: derivedAddress };
|
|
112
|
+
} else {
|
|
113
|
+
adminSigner = args.signer;
|
|
114
|
+
}
|
|
96
115
|
const walletResponse = yield this.apiClient.createWallet({
|
|
97
116
|
type: "smart",
|
|
98
117
|
chainType: this.getChainType(args.chain),
|
|
99
118
|
config: __spreadValues(__spreadValues({
|
|
100
119
|
adminSigner
|
|
101
|
-
}, (args == null ? void 0 : args.plugins) ? { plugins: args.plugins } : {}),
|
|
102
|
-
owner: (
|
|
103
|
-
alias: (
|
|
120
|
+
}, (args == null ? void 0 : args.plugins) ? { plugins: args.plugins } : {}), delegatedSigners != null ? { delegatedSigners } : {}),
|
|
121
|
+
owner: (_e = args.owner) != null ? _e : void 0,
|
|
122
|
+
alias: (_f = args.alias) != null ? _f : void 0
|
|
104
123
|
});
|
|
105
124
|
if ("error" in walletResponse) {
|
|
106
125
|
walletsLogger.error("walletFactory.createWallet.error", {
|
|
@@ -116,7 +135,7 @@ var WalletFactory = class {
|
|
|
116
135
|
}
|
|
117
136
|
createWalletInstance(walletResponse, args) {
|
|
118
137
|
this.validateExistingWalletConfig(walletResponse, args);
|
|
119
|
-
const signerConfig = this.toInternalSignerConfig(walletResponse, args.signer, args.options);
|
|
138
|
+
const signerConfig = this.toInternalSignerConfig(walletResponse, args.signer, args.chain, args.options);
|
|
120
139
|
return new Wallet(
|
|
121
140
|
{
|
|
122
141
|
chain: args.chain,
|
|
@@ -129,8 +148,8 @@ var WalletFactory = class {
|
|
|
129
148
|
this.apiClient
|
|
130
149
|
);
|
|
131
150
|
}
|
|
132
|
-
toInternalSignerConfig(walletResponse, signerArgs, options) {
|
|
133
|
-
var _a, _b, _c, _d, _e, _f;
|
|
151
|
+
toInternalSignerConfig(walletResponse, signerArgs, chain, options) {
|
|
152
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
134
153
|
if (!(walletResponse.chainType === "evm" || walletResponse.chainType === "solana" || walletResponse.chainType === "stellar")) {
|
|
135
154
|
throw new WalletCreationError(`Wallet type ${walletResponse.chainType} is not supported`);
|
|
136
155
|
}
|
|
@@ -165,8 +184,31 @@ var WalletFactory = class {
|
|
|
165
184
|
onCreatePasskey: signerArgs.onCreatePasskey,
|
|
166
185
|
onSignWithPasskey: signerArgs.onSignWithPasskey
|
|
167
186
|
};
|
|
187
|
+
case "server": {
|
|
188
|
+
const serverAdminSigner = (_e = walletResponse.config) == null ? void 0 : _e.adminSigner;
|
|
189
|
+
if ((serverAdminSigner == null ? void 0 : serverAdminSigner.type) !== "server") {
|
|
190
|
+
throw new WalletCreationError("Server signer expects a server admin signer on the wallet");
|
|
191
|
+
}
|
|
192
|
+
const { derivedKeyBytes, derivedAddress } = deriveServerSignerDetails(
|
|
193
|
+
signerArgs,
|
|
194
|
+
chain,
|
|
195
|
+
this.apiClient.projectId,
|
|
196
|
+
this.apiClient.environment
|
|
197
|
+
);
|
|
198
|
+
if (serverAdminSigner.address !== derivedAddress) {
|
|
199
|
+
throw new WalletCreationError(
|
|
200
|
+
`Server signer address ${derivedAddress} does not match the wallet's admin signer address`
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
type: "server",
|
|
205
|
+
derivedKeyBytes,
|
|
206
|
+
locator: serverAdminSigner.locator,
|
|
207
|
+
address: derivedAddress
|
|
208
|
+
};
|
|
209
|
+
}
|
|
168
210
|
case "email": {
|
|
169
|
-
if (((
|
|
211
|
+
if (((_f = walletResponse.config) == null ? void 0 : _f.adminSigner.type) !== "email") {
|
|
170
212
|
throw new WalletCreationError("Email signer does not match the wallet's signer type");
|
|
171
213
|
}
|
|
172
214
|
const { locator, email, address } = walletResponse.config.adminSigner;
|
|
@@ -181,7 +223,7 @@ var WalletFactory = class {
|
|
|
181
223
|
};
|
|
182
224
|
}
|
|
183
225
|
case "phone": {
|
|
184
|
-
if (((
|
|
226
|
+
if (((_g = walletResponse.config) == null ? void 0 : _g.adminSigner.type) !== "phone") {
|
|
185
227
|
throw new WalletCreationError("Phone signer does not match the wallet's signer type");
|
|
186
228
|
}
|
|
187
229
|
const { locator, phone, address } = walletResponse.config.adminSigner;
|
|
@@ -263,10 +305,10 @@ var WalletFactory = class {
|
|
|
263
305
|
compareSignerConfigs(adminSignerArgs, existingWalletSigner);
|
|
264
306
|
}
|
|
265
307
|
if (args.delegatedSigners != null) {
|
|
266
|
-
this.validateDelegatedSigners(existingWallet, args.delegatedSigners);
|
|
308
|
+
this.validateDelegatedSigners(existingWallet, args.delegatedSigners, args.chain);
|
|
267
309
|
}
|
|
268
310
|
}
|
|
269
|
-
validateDelegatedSigners(existingWallet, inputDelegatedSigners) {
|
|
311
|
+
validateDelegatedSigners(existingWallet, inputDelegatedSigners, chain) {
|
|
270
312
|
var _a;
|
|
271
313
|
const existingDelegatedSigners = (_a = existingWallet == null ? void 0 : existingWallet.config) == null ? void 0 : _a.delegatedSigners;
|
|
272
314
|
if (inputDelegatedSigners.length === 0) {
|
|
@@ -278,13 +320,14 @@ var WalletFactory = class {
|
|
|
278
320
|
);
|
|
279
321
|
}
|
|
280
322
|
for (const argSigner of inputDelegatedSigners) {
|
|
323
|
+
const resolvedSigner = typeof argSigner.signer === "object" && argSigner.signer.type === "server" ? `server:${deriveServerSignerDetails(argSigner.signer, chain, this.apiClient.projectId, this.apiClient.environment).derivedAddress}` : argSigner.signer;
|
|
281
324
|
const matchingExistingSigner = existingDelegatedSigners.find(
|
|
282
|
-
(existingSigner) => existingSigner.locator ===
|
|
325
|
+
(existingSigner) => existingSigner.locator === resolvedSigner
|
|
283
326
|
);
|
|
284
327
|
if (matchingExistingSigner == null) {
|
|
285
328
|
const walletSigners = existingDelegatedSigners.map((s) => s.locator).join(", ");
|
|
286
329
|
throw new WalletCreationError(
|
|
287
|
-
`Delegated signer '${
|
|
330
|
+
`Delegated signer '${resolvedSigner}' does not exist in wallet "${existingWallet.address}". Available delegated signers: ${walletSigners}. ${DELEGATED_SIGNER_MISMATCH_ERROR}`
|
|
288
331
|
);
|
|
289
332
|
}
|
|
290
333
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "./chunk-ASE2FXWP.js";
|
|
4
|
+
|
|
5
|
+
// src/signers/server/stellar-server-signer.ts
|
|
6
|
+
import { Keypair } from "@stellar/stellar-sdk";
|
|
7
|
+
var StellarServerSigner = class {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
this.type = "server";
|
|
10
|
+
this.keypair = Keypair.fromRawEd25519Seed(Buffer.from(config.derivedKeyBytes));
|
|
11
|
+
this._address = this.keypair.publicKey();
|
|
12
|
+
this._locator = config.locator;
|
|
13
|
+
}
|
|
14
|
+
address() {
|
|
15
|
+
return this._address;
|
|
16
|
+
}
|
|
17
|
+
locator() {
|
|
18
|
+
return this._locator;
|
|
19
|
+
}
|
|
20
|
+
signMessage(message) {
|
|
21
|
+
return __async(this, null, function* () {
|
|
22
|
+
if (!/^[A-Za-z0-9+/]*={0,2}$/.test(message)) {
|
|
23
|
+
throw new Error("StellarServerSigner.signMessage: expected a base64-encoded string");
|
|
24
|
+
}
|
|
25
|
+
const messageBytes = Buffer.from(message, "base64");
|
|
26
|
+
const signatureBytes = this.keypair.sign(messageBytes);
|
|
27
|
+
return { signature: signatureBytes.toString("base64") };
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
signTransaction(transaction) {
|
|
31
|
+
return __async(this, null, function* () {
|
|
32
|
+
return yield this.signMessage(transaction);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
StellarServerSigner
|
|
39
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_EVENT_OPTIONS,
|
|
3
3
|
NonCustodialSigner
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FZQG6OX2.js";
|
|
5
5
|
import {
|
|
6
6
|
walletsLogger
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XEPUH4XH.js";
|
|
8
8
|
import {
|
|
9
9
|
__async
|
|
10
10
|
} from "./chunk-ASE2FXWP.js";
|