@crossmint/wallets-sdk 0.20.2 → 0.20.5
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/package.json +1 -1
- package/LICENSE +0 -201
- package/README.md +0 -96
- package/dist/api/__tests__/constants.cjs +0 -31
- package/dist/api/__tests__/constants.d.cts +0 -96
- package/dist/api/__tests__/constants.d.ts +0 -96
- package/dist/api/__tests__/constants.js +0 -31
- package/dist/api/__tests__/test-utils.cjs +0 -372
- package/dist/api/__tests__/test-utils.d.cts +0 -99
- package/dist/api/__tests__/test-utils.d.ts +0 -99
- package/dist/api/__tests__/test-utils.js +0 -372
- package/dist/api/client.cjs +0 -10
- package/dist/api/client.d.cts +0 -42
- package/dist/api/client.d.ts +0 -42
- package/dist/api/client.js +0 -10
- package/dist/api/gen/client.gen.cjs +0 -7
- package/dist/api/gen/client.gen.d.cts +0 -16
- package/dist/api/gen/client.gen.d.ts +0 -16
- package/dist/api/gen/client.gen.js +0 -7
- package/dist/api/gen/index.cjs +0 -179
- package/dist/api/gen/index.d.cts +0 -3
- package/dist/api/gen/index.d.ts +0 -3
- package/dist/api/gen/index.js +0 -179
- package/dist/api/gen/sdk.gen.cjs +0 -178
- package/dist/api/gen/sdk.gen.d.cts +0 -611
- package/dist/api/gen/sdk.gen.d.ts +0 -611
- package/dist/api/gen/sdk.gen.js +0 -178
- package/dist/api/gen/types.gen.cjs +0 -1
- package/dist/api/gen/types.gen.d.cts +0 -13865
- package/dist/api/gen/types.gen.d.ts +0 -13865
- package/dist/api/gen/types.gen.js +0 -1
- package/dist/api/index.cjs +0 -12
- package/dist/api/index.d.cts +0 -6
- package/dist/api/index.d.ts +0 -6
- package/dist/api/index.js +0 -12
- package/dist/api/types.cjs +0 -1
- package/dist/api/types.d.cts +0 -55
- package/dist/api/types.d.ts +0 -55
- package/dist/api/types.js +0 -1
- package/dist/chains/chains.cjs +0 -24
- package/dist/chains/chains.d.cts +0 -28
- package/dist/chains/chains.d.ts +0 -28
- package/dist/chains/chains.js +0 -24
- package/dist/chains/definitions/arcTestnet.cjs +0 -7
- package/dist/chains/definitions/arcTestnet.d.cts +0 -43
- package/dist/chains/definitions/arcTestnet.d.ts +0 -43
- package/dist/chains/definitions/arcTestnet.js +0 -7
- package/dist/chains/definitions/story.cjs +0 -7
- package/dist/chains/definitions/story.d.cts +0 -49
- package/dist/chains/definitions/story.d.ts +0 -49
- package/dist/chains/definitions/story.js +0 -7
- package/dist/chains/definitions/storyTestnet.cjs +0 -7
- package/dist/chains/definitions/storyTestnet.d.cts +0 -43
- package/dist/chains/definitions/storyTestnet.d.ts +0 -43
- package/dist/chains/definitions/storyTestnet.js +0 -7
- package/dist/chains/definitions/tempo.cjs +0 -7
- package/dist/chains/definitions/tempo.d.cts +0 -39
- package/dist/chains/definitions/tempo.d.ts +0 -39
- package/dist/chains/definitions/tempo.js +0 -7
- package/dist/chains/definitions/tempoTestnet.cjs +0 -7
- package/dist/chains/definitions/tempoTestnet.d.cts +0 -39
- package/dist/chains/definitions/tempoTestnet.d.ts +0 -39
- package/dist/chains/definitions/tempoTestnet.js +0 -7
- package/dist/chunk-2I2OFGNL.js +0 -36
- package/dist/chunk-2T5HHKUI.js +0 -19
- package/dist/chunk-2WBSPOWU.js +0 -223
- package/dist/chunk-3U6UAYOV.js +0 -25
- package/dist/chunk-455NK5LB.js +0 -0
- package/dist/chunk-47R3UV3J.cjs +0 -58
- package/dist/chunk-47WKYTRN.js +0 -63
- package/dist/chunk-4GFSUI2I.cjs +0 -66
- package/dist/chunk-55V4VMTX.cjs +0 -25
- package/dist/chunk-5IFDVB4Y.js +0 -0
- package/dist/chunk-66UY53KP.cjs +0 -336
- package/dist/chunk-6FG5QXII.cjs +0 -110
- package/dist/chunk-6HXIZLEQ.cjs +0 -1
- package/dist/chunk-6UMJYMAY.js +0 -82
- package/dist/chunk-7GOUUPS4.js +0 -36
- package/dist/chunk-7TT3VUDF.cjs +0 -84
- package/dist/chunk-7USEVMTW.cjs +0 -21
- package/dist/chunk-A6E67ZZP.js +0 -237
- package/dist/chunk-ABMZ3ZVN.js +0 -52
- package/dist/chunk-ASE2FXWP.js +0 -65
- package/dist/chunk-BMMZIPXT.js +0 -778
- package/dist/chunk-CCIGWTAO.cjs +0 -1
- package/dist/chunk-CMBFV325.js +0 -69
- package/dist/chunk-COR3CNRW.cjs +0 -778
- package/dist/chunk-ECAM5KTH.cjs +0 -1
- package/dist/chunk-F7L2TZ3I.cjs +0 -21
- package/dist/chunk-FHMKNG62.js +0 -741
- package/dist/chunk-FICVKSXZ.js +0 -84
- package/dist/chunk-FOOISYCJ.js +0 -66
- package/dist/chunk-G6QJHFSY.cjs +0 -74
- package/dist/chunk-HTSQPZHW.cjs +0 -25
- package/dist/chunk-HXJ3YPAN.js +0 -110
- package/dist/chunk-IDKGJO2G.cjs +0 -115
- package/dist/chunk-IOMKHF6R.cjs +0 -44
- package/dist/chunk-IPO25BCU.js +0 -43
- package/dist/chunk-JREZWZ2S.cjs +0 -52
- package/dist/chunk-JSWTGW46.cjs +0 -36
- package/dist/chunk-JWMQALLN.js +0 -21
- package/dist/chunk-KBJA7JDT.js +0 -0
- package/dist/chunk-KQH5ZXJ4.js +0 -336
- package/dist/chunk-KT3CVXFG.js +0 -9
- package/dist/chunk-MMISP35W.js +0 -21
- package/dist/chunk-MRZXYVQO.cjs +0 -82
- package/dist/chunk-NIBKCMQ2.cjs +0 -19
- package/dist/chunk-PIFD6KNH.js +0 -59
- package/dist/chunk-PJOJIRTY.js +0 -74
- package/dist/chunk-PK7J3Y3L.js +0 -44
- package/dist/chunk-PM7BGATN.cjs +0 -237
- package/dist/chunk-PO6S7UR3.cjs +0 -1
- package/dist/chunk-POG76HDD.cjs +0 -741
- package/dist/chunk-PUO4QNXH.js +0 -89
- package/dist/chunk-Q5KNPVYI.cjs +0 -59
- package/dist/chunk-R4AW5ADG.cjs +0 -16
- package/dist/chunk-R6DH4V7S.cjs +0 -69
- package/dist/chunk-RBHGZDDX.cjs +0 -58
- package/dist/chunk-RHR6P2KP.cjs +0 -15
- package/dist/chunk-RYQI3RXL.cjs +0 -247
- package/dist/chunk-SGINWAB6.js +0 -155
- package/dist/chunk-T2XUADHW.js +0 -58
- package/dist/chunk-TYQ4YIP7.js +0 -16
- package/dist/chunk-U3NV7UY7.js +0 -323
- package/dist/chunk-UO2J2ZB2.cjs +0 -65
- package/dist/chunk-W7K5E64Q.js +0 -247
- package/dist/chunk-WDZY4PP4.cjs +0 -223
- package/dist/chunk-WHTECI7J.cjs +0 -89
- package/dist/chunk-WJUPOCKJ.js +0 -15
- package/dist/chunk-WWW6IGZ7.js +0 -115
- package/dist/chunk-XC2V34TS.cjs +0 -155
- package/dist/chunk-XOCC3MPK.cjs +0 -36
- package/dist/chunk-XPMCPXI3.cjs +0 -1
- package/dist/chunk-YDZRBHS3.js +0 -0
- package/dist/chunk-YMRXMNME.js +0 -0
- package/dist/chunk-ZAX22GSI.cjs +0 -323
- package/dist/chunk-ZBLW42YE.js +0 -25
- package/dist/chunk-ZNAGDENG.cjs +0 -43
- package/dist/chunk-ZP4ZZCIE.js +0 -58
- package/dist/chunk-ZT7EGOCI.cjs +0 -9
- package/dist/chunk-ZTEMOYS2.cjs +0 -63
- package/dist/index.cjs +0 -60
- package/dist/index.d.cts +0 -19
- package/dist/index.d.ts +0 -19
- package/dist/index.js +0 -60
- package/dist/logger/index.cjs +0 -11
- package/dist/logger/index.d.cts +0 -2
- package/dist/logger/index.d.ts +0 -2
- package/dist/logger/index.js +0 -11
- package/dist/logger/init.cjs +0 -10
- package/dist/logger/init.d.cts +0 -15
- package/dist/logger/init.d.ts +0 -15
- package/dist/logger/init.js +0 -10
- package/dist/sdk.cjs +0 -39
- package/dist/sdk.d.cts +0 -48
- package/dist/sdk.d.ts +0 -48
- package/dist/sdk.js +0 -39
- package/dist/signers/evm-api-key.cjs +0 -7
- package/dist/signers/evm-api-key.d.cts +0 -18
- package/dist/signers/evm-api-key.d.ts +0 -18
- package/dist/signers/evm-api-key.js +0 -7
- package/dist/signers/evm-external-wallet.cjs +0 -7
- package/dist/signers/evm-external-wallet.d.cts +0 -26
- package/dist/signers/evm-external-wallet.d.ts +0 -26
- package/dist/signers/evm-external-wallet.js +0 -7
- package/dist/signers/index.cjs +0 -24
- package/dist/signers/index.d.cts +0 -11
- package/dist/signers/index.d.ts +0 -11
- package/dist/signers/index.js +0 -24
- package/dist/signers/non-custodial/index.cjs +0 -27
- package/dist/signers/non-custodial/index.d.cts +0 -11
- package/dist/signers/non-custodial/index.d.ts +0 -11
- package/dist/signers/non-custodial/index.js +0 -27
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +0 -13
- package/dist/signers/non-custodial/ncs-evm-signer.d.cts +0 -30
- package/dist/signers/non-custodial/ncs-evm-signer.d.ts +0 -30
- package/dist/signers/non-custodial/ncs-evm-signer.js +0 -13
- package/dist/signers/non-custodial/ncs-iframe-manager.cjs +0 -7
- package/dist/signers/non-custodial/ncs-iframe-manager.d.cts +0 -16
- package/dist/signers/non-custodial/ncs-iframe-manager.d.ts +0 -16
- package/dist/signers/non-custodial/ncs-iframe-manager.js +0 -7
- package/dist/signers/non-custodial/ncs-signer.cjs +0 -14
- package/dist/signers/non-custodial/ncs-signer.d.cts +0 -50
- package/dist/signers/non-custodial/ncs-signer.d.ts +0 -50
- package/dist/signers/non-custodial/ncs-signer.js +0 -14
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +0 -13
- package/dist/signers/non-custodial/ncs-solana-signer.d.cts +0 -27
- package/dist/signers/non-custodial/ncs-solana-signer.d.ts +0 -27
- package/dist/signers/non-custodial/ncs-solana-signer.js +0 -13
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +0 -13
- package/dist/signers/non-custodial/ncs-stellar-signer.d.cts +0 -27
- package/dist/signers/non-custodial/ncs-stellar-signer.d.ts +0 -27
- package/dist/signers/non-custodial/ncs-stellar-signer.js +0 -13
- package/dist/signers/passkey.cjs +0 -7
- package/dist/signers/passkey.d.cts +0 -19
- package/dist/signers/passkey.d.ts +0 -19
- package/dist/signers/passkey.js +0 -7
- package/dist/signers/solana-api-key.cjs +0 -7
- package/dist/signers/solana-api-key.d.cts +0 -18
- package/dist/signers/solana-api-key.d.ts +0 -18
- package/dist/signers/solana-api-key.js +0 -7
- package/dist/signers/solana-external-wallet.cjs +0 -8
- package/dist/signers/solana-external-wallet.d.cts +0 -24
- package/dist/signers/solana-external-wallet.d.ts +0 -24
- package/dist/signers/solana-external-wallet.js +0 -8
- package/dist/signers/stellar-external-wallet.cjs +0 -7
- package/dist/signers/stellar-external-wallet.d.cts +0 -23
- package/dist/signers/stellar-external-wallet.d.ts +0 -23
- package/dist/signers/stellar-external-wallet.js +0 -7
- package/dist/signers/types.cjs +0 -9
- package/dist/signers/types.d.cts +0 -91
- package/dist/signers/types.d.ts +0 -91
- package/dist/signers/types.js +0 -9
- package/dist/utils/constants.cjs +0 -13
- package/dist/utils/constants.d.cts +0 -6
- package/dist/utils/constants.d.ts +0 -6
- package/dist/utils/constants.js +0 -13
- package/dist/utils/errors.cjs +0 -55
- package/dist/utils/errors.d.cts +0 -80
- package/dist/utils/errors.d.ts +0 -80
- package/dist/utils/errors.js +0 -55
- package/dist/utils/signer-validation.cjs +0 -10
- package/dist/utils/signer-validation.d.cts +0 -9
- package/dist/utils/signer-validation.d.ts +0 -9
- package/dist/utils/signer-validation.js +0 -10
- package/dist/wallets/__tests__/setup.cjs +0 -36
- package/dist/wallets/__tests__/setup.d.cts +0 -2
- package/dist/wallets/__tests__/setup.d.ts +0 -2
- package/dist/wallets/__tests__/setup.js +0 -36
- package/dist/wallets/__tests__/test-helpers.cjs +0 -93
- package/dist/wallets/__tests__/test-helpers.d.cts +0 -36
- package/dist/wallets/__tests__/test-helpers.d.ts +0 -36
- package/dist/wallets/__tests__/test-helpers.js +0 -93
- package/dist/wallets/evm.cjs +0 -25
- package/dist/wallets/evm.d.cts +0 -155
- package/dist/wallets/evm.d.ts +0 -155
- package/dist/wallets/evm.js +0 -25
- package/dist/wallets/solana.cjs +0 -26
- package/dist/wallets/solana.d.cts +0 -28
- package/dist/wallets/solana.d.ts +0 -28
- package/dist/wallets/solana.js +0 -26
- package/dist/wallets/stellar.cjs +0 -25
- package/dist/wallets/stellar.d.cts +0 -30
- package/dist/wallets/stellar.d.ts +0 -30
- package/dist/wallets/stellar.js +0 -25
- package/dist/wallets/types.cjs +0 -1
- package/dist/wallets/types.d.cts +0 -170
- package/dist/wallets/types.d.ts +0 -170
- package/dist/wallets/types.js +0 -0
- package/dist/wallets/wallet-factory.cjs +0 -33
- package/dist/wallets/wallet-factory.d.cts +0 -33
- package/dist/wallets/wallet-factory.d.ts +0 -33
- package/dist/wallets/wallet-factory.js +0 -33
- package/dist/wallets/wallet.cjs +0 -24
- package/dist/wallets/wallet.d.cts +0 -168
- package/dist/wallets/wallet.d.ts +0 -168
- package/dist/wallets/wallet.js +0 -24
package/dist/chunk-PM7BGATN.cjs
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkPOG76HDDcjs = require('./chunk-POG76HDD.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkWDZY4PP4cjs = require('./chunk-WDZY4PP4.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _chunkJREZWZ2Scjs = require('./chunk-JREZWZ2S.cjs');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
19
|
-
|
|
20
|
-
// src/wallets/evm.ts
|
|
21
|
-
var _viem = require('viem');
|
|
22
|
-
var _commonsdkbase = require('@crossmint/common-sdk-base');
|
|
23
|
-
var _EVMWallet = class _EVMWallet extends _chunkPOG76HDDcjs.Wallet {
|
|
24
|
-
constructor(wallet) {
|
|
25
|
-
super(
|
|
26
|
-
{
|
|
27
|
-
chain: wallet.chain,
|
|
28
|
-
address: wallet.address,
|
|
29
|
-
owner: wallet.owner,
|
|
30
|
-
signer: wallet.signer,
|
|
31
|
-
options: _chunkPOG76HDDcjs.Wallet.getOptions(wallet),
|
|
32
|
-
alias: wallet.alias
|
|
33
|
-
},
|
|
34
|
-
_chunkPOG76HDDcjs.Wallet.getApiClient(wallet)
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
static from(wallet) {
|
|
38
|
-
if (!_commonsdkbase.isValidEvmAddress.call(void 0, wallet.address)) {
|
|
39
|
-
throw new Error("Wallet is not an EVM wallet");
|
|
40
|
-
}
|
|
41
|
-
return new _EVMWallet(wallet);
|
|
42
|
-
}
|
|
43
|
-
sendTransaction(params) {
|
|
44
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
45
|
-
var _a;
|
|
46
|
-
_chunkJREZWZ2Scjs.walletsLogger.info("evmWallet.sendTransaction.start");
|
|
47
|
-
yield this.preAuthIfNeeded();
|
|
48
|
-
const builtTransaction = this.buildTransaction(params);
|
|
49
|
-
const createdTransaction = yield this.createTransaction(builtTransaction, params.options);
|
|
50
|
-
if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
|
|
51
|
-
_chunkJREZWZ2Scjs.walletsLogger.info("evmWallet.sendTransaction.prepared", {
|
|
52
|
-
transactionId: createdTransaction.id
|
|
53
|
-
});
|
|
54
|
-
return {
|
|
55
|
-
hash: void 0,
|
|
56
|
-
explorerLink: void 0,
|
|
57
|
-
transactionId: createdTransaction.id
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
const result = yield this.approveTransactionAndWait(createdTransaction.id);
|
|
61
|
-
_chunkJREZWZ2Scjs.walletsLogger.info("evmWallet.sendTransaction.success", {
|
|
62
|
-
transactionId: createdTransaction.id,
|
|
63
|
-
hash: result.hash
|
|
64
|
-
});
|
|
65
|
-
return result;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
signMessage(params) {
|
|
69
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
70
|
-
var _a;
|
|
71
|
-
_chunkJREZWZ2Scjs.walletsLogger.info("evmWallet.signMessage.start");
|
|
72
|
-
yield this.preAuthIfNeeded();
|
|
73
|
-
const signatureCreationResponse = yield this.apiClient.createSignature(this.walletLocator, {
|
|
74
|
-
type: "message",
|
|
75
|
-
params: {
|
|
76
|
-
message: params.message,
|
|
77
|
-
signer: this.signer.locator(),
|
|
78
|
-
chain: this.chain
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
if ("error" in signatureCreationResponse) {
|
|
82
|
-
_chunkJREZWZ2Scjs.walletsLogger.error("evmWallet.signMessage.error", { error: signatureCreationResponse });
|
|
83
|
-
throw new (0, _chunkXC2V34TScjs.SignatureNotCreatedError)(JSON.stringify(signatureCreationResponse));
|
|
84
|
-
}
|
|
85
|
-
if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
|
|
86
|
-
_chunkJREZWZ2Scjs.walletsLogger.info("evmWallet.signMessage.prepared", {
|
|
87
|
-
signatureId: signatureCreationResponse.id
|
|
88
|
-
});
|
|
89
|
-
return {
|
|
90
|
-
signature: void 0,
|
|
91
|
-
signatureId: signatureCreationResponse.id
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
|
|
95
|
-
_chunkJREZWZ2Scjs.walletsLogger.info("evmWallet.signMessage.success", { signatureId: signatureCreationResponse.id });
|
|
96
|
-
return result;
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
signTypedData(params) {
|
|
100
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
101
|
-
var _a;
|
|
102
|
-
_chunkJREZWZ2Scjs.walletsLogger.info("evmWallet.signTypedData.start");
|
|
103
|
-
yield this.preAuthIfNeeded();
|
|
104
|
-
const { domain, message, primaryType, types, chain } = params;
|
|
105
|
-
if (!domain || !message || !types || !chain) {
|
|
106
|
-
_chunkJREZWZ2Scjs.walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data" });
|
|
107
|
-
throw new (0, _chunkXC2V34TScjs.InvalidTypedDataError)("Invalid typed data");
|
|
108
|
-
}
|
|
109
|
-
const { name, version, chainId, verifyingContract, salt } = domain;
|
|
110
|
-
if (!name || !version || !chainId || !verifyingContract) {
|
|
111
|
-
_chunkJREZWZ2Scjs.walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data domain" });
|
|
112
|
-
throw new (0, _chunkXC2V34TScjs.InvalidTypedDataError)("Invalid typed data domain");
|
|
113
|
-
}
|
|
114
|
-
const signatureCreationResponse = yield this.apiClient.createSignature(this.walletLocator, {
|
|
115
|
-
type: "typed-data",
|
|
116
|
-
params: {
|
|
117
|
-
typedData: {
|
|
118
|
-
domain: {
|
|
119
|
-
name,
|
|
120
|
-
version,
|
|
121
|
-
chainId: Number(chainId),
|
|
122
|
-
verifyingContract,
|
|
123
|
-
salt
|
|
124
|
-
},
|
|
125
|
-
message,
|
|
126
|
-
primaryType,
|
|
127
|
-
types
|
|
128
|
-
},
|
|
129
|
-
signer: this.signer.locator(),
|
|
130
|
-
chain
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
if ("error" in signatureCreationResponse) {
|
|
134
|
-
_chunkJREZWZ2Scjs.walletsLogger.error("evmWallet.signTypedData.error", { error: signatureCreationResponse });
|
|
135
|
-
throw new (0, _chunkXC2V34TScjs.SignatureNotCreatedError)(JSON.stringify(signatureCreationResponse));
|
|
136
|
-
}
|
|
137
|
-
if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
|
|
138
|
-
_chunkJREZWZ2Scjs.walletsLogger.info("evmWallet.signTypedData.prepared", {
|
|
139
|
-
signatureId: signatureCreationResponse.id
|
|
140
|
-
});
|
|
141
|
-
return {
|
|
142
|
-
signature: void 0,
|
|
143
|
-
signatureId: signatureCreationResponse.id
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
|
|
147
|
-
_chunkJREZWZ2Scjs.walletsLogger.info("evmWallet.signTypedData.success", { signatureId: signatureCreationResponse.id });
|
|
148
|
-
return result;
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Get a Viem public client instance configured for this wallet's chain.
|
|
153
|
-
* @param params - Optional transport configuration
|
|
154
|
-
* @returns A Viem public client
|
|
155
|
-
*/
|
|
156
|
-
getViemClient(params) {
|
|
157
|
-
var _a;
|
|
158
|
-
return _viem.createPublicClient.call(void 0, {
|
|
159
|
-
transport: (_a = params == null ? void 0 : params.transport) != null ? _a : _viem.http.call(void 0, ),
|
|
160
|
-
chain: _chunkWDZY4PP4cjs.toViemChain.call(void 0, this.chain)
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
createTransaction(transaction, options) {
|
|
164
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
165
|
-
var _a;
|
|
166
|
-
const signer = (_a = options == null ? void 0 : options.experimental_signer) != null ? _a : this.signer.locator();
|
|
167
|
-
const transactionCreationResponse = yield this.apiClient.createTransaction(this.walletLocator, {
|
|
168
|
-
params: {
|
|
169
|
-
signer,
|
|
170
|
-
chain: this.chain,
|
|
171
|
-
calls: [transaction]
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
if ("error" in transactionCreationResponse) {
|
|
175
|
-
throw new (0, _chunkXC2V34TScjs.TransactionNotCreatedError)(JSON.stringify(transactionCreationResponse));
|
|
176
|
-
}
|
|
177
|
-
return transactionCreationResponse;
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
buildTransaction(params) {
|
|
181
|
-
var _a, _b, _c, _d, _e;
|
|
182
|
-
if ("transaction" in params) {
|
|
183
|
-
return { transaction: params.transaction };
|
|
184
|
-
}
|
|
185
|
-
if (params.abi == null) {
|
|
186
|
-
return {
|
|
187
|
-
to: params.to,
|
|
188
|
-
value: (_b = (_a = params.value) == null ? void 0 : _a.toString()) != null ? _b : "0",
|
|
189
|
-
data: (_c = params.data) != null ? _c : "0x"
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
if (!params.functionName) {
|
|
193
|
-
throw new Error("Function name is required");
|
|
194
|
-
}
|
|
195
|
-
return {
|
|
196
|
-
to: params.to,
|
|
197
|
-
value: (_e = (_d = params.value) == null ? void 0 : _d.toString()) != null ? _e : "0",
|
|
198
|
-
data: _viem.encodeFunctionData.call(void 0, {
|
|
199
|
-
abi: params.abi,
|
|
200
|
-
functionName: params.functionName,
|
|
201
|
-
args: params.args
|
|
202
|
-
})
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
};
|
|
206
|
-
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
207
|
-
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
208
|
-
logger: _chunkJREZWZ2Scjs.walletsLogger,
|
|
209
|
-
methodName: "evmWallet.sendTransaction",
|
|
210
|
-
buildContext(thisArg) {
|
|
211
|
-
return { chain: thisArg.chain, address: thisArg.address };
|
|
212
|
-
}
|
|
213
|
-
})
|
|
214
|
-
], _EVMWallet.prototype, "sendTransaction", 1);
|
|
215
|
-
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
216
|
-
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
217
|
-
logger: _chunkJREZWZ2Scjs.walletsLogger,
|
|
218
|
-
methodName: "evmWallet.signMessage",
|
|
219
|
-
buildContext(thisArg) {
|
|
220
|
-
return { chain: thisArg.chain, address: thisArg.address };
|
|
221
|
-
}
|
|
222
|
-
})
|
|
223
|
-
], _EVMWallet.prototype, "signMessage", 1);
|
|
224
|
-
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
225
|
-
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
226
|
-
logger: _chunkJREZWZ2Scjs.walletsLogger,
|
|
227
|
-
methodName: "evmWallet.signTypedData",
|
|
228
|
-
buildContext(thisArg) {
|
|
229
|
-
return { chain: thisArg.chain, address: thisArg.address };
|
|
230
|
-
}
|
|
231
|
-
})
|
|
232
|
-
], _EVMWallet.prototype, "signTypedData", 1);
|
|
233
|
-
var EVMWallet = _EVMWallet;
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
exports.EVMWallet = EVMWallet;
|
package/dist/chunk-PO6S7UR3.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|