@talken/talkenkit 2.3.4 → 2.3.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/LICENSE +9 -0
- package/dist/index.js +69 -23
- package/dist/wallets/walletConnectors/abcWallet/abcApi.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/abcConnector.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaWallet.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/abcWallet.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/index.js +4 -4
- package/dist/wallets/walletConnectors/chunk-2J66VMY5.js +152 -0
- package/dist/wallets/walletConnectors/chunk-2W6UBYKX.js +66 -0
- package/dist/wallets/walletConnectors/chunk-2ZPGPZCP.js +228 -0
- package/dist/wallets/walletConnectors/chunk-3DPCIDW6.js +1730 -0
- package/dist/wallets/walletConnectors/chunk-3IVTKZ7V.js +87 -0
- package/dist/wallets/walletConnectors/chunk-47TQ23J4.js +63 -0
- package/dist/wallets/walletConnectors/chunk-4HKJ53H3.js +1742 -0
- package/dist/wallets/walletConnectors/chunk-4T3UOJYR.js +76 -0
- package/dist/wallets/walletConnectors/chunk-53IBFGVW.js +102 -0
- package/dist/wallets/walletConnectors/chunk-5EARL7FN.js +39 -0
- package/dist/wallets/walletConnectors/chunk-5NM2LK2G.js +95 -0
- package/dist/wallets/walletConnectors/chunk-66SCJ77O.js +63 -0
- package/dist/wallets/walletConnectors/chunk-6JKWIEGA.js +228 -0
- package/dist/wallets/walletConnectors/chunk-7SXCH5TL.js +1752 -0
- package/dist/wallets/walletConnectors/chunk-7UZBDZZZ.js +599 -0
- package/dist/wallets/walletConnectors/chunk-AKLKCDXT.js +186 -0
- package/dist/wallets/walletConnectors/chunk-ATQWOE4J.js +110 -0
- package/dist/wallets/walletConnectors/chunk-B6DM7J4N.js +71 -0
- package/dist/wallets/walletConnectors/chunk-BJYSWRV6.js +93 -0
- package/dist/wallets/walletConnectors/chunk-BRM4ZVXZ.js +44 -0
- package/dist/wallets/walletConnectors/chunk-BUDWZAL7.js +44 -0
- package/dist/wallets/walletConnectors/chunk-C7S72VGD.js +93 -0
- package/dist/wallets/walletConnectors/chunk-CSWWNAYR.js +44 -0
- package/dist/wallets/walletConnectors/chunk-CULIWWLV.js +101 -0
- package/dist/wallets/walletConnectors/chunk-D7U5WEH2.js +96 -0
- package/dist/wallets/walletConnectors/chunk-E4N7SPPU.js +39 -0
- package/dist/wallets/walletConnectors/chunk-ENU7XLF5.js +44 -0
- package/dist/wallets/walletConnectors/chunk-ESRU5KCF.js +151 -0
- package/dist/wallets/walletConnectors/chunk-FBI7UGNO.js +95 -0
- package/dist/wallets/walletConnectors/chunk-FF7ZIXKD.js +39 -0
- package/dist/wallets/walletConnectors/chunk-FJCL2YPU.js +1737 -0
- package/dist/wallets/walletConnectors/chunk-FSU3WBH3.js +63 -0
- package/dist/wallets/walletConnectors/chunk-G2IHR6PW.js +63 -0
- package/dist/wallets/walletConnectors/chunk-GILMNC3J.js +96 -0
- package/dist/wallets/walletConnectors/chunk-HDYBRMYW.js +194 -0
- package/dist/wallets/walletConnectors/chunk-HIZCIW5L.js +228 -0
- package/dist/wallets/walletConnectors/chunk-JBVBQUCS.js +73 -0
- package/dist/wallets/walletConnectors/chunk-JCMXNOQ5.js +63 -0
- package/dist/wallets/walletConnectors/chunk-JWO4ZQLK.js +98 -0
- package/dist/wallets/walletConnectors/chunk-K6GEK4JB.js +66 -0
- package/dist/wallets/walletConnectors/chunk-K6UZPSBG.js +94 -0
- package/dist/wallets/walletConnectors/chunk-KIQDE4N6.js +39 -0
- package/dist/wallets/walletConnectors/chunk-KM55XFBI.js +65 -0
- package/dist/wallets/walletConnectors/chunk-KOT7JYJR.js +39 -0
- package/dist/wallets/walletConnectors/chunk-KZOSE2PI.js +228 -0
- package/dist/wallets/walletConnectors/chunk-LNZJLKFB.js +39 -0
- package/dist/wallets/walletConnectors/chunk-LV765WZL.js +1748 -0
- package/dist/wallets/walletConnectors/chunk-MSI2BPP5.js +1722 -0
- package/dist/wallets/walletConnectors/chunk-MX2IY5CD.js +44 -0
- package/dist/wallets/walletConnectors/chunk-NLX2EV7O.js +44 -0
- package/dist/wallets/walletConnectors/chunk-NVAZ3B3V.js +228 -0
- package/dist/wallets/walletConnectors/chunk-OEWU3ZMN.js +39 -0
- package/dist/wallets/walletConnectors/chunk-P2MTINFI.js +280 -0
- package/dist/wallets/walletConnectors/chunk-PNMSIVVT.js +44 -0
- package/dist/wallets/walletConnectors/chunk-PZNYT2HC.js +1722 -0
- package/dist/wallets/walletConnectors/chunk-QZRNNI3E.js +39 -0
- package/dist/wallets/walletConnectors/chunk-R4UYVU5X.js +1721 -0
- package/dist/wallets/walletConnectors/chunk-RLBGBBIO.js +309 -0
- package/dist/wallets/walletConnectors/chunk-S2PY4MDO.js +108 -0
- package/dist/wallets/walletConnectors/chunk-SCOX5RF4.js +91 -0
- package/dist/wallets/walletConnectors/chunk-TUUNSVKZ.js +345 -0
- package/dist/wallets/walletConnectors/chunk-U2CUEL35.js +240 -0
- package/dist/wallets/walletConnectors/chunk-V6NRLREB.js +44 -0
- package/dist/wallets/walletConnectors/chunk-V7E5KRXJ.js +103 -0
- package/dist/wallets/walletConnectors/chunk-VCBVYFLJ.js +63 -0
- package/dist/wallets/walletConnectors/chunk-VM7AEC7H.js +39 -0
- package/dist/wallets/walletConnectors/chunk-W2VDZD74.js +478 -0
- package/dist/wallets/walletConnectors/chunk-WAO3KL5U.js +285 -0
- package/dist/wallets/walletConnectors/chunk-WPHTIILX.js +228 -0
- package/dist/wallets/walletConnectors/chunk-WSCJY2QD.js +228 -0
- package/dist/wallets/walletConnectors/chunk-WSLFMQIG.js +98 -0
- package/dist/wallets/walletConnectors/chunk-X3JQB5QL.js +44 -0
- package/dist/wallets/walletConnectors/chunk-X4CDP7L7.js +228 -0
- package/dist/wallets/walletConnectors/chunk-XETOVXYM.js +228 -0
- package/dist/wallets/walletConnectors/chunk-XYPR4BAF.js +436 -0
- package/dist/wallets/walletConnectors/chunk-Z2E65XSS.js +96 -0
- package/dist/wallets/walletConnectors/chunk-Z2ZRPTPX.js +1726 -0
- package/dist/wallets/walletConnectors/index.js +31 -31
- package/package.json +11 -12
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
isAndroid
|
|
4
|
+
} from "./chunk-RETKWSKD.js";
|
|
5
|
+
import {
|
|
6
|
+
getInjectedConnector,
|
|
7
|
+
hasInjectedProvider
|
|
8
|
+
} from "./chunk-MBBGZGXF.js";
|
|
9
|
+
import {
|
|
10
|
+
getWalletConnectConnector
|
|
11
|
+
} from "./chunk-PODFK4OS.js";
|
|
12
|
+
|
|
13
|
+
// src/wallets/walletConnectors/bitgetWallet/bitgetWallet.ts
|
|
14
|
+
var bitgetWallet = ({
|
|
15
|
+
projectId,
|
|
16
|
+
walletConnectParameters
|
|
17
|
+
}) => {
|
|
18
|
+
const isBitKeepInjected = hasInjectedProvider({
|
|
19
|
+
namespace: "bitkeep.ethereum",
|
|
20
|
+
flag: "isBitKeep"
|
|
21
|
+
});
|
|
22
|
+
const shouldUseWalletConnect = !isBitKeepInjected;
|
|
23
|
+
return {
|
|
24
|
+
id: "bitget",
|
|
25
|
+
name: "Bitget Wallet",
|
|
26
|
+
rdns: "com.bitget.web3",
|
|
27
|
+
iconUrl: async () => (await import("./bitgetWallet-CLYTW54T.js")).default,
|
|
28
|
+
iconAccent: "#f6851a",
|
|
29
|
+
iconBackground: "#fff",
|
|
30
|
+
installed: !shouldUseWalletConnect ? isBitKeepInjected : void 0,
|
|
31
|
+
downloadUrls: {
|
|
32
|
+
android: "https://web3.bitget.com/en/wallet-download?type=0",
|
|
33
|
+
ios: "https://apps.apple.com/app/bitkeep/id1395301115",
|
|
34
|
+
mobile: "https://web3.bitget.com/en/wallet-download?type=2",
|
|
35
|
+
qrCode: "https://web3.bitget.com/en/wallet-download",
|
|
36
|
+
chrome: "https://chrome.google.com/webstore/detail/bitkeep-crypto-nft-wallet/jiidiaalihmmhddjgbnbgdfflelocpak",
|
|
37
|
+
browserExtension: "https://web3.bitget.com/en/wallet-download"
|
|
38
|
+
},
|
|
39
|
+
extension: {
|
|
40
|
+
instructions: {
|
|
41
|
+
learnMoreUrl: "https://web3.bitget.com/en/academy",
|
|
42
|
+
steps: [
|
|
43
|
+
{
|
|
44
|
+
description: "wallet_connectors.bitget.extension.step1.description",
|
|
45
|
+
step: "install",
|
|
46
|
+
title: "wallet_connectors.bitget.extension.step1.title"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
description: "wallet_connectors.bitget.extension.step2.description",
|
|
50
|
+
step: "create",
|
|
51
|
+
title: "wallet_connectors.bitget.extension.step2.title"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
description: "wallet_connectors.bitget.extension.step3.description",
|
|
55
|
+
step: "refresh",
|
|
56
|
+
title: "wallet_connectors.bitget.extension.step3.description"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
mobile: {
|
|
62
|
+
getUri: shouldUseWalletConnect ? (uri) => {
|
|
63
|
+
return isAndroid() ? uri : `bitkeep://wc?uri=${encodeURIComponent(uri)}`;
|
|
64
|
+
} : void 0
|
|
65
|
+
},
|
|
66
|
+
qrCode: shouldUseWalletConnect ? {
|
|
67
|
+
getUri: (uri) => uri,
|
|
68
|
+
instructions: {
|
|
69
|
+
learnMoreUrl: "https://web3.bitget.com/en/academy",
|
|
70
|
+
steps: [
|
|
71
|
+
{
|
|
72
|
+
description: "wallet_connectors.bitget.qr_code.step1.description",
|
|
73
|
+
step: "install",
|
|
74
|
+
title: "wallet_connectors.bitget.qr_code.step1.title"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
description: "wallet_connectors.bitget.qr_code.step2.description",
|
|
78
|
+
step: "create",
|
|
79
|
+
title: "wallet_connectors.bitget.qr_code.step2.title"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
description: "wallet_connectors.bitget.qr_code.step3.description",
|
|
83
|
+
step: "scan",
|
|
84
|
+
title: "wallet_connectors.bitget.qr_code.step3.title"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
} : void 0,
|
|
89
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
90
|
+
projectId,
|
|
91
|
+
walletConnectParameters
|
|
92
|
+
}) : getInjectedConnector({
|
|
93
|
+
namespace: "bitkeep.ethereum",
|
|
94
|
+
flag: "isBitKeep"
|
|
95
|
+
})
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export {
|
|
100
|
+
bitgetWallet
|
|
101
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getInjectedConnector,
|
|
4
|
+
hasInjectedProvider
|
|
5
|
+
} from "./chunk-MBBGZGXF.js";
|
|
6
|
+
import {
|
|
7
|
+
getWalletConnectConnector
|
|
8
|
+
} from "./chunk-PODFK4OS.js";
|
|
9
|
+
|
|
10
|
+
// src/wallets/walletConnectors/roninWallet/roninWallet.ts
|
|
11
|
+
var roninWallet = ({
|
|
12
|
+
projectId,
|
|
13
|
+
walletConnectParameters
|
|
14
|
+
}) => {
|
|
15
|
+
const isRoninInjected = hasInjectedProvider({
|
|
16
|
+
namespace: "ronin.provider"
|
|
17
|
+
});
|
|
18
|
+
const shouldUseWalletConnect = !isRoninInjected;
|
|
19
|
+
const getUri = (uri) => {
|
|
20
|
+
return `roninwallet://wc?uri=${encodeURIComponent(uri)}`;
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
id: "ronin",
|
|
24
|
+
name: "Ronin Wallet",
|
|
25
|
+
iconUrl: async () => (await import("./roninWallet-SAB5ESVK.js")).default,
|
|
26
|
+
iconBackground: "#ffffff",
|
|
27
|
+
rdns: "com.roninchain.wallet",
|
|
28
|
+
installed: isRoninInjected || void 0,
|
|
29
|
+
downloadUrls: {
|
|
30
|
+
android: "https://play.google.com/store/apps/details?id=com.skymavis.genesis",
|
|
31
|
+
ios: "https://apps.apple.com/us/app/ronin-wallet/id1592675001",
|
|
32
|
+
mobile: "https://wallet.roninchain.com",
|
|
33
|
+
chrome: "https://chrome.google.com/webstore/detail/ronin-wallet/fnjhmkhhmkbjkkabndcnnogagogbneec",
|
|
34
|
+
edge: "https://microsoftedge.microsoft.com/addons/detail/ronin-wallet/kjmoohlgokccodicjjfebfomlbljgfhk",
|
|
35
|
+
firefox: "https://addons.mozilla.org/firefox/addon/ronin-wallet",
|
|
36
|
+
browserExtension: "https://wallet.roninchain.com/",
|
|
37
|
+
qrCode: "https://wallet.roninchain.com/"
|
|
38
|
+
},
|
|
39
|
+
mobile: {
|
|
40
|
+
getUri: shouldUseWalletConnect ? getUri : void 0
|
|
41
|
+
},
|
|
42
|
+
qrCode: shouldUseWalletConnect ? {
|
|
43
|
+
getUri: (uri) => uri,
|
|
44
|
+
instructions: {
|
|
45
|
+
learnMoreUrl: "https://wallet.roninchain.com/",
|
|
46
|
+
steps: [
|
|
47
|
+
{
|
|
48
|
+
description: "wallet_connectors.ronin.qr_code.step1.description",
|
|
49
|
+
step: "install",
|
|
50
|
+
title: "wallet_connectors.ronin.qr_code.step1.title"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
description: "wallet_connectors.ronin.qr_code.step2.description",
|
|
54
|
+
step: "create",
|
|
55
|
+
title: "wallet_connectors.ronin.qr_code.step2.title"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
description: "wallet_connectors.ronin.qr_code.step3.description",
|
|
59
|
+
step: "scan",
|
|
60
|
+
title: "wallet_connectors.ronin.qr_code.step3.title"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
} : void 0,
|
|
65
|
+
extension: {
|
|
66
|
+
instructions: {
|
|
67
|
+
learnMoreUrl: "https://wallet.roninchain.com/",
|
|
68
|
+
steps: [
|
|
69
|
+
{
|
|
70
|
+
description: "wallet_connectors.ronin.extension.step1.description",
|
|
71
|
+
step: "install",
|
|
72
|
+
title: "wallet_connectors.ronin.extension.step1.title"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
description: "wallet_connectors.ronin.extension.step2.description",
|
|
76
|
+
step: "create",
|
|
77
|
+
title: "wallet_connectors.ronin.extension.step2.title"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
description: "wallet_connectors.ronin.extension.step3.description",
|
|
81
|
+
step: "refresh",
|
|
82
|
+
title: "wallet_connectors.ronin.extension.step3.title"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
88
|
+
projectId,
|
|
89
|
+
walletConnectParameters
|
|
90
|
+
}) : getInjectedConnector({ namespace: "ronin.provider" })
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export {
|
|
95
|
+
roninWallet
|
|
96
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
createAbcSolanaConnector
|
|
4
|
+
} from "./chunk-U2CUEL35.js";
|
|
5
|
+
import {
|
|
6
|
+
createAbcSolanaProvider
|
|
7
|
+
} from "./chunk-MY5YIDOB.js";
|
|
8
|
+
import {
|
|
9
|
+
createAbcWaasClient
|
|
10
|
+
} from "./chunk-PZNYT2HC.js";
|
|
11
|
+
|
|
12
|
+
// src/wallets/walletConnectors/abcWallet/abcSolanaWallet.ts
|
|
13
|
+
var abcSolanaWallet = (options) => ({
|
|
14
|
+
id: "abc-solana",
|
|
15
|
+
name: "ABC Solana Wallet",
|
|
16
|
+
iconUrl: async () => (await import("./abcWallet-AYWSIGAG.js")).default,
|
|
17
|
+
iconBackground: "#fff",
|
|
18
|
+
// Embedded wallet - no download URLs needed
|
|
19
|
+
installed: void 0,
|
|
20
|
+
createConnector: () => {
|
|
21
|
+
console.log("[abcSolanaWallet] Creating Solana connector with options:", {
|
|
22
|
+
hasConfig: !!options.config,
|
|
23
|
+
waasUrl: options.config.waasUrl,
|
|
24
|
+
environment: options.config.environment
|
|
25
|
+
});
|
|
26
|
+
const client = createAbcWaasClient(options.config);
|
|
27
|
+
const provider = createAbcSolanaProvider(client);
|
|
28
|
+
const connector = createAbcSolanaConnector({
|
|
29
|
+
client,
|
|
30
|
+
provider
|
|
31
|
+
});
|
|
32
|
+
console.log("[abcSolanaWallet] Solana connector created successfully");
|
|
33
|
+
return connector;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
abcSolanaWallet
|
|
39
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
abcConnector
|
|
4
|
+
} from "./chunk-NVAZ3B3V.js";
|
|
5
|
+
import {
|
|
6
|
+
ABC_WALLET_METADATA
|
|
7
|
+
} from "./chunk-VETRBBA2.js";
|
|
8
|
+
|
|
9
|
+
// src/wallets/walletConnectors/abcWallet/abcWallet.ts
|
|
10
|
+
var abcWallet = (specificOptions) => ({ projectId }) => {
|
|
11
|
+
const waasUrl = specificOptions?.waasUrl || process.env.NEXT_PUBLIC_ABC_WAAS_URL || process.env.VITE_ABC_WAAS_URL;
|
|
12
|
+
if (!waasUrl) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
'ABC WaaS URL is required. Please provide it via:\n1. abcWallet({ waasUrl: "..." }) options, or\n2. NEXT_PUBLIC_ABC_WAAS_URL environment variable, or\n3. VITE_ABC_WAAS_URL environment variable'
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
const config = {
|
|
18
|
+
waasUrl,
|
|
19
|
+
apiKey: specificOptions?.apiKey,
|
|
20
|
+
plain: specificOptions?.plain || "",
|
|
21
|
+
// Deprecated - not used (secure.ts uses random generation)
|
|
22
|
+
environment: specificOptions?.environment || "development",
|
|
23
|
+
projectId
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
id: ABC_WALLET_METADATA.id,
|
|
27
|
+
name: ABC_WALLET_METADATA.name,
|
|
28
|
+
rdns: ABC_WALLET_METADATA.rdns,
|
|
29
|
+
iconUrl: async () => (await import("./abcWallet-AYWSIGAG.js")).default,
|
|
30
|
+
iconBackground: ABC_WALLET_METADATA.iconBackground,
|
|
31
|
+
// Embedded wallet - no installation required
|
|
32
|
+
installed: void 0,
|
|
33
|
+
// No download URLs for embedded wallet
|
|
34
|
+
downloadUrls: void 0,
|
|
35
|
+
// Create connector - wrapper function required by Wallet type
|
|
36
|
+
createConnector: (_walletDetails) => abcConnector({ config }),
|
|
37
|
+
// Embedded wallet always available
|
|
38
|
+
hidden: () => false
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
abcWallet
|
|
44
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
BaseApiClient
|
|
4
|
+
} from "./chunk-WAO3KL5U.js";
|
|
5
|
+
import {
|
|
6
|
+
createAbcError
|
|
7
|
+
} from "./chunk-W2VDZD74.js";
|
|
8
|
+
import {
|
|
9
|
+
ABC_ENDPOINTS,
|
|
10
|
+
DEFAULT_HEADERS
|
|
11
|
+
} from "./chunk-VETRBBA2.js";
|
|
12
|
+
|
|
13
|
+
// src/wallets/walletConnectors/abcWallet/api/WalletApi.ts
|
|
14
|
+
var WalletApi = class extends BaseApiClient {
|
|
15
|
+
/**
|
|
16
|
+
* Generate or recover EVM wallet
|
|
17
|
+
*/
|
|
18
|
+
async generateOrRecoverWallet(params) {
|
|
19
|
+
const response = await this.request(
|
|
20
|
+
// Use 'any' to get raw API response
|
|
21
|
+
ABC_ENDPOINTS.MPC_WALLETS,
|
|
22
|
+
// Use correct EVM endpoint, not WALLETS_V3 (Solana only)
|
|
23
|
+
{
|
|
24
|
+
method: "POST",
|
|
25
|
+
body: {
|
|
26
|
+
uid: params.uid,
|
|
27
|
+
pin: params.pin,
|
|
28
|
+
chainId: params.chainId,
|
|
29
|
+
network: params.network || "mainnet"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
if (response.status === "success" && response.data) {
|
|
34
|
+
const raw = response.data;
|
|
35
|
+
console.log("[WalletApi] Raw wallet API response:", {
|
|
36
|
+
hasUid: !!raw.uid,
|
|
37
|
+
hasSid: !!raw.sid,
|
|
38
|
+
hasWid: !!raw.wid,
|
|
39
|
+
hasPvencstr: !!raw.pvencstr,
|
|
40
|
+
hasEncryptDevicePassword: !!raw.encryptDevicePassword,
|
|
41
|
+
hasPubkey: !!raw.pubkey,
|
|
42
|
+
allKeys: Object.keys(raw)
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
address: raw.address || "",
|
|
46
|
+
keyId: raw.keyId || raw.key_id || raw.sid,
|
|
47
|
+
encryptedShare: raw.encryptedShare || raw.encrypted_share || "",
|
|
48
|
+
uid: raw.uid,
|
|
49
|
+
sid: raw.sid,
|
|
50
|
+
wid: raw.wid,
|
|
51
|
+
// Preserve for Bitcoin signing
|
|
52
|
+
pvencstr: raw.pvencstr,
|
|
53
|
+
// Preserve for Bitcoin signing
|
|
54
|
+
encryptDevicePassword: raw.encryptDevicePassword,
|
|
55
|
+
// Preserve for Bitcoin signing
|
|
56
|
+
pubkey: raw.pubkey || null
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
throw createAbcError(
|
|
60
|
+
"WALLET_NOT_FOUND" /* WALLET_NOT_FOUND */,
|
|
61
|
+
"Failed to generate wallet",
|
|
62
|
+
response
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get wallet info
|
|
67
|
+
*/
|
|
68
|
+
async getWalletInfo(uid) {
|
|
69
|
+
const response = await this.request(ABC_ENDPOINTS.INFO, {
|
|
70
|
+
method: "POST",
|
|
71
|
+
body: { uid }
|
|
72
|
+
});
|
|
73
|
+
if (response.status === "success") {
|
|
74
|
+
return response.data;
|
|
75
|
+
}
|
|
76
|
+
throw createAbcError(
|
|
77
|
+
"WALLET_NOT_FOUND" /* WALLET_NOT_FOUND */,
|
|
78
|
+
"Failed to get wallet info",
|
|
79
|
+
response
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Generate or recover Solana wallet (Ed25519)
|
|
84
|
+
*/
|
|
85
|
+
async generateSolanaWallet(pin, _isRecover = false) {
|
|
86
|
+
const url = `\${this.baseURL}/v3/wallet/\${isRecover ? 'recover' : 'generate'}`;
|
|
87
|
+
const response = await fetch(url, {
|
|
88
|
+
method: "POST",
|
|
89
|
+
headers: {
|
|
90
|
+
...DEFAULT_HEADERS,
|
|
91
|
+
...this.accessToken ? { Authorization: "Bearer ${this.accessToken}" } : {}
|
|
92
|
+
},
|
|
93
|
+
body: JSON.stringify({
|
|
94
|
+
curve: "ed25519",
|
|
95
|
+
password: pin
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
const data = await response.json();
|
|
99
|
+
if (!response.ok || data.status !== "success") {
|
|
100
|
+
throw createAbcError(
|
|
101
|
+
"WALLET_NOT_FOUND" /* WALLET_NOT_FOUND */,
|
|
102
|
+
"Failed to generate Solana wallet",
|
|
103
|
+
data
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
const result = data.result;
|
|
107
|
+
const addressResult = await this.getSolanaAddress(
|
|
108
|
+
result.public_key,
|
|
109
|
+
this.config.environment === "production" ? "solana" : "solana_devnet"
|
|
110
|
+
);
|
|
111
|
+
return {
|
|
112
|
+
uid: result.uid || "",
|
|
113
|
+
sessionId: result.share_id,
|
|
114
|
+
shareId: result.share_id,
|
|
115
|
+
publicKey: result.public_key,
|
|
116
|
+
address: addressResult,
|
|
117
|
+
keyId: result.key_id || result.share_id,
|
|
118
|
+
encryptedShare: result.encrypted_share || ""
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get Solana address from Ed25519 public key
|
|
123
|
+
*/
|
|
124
|
+
async getSolanaAddress(publicKey, network) {
|
|
125
|
+
const url = "${this.baseURL}/wapi/v2/solana/wallet/getAddress";
|
|
126
|
+
const response = await fetch(url, {
|
|
127
|
+
method: "POST",
|
|
128
|
+
headers: {
|
|
129
|
+
...DEFAULT_HEADERS,
|
|
130
|
+
...this.accessToken ? { Authorization: "Bearer ${this.accessToken}" } : {}
|
|
131
|
+
},
|
|
132
|
+
body: JSON.stringify({
|
|
133
|
+
network,
|
|
134
|
+
publicKey
|
|
135
|
+
})
|
|
136
|
+
});
|
|
137
|
+
const data = await response.json();
|
|
138
|
+
if (!response.ok || data.status !== "success") {
|
|
139
|
+
throw createAbcError(
|
|
140
|
+
"NETWORK_ERROR" /* NETWORK_ERROR */,
|
|
141
|
+
"Failed to get Solana address",
|
|
142
|
+
data
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
return data.result?.data?.address;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export {
|
|
150
|
+
WalletApi
|
|
151
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
getInjectedConnector,
|
|
4
|
+
hasInjectedProvider
|
|
5
|
+
} from "./chunk-MBBGZGXF.js";
|
|
6
|
+
import {
|
|
7
|
+
getWalletConnectConnector
|
|
8
|
+
} from "./chunk-PODFK4OS.js";
|
|
9
|
+
|
|
10
|
+
// src/wallets/walletConnectors/coreWallet/coreWallet.ts
|
|
11
|
+
var coreWallet = ({
|
|
12
|
+
projectId,
|
|
13
|
+
walletConnectParameters
|
|
14
|
+
}) => {
|
|
15
|
+
const isCoreInjected = hasInjectedProvider({
|
|
16
|
+
namespace: "avalanche",
|
|
17
|
+
flag: "isAvalanche"
|
|
18
|
+
});
|
|
19
|
+
const shouldUseWalletConnect = !isCoreInjected;
|
|
20
|
+
return {
|
|
21
|
+
id: "core",
|
|
22
|
+
name: "Core",
|
|
23
|
+
rdns: "app.core.extension",
|
|
24
|
+
iconUrl: async () => (await import("./coreWallet-52SXITOT.js")).default,
|
|
25
|
+
iconBackground: "#1A1A1C",
|
|
26
|
+
installed: !shouldUseWalletConnect ? isCoreInjected : void 0,
|
|
27
|
+
downloadUrls: {
|
|
28
|
+
android: "https://play.google.com/store/apps/details?id=com.avaxwallet",
|
|
29
|
+
ios: "https://apps.apple.com/us/app/core-wallet/id6443685999",
|
|
30
|
+
mobile: "https://core.app/?downloadCoreMobile=1",
|
|
31
|
+
qrCode: "https://core.app/?downloadCoreMobile=1",
|
|
32
|
+
chrome: "https://chrome.google.com/webstore/detail/core-crypto-wallet-nft-ex/agoakfejjabomempkjlepdflaleeobhb",
|
|
33
|
+
browserExtension: "https://extension.core.app/"
|
|
34
|
+
},
|
|
35
|
+
mobile: {
|
|
36
|
+
getUri: shouldUseWalletConnect ? (uri) => uri : void 0
|
|
37
|
+
},
|
|
38
|
+
qrCode: shouldUseWalletConnect ? {
|
|
39
|
+
getUri: (uri) => uri,
|
|
40
|
+
instructions: {
|
|
41
|
+
learnMoreUrl: "https://support.avax.network/en/articles/6115608-core-mobile-how-to-add-the-core-mobile-to-my-phone",
|
|
42
|
+
steps: [
|
|
43
|
+
{
|
|
44
|
+
description: "wallet_connectors.core.qr_code.step1.description",
|
|
45
|
+
step: "install",
|
|
46
|
+
title: "wallet_connectors.core.qr_code.step1.title"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
description: "wallet_connectors.core.qr_code.step2.description",
|
|
50
|
+
step: "create",
|
|
51
|
+
title: "wallet_connectors.core.qr_code.step2.title"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
description: "wallet_connectors.core.qr_code.step3.description",
|
|
55
|
+
step: "scan",
|
|
56
|
+
title: "wallet_connectors.core.qr_code.step3.title"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
} : void 0,
|
|
61
|
+
extension: {
|
|
62
|
+
instructions: {
|
|
63
|
+
learnMoreUrl: "https://extension.core.app/",
|
|
64
|
+
steps: [
|
|
65
|
+
{
|
|
66
|
+
description: "wallet_connectors.core.extension.step1.description",
|
|
67
|
+
step: "install",
|
|
68
|
+
title: "wallet_connectors.core.extension.step1.title"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
description: "wallet_connectors.core.extension.step2.description",
|
|
72
|
+
step: "create",
|
|
73
|
+
title: "wallet_connectors.core.extension.step2.title"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
description: "wallet_connectors.core.extension.step3.description",
|
|
77
|
+
step: "refresh",
|
|
78
|
+
title: "wallet_connectors.core.extension.step3.title"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
createConnector: shouldUseWalletConnect ? getWalletConnectConnector({
|
|
84
|
+
projectId,
|
|
85
|
+
walletConnectParameters
|
|
86
|
+
}) : getInjectedConnector({
|
|
87
|
+
namespace: "avalanche",
|
|
88
|
+
flag: "isAvalanche"
|
|
89
|
+
})
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
coreWallet
|
|
95
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
createAbcSolanaConnector
|
|
4
|
+
} from "./chunk-AEQOPQL6.js";
|
|
5
|
+
import {
|
|
6
|
+
createAbcSolanaProvider
|
|
7
|
+
} from "./chunk-MY5YIDOB.js";
|
|
8
|
+
import {
|
|
9
|
+
createAbcWaasClient
|
|
10
|
+
} from "./chunk-LV765WZL.js";
|
|
11
|
+
|
|
12
|
+
// src/wallets/walletConnectors/abcWallet/abcSolanaWallet.ts
|
|
13
|
+
var abcSolanaWallet = (options) => ({
|
|
14
|
+
id: "abc-solana",
|
|
15
|
+
name: "ABC Solana Wallet",
|
|
16
|
+
iconUrl: async () => (await import("./abcWallet-AYWSIGAG.js")).default,
|
|
17
|
+
iconBackground: "#fff",
|
|
18
|
+
// Embedded wallet - no download URLs needed
|
|
19
|
+
installed: void 0,
|
|
20
|
+
createConnector: () => {
|
|
21
|
+
console.log("[abcSolanaWallet] Creating Solana connector with options:", {
|
|
22
|
+
hasConfig: !!options.config,
|
|
23
|
+
waasUrl: options.config.waasUrl,
|
|
24
|
+
environment: options.config.environment
|
|
25
|
+
});
|
|
26
|
+
const client = createAbcWaasClient(options.config);
|
|
27
|
+
const provider = createAbcSolanaProvider(client);
|
|
28
|
+
const connector = createAbcSolanaConnector({
|
|
29
|
+
client,
|
|
30
|
+
provider
|
|
31
|
+
});
|
|
32
|
+
console.log("[abcSolanaWallet] Solana connector created successfully");
|
|
33
|
+
return connector;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
abcSolanaWallet
|
|
39
|
+
};
|