@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-FICVKSXZ.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_EVENT_OPTIONS,
|
|
3
|
-
NonCustodialSigner
|
|
4
|
-
} from "./chunk-U3NV7UY7.js";
|
|
5
|
-
import {
|
|
6
|
-
walletsLogger
|
|
7
|
-
} from "./chunk-ABMZ3ZVN.js";
|
|
8
|
-
import {
|
|
9
|
-
__async
|
|
10
|
-
} from "./chunk-ASE2FXWP.js";
|
|
11
|
-
|
|
12
|
-
// src/signers/non-custodial/ncs-solana-signer.ts
|
|
13
|
-
import { VersionedTransaction } from "@solana/web3.js";
|
|
14
|
-
import base58 from "bs58";
|
|
15
|
-
var SolanaNonCustodialSigner = class _SolanaNonCustodialSigner extends NonCustodialSigner {
|
|
16
|
-
constructor(config) {
|
|
17
|
-
super(config);
|
|
18
|
-
}
|
|
19
|
-
signMessage() {
|
|
20
|
-
return __async(this, null, function* () {
|
|
21
|
-
return yield Promise.reject(new Error("signMessage method not implemented for email signer"));
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
signTransaction(transaction) {
|
|
25
|
-
return __async(this, null, function* () {
|
|
26
|
-
var _a;
|
|
27
|
-
yield this.handleAuthRequired();
|
|
28
|
-
const jwt = this.getJwtOrThrow();
|
|
29
|
-
const transactionBytes = base58.decode(transaction);
|
|
30
|
-
const deserializedTransaction = VersionedTransaction.deserialize(transactionBytes);
|
|
31
|
-
const messageData = deserializedTransaction.message.serialize();
|
|
32
|
-
walletsLogger.info("sign: sending request", { keyType: "ed25519" });
|
|
33
|
-
const startTime = Date.now();
|
|
34
|
-
const res = yield (_a = this.config.clientTEEConnection) == null ? void 0 : _a.sendAction({
|
|
35
|
-
event: "request:sign",
|
|
36
|
-
responseEvent: "response:sign",
|
|
37
|
-
data: {
|
|
38
|
-
authData: {
|
|
39
|
-
jwt,
|
|
40
|
-
apiKey: this.config.crossmint.apiKey
|
|
41
|
-
},
|
|
42
|
-
data: {
|
|
43
|
-
keyType: "ed25519",
|
|
44
|
-
bytes: base58.encode(messageData),
|
|
45
|
-
encoding: "base58"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
options: DEFAULT_EVENT_OPTIONS
|
|
49
|
-
});
|
|
50
|
-
walletsLogger.info("sign: response received", {
|
|
51
|
-
status: res == null ? void 0 : res.status,
|
|
52
|
-
durationMs: Date.now() - startTime
|
|
53
|
-
});
|
|
54
|
-
if ((res == null ? void 0 : res.status) === "error") {
|
|
55
|
-
throw new Error(res.error);
|
|
56
|
-
}
|
|
57
|
-
if ((res == null ? void 0 : res.signature) == null) {
|
|
58
|
-
throw new Error("Failed to sign transaction");
|
|
59
|
-
}
|
|
60
|
-
_SolanaNonCustodialSigner.verifyPublicKeyFormat(res.publicKey);
|
|
61
|
-
return { signature: res.signature.bytes };
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
static verifyPublicKeyFormat(publicKey) {
|
|
65
|
-
if (publicKey == null) {
|
|
66
|
-
throw new Error("No public key found");
|
|
67
|
-
}
|
|
68
|
-
if (publicKey.encoding !== "base58" || publicKey.keyType !== "ed25519" || publicKey.bytes == null) {
|
|
69
|
-
throw new Error(
|
|
70
|
-
"Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: " + JSON.stringify(publicKey)
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
getChainKeyParams() {
|
|
75
|
-
return {
|
|
76
|
-
scheme: "ed25519",
|
|
77
|
-
encoding: "base58"
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export {
|
|
83
|
-
SolanaNonCustodialSigner
|
|
84
|
-
};
|
package/dist/chunk-FOOISYCJ.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__async
|
|
3
|
-
} from "./chunk-ASE2FXWP.js";
|
|
4
|
-
|
|
5
|
-
// src/signers/non-custodial/ncs-iframe-manager.ts
|
|
6
|
-
import { IFrameWindow, SignersWindowTransport } from "@crossmint/client-sdk-window";
|
|
7
|
-
import { environmentUrlConfig, signerInboundEvents, signerOutboundEvents } from "@crossmint/client-signers";
|
|
8
|
-
var NcsIframeManager = class {
|
|
9
|
-
constructor(config) {
|
|
10
|
-
this.config = config;
|
|
11
|
-
this.handshakeParent = null;
|
|
12
|
-
}
|
|
13
|
-
initialize() {
|
|
14
|
-
return __async(this, null, function* () {
|
|
15
|
-
if (this.handshakeParent) {
|
|
16
|
-
return this.handshakeParent;
|
|
17
|
-
}
|
|
18
|
-
console.info("Initializing signers frame for the first time");
|
|
19
|
-
const t0 = Date.now();
|
|
20
|
-
const iframeUrl = new URL(environmentUrlConfig[this.config.environment]);
|
|
21
|
-
iframeUrl.searchParams.set("targetOrigin", window.location.origin);
|
|
22
|
-
const iframeElement = yield this.createInvisibleIFrame(iframeUrl.toString());
|
|
23
|
-
this.handshakeParent = yield IFrameWindow.init(
|
|
24
|
-
iframeElement,
|
|
25
|
-
{
|
|
26
|
-
targetOrigin: iframeUrl.origin,
|
|
27
|
-
incomingEvents: signerOutboundEvents,
|
|
28
|
-
outgoingEvents: signerInboundEvents,
|
|
29
|
-
handshakeOptions: {
|
|
30
|
-
timeoutMs: 3e4,
|
|
31
|
-
intervalMs: 100
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
SignersWindowTransport
|
|
35
|
-
);
|
|
36
|
-
yield this.handshakeParent.handshakeWithChild();
|
|
37
|
-
console.info(`Signers frame initialized in ${Date.now() - t0}ms`);
|
|
38
|
-
return this.handshakeParent;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
createInvisibleIFrame(url) {
|
|
42
|
-
return __async(this, null, function* () {
|
|
43
|
-
const iframe = document.createElement("iframe");
|
|
44
|
-
iframe.src = url;
|
|
45
|
-
Object.assign(iframe.style, {
|
|
46
|
-
position: "absolute",
|
|
47
|
-
opacity: "0",
|
|
48
|
-
pointerEvents: "none",
|
|
49
|
-
width: "0",
|
|
50
|
-
height: "0",
|
|
51
|
-
border: "none",
|
|
52
|
-
top: "-9999px",
|
|
53
|
-
left: "-9999px"
|
|
54
|
-
});
|
|
55
|
-
return new Promise((resolve, reject) => {
|
|
56
|
-
iframe.onload = () => resolve(iframe);
|
|
57
|
-
iframe.onerror = () => reject(new Error("Failed to load iframe content"));
|
|
58
|
-
document.body.appendChild(iframe);
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export {
|
|
65
|
-
NcsIframeManager
|
|
66
|
-
};
|
package/dist/chunk-G6QJHFSY.cjs
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/api/__tests__/constants.ts
|
|
2
|
-
var HTTP_ERROR_STATUSES = [
|
|
3
|
-
{ status: 400, message: "Bad Request" },
|
|
4
|
-
{ status: 401, message: "Unauthorized" },
|
|
5
|
-
{ status: 403, message: "Forbidden" },
|
|
6
|
-
{ status: 404, message: "Not Found" },
|
|
7
|
-
{ status: 429, message: "Rate limit exceeded" },
|
|
8
|
-
{ status: 500, message: "Internal server error" },
|
|
9
|
-
{ status: 502, message: "Bad Gateway" },
|
|
10
|
-
{ status: 503, message: "Service Unavailable" }
|
|
11
|
-
];
|
|
12
|
-
var WALLET_LOCATORS = {
|
|
13
|
-
evmSmart: "me:evm:smart",
|
|
14
|
-
evmMpc: "me:evm:mpc",
|
|
15
|
-
solanaSmart: "me:solana:smart",
|
|
16
|
-
solanaAddress: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
|
|
17
|
-
evmAddress: "0x1234567890123456789012345678901234567890",
|
|
18
|
-
evmAddressWithSpecialChars: "0xABCDEFabcdef0123456789ABCDEFabcdef012345"
|
|
19
|
-
};
|
|
20
|
-
var TOKEN_LOCATORS = {
|
|
21
|
-
eth: "base-sepolia:eth",
|
|
22
|
-
usdc: "base-sepolia:usdc",
|
|
23
|
-
sol: "solana:sol",
|
|
24
|
-
customContract: "base-sepolia:0x1234567890123456789012345678901234567890",
|
|
25
|
-
tokenWithSpecialChars: "base-sepolia:0xABCDEFabcdef0123456789ABCDEFabcdef012345"
|
|
26
|
-
};
|
|
27
|
-
var TIMEOUT_SHORT = 3e4;
|
|
28
|
-
var TIMEOUT_MEDIUM = 6e4;
|
|
29
|
-
var TIMEOUT_LONG = 12e4;
|
|
30
|
-
var DELAY_SHORT = 200;
|
|
31
|
-
var DELAY_MEDIUM = 500;
|
|
32
|
-
var DELAY_LONG = 1e3;
|
|
33
|
-
var DELAY_RATE_LIMIT_WINDOW = 2e3;
|
|
34
|
-
var TEST_ADDRESSES = {
|
|
35
|
-
EVM_ADMIN_SIGNER: "0xe5E91D9b21C3563011cc332B050150fb9211bBEB",
|
|
36
|
-
SOLANA_ADMIN_SIGNER: "CsHuaddA9J8j9vSTdL9wpvBsyjYe4F7iQQLuPg3EUqsU",
|
|
37
|
-
EVM_RECIPIENT: "0xDF8b5F9c19E187f1Ea00730a1e46180152244315",
|
|
38
|
-
EVM_NON_EXISTENT: "0x0000000000000000000000000000000000000000",
|
|
39
|
-
EVM_TEST: "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"
|
|
40
|
-
};
|
|
41
|
-
var TEST_VALUES = {
|
|
42
|
-
FUNDING_AMOUNT_SMALL: 1,
|
|
43
|
-
FUNDING_AMOUNT_LARGE: 10,
|
|
44
|
-
SEND_AMOUNT_SMALL: "0.0001",
|
|
45
|
-
SEND_AMOUNT_VERY_SMALL: "0.000000000000000001",
|
|
46
|
-
SEND_AMOUNT_ZERO: "0",
|
|
47
|
-
SEND_AMOUNT_INVALID: "999999999999999999.0",
|
|
48
|
-
SEND_AMOUNT_EXTREME: "999999999999999999999999999999.999999999999999999",
|
|
49
|
-
LONG_STRING_LENGTH: 1e4,
|
|
50
|
-
CONCURRENT_REQUESTS: 3,
|
|
51
|
-
RAPID_SEQUENTIAL_COUNT: 3,
|
|
52
|
-
RATE_LIMIT_BATCH_SIZE: 5,
|
|
53
|
-
RATE_LIMIT_BATCHES: 3,
|
|
54
|
-
RATE_LIMIT_RAPID_COUNT: 20,
|
|
55
|
-
RATE_LIMIT_STRESS_COUNT: 50,
|
|
56
|
-
APPROVE_TRANSACTION_MAX_RETRIES: 10
|
|
57
|
-
};
|
|
58
|
-
var MOCK_API_KEY = "ck_development_A61UZQnvjSQcM5qVBaBactgqebxafWAVsNdD2xLkgBxoYuH5q2guM8r9DUmZQzE1WYyoByGVYpEG2o9gVSzAZFsrLbfKGERUJ6D5CW6S9AsJGAc3ctgrsD4n2ioekzGj7KPbLwT3SysDjMamYXLxEroUbQSdwf6aLF4zeEpECq2crkTUQeLFzxzmjWNxFDHFYefDrfrFPCURvBXJLf5pCxCQ";
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
exports.HTTP_ERROR_STATUSES = HTTP_ERROR_STATUSES; exports.WALLET_LOCATORS = WALLET_LOCATORS; exports.TOKEN_LOCATORS = TOKEN_LOCATORS; exports.TIMEOUT_SHORT = TIMEOUT_SHORT; exports.TIMEOUT_MEDIUM = TIMEOUT_MEDIUM; exports.TIMEOUT_LONG = TIMEOUT_LONG; exports.DELAY_SHORT = DELAY_SHORT; exports.DELAY_MEDIUM = DELAY_MEDIUM; exports.DELAY_LONG = DELAY_LONG; exports.DELAY_RATE_LIMIT_WINDOW = DELAY_RATE_LIMIT_WINDOW; exports.TEST_ADDRESSES = TEST_ADDRESSES; exports.TEST_VALUES = TEST_VALUES; exports.MOCK_API_KEY = MOCK_API_KEY;
|
package/dist/chunk-HTSQPZHW.cjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/chains/definitions/arcTestnet.ts
|
|
2
|
-
var _viem = require('viem');
|
|
3
|
-
var arcTestnet = _viem.defineChain.call(void 0, {
|
|
4
|
-
id: 5042002,
|
|
5
|
-
name: "Arc Testnet",
|
|
6
|
-
nativeCurrency: {
|
|
7
|
-
decimals: 6,
|
|
8
|
-
name: "USDC",
|
|
9
|
-
symbol: "USDC"
|
|
10
|
-
},
|
|
11
|
-
rpcUrls: {
|
|
12
|
-
default: { http: ["https://rpc.testnet.arc.network"] }
|
|
13
|
-
},
|
|
14
|
-
blockExplorers: {
|
|
15
|
-
default: {
|
|
16
|
-
name: "Arc Testnet Explorer",
|
|
17
|
-
url: "https://testnet.arcscan.app"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
testnet: true
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
exports.arcTestnet = arcTestnet;
|
package/dist/chunk-HXJ3YPAN.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Wallet
|
|
3
|
-
} from "./chunk-FHMKNG62.js";
|
|
4
|
-
import {
|
|
5
|
-
TransactionNotCreatedError
|
|
6
|
-
} from "./chunk-SGINWAB6.js";
|
|
7
|
-
import {
|
|
8
|
-
walletsLogger
|
|
9
|
-
} from "./chunk-ABMZ3ZVN.js";
|
|
10
|
-
import {
|
|
11
|
-
__async,
|
|
12
|
-
__decorateClass
|
|
13
|
-
} from "./chunk-ASE2FXWP.js";
|
|
14
|
-
|
|
15
|
-
// src/wallets/stellar.ts
|
|
16
|
-
import { isValidStellarAddress, WithLoggerContext } from "@crossmint/common-sdk-base";
|
|
17
|
-
var _StellarWallet = class _StellarWallet extends Wallet {
|
|
18
|
-
constructor(wallet) {
|
|
19
|
-
super(
|
|
20
|
-
{
|
|
21
|
-
chain: wallet.chain,
|
|
22
|
-
address: wallet.address,
|
|
23
|
-
owner: wallet.owner,
|
|
24
|
-
signer: wallet.signer,
|
|
25
|
-
options: Wallet.getOptions(wallet),
|
|
26
|
-
alias: wallet.alias
|
|
27
|
-
},
|
|
28
|
-
Wallet.getApiClient(wallet)
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
static from(wallet) {
|
|
32
|
-
if (!isValidStellarAddress(wallet.address)) {
|
|
33
|
-
throw new Error("Wallet is not a Stellar wallet");
|
|
34
|
-
}
|
|
35
|
-
return new _StellarWallet(wallet);
|
|
36
|
-
}
|
|
37
|
-
sendTransaction(params) {
|
|
38
|
-
return __async(this, null, function* () {
|
|
39
|
-
var _a;
|
|
40
|
-
walletsLogger.info("stellarWallet.sendTransaction.start");
|
|
41
|
-
yield this.preAuthIfNeeded();
|
|
42
|
-
const createdTransaction = yield this.createTransaction(params);
|
|
43
|
-
if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
|
|
44
|
-
walletsLogger.info("stellarWallet.sendTransaction.prepared", {
|
|
45
|
-
transactionId: createdTransaction.id
|
|
46
|
-
});
|
|
47
|
-
return {
|
|
48
|
-
hash: void 0,
|
|
49
|
-
explorerLink: void 0,
|
|
50
|
-
transactionId: createdTransaction.id
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
const options = {};
|
|
54
|
-
const result = yield this.approveTransactionAndWait(createdTransaction.id, options);
|
|
55
|
-
walletsLogger.info("stellarWallet.sendTransaction.success", {
|
|
56
|
-
transactionId: createdTransaction.id,
|
|
57
|
-
hash: result.hash
|
|
58
|
-
});
|
|
59
|
-
return result;
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
createTransaction(params) {
|
|
63
|
-
return __async(this, null, function* () {
|
|
64
|
-
var _a;
|
|
65
|
-
const { contractId, options } = params;
|
|
66
|
-
const signer = (_a = options == null ? void 0 : options.experimental_signer) != null ? _a : this.signer.locator();
|
|
67
|
-
let transaction;
|
|
68
|
-
if ("transaction" in params) {
|
|
69
|
-
transaction = {
|
|
70
|
-
type: "serialized-transaction",
|
|
71
|
-
serializedTransaction: params.transaction,
|
|
72
|
-
contractId
|
|
73
|
-
};
|
|
74
|
-
} else {
|
|
75
|
-
const { method, memo, args } = params;
|
|
76
|
-
transaction = {
|
|
77
|
-
type: "contract-call",
|
|
78
|
-
contractId,
|
|
79
|
-
method,
|
|
80
|
-
memo: memo != null ? { type: "text", value: memo } : void 0,
|
|
81
|
-
args
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
const transactionCreationResponse = yield this.apiClient.createTransaction(this.walletLocator, {
|
|
85
|
-
params: {
|
|
86
|
-
transaction,
|
|
87
|
-
signer
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
if ("error" in transactionCreationResponse) {
|
|
91
|
-
throw new TransactionNotCreatedError(JSON.stringify(transactionCreationResponse));
|
|
92
|
-
}
|
|
93
|
-
return transactionCreationResponse;
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
__decorateClass([
|
|
98
|
-
WithLoggerContext({
|
|
99
|
-
logger: walletsLogger,
|
|
100
|
-
methodName: "stellarWallet.sendTransaction",
|
|
101
|
-
buildContext(thisArg) {
|
|
102
|
-
return { chain: thisArg.chain, address: thisArg.address };
|
|
103
|
-
}
|
|
104
|
-
})
|
|
105
|
-
], _StellarWallet.prototype, "sendTransaction", 1);
|
|
106
|
-
var StellarWallet = _StellarWallet;
|
|
107
|
-
|
|
108
|
-
export {
|
|
109
|
-
StellarWallet
|
|
110
|
-
};
|
package/dist/chunk-IDKGJO2G.cjs
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
-
|
|
3
|
-
var _chunkPOG76HDDcjs = require('./chunk-POG76HDD.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkQ5KNPVYIcjs = require('./chunk-Q5KNPVYI.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _chunkJREZWZ2Scjs = require('./chunk-JREZWZ2S.cjs');
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
17
|
-
|
|
18
|
-
// src/wallets/solana.ts
|
|
19
|
-
var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);
|
|
20
|
-
var _commonsdkbase = require('@crossmint/common-sdk-base');
|
|
21
|
-
var _SolanaWallet = class _SolanaWallet extends _chunkPOG76HDDcjs.Wallet {
|
|
22
|
-
constructor(wallet) {
|
|
23
|
-
super(
|
|
24
|
-
{
|
|
25
|
-
chain: wallet.chain,
|
|
26
|
-
address: wallet.address,
|
|
27
|
-
owner: wallet.owner,
|
|
28
|
-
signer: wallet.signer,
|
|
29
|
-
options: _chunkPOG76HDDcjs.Wallet.getOptions(wallet),
|
|
30
|
-
alias: wallet.alias
|
|
31
|
-
},
|
|
32
|
-
_chunkPOG76HDDcjs.Wallet.getApiClient(wallet)
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
static from(wallet) {
|
|
36
|
-
if (!_commonsdkbase.isValidSolanaAddress.call(void 0, wallet.address)) {
|
|
37
|
-
throw new Error("Wallet is not a Solana wallet");
|
|
38
|
-
}
|
|
39
|
-
return new _SolanaWallet(wallet);
|
|
40
|
-
}
|
|
41
|
-
sendTransaction(params) {
|
|
42
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
43
|
-
var _a, _b;
|
|
44
|
-
_chunkJREZWZ2Scjs.walletsLogger.info("solanaWallet.sendTransaction.start");
|
|
45
|
-
yield this.preAuthIfNeeded();
|
|
46
|
-
const createdTransaction = yield this.createTransaction(params);
|
|
47
|
-
if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
|
|
48
|
-
_chunkJREZWZ2Scjs.walletsLogger.info("solanaWallet.sendTransaction.prepared", {
|
|
49
|
-
transactionId: createdTransaction.id
|
|
50
|
-
});
|
|
51
|
-
return {
|
|
52
|
-
hash: void 0,
|
|
53
|
-
explorerLink: void 0,
|
|
54
|
-
transactionId: createdTransaction.id
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
const _additionalSigners = (_b = params.additionalSigners) == null ? void 0 : _b.map(
|
|
58
|
-
(signer) => new (0, _chunkQ5KNPVYIcjs.SolanaExternalWalletSigner)({
|
|
59
|
-
type: "external-wallet",
|
|
60
|
-
address: signer.publicKey.toString(),
|
|
61
|
-
locator: `external-wallet:${signer.publicKey.toString()}`,
|
|
62
|
-
onSignTransaction: (transaction) => {
|
|
63
|
-
transaction.sign([signer]);
|
|
64
|
-
return Promise.resolve(transaction);
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
);
|
|
68
|
-
const options = {
|
|
69
|
-
additionalSigners: _additionalSigners
|
|
70
|
-
};
|
|
71
|
-
const result = yield this.approveTransactionAndWait(createdTransaction.id, options);
|
|
72
|
-
_chunkJREZWZ2Scjs.walletsLogger.info("solanaWallet.sendTransaction.success", {
|
|
73
|
-
transactionId: createdTransaction.id,
|
|
74
|
-
hash: result.hash
|
|
75
|
-
});
|
|
76
|
-
return result;
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
createTransaction(params) {
|
|
80
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
81
|
-
var _a, _b;
|
|
82
|
-
const signer = (_b = (_a = params.options) == null ? void 0 : _a.experimental_signer) != null ? _b : this.signer.locator();
|
|
83
|
-
let serializedTransaction;
|
|
84
|
-
if ("serializedTransaction" in params) {
|
|
85
|
-
serializedTransaction = params.serializedTransaction;
|
|
86
|
-
} else {
|
|
87
|
-
serializedTransaction = _bs582.default.encode(params.transaction.serialize());
|
|
88
|
-
}
|
|
89
|
-
const transactionCreationResponse = yield this.apiClient.createTransaction(this.walletLocator, {
|
|
90
|
-
params: {
|
|
91
|
-
transaction: serializedTransaction,
|
|
92
|
-
signer
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
if ("error" in transactionCreationResponse) {
|
|
96
|
-
throw new (0, _chunkXC2V34TScjs.TransactionNotCreatedError)(JSON.stringify(transactionCreationResponse));
|
|
97
|
-
}
|
|
98
|
-
return transactionCreationResponse;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
103
|
-
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
104
|
-
logger: _chunkJREZWZ2Scjs.walletsLogger,
|
|
105
|
-
methodName: "solanaWallet.sendTransaction",
|
|
106
|
-
buildContext(thisArg) {
|
|
107
|
-
return { chain: thisArg.chain, address: thisArg.address };
|
|
108
|
-
}
|
|
109
|
-
})
|
|
110
|
-
], _SolanaWallet.prototype, "sendTransaction", 1);
|
|
111
|
-
var SolanaWallet = _SolanaWallet;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
exports.SolanaWallet = SolanaWallet;
|
package/dist/chunk-IOMKHF6R.cjs
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
4
|
-
|
|
5
|
-
// src/signers/stellar-external-wallet.ts
|
|
6
|
-
var StellarExternalWalletSigner = class {
|
|
7
|
-
constructor(config) {
|
|
8
|
-
this.config = config;
|
|
9
|
-
this.type = "external-wallet";
|
|
10
|
-
if (config.address == null) {
|
|
11
|
-
throw new Error("Please provide an address for the External Wallet Signer");
|
|
12
|
-
}
|
|
13
|
-
this._address = config.address;
|
|
14
|
-
this.onSignStellarTransaction = config.onSignStellarTransaction;
|
|
15
|
-
}
|
|
16
|
-
address() {
|
|
17
|
-
return this._address;
|
|
18
|
-
}
|
|
19
|
-
locator() {
|
|
20
|
-
return this.config.locator;
|
|
21
|
-
}
|
|
22
|
-
signMessage() {
|
|
23
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
24
|
-
return yield Promise.reject(new Error("signMessage method not implemented for stellar external wallet signer"));
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
signTransaction(payload) {
|
|
28
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
29
|
-
if (this.onSignStellarTransaction == null) {
|
|
30
|
-
return yield Promise.reject(
|
|
31
|
-
new Error(
|
|
32
|
-
"onSignStellarTransaction method is required to sign transactions with a Stellar external wallet"
|
|
33
|
-
)
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
const signedTx = yield this.onSignStellarTransaction(payload);
|
|
37
|
-
return { signature: signedTx };
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
exports.StellarExternalWalletSigner = StellarExternalWalletSigner;
|
package/dist/chunk-IPO25BCU.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__async
|
|
3
|
-
} from "./chunk-ASE2FXWP.js";
|
|
4
|
-
|
|
5
|
-
// src/signers/passkey.ts
|
|
6
|
-
import { WebAuthnP256 } from "ox";
|
|
7
|
-
var PasskeySigner = class {
|
|
8
|
-
constructor(config) {
|
|
9
|
-
this.config = config;
|
|
10
|
-
this.type = "passkey";
|
|
11
|
-
this.id = config.id;
|
|
12
|
-
}
|
|
13
|
-
locator() {
|
|
14
|
-
return this.config.locator;
|
|
15
|
-
}
|
|
16
|
-
signMessage(message) {
|
|
17
|
-
return __async(this, null, function* () {
|
|
18
|
-
if (this.config.onSignWithPasskey) {
|
|
19
|
-
return yield this.config.onSignWithPasskey(message);
|
|
20
|
-
}
|
|
21
|
-
const { signature, metadata } = yield WebAuthnP256.sign({
|
|
22
|
-
credentialId: this.id,
|
|
23
|
-
challenge: message
|
|
24
|
-
});
|
|
25
|
-
return {
|
|
26
|
-
signature: {
|
|
27
|
-
r: `0x${signature.r.toString(16)}`,
|
|
28
|
-
s: `0x${signature.s.toString(16)}`
|
|
29
|
-
},
|
|
30
|
-
metadata
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
signTransaction(transaction) {
|
|
35
|
-
return __async(this, null, function* () {
|
|
36
|
-
return yield this.signMessage(transaction);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export {
|
|
42
|
-
PasskeySigner
|
|
43
|
-
};
|
package/dist/chunk-JREZWZ2S.cjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkR4AW5ADGcjs = require('./chunk-R4AW5ADG.cjs');
|
|
5
|
-
|
|
6
|
-
// src/logger/init.ts
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _commonsdkbase = require('@crossmint/common-sdk-base');
|
|
14
|
-
var walletsLogger = new (0, _commonsdkbase.SdkLogger)();
|
|
15
|
-
function initWalletsLogger(apiKey) {
|
|
16
|
-
const platform = _commonsdkbase.detectPlatform.call(void 0, );
|
|
17
|
-
const validationResult = _commonsdkbase.validateAPIKey.call(void 0, apiKey);
|
|
18
|
-
if (!validationResult.isValid) {
|
|
19
|
-
throw new Error(`Invalid API key: ${validationResult.message}`);
|
|
20
|
-
}
|
|
21
|
-
const { environment, projectId } = validationResult;
|
|
22
|
-
walletsLogger.init({
|
|
23
|
-
packageName: _chunkR4AW5ADGcjs.SDK_NAME,
|
|
24
|
-
packageVersion: _chunkR4AW5ADGcjs.SDK_VERSION,
|
|
25
|
-
environment,
|
|
26
|
-
projectId,
|
|
27
|
-
platform
|
|
28
|
-
});
|
|
29
|
-
switch (platform) {
|
|
30
|
-
case "browser": {
|
|
31
|
-
const sink = new (0, _commonsdkbase.BrowserDatadogSink)(environment);
|
|
32
|
-
walletsLogger.addSink(sink);
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
case "react-native": {
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
case "server": {
|
|
39
|
-
const sink = new (0, _commonsdkbase.ServerDatadogSink)(environment);
|
|
40
|
-
walletsLogger.addSink(sink);
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
default: {
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
exports.walletsLogger = walletsLogger; exports.initWalletsLogger = initWalletsLogger;
|
package/dist/chunk-JSWTGW46.cjs
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
4
|
-
|
|
5
|
-
// src/signers/evm-api-key.ts
|
|
6
|
-
var EVMApiKeySigner = class {
|
|
7
|
-
constructor(config) {
|
|
8
|
-
this.config = config;
|
|
9
|
-
this.type = "api-key";
|
|
10
|
-
}
|
|
11
|
-
locator() {
|
|
12
|
-
return this.config.locator;
|
|
13
|
-
}
|
|
14
|
-
signMessage() {
|
|
15
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
16
|
-
return yield Promise.reject(
|
|
17
|
-
new Error(
|
|
18
|
-
"API key signers do not support direct message signing - signatures are handled automatically by the backend"
|
|
19
|
-
)
|
|
20
|
-
);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
signTransaction() {
|
|
24
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
25
|
-
return yield Promise.reject(
|
|
26
|
-
new Error(
|
|
27
|
-
"API key signers do not support direct transaction signing - transaction are handled automatically by the backend"
|
|
28
|
-
)
|
|
29
|
-
);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
exports.EVMApiKeySigner = EVMApiKeySigner;
|
package/dist/chunk-JWMQALLN.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// src/chains/definitions/tempoTestnet.ts
|
|
2
|
-
import { defineChain } from "viem";
|
|
3
|
-
var tempoTestnet = defineChain({
|
|
4
|
-
id: 42431,
|
|
5
|
-
name: "Tempo Testnet",
|
|
6
|
-
nativeCurrency: void 0,
|
|
7
|
-
rpcUrls: {
|
|
8
|
-
default: { http: ["https://rpc.moderato.tempo.xyz"] }
|
|
9
|
-
},
|
|
10
|
-
blockExplorers: {
|
|
11
|
-
default: {
|
|
12
|
-
name: "Tempo Explorer",
|
|
13
|
-
url: "https://explore.tempo.xyz"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
testnet: true
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
tempoTestnet
|
|
21
|
-
};
|
package/dist/chunk-KBJA7JDT.js
DELETED
|
File without changes
|