@crossmint/wallets-sdk 0.18.2 → 0.18.4
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/client.cjs +9 -1
- package/dist/api/client.d.cts +4 -4
- package/dist/api/client.d.ts +4 -4
- package/dist/api/client.js +9 -1
- package/dist/api/gen/client.gen.cjs +7 -1
- package/dist/api/gen/client.gen.js +7 -1
- package/dist/api/gen/index.cjs +179 -1
- package/dist/api/gen/index.js +179 -1
- package/dist/api/gen/sdk.gen.cjs +178 -1
- package/dist/api/gen/sdk.gen.js +178 -1
- package/dist/api/gen/types.gen.js +1 -1
- package/dist/api/index.cjs +11 -1
- package/dist/api/index.d.cts +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +11 -1
- package/dist/api/types.d.cts +4 -2
- package/dist/api/types.d.ts +4 -2
- package/dist/api/types.js +1 -1
- package/dist/chains/chains.cjs +9 -1
- package/dist/chains/chains.js +9 -1
- package/dist/chains/definitions/story.cjs +7 -1
- package/dist/chains/definitions/story.js +7 -1
- package/dist/chains/definitions/storyTestnet.cjs +7 -1
- package/dist/chains/definitions/storyTestnet.js +7 -1
- package/dist/chunk-2DHIAP2S.js +58 -0
- package/dist/chunk-2T5HHKUI.js +19 -0
- package/dist/chunk-2VOEAAFA.cjs +200 -0
- package/dist/chunk-3U6UAYOV.js +25 -0
- package/dist/chunk-4BMNDPJ4.cjs +92 -0
- package/dist/chunk-4QGBVHV3.js +629 -0
- package/dist/chunk-55V4VMTX.cjs +25 -0
- package/dist/chunk-5H5YHSCK.js +200 -0
- package/dist/chunk-7ECQJFYM.cjs +63 -0
- package/dist/chunk-7GHQBCRV.cjs +57 -0
- package/dist/chunk-7JFVG4IY.js +59 -0
- package/dist/chunk-7QL5JVK4.js +262 -0
- package/dist/chunk-AJCWEEWH.js +73 -0
- package/dist/chunk-AL77JANE.js +36 -0
- package/dist/chunk-BAHU3KZE.cjs +75 -0
- package/dist/chunk-BAULM7A2.js +289 -0
- package/dist/chunk-BFAU2NL6.js +175 -0
- package/dist/chunk-BSC55MYK.cjs +43 -0
- package/dist/chunk-CHGPNMRL.cjs +36 -0
- package/dist/chunk-CN2GVFBU.cjs +138 -0
- package/dist/chunk-COVOGZ4S.js +80 -0
- package/dist/chunk-DPERJZBG.js +63 -0
- package/dist/chunk-DQCXGBZM.js +59 -0
- package/dist/chunk-E4LJ7252.cjs +289 -0
- package/dist/chunk-EM6H7EUU.cjs +80 -0
- package/dist/chunk-EYJQSDDI.js +43 -0
- package/dist/chunk-FAGFW4AR.js +16 -0
- package/dist/chunk-FK23BDCU.js +87 -0
- package/dist/chunk-FPMW7Q5O.js +55 -0
- package/dist/chunk-G5NYLGM5.cjs +55 -0
- package/dist/chunk-HHDDI3CS.js +75 -0
- package/dist/chunk-HNRM45KF.cjs +87 -0
- package/dist/chunk-JICSSJOK.js +57 -0
- package/dist/chunk-KS63YEQ4.js +138 -0
- package/dist/chunk-KT3CVXFG.js +9 -0
- package/dist/chunk-LLFD22UQ.cjs +36 -0
- package/dist/chunk-MPGPBFUZ.cjs +16 -0
- package/dist/chunk-MYKPHXUR.cjs +629 -0
- package/dist/chunk-MZBFXUHT.js +63 -0
- package/dist/chunk-NIBKCMQ2.cjs +19 -0
- package/dist/chunk-OD5RGQ4Z.js +92 -0
- package/dist/chunk-PSPNZEG4.cjs +175 -0
- package/dist/chunk-R2OY54EJ.cjs +59 -0
- package/dist/chunk-RHR6P2KP.cjs +15 -0
- package/dist/chunk-RSPJPRQW.cjs +262 -0
- package/dist/chunk-RTRDZB52.js +778 -0
- package/dist/chunk-SG7WIZLK.cjs +63 -0
- package/dist/chunk-SGINWAB6.js +155 -0
- package/dist/chunk-TK3EUCQ4.cjs +59 -0
- package/dist/chunk-V3QJQUT7.cjs +778 -0
- package/dist/chunk-WC7T2CR4.js +44 -0
- package/dist/chunk-WJUPOCKJ.js +15 -0
- package/dist/chunk-XC2V34TS.cjs +155 -0
- package/dist/chunk-XH3ARVJG.cjs +58 -0
- package/dist/chunk-YBA7WO32.cjs +44 -0
- package/dist/chunk-YOJETSLN.cjs +73 -0
- package/dist/chunk-ZT7EGOCI.cjs +9 -0
- package/dist/chunk-ZTGRDOOH.js +36 -0
- package/dist/index.cjs +55 -1
- package/dist/index.js +55 -1
- package/dist/sdk.cjs +31 -1
- package/dist/sdk.js +31 -1
- package/dist/signers/evm-api-key.cjs +7 -1
- package/dist/signers/evm-api-key.js +7 -1
- package/dist/signers/evm-external-wallet.cjs +7 -1
- package/dist/signers/evm-external-wallet.js +7 -1
- package/dist/signers/index.cjs +21 -1
- package/dist/signers/index.js +21 -1
- package/dist/signers/non-custodial/index.cjs +24 -1
- package/dist/signers/non-custodial/index.js +24 -1
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +10 -1
- package/dist/signers/non-custodial/ncs-evm-signer.js +10 -1
- package/dist/signers/non-custodial/ncs-iframe-manager.cjs +7 -1
- package/dist/signers/non-custodial/ncs-iframe-manager.js +7 -1
- package/dist/signers/non-custodial/ncs-signer.cjs +11 -1
- package/dist/signers/non-custodial/ncs-signer.js +11 -1
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +10 -1
- package/dist/signers/non-custodial/ncs-solana-signer.js +10 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +10 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.js +10 -1
- package/dist/signers/passkey.cjs +7 -1
- package/dist/signers/passkey.js +7 -1
- package/dist/signers/solana-api-key.cjs +7 -1
- package/dist/signers/solana-api-key.js +7 -1
- package/dist/signers/solana-external-wallet.cjs +8 -1
- package/dist/signers/solana-external-wallet.js +8 -1
- package/dist/signers/stellar-external-wallet.cjs +7 -1
- package/dist/signers/stellar-external-wallet.js +7 -1
- package/dist/signers/types.cjs +9 -1
- package/dist/signers/types.js +9 -1
- package/dist/utils/constants.cjs +13 -1
- package/dist/utils/constants.js +13 -1
- package/dist/utils/errors.cjs +55 -1
- package/dist/utils/errors.js +55 -1
- package/dist/utils/signer-validation.cjs +8 -1
- package/dist/utils/signer-validation.js +8 -1
- package/dist/wallets/evm.cjs +20 -1
- package/dist/wallets/evm.js +20 -1
- package/dist/wallets/solana.cjs +18 -1
- package/dist/wallets/solana.js +18 -1
- package/dist/wallets/stellar.cjs +17 -1
- package/dist/wallets/stellar.js +17 -1
- package/dist/wallets/wallet-factory.cjs +25 -1
- package/dist/wallets/wallet-factory.js +25 -1
- package/dist/wallets/wallet.cjs +16 -1
- package/dist/wallets/wallet.d.cts +12 -1
- package/dist/wallets/wallet.d.ts +12 -1
- package/dist/wallets/wallet.js +16 -1
- package/package.json +4 -4
- package/dist/chunk-23ZHV3VD.js +0 -1
- package/dist/chunk-2SHDBC47.js +0 -1
- package/dist/chunk-2XVV7Z43.cjs +0 -1
- package/dist/chunk-2YH3NVVK.cjs +0 -1
- package/dist/chunk-3APSOOE3.js +0 -1
- package/dist/chunk-3IZNWAZE.cjs +0 -1
- package/dist/chunk-4AJT6I6Q.js +0 -1
- package/dist/chunk-4KXOWU5E.cjs +0 -1
- package/dist/chunk-5M7IRODB.js +0 -1
- package/dist/chunk-5QIW67NU.cjs +0 -1
- package/dist/chunk-6PVKL5RC.js +0 -1
- package/dist/chunk-73RCBQG5.js +0 -1
- package/dist/chunk-7JIPYRKX.js +0 -1
- package/dist/chunk-7WKKOG6H.cjs +0 -3
- package/dist/chunk-BQZES4ST.js +0 -1
- package/dist/chunk-BW7YYVZE.js +0 -1
- package/dist/chunk-C3T63EC7.cjs +0 -1
- package/dist/chunk-CVZ3RNWV.cjs +0 -1
- package/dist/chunk-GEY574TH.cjs +0 -1
- package/dist/chunk-H4T4IXCF.js +0 -1
- package/dist/chunk-HJ5EDMTA.js +0 -1
- package/dist/chunk-HMPMFEPS.cjs +0 -1
- package/dist/chunk-HPHVJ6BA.cjs +0 -1
- package/dist/chunk-HRSVFJND.cjs +0 -1
- package/dist/chunk-IGBQEAD5.js +0 -1
- package/dist/chunk-IR5WN6FQ.cjs +0 -1
- package/dist/chunk-JUSY5XEE.js +0 -1
- package/dist/chunk-KHSWQE6W.js +0 -1
- package/dist/chunk-KKQBZXFE.js +0 -1
- package/dist/chunk-KO6QYKDX.cjs +0 -1
- package/dist/chunk-KRV3IXJU.cjs +0 -1
- package/dist/chunk-L5L64FWM.js +0 -1
- package/dist/chunk-LW6JSI4J.js +0 -1
- package/dist/chunk-M4TOGGLV.cjs +0 -1
- package/dist/chunk-MQP5VZCA.cjs +0 -1
- package/dist/chunk-NEJPPLYW.cjs +0 -1
- package/dist/chunk-NIKULSJK.cjs +0 -1
- package/dist/chunk-NT4EICOB.cjs +0 -1
- package/dist/chunk-O4FVTK7X.cjs +0 -1
- package/dist/chunk-P6JJHAAV.js +0 -1
- package/dist/chunk-PONCGT2H.cjs +0 -1
- package/dist/chunk-PSXRNSOE.js +0 -1
- package/dist/chunk-R6VFNNAA.js +0 -3
- package/dist/chunk-RJZV72YF.js +0 -1
- package/dist/chunk-S3DYQVRD.js +0 -1
- package/dist/chunk-SHVVA55W.js +0 -1
- package/dist/chunk-STYSP6KL.cjs +0 -1
- package/dist/chunk-UBOWSXW3.js +0 -1
- package/dist/chunk-UNBXKCNN.js +0 -1
- package/dist/chunk-VXFSSEA4.js +0 -1
- package/dist/chunk-VY634F3J.js +0 -1
- package/dist/chunk-WQP2FSVI.js +0 -1
- package/dist/chunk-WYYAPI4G.cjs +0 -1
- package/dist/chunk-WZFHEUWT.cjs +0 -1
- package/dist/chunk-XALFCQKD.cjs +0 -1
- package/dist/chunk-XIRT2EZN.cjs +0 -1
- package/dist/chunk-YWPTI2QO.cjs +0 -1
- package/dist/chunk-YZ4HRYSL.cjs +0 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkE4LJ7252cjs = require('./chunk-E4LJ7252.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkG5NYLGM5cjs = require('./chunk-G5NYLGM5.cjs');
|
|
8
|
+
|
|
9
|
+
// src/signers/non-custodial/ncs-evm-signer.ts
|
|
10
|
+
var _ox = require('ox');
|
|
11
|
+
var _viem = require('viem');
|
|
12
|
+
var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends _chunkE4LJ7252cjs.NonCustodialSigner {
|
|
13
|
+
constructor(config) {
|
|
14
|
+
super(config);
|
|
15
|
+
}
|
|
16
|
+
signMessage(message) {
|
|
17
|
+
return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
|
|
18
|
+
const messageRaw = _viem.isHex.call(void 0, message) ? message : _viem.toHex.call(void 0, message);
|
|
19
|
+
const messageToSign = _ox.PersonalMessage.getSignPayload(messageRaw);
|
|
20
|
+
return yield this.sign(messageToSign);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
signTransaction(transaction) {
|
|
24
|
+
return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
|
|
25
|
+
return yield this.sign(transaction);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
sign(raw) {
|
|
29
|
+
return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
|
|
30
|
+
var _a;
|
|
31
|
+
yield this.handleAuthRequired();
|
|
32
|
+
const jwt = this.getJwtOrThrow();
|
|
33
|
+
const hexString = raw.replace("0x", "");
|
|
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: "secp256k1",
|
|
44
|
+
bytes: hexString,
|
|
45
|
+
encoding: "hex"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
options: _chunkE4LJ7252cjs.DEFAULT_EVENT_OPTIONS
|
|
49
|
+
});
|
|
50
|
+
if ((res == null ? void 0 : res.status) === "error") {
|
|
51
|
+
throw new Error(res.error);
|
|
52
|
+
}
|
|
53
|
+
if ((res == null ? void 0 : res.signature) == null) {
|
|
54
|
+
throw new Error("Failed to sign transaction");
|
|
55
|
+
}
|
|
56
|
+
_EVMNonCustodialSigner.verifyPublicKeyFormat(res.publicKey);
|
|
57
|
+
return { signature: res.signature.bytes };
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
static verifyPublicKeyFormat(publicKey) {
|
|
61
|
+
if (publicKey == null) {
|
|
62
|
+
throw new Error("No public key found");
|
|
63
|
+
}
|
|
64
|
+
if (publicKey.encoding !== "hex" || publicKey.keyType !== "secp256k1" || publicKey.bytes == null) {
|
|
65
|
+
throw new Error(
|
|
66
|
+
"Not supported. Expected public key to be in hex encoding and secp256k1 key type. Got: " + JSON.stringify(publicKey)
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
getChainKeyParams() {
|
|
71
|
+
return {
|
|
72
|
+
scheme: "secp256k1",
|
|
73
|
+
encoding: "hex"
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
exports.EVMNonCustodialSigner = EVMNonCustodialSigner;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__async
|
|
3
|
+
} from "./chunk-FPMW7Q5O.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
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// package.json
|
|
2
|
+
var name = "@crossmint/wallets-sdk";
|
|
3
|
+
var version = "0.18.4";
|
|
4
|
+
|
|
5
|
+
// src/utils/constants.ts
|
|
6
|
+
var WALLETS_SERVICE = "WALLETS_SDK";
|
|
7
|
+
var SDK_VERSION = version;
|
|
8
|
+
var SDK_NAME = name;
|
|
9
|
+
var STATUS_POLLING_INTERVAL_MS = 500;
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
WALLETS_SERVICE,
|
|
13
|
+
SDK_VERSION,
|
|
14
|
+
SDK_NAME,
|
|
15
|
+
STATUS_POLLING_INTERVAL_MS
|
|
16
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Wallet
|
|
3
|
+
} from "./chunk-4QGBVHV3.js";
|
|
4
|
+
import {
|
|
5
|
+
TransactionNotCreatedError
|
|
6
|
+
} from "./chunk-SGINWAB6.js";
|
|
7
|
+
import {
|
|
8
|
+
__async
|
|
9
|
+
} from "./chunk-FPMW7Q5O.js";
|
|
10
|
+
|
|
11
|
+
// src/wallets/stellar.ts
|
|
12
|
+
import { isValidStellarAddress } from "@crossmint/common-sdk-base";
|
|
13
|
+
var StellarWallet = class _StellarWallet extends Wallet {
|
|
14
|
+
constructor(wallet) {
|
|
15
|
+
super(
|
|
16
|
+
{
|
|
17
|
+
chain: wallet.chain,
|
|
18
|
+
address: wallet.address,
|
|
19
|
+
owner: wallet.owner,
|
|
20
|
+
signer: wallet.signer,
|
|
21
|
+
options: Wallet.getOptions(wallet),
|
|
22
|
+
alias: wallet.alias
|
|
23
|
+
},
|
|
24
|
+
Wallet.getApiClient(wallet)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
static from(wallet) {
|
|
28
|
+
if (!isValidStellarAddress(wallet.address)) {
|
|
29
|
+
throw new Error("Wallet is not a Stellar wallet");
|
|
30
|
+
}
|
|
31
|
+
return new _StellarWallet(wallet);
|
|
32
|
+
}
|
|
33
|
+
sendTransaction(params) {
|
|
34
|
+
return __async(this, null, function* () {
|
|
35
|
+
var _a;
|
|
36
|
+
yield this.preAuthIfNeeded();
|
|
37
|
+
const createdTransaction = yield this.createTransaction(params);
|
|
38
|
+
if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
|
|
39
|
+
return {
|
|
40
|
+
hash: void 0,
|
|
41
|
+
explorerLink: void 0,
|
|
42
|
+
transactionId: createdTransaction.id
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const options = {};
|
|
46
|
+
return yield this.approveTransactionAndWait(createdTransaction.id, options);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
createTransaction(params) {
|
|
50
|
+
return __async(this, null, function* () {
|
|
51
|
+
var _a;
|
|
52
|
+
const { contractId, options } = params;
|
|
53
|
+
const signer = (_a = options == null ? void 0 : options.experimental_signer) != null ? _a : this.signer.locator();
|
|
54
|
+
let transaction;
|
|
55
|
+
if ("transaction" in params) {
|
|
56
|
+
transaction = {
|
|
57
|
+
type: "serialized-transaction",
|
|
58
|
+
serializedTransaction: params.transaction,
|
|
59
|
+
contractId
|
|
60
|
+
};
|
|
61
|
+
} else {
|
|
62
|
+
const { method, memo, args } = params;
|
|
63
|
+
transaction = {
|
|
64
|
+
type: "contract-call",
|
|
65
|
+
contractId,
|
|
66
|
+
method,
|
|
67
|
+
memo: memo != null ? { type: "text", value: memo } : void 0,
|
|
68
|
+
args
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const transactionCreationResponse = yield this.apiClient.createTransaction(this.walletLocator, {
|
|
72
|
+
params: {
|
|
73
|
+
transaction,
|
|
74
|
+
signer
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
if ("error" in transactionCreationResponse) {
|
|
78
|
+
throw new TransactionNotCreatedError(JSON.stringify(transactionCreationResponse));
|
|
79
|
+
}
|
|
80
|
+
return transactionCreationResponse;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export {
|
|
86
|
+
StellarWallet
|
|
87
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __typeError = (msg) => {
|
|
8
|
+
throw TypeError(msg);
|
|
9
|
+
};
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
24
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
25
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
26
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
27
|
+
var __async = (__this, __arguments, generator) => {
|
|
28
|
+
return new Promise((resolve, reject) => {
|
|
29
|
+
var fulfilled = (value) => {
|
|
30
|
+
try {
|
|
31
|
+
step(generator.next(value));
|
|
32
|
+
} catch (e) {
|
|
33
|
+
reject(e);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var rejected = (value) => {
|
|
37
|
+
try {
|
|
38
|
+
step(generator.throw(value));
|
|
39
|
+
} catch (e) {
|
|
40
|
+
reject(e);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
44
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
__spreadValues,
|
|
50
|
+
__spreadProps,
|
|
51
|
+
__privateGet,
|
|
52
|
+
__privateAdd,
|
|
53
|
+
__privateSet,
|
|
54
|
+
__async
|
|
55
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __typeError = (msg) => {
|
|
8
|
+
throw TypeError(msg);
|
|
9
|
+
};
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
24
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
25
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
26
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
27
|
+
var __async = (__this, __arguments, generator) => {
|
|
28
|
+
return new Promise((resolve, reject) => {
|
|
29
|
+
var fulfilled = (value) => {
|
|
30
|
+
try {
|
|
31
|
+
step(generator.next(value));
|
|
32
|
+
} catch (e) {
|
|
33
|
+
reject(e);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var rejected = (value) => {
|
|
37
|
+
try {
|
|
38
|
+
step(generator.throw(value));
|
|
39
|
+
} catch (e) {
|
|
40
|
+
reject(e);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
44
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__async = __async;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_EVENT_OPTIONS,
|
|
3
|
+
NonCustodialSigner
|
|
4
|
+
} from "./chunk-BAULM7A2.js";
|
|
5
|
+
import {
|
|
6
|
+
__async
|
|
7
|
+
} from "./chunk-FPMW7Q5O.js";
|
|
8
|
+
|
|
9
|
+
// src/signers/non-custodial/ncs-solana-signer.ts
|
|
10
|
+
import { VersionedTransaction } from "@solana/web3.js";
|
|
11
|
+
import base58 from "bs58";
|
|
12
|
+
var SolanaNonCustodialSigner = class _SolanaNonCustodialSigner extends NonCustodialSigner {
|
|
13
|
+
constructor(config) {
|
|
14
|
+
super(config);
|
|
15
|
+
}
|
|
16
|
+
signMessage() {
|
|
17
|
+
return __async(this, null, function* () {
|
|
18
|
+
return yield Promise.reject(new Error("signMessage method not implemented for email signer"));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
signTransaction(transaction) {
|
|
22
|
+
return __async(this, null, function* () {
|
|
23
|
+
var _a;
|
|
24
|
+
yield this.handleAuthRequired();
|
|
25
|
+
const jwt = this.getJwtOrThrow();
|
|
26
|
+
const transactionBytes = base58.decode(transaction);
|
|
27
|
+
const deserializedTransaction = VersionedTransaction.deserialize(transactionBytes);
|
|
28
|
+
const messageData = deserializedTransaction.message.serialize();
|
|
29
|
+
const res = yield (_a = this.config.clientTEEConnection) == null ? void 0 : _a.sendAction({
|
|
30
|
+
event: "request:sign",
|
|
31
|
+
responseEvent: "response:sign",
|
|
32
|
+
data: {
|
|
33
|
+
authData: {
|
|
34
|
+
jwt,
|
|
35
|
+
apiKey: this.config.crossmint.apiKey
|
|
36
|
+
},
|
|
37
|
+
data: {
|
|
38
|
+
keyType: "ed25519",
|
|
39
|
+
bytes: base58.encode(messageData),
|
|
40
|
+
encoding: "base58"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
options: DEFAULT_EVENT_OPTIONS
|
|
44
|
+
});
|
|
45
|
+
if ((res == null ? void 0 : res.status) === "error") {
|
|
46
|
+
throw new Error(res.error);
|
|
47
|
+
}
|
|
48
|
+
if ((res == null ? void 0 : res.signature) == null) {
|
|
49
|
+
throw new Error("Failed to sign transaction");
|
|
50
|
+
}
|
|
51
|
+
_SolanaNonCustodialSigner.verifyPublicKeyFormat(res.publicKey);
|
|
52
|
+
return { signature: res.signature.bytes };
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
static verifyPublicKeyFormat(publicKey) {
|
|
56
|
+
if (publicKey == null) {
|
|
57
|
+
throw new Error("No public key found");
|
|
58
|
+
}
|
|
59
|
+
if (publicKey.encoding !== "base58" || publicKey.keyType !== "ed25519" || publicKey.bytes == null) {
|
|
60
|
+
throw new Error(
|
|
61
|
+
"Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: " + JSON.stringify(publicKey)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
getChainKeyParams() {
|
|
66
|
+
return {
|
|
67
|
+
scheme: "ed25519",
|
|
68
|
+
encoding: "base58"
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
SolanaNonCustodialSigner
|
|
75
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkMYKPHXURcjs = require('./chunk-MYKPHXUR.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkG5NYLGM5cjs = require('./chunk-G5NYLGM5.cjs');
|
|
10
|
+
|
|
11
|
+
// src/wallets/stellar.ts
|
|
12
|
+
var _commonsdkbase = require('@crossmint/common-sdk-base');
|
|
13
|
+
var StellarWallet = class _StellarWallet extends _chunkMYKPHXURcjs.Wallet {
|
|
14
|
+
constructor(wallet) {
|
|
15
|
+
super(
|
|
16
|
+
{
|
|
17
|
+
chain: wallet.chain,
|
|
18
|
+
address: wallet.address,
|
|
19
|
+
owner: wallet.owner,
|
|
20
|
+
signer: wallet.signer,
|
|
21
|
+
options: _chunkMYKPHXURcjs.Wallet.getOptions(wallet),
|
|
22
|
+
alias: wallet.alias
|
|
23
|
+
},
|
|
24
|
+
_chunkMYKPHXURcjs.Wallet.getApiClient(wallet)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
static from(wallet) {
|
|
28
|
+
if (!_commonsdkbase.isValidStellarAddress.call(void 0, wallet.address)) {
|
|
29
|
+
throw new Error("Wallet is not a Stellar wallet");
|
|
30
|
+
}
|
|
31
|
+
return new _StellarWallet(wallet);
|
|
32
|
+
}
|
|
33
|
+
sendTransaction(params) {
|
|
34
|
+
return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
|
|
35
|
+
var _a;
|
|
36
|
+
yield this.preAuthIfNeeded();
|
|
37
|
+
const createdTransaction = yield this.createTransaction(params);
|
|
38
|
+
if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
|
|
39
|
+
return {
|
|
40
|
+
hash: void 0,
|
|
41
|
+
explorerLink: void 0,
|
|
42
|
+
transactionId: createdTransaction.id
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const options = {};
|
|
46
|
+
return yield this.approveTransactionAndWait(createdTransaction.id, options);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
createTransaction(params) {
|
|
50
|
+
return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
|
|
51
|
+
var _a;
|
|
52
|
+
const { contractId, options } = params;
|
|
53
|
+
const signer = (_a = options == null ? void 0 : options.experimental_signer) != null ? _a : this.signer.locator();
|
|
54
|
+
let transaction;
|
|
55
|
+
if ("transaction" in params) {
|
|
56
|
+
transaction = {
|
|
57
|
+
type: "serialized-transaction",
|
|
58
|
+
serializedTransaction: params.transaction,
|
|
59
|
+
contractId
|
|
60
|
+
};
|
|
61
|
+
} else {
|
|
62
|
+
const { method, memo, args } = params;
|
|
63
|
+
transaction = {
|
|
64
|
+
type: "contract-call",
|
|
65
|
+
contractId,
|
|
66
|
+
method,
|
|
67
|
+
memo: memo != null ? { type: "text", value: memo } : void 0,
|
|
68
|
+
args
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const transactionCreationResponse = yield this.apiClient.createTransaction(this.walletLocator, {
|
|
72
|
+
params: {
|
|
73
|
+
transaction,
|
|
74
|
+
signer
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
if ("error" in transactionCreationResponse) {
|
|
78
|
+
throw new (0, _chunkXC2V34TScjs.TransactionNotCreatedError)(JSON.stringify(transactionCreationResponse));
|
|
79
|
+
}
|
|
80
|
+
return transactionCreationResponse;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
exports.StellarWallet = StellarWallet;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WalletCreationError
|
|
3
|
+
} from "./chunk-SGINWAB6.js";
|
|
4
|
+
|
|
5
|
+
// src/utils/signer-validation.ts
|
|
6
|
+
import { isEmailValid } from "@crossmint/common-sdk-auth";
|
|
7
|
+
var signerConfigMismatchErrorMessage = (fieldPath, newValue, existingValue) => `Wallet signer configuration mismatch at "${fieldPath}" - expected "${existingValue}" from existing wallet but found "${newValue}"`;
|
|
8
|
+
function normalizeEmail(email) {
|
|
9
|
+
const lowerCaseEmail = email.toLowerCase();
|
|
10
|
+
const emailParts = lowerCaseEmail.split("@");
|
|
11
|
+
const domain = emailParts[1];
|
|
12
|
+
const isGoogleMailDomain = domain === "googlemail.com";
|
|
13
|
+
const isGmail = isGoogleMailDomain || domain === "gmail.com";
|
|
14
|
+
const isGmailAndHasDots = isGmail && emailParts[0].includes(".");
|
|
15
|
+
if (isGoogleMailDomain) {
|
|
16
|
+
emailParts[1] = "gmail.com";
|
|
17
|
+
}
|
|
18
|
+
if (isGmailAndHasDots) {
|
|
19
|
+
emailParts[0] = emailParts[0].replace(/\./g, "");
|
|
20
|
+
}
|
|
21
|
+
return `${emailParts[0]}@${emailParts[1]}`;
|
|
22
|
+
}
|
|
23
|
+
function normalizeValueForComparison(value) {
|
|
24
|
+
if (typeof value === "string" && isEmailValid(value)) {
|
|
25
|
+
return normalizeEmail(value);
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
function compareSignerConfigs(newSignerConfig, existingSignerConfig, path = "") {
|
|
30
|
+
if (newSignerConfig === existingSignerConfig) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (newSignerConfig == null || existingSignerConfig == null) {
|
|
34
|
+
throw new Error(`Cannot compare null or undefined signer configs at path: ${path}`);
|
|
35
|
+
}
|
|
36
|
+
for (const key of Object.keys(newSignerConfig)) {
|
|
37
|
+
if (!(key in existingSignerConfig)) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
const fieldPath = path ? `${path}.${key}` : key;
|
|
41
|
+
const newValue = newSignerConfig[key];
|
|
42
|
+
const existingValue = existingSignerConfig[key];
|
|
43
|
+
if (typeof newValue === "object" && newValue !== null && typeof existingValue === "object" && existingValue !== null) {
|
|
44
|
+
compareSignerConfigs(
|
|
45
|
+
newValue,
|
|
46
|
+
existingValue,
|
|
47
|
+
fieldPath
|
|
48
|
+
);
|
|
49
|
+
} else if (normalizeValueForComparison(newValue) !== normalizeValueForComparison(existingValue)) {
|
|
50
|
+
throw new WalletCreationError(signerConfigMismatchErrorMessage(fieldPath, newValue, existingValue));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
compareSignerConfigs
|
|
57
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
story
|
|
3
|
+
} from "./chunk-2T5HHKUI.js";
|
|
4
|
+
import {
|
|
5
|
+
storyTestnet
|
|
6
|
+
} from "./chunk-3U6UAYOV.js";
|
|
7
|
+
|
|
8
|
+
// src/chains/chains.ts
|
|
9
|
+
import { BlockchainIncludingTestnet as Blockchain } from "@crossmint/common-sdk-base";
|
|
10
|
+
import {
|
|
11
|
+
baseSepolia,
|
|
12
|
+
base,
|
|
13
|
+
polygonAmoy,
|
|
14
|
+
polygon,
|
|
15
|
+
optimismSepolia,
|
|
16
|
+
optimism,
|
|
17
|
+
arbitrumSepolia,
|
|
18
|
+
arbitrum,
|
|
19
|
+
arbitrumNova,
|
|
20
|
+
modeTestnet,
|
|
21
|
+
mode,
|
|
22
|
+
bsc,
|
|
23
|
+
shape,
|
|
24
|
+
zora,
|
|
25
|
+
zoraSepolia,
|
|
26
|
+
sepolia,
|
|
27
|
+
flowMainnet,
|
|
28
|
+
flowTestnet,
|
|
29
|
+
plume,
|
|
30
|
+
plumeTestnet
|
|
31
|
+
} from "viem/chains";
|
|
32
|
+
var TESTNET_AA_CHAINS = [
|
|
33
|
+
Blockchain.ABSTRACT_TESTNET,
|
|
34
|
+
Blockchain.ARBITRUM_SEPOLIA,
|
|
35
|
+
Blockchain.BASE_SEPOLIA,
|
|
36
|
+
Blockchain.CURTIS,
|
|
37
|
+
Blockchain.ETHEREUM_SEPOLIA,
|
|
38
|
+
Blockchain.FLOW_TESTNET,
|
|
39
|
+
Blockchain.MANTLE_SEPOLIA,
|
|
40
|
+
Blockchain.MODE_SEPOLIA,
|
|
41
|
+
Blockchain.OPTIMISM_SEPOLIA,
|
|
42
|
+
Blockchain.PLUME_TESTNET,
|
|
43
|
+
Blockchain.POLYGON_AMOY,
|
|
44
|
+
Blockchain.SCROLL_SEPOLIA,
|
|
45
|
+
Blockchain.SEI_ATLANTIC_2_TESTNET,
|
|
46
|
+
Blockchain.STORY_TESTNET,
|
|
47
|
+
Blockchain.WORLD_CHAIN_SEPOLIA,
|
|
48
|
+
Blockchain.ZORA_SEPOLIA
|
|
49
|
+
];
|
|
50
|
+
var PRODUCTION_AA_CHAINS = [
|
|
51
|
+
Blockchain.ABSTRACT,
|
|
52
|
+
Blockchain.APECHAIN,
|
|
53
|
+
Blockchain.ARBITRUM,
|
|
54
|
+
Blockchain.ARBITRUMNOVA,
|
|
55
|
+
Blockchain.BASE,
|
|
56
|
+
Blockchain.BSC,
|
|
57
|
+
Blockchain.FLOW,
|
|
58
|
+
Blockchain.MANTLE,
|
|
59
|
+
Blockchain.MODE,
|
|
60
|
+
Blockchain.OPTIMISM,
|
|
61
|
+
Blockchain.PLUME,
|
|
62
|
+
Blockchain.POLYGON,
|
|
63
|
+
Blockchain.SCROLL,
|
|
64
|
+
Blockchain.SEI_PACIFIC_1,
|
|
65
|
+
Blockchain.SHAPE,
|
|
66
|
+
Blockchain.STORY,
|
|
67
|
+
Blockchain.WORLDCHAIN,
|
|
68
|
+
Blockchain.ZORA
|
|
69
|
+
];
|
|
70
|
+
function toViemChain(chain) {
|
|
71
|
+
switch (chain) {
|
|
72
|
+
case Blockchain.BASE_SEPOLIA:
|
|
73
|
+
return baseSepolia;
|
|
74
|
+
case Blockchain.BASE:
|
|
75
|
+
return base;
|
|
76
|
+
case Blockchain.POLYGON_AMOY:
|
|
77
|
+
return polygonAmoy;
|
|
78
|
+
case Blockchain.POLYGON:
|
|
79
|
+
return polygon;
|
|
80
|
+
case Blockchain.OPTIMISM_SEPOLIA:
|
|
81
|
+
return optimismSepolia;
|
|
82
|
+
case Blockchain.OPTIMISM:
|
|
83
|
+
return optimism;
|
|
84
|
+
case Blockchain.ARBITRUM_SEPOLIA:
|
|
85
|
+
return arbitrumSepolia;
|
|
86
|
+
case Blockchain.ARBITRUM:
|
|
87
|
+
return arbitrum;
|
|
88
|
+
case Blockchain.ARBITRUMNOVA:
|
|
89
|
+
return arbitrumNova;
|
|
90
|
+
case Blockchain.STORY_TESTNET:
|
|
91
|
+
return storyTestnet;
|
|
92
|
+
case Blockchain.STORY:
|
|
93
|
+
return story;
|
|
94
|
+
case Blockchain.MODE_SEPOLIA:
|
|
95
|
+
return modeTestnet;
|
|
96
|
+
case Blockchain.MODE:
|
|
97
|
+
return mode;
|
|
98
|
+
case Blockchain.BSC:
|
|
99
|
+
return bsc;
|
|
100
|
+
case Blockchain.SHAPE:
|
|
101
|
+
return shape;
|
|
102
|
+
case Blockchain.ZORA:
|
|
103
|
+
return zora;
|
|
104
|
+
case Blockchain.ZORA_SEPOLIA:
|
|
105
|
+
return zoraSepolia;
|
|
106
|
+
case Blockchain.ETHEREUM_SEPOLIA:
|
|
107
|
+
return sepolia;
|
|
108
|
+
case Blockchain.FLOW:
|
|
109
|
+
return flowMainnet;
|
|
110
|
+
case Blockchain.FLOW_TESTNET:
|
|
111
|
+
return flowTestnet;
|
|
112
|
+
case Blockchain.PLUME_TESTNET:
|
|
113
|
+
return plumeTestnet;
|
|
114
|
+
case Blockchain.PLUME:
|
|
115
|
+
return plume;
|
|
116
|
+
case Blockchain.ABSTRACT:
|
|
117
|
+
case Blockchain.ABSTRACT_TESTNET:
|
|
118
|
+
case Blockchain.APECHAIN:
|
|
119
|
+
case Blockchain.MANTLE:
|
|
120
|
+
case Blockchain.MANTLE_SEPOLIA:
|
|
121
|
+
case Blockchain.SCROLL:
|
|
122
|
+
case Blockchain.SCROLL_SEPOLIA:
|
|
123
|
+
case Blockchain.SEI_PACIFIC_1:
|
|
124
|
+
case Blockchain.SEI_ATLANTIC_2_TESTNET:
|
|
125
|
+
case Blockchain.CURTIS:
|
|
126
|
+
case Blockchain.WORLDCHAIN:
|
|
127
|
+
case Blockchain.WORLD_CHAIN_SEPOLIA:
|
|
128
|
+
throw new Error(
|
|
129
|
+
`Chain ${chain} is not yet supported in toViemChain function. Please add the appropriate viem chain definition.`
|
|
130
|
+
);
|
|
131
|
+
default:
|
|
132
|
+
throw new Error(`Unknown chain: ${chain}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export {
|
|
137
|
+
toViemChain
|
|
138
|
+
};
|