@talken/talkenkit 2.4.21 → 2.4.22
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/abcWallet-4RS3B4ZG.js +188 -0
- package/dist/abcWallet-EBOW2RJB.js +188 -0
- package/dist/abcWallet-RS4EOJ4I.js +188 -0
- package/dist/abcWallet-SNEZVK7V.js +188 -0
- package/dist/abcWallet-TC7M2JYX.js +188 -0
- package/dist/abcWallet-VZMW2DR3.js +188 -0
- package/dist/abcWallet-XJ3WSUVI.js +188 -0
- package/dist/abcWallet-XNCBZAIQ.js +188 -0
- package/dist/chunk-6FLQAAC4.js +7213 -0
- package/dist/chunk-7GIIMIPN.js +7213 -0
- package/dist/chunk-IBFA37SC.js +7228 -0
- package/dist/chunk-O5ZOC4NJ.js +7215 -0
- package/dist/chunk-OPOAKGEX.js +7216 -0
- package/dist/chunk-OTIHVCVR.js +7213 -0
- package/dist/chunk-P77BVZZF.js +7369 -0
- package/dist/chunk-RFLXXSQH.js +7139 -0
- package/dist/components/ConfirmationModal/NonEvmConfirmationModal.css.d.ts +11 -0
- package/dist/components/ConfirmationModal/NonEvmSignConfirmationModal.d.ts +9 -0
- package/dist/components/ConfirmationModal/NonEvmTransferConfirmationModal.d.ts +9 -0
- package/dist/components/ConfirmationModal/SignConfirmationModal.css.d.ts +1 -19
- package/dist/components/ConfirmationModal/TransactionConfirmationModal.css.d.ts +1 -20
- package/dist/components/ConfirmationModal/commonStyles.css.d.ts +19 -0
- package/dist/components/ConfirmationModal/index.d.ts +2 -0
- package/dist/components/ConfirmationModal/utils.d.ts +2 -1
- package/dist/hooks/useWalletCapabilities.d.ts +2 -0
- package/dist/index.css +227 -307
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2004 -1064
- package/dist/providers/SignConfirmationProvider/NonEvmConfirmationContext.d.ts +6 -0
- package/dist/providers/SignConfirmationProvider/index.d.ts +2 -1
- package/dist/providers/SignConfirmationProvider/requestParsers.d.ts +6 -1
- package/dist/providers/SignConfirmationProvider/types.d.ts +35 -1
- package/dist/wallets/capabilities/detectCapabilities.d.ts +7 -0
- package/dist/wallets/capabilities/requestWalletAction.d.ts +8 -0
- package/dist/wallets/capabilities/types.d.ts +50 -0
- package/dist/wallets/walletConnectors/abcWallet/abcApi.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/abcBitcoinConnector.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/abcBitcoinProvider.d.ts +10 -0
- package/dist/wallets/walletConnectors/abcWallet/abcBitcoinProvider.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/abcConnector.js +5 -5
- package/dist/wallets/walletConnectors/abcWallet/abcProvider.d.ts +9 -0
- package/dist/wallets/walletConnectors/abcWallet/abcProvider.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaProvider.d.ts +10 -0
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaProvider.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaWalletAdapter.d.ts +16 -0
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaWalletAdapter.js +115 -33
- package/dist/wallets/walletConnectors/abcWallet/abcTronProvider.d.ts +16 -0
- package/dist/wallets/walletConnectors/abcWallet/abcTronProvider.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/abcWallet.js +7 -7
- package/dist/wallets/walletConnectors/abcWallet/api/AuthApi.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/api/BaseApiClient.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/api/BitcoinApi.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/api/GasApi.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/api/SolanaApi.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/api/TalkenApiClient.d.ts +9 -4
- package/dist/wallets/walletConnectors/abcWallet/api/TalkenApiClient.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/api/TransactionApi.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/api/TronApi.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/api/WalletApi.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/api/WalletscanApi.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/api/index.js +13 -13
- package/dist/wallets/walletConnectors/abcWallet/constants.d.ts +5 -4
- package/dist/wallets/walletConnectors/abcWallet/constants.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/index.js +21 -21
- package/dist/wallets/walletConnectors/abcWallet/types.d.ts +31 -1
- package/dist/wallets/walletConnectors/abcWallet/utils.js +2 -2
- package/dist/wallets/walletConnectors/berasigWallet/berasigWallet.js +2 -2
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/binanceWallet/binanceWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/chunk-2IZBLAHI.js +52 -0
- package/dist/wallets/walletConnectors/chunk-32IJ3ILH.js +71 -0
- package/dist/wallets/walletConnectors/chunk-3AX66UHT.js +479 -0
- package/dist/wallets/walletConnectors/chunk-3BVPV64G.js +36 -0
- package/dist/wallets/walletConnectors/chunk-3DGFHWI3.js +302 -0
- package/dist/wallets/walletConnectors/chunk-4FKUVQCM.js +655 -0
- package/dist/wallets/walletConnectors/chunk-56SF4VRC.js +640 -0
- package/dist/wallets/walletConnectors/chunk-5KOE7NJW.js +52 -0
- package/dist/wallets/walletConnectors/chunk-6CVXZ3ZW.js +771 -0
- package/dist/wallets/walletConnectors/chunk-6GCWEPU7.js +643 -0
- package/dist/wallets/walletConnectors/chunk-6YFP3Q2I.js +118 -0
- package/dist/wallets/walletConnectors/chunk-7EEPPULA.js +118 -0
- package/dist/wallets/walletConnectors/chunk-7QL42XTB.js +302 -0
- package/dist/wallets/walletConnectors/chunk-A7ZSPSFX.js +577 -0
- package/dist/wallets/walletConnectors/chunk-AI3CT254.js +302 -0
- package/dist/wallets/walletConnectors/chunk-AMNVH7CZ.js +151 -0
- package/dist/wallets/walletConnectors/chunk-AOREXGRM.js +350 -0
- package/dist/wallets/walletConnectors/chunk-BLO7E54F.js +302 -0
- package/dist/wallets/walletConnectors/chunk-BNRH5PYS.js +52 -0
- package/dist/wallets/walletConnectors/chunk-BOV5FXU6.js +151 -0
- package/dist/wallets/walletConnectors/chunk-BR25RFNF.js +260 -0
- package/dist/wallets/walletConnectors/chunk-BXQ2UWJ3.js +91 -0
- package/dist/wallets/walletConnectors/chunk-CAMPW7O2.js +874 -0
- package/dist/wallets/walletConnectors/chunk-CLMFCNP7.js +52 -0
- package/dist/wallets/walletConnectors/chunk-DSZOE65L.js +107 -0
- package/dist/wallets/walletConnectors/chunk-DU6RCLWT.js +272 -0
- package/dist/wallets/walletConnectors/chunk-ENN6UGGA.js +421 -0
- package/dist/wallets/walletConnectors/chunk-EXWDLN5V.js +204 -0
- package/dist/wallets/walletConnectors/chunk-FFU26Y5Y.js +272 -0
- package/dist/wallets/walletConnectors/chunk-FGS2WHVA.js +118 -0
- package/dist/wallets/walletConnectors/chunk-FJJ3QI4R.js +91 -0
- package/dist/wallets/walletConnectors/chunk-FS2OOQYF.js +204 -0
- package/dist/wallets/walletConnectors/chunk-G5X3COSW.js +205 -0
- package/dist/wallets/walletConnectors/chunk-H53R4SFZ.js +204 -0
- package/dist/wallets/walletConnectors/chunk-J4QGDATF.js +71 -0
- package/dist/wallets/walletConnectors/chunk-JIJNCMJR.js +874 -0
- package/dist/wallets/walletConnectors/chunk-JSGZYU4A.js +52 -0
- package/dist/wallets/walletConnectors/chunk-JVT7R2GZ.js +771 -0
- package/dist/wallets/walletConnectors/chunk-K3JNN5UK.js +71 -0
- package/dist/wallets/walletConnectors/chunk-KBHPY3NA.js +302 -0
- package/dist/wallets/walletConnectors/chunk-KEX6WS23.js +640 -0
- package/dist/wallets/walletConnectors/chunk-KHYKVVR7.js +52 -0
- package/dist/wallets/walletConnectors/chunk-LOL7ZZ3S.js +302 -0
- package/dist/wallets/walletConnectors/chunk-LOSXI36Y.js +479 -0
- package/dist/wallets/walletConnectors/chunk-M2U5QGM7.js +260 -0
- package/dist/wallets/walletConnectors/chunk-M73AWLIV.js +107 -0
- package/dist/wallets/walletConnectors/chunk-MAUC46AE.js +302 -0
- package/dist/wallets/walletConnectors/chunk-MBRXYEQC.js +272 -0
- package/dist/wallets/walletConnectors/chunk-MDDD4LG2.js +874 -0
- package/dist/wallets/walletConnectors/chunk-MMR2QAEU.js +642 -0
- package/dist/wallets/walletConnectors/chunk-MNZZRFUC.js +302 -0
- package/dist/wallets/walletConnectors/chunk-OIRY24PH.js +302 -0
- package/dist/wallets/walletConnectors/chunk-ORBX4JE2.js +52 -0
- package/dist/wallets/walletConnectors/chunk-OXJFFDW7.js +761 -0
- package/dist/wallets/walletConnectors/chunk-QD3PPWTN.js +272 -0
- package/dist/wallets/walletConnectors/chunk-RCIABMG5.js +259 -0
- package/dist/wallets/walletConnectors/chunk-RHC4SVLB.js +71 -0
- package/dist/wallets/walletConnectors/chunk-S2CB4KFC.js +71 -0
- package/dist/wallets/walletConnectors/chunk-S6HZD4XZ.js +302 -0
- package/dist/wallets/walletConnectors/chunk-S72LCNVX.js +272 -0
- package/dist/wallets/walletConnectors/chunk-SCWE5EEX.js +91 -0
- package/dist/wallets/walletConnectors/chunk-TKEL4D4E.js +151 -0
- package/dist/wallets/walletConnectors/chunk-TKJEMEBZ.js +71 -0
- package/dist/wallets/walletConnectors/chunk-TZ44ZREA.js +302 -0
- package/dist/wallets/walletConnectors/chunk-UGQSI3US.js +547 -0
- package/dist/wallets/walletConnectors/chunk-UU4JYY3C.js +205 -0
- package/dist/wallets/walletConnectors/chunk-V5P5BL6Z.js +302 -0
- package/dist/wallets/walletConnectors/chunk-VH6DIRPF.js +71 -0
- package/dist/wallets/walletConnectors/chunk-VPNZAMW5.js +205 -0
- package/dist/wallets/walletConnectors/chunk-W6QN6QXO.js +52 -0
- package/dist/wallets/walletConnectors/chunk-WDULICVN.js +302 -0
- package/dist/wallets/walletConnectors/chunk-WGGHGODM.js +272 -0
- package/dist/wallets/walletConnectors/chunk-XUCMTLM3.js +52 -0
- package/dist/wallets/walletConnectors/chunk-Y5WAX6WO.js +52 -0
- package/dist/wallets/walletConnectors/chunk-Y62PFBWE.js +640 -0
- package/dist/wallets/walletConnectors/chunk-Z6ABK6G6.js +107 -0
- package/dist/wallets/walletConnectors/chunk-ZCA5QSIM.js +71 -0
- package/dist/wallets/walletConnectors/chunk-ZJDZJW55.js +479 -0
- package/dist/wallets/walletConnectors/chunk-ZOF7ZDGU.js +52 -0
- package/dist/wallets/walletConnectors/chunk-ZUU57RHO.js +36 -0
- package/dist/wallets/walletConnectors/chunk-ZWFGRREM.js +36 -0
- package/dist/wallets/walletConnectors/chunk-ZY5BCHP2.js +302 -0
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +91 -91
- package/dist/wallets/walletConnectors/iopayWallet/iopayWallet.js +2 -2
- package/dist/wallets/walletConnectors/kaiaWallet/kaiaWallet.js +2 -2
- package/dist/wallets/walletConnectors/kaikasWallet/kaikasWallet.js +2 -2
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zealWallet/zealWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +11 -12
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/wallets/walletConnectors/abcWallet/abcTronProvider.ts
|
|
4
|
+
import { getTalkenApiClient } from "@talken/talkenkit";
|
|
5
|
+
var TronErrorCode = {
|
|
6
|
+
USER_REJECTED: 4001,
|
|
7
|
+
UNAUTHORIZED: 4100,
|
|
8
|
+
UNSUPPORTED_METHOD: 4200,
|
|
9
|
+
DISCONNECTED: 4900,
|
|
10
|
+
INVALID_PARAMS: -32602,
|
|
11
|
+
INTERNAL_ERROR: -32603,
|
|
12
|
+
INSUFFICIENT_FUNDS: 5001
|
|
13
|
+
};
|
|
14
|
+
var TronProviderError = class extends Error {
|
|
15
|
+
constructor(code, message, data) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.code = code;
|
|
18
|
+
this.data = data;
|
|
19
|
+
this.name = "TronProviderError";
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var TRON_NETWORKS = {
|
|
23
|
+
mainnet: {
|
|
24
|
+
name: "TRON Mainnet",
|
|
25
|
+
type: "tron",
|
|
26
|
+
explorer: "https://tronscan.org"
|
|
27
|
+
},
|
|
28
|
+
nile: {
|
|
29
|
+
name: "TRON Nile Testnet",
|
|
30
|
+
type: "tron_nile",
|
|
31
|
+
explorer: "https://nile.tronscan.org"
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var EventEmitter = class {
|
|
35
|
+
constructor() {
|
|
36
|
+
this.events = /* @__PURE__ */ new Map();
|
|
37
|
+
}
|
|
38
|
+
on(event, listener) {
|
|
39
|
+
if (!this.events.has(event)) {
|
|
40
|
+
this.events.set(event, []);
|
|
41
|
+
}
|
|
42
|
+
this.events.get(event).push(listener);
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
off(event, listener) {
|
|
46
|
+
const listeners = this.events.get(event);
|
|
47
|
+
if (listeners) {
|
|
48
|
+
const index = listeners.indexOf(listener);
|
|
49
|
+
if (index !== -1) {
|
|
50
|
+
listeners.splice(index, 1);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
emit(event, ...args) {
|
|
56
|
+
const listeners = this.events.get(event);
|
|
57
|
+
if (listeners) {
|
|
58
|
+
for (const listener of listeners) {
|
|
59
|
+
listener(...args);
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
removeAllListeners(event) {
|
|
66
|
+
if (event) {
|
|
67
|
+
this.events.delete(event);
|
|
68
|
+
} else {
|
|
69
|
+
this.events.clear();
|
|
70
|
+
}
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var AbcTronProvider = class extends EventEmitter {
|
|
75
|
+
constructor(_client) {
|
|
76
|
+
super();
|
|
77
|
+
this.wallet = null;
|
|
78
|
+
this.network = TRON_NETWORKS.mainnet;
|
|
79
|
+
this.connected = false;
|
|
80
|
+
this.tokenMetadataCache = /* @__PURE__ */ new Map();
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Set request interceptor for transfer confirmation modals
|
|
84
|
+
*/
|
|
85
|
+
setRequestInterceptor(interceptor) {
|
|
86
|
+
this.requestInterceptor = interceptor;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Call request interceptor if set (throws on user cancel)
|
|
90
|
+
*/
|
|
91
|
+
async callInterceptor(request) {
|
|
92
|
+
if (this.requestInterceptor) {
|
|
93
|
+
await this.requestInterceptor(request);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Set wallet information
|
|
98
|
+
*/
|
|
99
|
+
setWallet(wallet) {
|
|
100
|
+
const previousAddress = this.wallet?.address;
|
|
101
|
+
this.wallet = wallet;
|
|
102
|
+
this.connected = true;
|
|
103
|
+
if (wallet.network === "tron") {
|
|
104
|
+
this.network = TRON_NETWORKS.mainnet;
|
|
105
|
+
} else {
|
|
106
|
+
this.network = TRON_NETWORKS.nile;
|
|
107
|
+
}
|
|
108
|
+
if (previousAddress !== wallet.address) {
|
|
109
|
+
this.emit("accountsChanged", [wallet.address]);
|
|
110
|
+
}
|
|
111
|
+
this.emit("connect", {
|
|
112
|
+
address: wallet.address,
|
|
113
|
+
network: this.network.type
|
|
114
|
+
});
|
|
115
|
+
console.log(
|
|
116
|
+
"[TronProvider] \u2705 Wallet connected:",
|
|
117
|
+
`${wallet.address.substring(0, 6)}...${wallet.address.substring(wallet.address.length - 6)}`
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Clear wallet (disconnect)
|
|
122
|
+
*/
|
|
123
|
+
clearWallet() {
|
|
124
|
+
this.wallet = null;
|
|
125
|
+
this.connected = false;
|
|
126
|
+
this.emit("disconnect");
|
|
127
|
+
this.emit("accountsChanged", []);
|
|
128
|
+
console.log("[TronProvider] \u{1F50C} Wallet disconnected");
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Set TalkenApiClient for backend-proxied transaction flow
|
|
132
|
+
* When set, sendTransaction will use a single API call instead of multi-step WaaS
|
|
133
|
+
*/
|
|
134
|
+
setTalkenApi(talkenApi) {
|
|
135
|
+
this.talkenApi = talkenApi;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Fetch token metadata (symbol, logo) from walletscan API with caching.
|
|
139
|
+
* Falls back to 'TRX'/'TRC20' on failure.
|
|
140
|
+
*/
|
|
141
|
+
async fetchTokenMetadata(contractAddress) {
|
|
142
|
+
const cacheKey = contractAddress || "__native__";
|
|
143
|
+
const cached = this.tokenMetadataCache.get(cacheKey);
|
|
144
|
+
if (cached)
|
|
145
|
+
return cached;
|
|
146
|
+
try {
|
|
147
|
+
const api = this.talkenApi || getTalkenApiClient();
|
|
148
|
+
const chainKeys = this.network.type === "tron_nile" ? "tronNile" : "tron";
|
|
149
|
+
let tokens;
|
|
150
|
+
if (contractAddress) {
|
|
151
|
+
tokens = await api.walletscan.getToken({ chainKeys, contractAddress });
|
|
152
|
+
} else {
|
|
153
|
+
tokens = await api.walletscan.getNativeTokens({
|
|
154
|
+
chainKeys,
|
|
155
|
+
walletAddress: this.wallet.address
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
if (tokens.length > 0) {
|
|
159
|
+
const info = { symbol: tokens[0].symbol, logo: tokens[0].logo };
|
|
160
|
+
this.tokenMetadataCache.set(cacheKey, info);
|
|
161
|
+
return info;
|
|
162
|
+
}
|
|
163
|
+
} catch {
|
|
164
|
+
}
|
|
165
|
+
return { symbol: contractAddress ? "TRC20" : "TRX" };
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Check if connected
|
|
169
|
+
*/
|
|
170
|
+
isConnected() {
|
|
171
|
+
return this.connected && this.wallet !== null;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Get TRON address
|
|
175
|
+
*/
|
|
176
|
+
async getAddress() {
|
|
177
|
+
if (!this.wallet) {
|
|
178
|
+
throw new TronProviderError(
|
|
179
|
+
TronErrorCode.DISCONNECTED,
|
|
180
|
+
"Wallet not connected"
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
return this.wallet.address;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Get public key
|
|
187
|
+
*/
|
|
188
|
+
async getPublicKey() {
|
|
189
|
+
if (!this.wallet) {
|
|
190
|
+
throw new TronProviderError(
|
|
191
|
+
TronErrorCode.DISCONNECTED,
|
|
192
|
+
"Wallet not connected"
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
return this.wallet.publicKey;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Get current network
|
|
199
|
+
*/
|
|
200
|
+
getNetwork() {
|
|
201
|
+
return this.network;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Sign TRON message (not supported)
|
|
205
|
+
*/
|
|
206
|
+
async signMessage(_message) {
|
|
207
|
+
throw new TronProviderError(
|
|
208
|
+
TronErrorCode.UNSUPPORTED_METHOD,
|
|
209
|
+
"TRON message signing is not supported. Use sendTransaction() instead."
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Send TRON transaction (TRX native or TRC20)
|
|
214
|
+
* Complete flow: create unsigned tx -> request PIN -> sign -> broadcast
|
|
215
|
+
*
|
|
216
|
+
* @param params - Transaction parameters
|
|
217
|
+
* @returns Transaction hash
|
|
218
|
+
*/
|
|
219
|
+
async sendTransaction(params) {
|
|
220
|
+
if (!this.wallet) {
|
|
221
|
+
throw new TronProviderError(
|
|
222
|
+
TronErrorCode.DISCONNECTED,
|
|
223
|
+
"Wallet not connected"
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
try {
|
|
227
|
+
const tokenMetadata = await this.fetchTokenMetadata(
|
|
228
|
+
params.contractAddress
|
|
229
|
+
);
|
|
230
|
+
await this.callInterceptor({
|
|
231
|
+
chain: "tron",
|
|
232
|
+
method: "sendTransaction",
|
|
233
|
+
fromAddress: this.wallet.address,
|
|
234
|
+
toAddress: params.toAddress,
|
|
235
|
+
amount: params.amount,
|
|
236
|
+
symbol: tokenMetadata.symbol,
|
|
237
|
+
network: this.network.type,
|
|
238
|
+
tokenAddress: params.contractAddress,
|
|
239
|
+
isNativeToken: !params.contractAddress,
|
|
240
|
+
feeSymbol: "TRX",
|
|
241
|
+
tokenLogo: tokenMetadata.logo
|
|
242
|
+
});
|
|
243
|
+
console.log("[TronProvider] \u{1F4B8} Starting TRON transaction...");
|
|
244
|
+
const pinHash = localStorage.getItem("talkenkit_abc_pin_hash");
|
|
245
|
+
if (!pinHash) {
|
|
246
|
+
throw new TronProviderError(
|
|
247
|
+
TronErrorCode.INTERNAL_ERROR,
|
|
248
|
+
"PIN hash not found. Please login again."
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
const txType = params.contractAddress ? "TRC20" : "NATIVE";
|
|
252
|
+
let amountRaw;
|
|
253
|
+
if (txType === "NATIVE") {
|
|
254
|
+
amountRaw = Math.floor(
|
|
255
|
+
Number.parseFloat(params.amount) * 1e6
|
|
256
|
+
).toString();
|
|
257
|
+
console.log(
|
|
258
|
+
`[TronProvider] Converting ${params.amount} TRX -> ${amountRaw} SUN`
|
|
259
|
+
);
|
|
260
|
+
} else {
|
|
261
|
+
const decimals = params.decimals ?? 6;
|
|
262
|
+
amountRaw = Math.floor(
|
|
263
|
+
Number.parseFloat(params.amount) * 10 ** decimals
|
|
264
|
+
).toString();
|
|
265
|
+
console.log(
|
|
266
|
+
`[TronProvider] Converting ${params.amount} -> ${amountRaw} (decimals: ${decimals})`
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
let email;
|
|
270
|
+
try {
|
|
271
|
+
const authState = localStorage.getItem("talkenkit_abc_auth_state");
|
|
272
|
+
if (authState) {
|
|
273
|
+
const authData = JSON.parse(authState);
|
|
274
|
+
email = authData.user?.email;
|
|
275
|
+
}
|
|
276
|
+
} catch {
|
|
277
|
+
}
|
|
278
|
+
const api = this.talkenApi || getTalkenApiClient();
|
|
279
|
+
const request = txType === "NATIVE" ? {
|
|
280
|
+
kind: "native",
|
|
281
|
+
network: this.network.type,
|
|
282
|
+
toAddress: params.toAddress,
|
|
283
|
+
amountSun: amountRaw,
|
|
284
|
+
pin: pinHash,
|
|
285
|
+
...email && { email }
|
|
286
|
+
} : {
|
|
287
|
+
kind: "trc20",
|
|
288
|
+
network: this.network.type,
|
|
289
|
+
toAddress: params.toAddress,
|
|
290
|
+
contractAddress: params.contractAddress,
|
|
291
|
+
amount: amountRaw,
|
|
292
|
+
feeLimit: params.feeLimit,
|
|
293
|
+
pin: pinHash,
|
|
294
|
+
...email && { email }
|
|
295
|
+
};
|
|
296
|
+
const result = await api.tron.transferTrx(request);
|
|
297
|
+
const txHash = result.txHash;
|
|
298
|
+
console.log(
|
|
299
|
+
`[TronProvider] \u2705 ${txType === "NATIVE" ? "TRX" : "TRC-20"} transaction complete via TalkenApiClient:`,
|
|
300
|
+
txHash
|
|
301
|
+
);
|
|
302
|
+
this.emit("transactionBroadcasted", {
|
|
303
|
+
txHash,
|
|
304
|
+
explorerUrl: `${this.network.explorer}/#/transaction/${txHash}`
|
|
305
|
+
});
|
|
306
|
+
return txHash;
|
|
307
|
+
} catch (error) {
|
|
308
|
+
if (error.message?.includes("cancelled") || error.message?.includes("rejected")) {
|
|
309
|
+
console.log("[TronProvider] \u2139\uFE0F User cancelled transaction");
|
|
310
|
+
throw new TronProviderError(
|
|
311
|
+
TronErrorCode.USER_REJECTED,
|
|
312
|
+
"User rejected transaction",
|
|
313
|
+
error
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
console.error("[TronProvider] \u274C Transaction failed:", error.message);
|
|
317
|
+
if (error.message?.includes("insufficient")) {
|
|
318
|
+
throw new TronProviderError(
|
|
319
|
+
TronErrorCode.INSUFFICIENT_FUNDS,
|
|
320
|
+
"Insufficient TRX balance",
|
|
321
|
+
error
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
this.emit("error", error);
|
|
325
|
+
throw new TronProviderError(
|
|
326
|
+
TronErrorCode.INTERNAL_ERROR,
|
|
327
|
+
error.message || "Failed to send TRON transaction",
|
|
328
|
+
error
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Get wallet info
|
|
334
|
+
*/
|
|
335
|
+
getWalletInfo() {
|
|
336
|
+
if (!this.wallet)
|
|
337
|
+
return null;
|
|
338
|
+
return {
|
|
339
|
+
address: this.wallet.address,
|
|
340
|
+
publicKey: this.wallet.publicKey,
|
|
341
|
+
network: this.network.type
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
export {
|
|
347
|
+
TronProviderError,
|
|
348
|
+
TRON_NETWORKS,
|
|
349
|
+
AbcTronProvider
|
|
350
|
+
};
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
createAbcEvmProvider
|
|
4
|
+
} from "./chunk-Y62PFBWE.js";
|
|
5
|
+
import {
|
|
6
|
+
createAbcWaasClient
|
|
7
|
+
} from "./chunk-MDDD4LG2.js";
|
|
8
|
+
import {
|
|
9
|
+
setGlobalDefaultBitcoinNetwork,
|
|
10
|
+
setGlobalDefaultChainId,
|
|
11
|
+
setGlobalDefaultSolanaNetwork
|
|
12
|
+
} from "./chunk-O4AU63LK.js";
|
|
13
|
+
import {
|
|
14
|
+
clearAuthState,
|
|
15
|
+
clearEncryptedTokens,
|
|
16
|
+
clearStorage,
|
|
17
|
+
loadAuthState,
|
|
18
|
+
loadFromStorage,
|
|
19
|
+
saveAuthState
|
|
20
|
+
} from "./chunk-ZJDZJW55.js";
|
|
21
|
+
|
|
22
|
+
// src/wallets/walletConnectors/abcWallet/abcConnector.ts
|
|
23
|
+
import { getTalkenApiClient } from "@talken/talkenkit";
|
|
24
|
+
import { createConnector } from "wagmi";
|
|
25
|
+
function abcConnector(options) {
|
|
26
|
+
const { config } = options;
|
|
27
|
+
if (config.defaultChainId) {
|
|
28
|
+
setGlobalDefaultChainId(config.defaultChainId);
|
|
29
|
+
}
|
|
30
|
+
if (config.defaultSolanaNetwork) {
|
|
31
|
+
setGlobalDefaultSolanaNetwork(config.defaultSolanaNetwork);
|
|
32
|
+
}
|
|
33
|
+
if (config.defaultBitcoinNetwork) {
|
|
34
|
+
setGlobalDefaultBitcoinNetwork(config.defaultBitcoinNetwork);
|
|
35
|
+
}
|
|
36
|
+
return createConnector((wagmiConfig) => {
|
|
37
|
+
const client = createAbcWaasClient(config);
|
|
38
|
+
const provider = createAbcEvmProvider(client);
|
|
39
|
+
let accountsChangedHandler;
|
|
40
|
+
let chainChangedHandler;
|
|
41
|
+
let disconnectHandler;
|
|
42
|
+
return {
|
|
43
|
+
id: "abc",
|
|
44
|
+
name: "ABC Wallet",
|
|
45
|
+
type: "abc",
|
|
46
|
+
/**
|
|
47
|
+
* Connect wallet
|
|
48
|
+
*/
|
|
49
|
+
async connect() {
|
|
50
|
+
try {
|
|
51
|
+
const authState = loadAuthState();
|
|
52
|
+
if (!authState || !authState.isAuthenticated || !authState.wallet) {
|
|
53
|
+
throw new Error("ABC_LOGIN_REQUIRED");
|
|
54
|
+
}
|
|
55
|
+
provider.setWallet(authState.wallet);
|
|
56
|
+
if (authState.accessToken && authState.refreshToken && authState.expiresAt) {
|
|
57
|
+
client.setTokens(
|
|
58
|
+
authState.accessToken,
|
|
59
|
+
authState.refreshToken,
|
|
60
|
+
authState.expiresAt
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
const accounts = await provider.request({
|
|
64
|
+
method: "eth_requestAccounts"
|
|
65
|
+
});
|
|
66
|
+
let currentChainId = await provider.request({
|
|
67
|
+
method: "eth_chainId"
|
|
68
|
+
});
|
|
69
|
+
const currentChainIdNumber = Number(currentChainId);
|
|
70
|
+
const isChainSupported = wagmiConfig.chains.some(
|
|
71
|
+
(c) => c.id === currentChainIdNumber
|
|
72
|
+
);
|
|
73
|
+
if (!isChainSupported && wagmiConfig.chains.length > 0) {
|
|
74
|
+
const fallbackChainId = wagmiConfig.chains[0].id;
|
|
75
|
+
await provider.request({
|
|
76
|
+
method: "wallet_switchEthereumChain",
|
|
77
|
+
params: [{ chainId: `0x${fallbackChainId.toString(16)}` }]
|
|
78
|
+
});
|
|
79
|
+
currentChainId = `0x${fallbackChainId.toString(16)}`;
|
|
80
|
+
if (authState.wallet) {
|
|
81
|
+
authState.wallet.chainId = fallbackChainId;
|
|
82
|
+
saveAuthState(authState);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (accountsChangedHandler) {
|
|
86
|
+
provider.removeListener("accountsChanged", accountsChangedHandler);
|
|
87
|
+
}
|
|
88
|
+
accountsChangedHandler = (accounts2) => {
|
|
89
|
+
wagmiConfig.emitter.emit("change", {
|
|
90
|
+
accounts: accounts2
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
provider.on("accountsChanged", accountsChangedHandler);
|
|
94
|
+
if (chainChangedHandler) {
|
|
95
|
+
provider.removeListener("chainChanged", chainChangedHandler);
|
|
96
|
+
}
|
|
97
|
+
chainChangedHandler = (chainId) => {
|
|
98
|
+
wagmiConfig.emitter.emit("change", {
|
|
99
|
+
chainId: Number(chainId)
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
provider.on("chainChanged", chainChangedHandler);
|
|
103
|
+
if (disconnectHandler) {
|
|
104
|
+
provider.removeListener("disconnect", disconnectHandler);
|
|
105
|
+
}
|
|
106
|
+
disconnectHandler = () => {
|
|
107
|
+
wagmiConfig.emitter.emit("disconnect");
|
|
108
|
+
this.onDisconnect();
|
|
109
|
+
};
|
|
110
|
+
provider.on("disconnect", disconnectHandler);
|
|
111
|
+
wagmiConfig.emitter.emit("connect", {
|
|
112
|
+
accounts,
|
|
113
|
+
chainId: Number(currentChainId)
|
|
114
|
+
});
|
|
115
|
+
return {
|
|
116
|
+
accounts,
|
|
117
|
+
chainId: Number(currentChainId)
|
|
118
|
+
};
|
|
119
|
+
} catch (error) {
|
|
120
|
+
console.error("\u274C ABC Connector connect() failed:", {
|
|
121
|
+
message: error.message,
|
|
122
|
+
code: error.code,
|
|
123
|
+
error
|
|
124
|
+
});
|
|
125
|
+
if (error.message === "ABC_LOGIN_REQUIRED") {
|
|
126
|
+
throw error;
|
|
127
|
+
}
|
|
128
|
+
throw error;
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
/**
|
|
132
|
+
* Disconnect wallet
|
|
133
|
+
*/
|
|
134
|
+
async disconnect() {
|
|
135
|
+
if (accountsChangedHandler) {
|
|
136
|
+
provider.removeListener("accountsChanged", accountsChangedHandler);
|
|
137
|
+
accountsChangedHandler = void 0;
|
|
138
|
+
}
|
|
139
|
+
if (chainChangedHandler) {
|
|
140
|
+
provider.removeListener("chainChanged", chainChangedHandler);
|
|
141
|
+
chainChangedHandler = void 0;
|
|
142
|
+
}
|
|
143
|
+
if (disconnectHandler) {
|
|
144
|
+
provider.removeListener("disconnect", disconnectHandler);
|
|
145
|
+
disconnectHandler = void 0;
|
|
146
|
+
}
|
|
147
|
+
provider.clearWallet();
|
|
148
|
+
await client.logout();
|
|
149
|
+
let savedPinHash = null;
|
|
150
|
+
let savedEmail = null;
|
|
151
|
+
if (typeof window !== "undefined") {
|
|
152
|
+
savedPinHash = localStorage.getItem("talkenkit_abc_pin_hash");
|
|
153
|
+
savedEmail = localStorage.getItem("talkenkit_abc_saved_email");
|
|
154
|
+
}
|
|
155
|
+
clearAuthState();
|
|
156
|
+
clearEncryptedTokens();
|
|
157
|
+
if (typeof window !== "undefined") {
|
|
158
|
+
localStorage.removeItem("talkenkit_abc_enc_salt");
|
|
159
|
+
localStorage.removeItem("talkenkit_abc_enc_tokens");
|
|
160
|
+
if (savedPinHash) {
|
|
161
|
+
localStorage.setItem("talkenkit_abc_pin_hash", savedPinHash);
|
|
162
|
+
}
|
|
163
|
+
if (savedEmail) {
|
|
164
|
+
localStorage.setItem("talkenkit_abc_saved_email", savedEmail);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
/**
|
|
169
|
+
* Get accounts
|
|
170
|
+
*/
|
|
171
|
+
async getAccounts() {
|
|
172
|
+
const accounts = await provider.request({
|
|
173
|
+
method: "eth_accounts"
|
|
174
|
+
});
|
|
175
|
+
return accounts.map((account) => account);
|
|
176
|
+
},
|
|
177
|
+
/**
|
|
178
|
+
* Get chain ID
|
|
179
|
+
*/
|
|
180
|
+
async getChainId() {
|
|
181
|
+
const chainId = await provider.request({
|
|
182
|
+
method: "eth_chainId"
|
|
183
|
+
});
|
|
184
|
+
return Number(chainId);
|
|
185
|
+
},
|
|
186
|
+
/**
|
|
187
|
+
* Get provider
|
|
188
|
+
*/
|
|
189
|
+
async getProvider() {
|
|
190
|
+
return provider;
|
|
191
|
+
},
|
|
192
|
+
/**
|
|
193
|
+
* Check if authorized (has valid session)
|
|
194
|
+
* Auto-refreshes access token if expired but refresh token is valid
|
|
195
|
+
*/
|
|
196
|
+
async isAuthorized() {
|
|
197
|
+
try {
|
|
198
|
+
const authState = loadAuthState();
|
|
199
|
+
if (!authState || !authState.isAuthenticated) {
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
202
|
+
if (!authState.wallet) {
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
if (client.isAuthenticated()) {
|
|
206
|
+
return true;
|
|
207
|
+
}
|
|
208
|
+
const refreshToken = loadFromStorage(
|
|
209
|
+
"refresh_token" /* REFRESH_TOKEN */
|
|
210
|
+
);
|
|
211
|
+
if (!refreshToken) {
|
|
212
|
+
clearStorage();
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
try {
|
|
216
|
+
const api = getTalkenApiClient();
|
|
217
|
+
if (!api) {
|
|
218
|
+
clearStorage();
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
const res = await api.auth.refresh();
|
|
222
|
+
client.setTokens(
|
|
223
|
+
res.accessToken,
|
|
224
|
+
res.refreshToken,
|
|
225
|
+
Date.now() + res.expiresIn * 1e3
|
|
226
|
+
);
|
|
227
|
+
const updatedState = loadAuthState();
|
|
228
|
+
return updatedState?.isAuthenticated ?? false;
|
|
229
|
+
} catch (error) {
|
|
230
|
+
console.error("[AbcConnector] Token refresh failed:", error);
|
|
231
|
+
clearStorage();
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
} catch (error) {
|
|
235
|
+
console.error(
|
|
236
|
+
"[AbcConnector] Unexpected error in isAuthorized:",
|
|
237
|
+
error
|
|
238
|
+
);
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
/**
|
|
243
|
+
* Switch chain
|
|
244
|
+
*/
|
|
245
|
+
async switchChain({ chainId }) {
|
|
246
|
+
await provider.request({
|
|
247
|
+
method: "wallet_switchEthereumChain",
|
|
248
|
+
params: [{ chainId: `0x${chainId.toString(16)}` }]
|
|
249
|
+
});
|
|
250
|
+
const newChainId = await this.getChainId();
|
|
251
|
+
const authState = loadAuthState();
|
|
252
|
+
if (authState?.wallet) {
|
|
253
|
+
authState.wallet.chainId = newChainId;
|
|
254
|
+
saveAuthState(authState);
|
|
255
|
+
}
|
|
256
|
+
return wagmiConfig.chains.find((x) => x.id === chainId) ?? {
|
|
257
|
+
id: chainId,
|
|
258
|
+
name: `Chain ${chainId}`,
|
|
259
|
+
nativeCurrency: {
|
|
260
|
+
name: "Ether",
|
|
261
|
+
decimals: 18,
|
|
262
|
+
symbol: "ETH"
|
|
263
|
+
},
|
|
264
|
+
rpcUrls: {
|
|
265
|
+
default: { http: [""] }
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
},
|
|
269
|
+
/**
|
|
270
|
+
* Handle accounts changed
|
|
271
|
+
*/
|
|
272
|
+
onAccountsChanged(accounts) {
|
|
273
|
+
if (accounts.length === 0) {
|
|
274
|
+
this.onDisconnect();
|
|
275
|
+
} else {
|
|
276
|
+
wagmiConfig.emitter.emit("change", {
|
|
277
|
+
accounts
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
/**
|
|
282
|
+
* Handle chain changed
|
|
283
|
+
*/
|
|
284
|
+
onChainChanged(chain) {
|
|
285
|
+
const chainId = Number(chain);
|
|
286
|
+
wagmiConfig.emitter.emit("change", { chainId });
|
|
287
|
+
},
|
|
288
|
+
/**
|
|
289
|
+
* Handle disconnect
|
|
290
|
+
*/
|
|
291
|
+
onDisconnect(_error) {
|
|
292
|
+
provider.clearWallet();
|
|
293
|
+
clearAuthState();
|
|
294
|
+
wagmiConfig.emitter.emit("disconnect");
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export {
|
|
301
|
+
abcConnector
|
|
302
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
createTalkenApiClient
|
|
4
|
+
} from "./chunk-6CVXZ3ZW.js";
|
|
5
|
+
import {
|
|
6
|
+
abcConnector
|
|
7
|
+
} from "./chunk-TZ44ZREA.js";
|
|
8
|
+
import {
|
|
9
|
+
ABC_WALLET_METADATA
|
|
10
|
+
} from "./chunk-BR25RFNF.js";
|
|
11
|
+
|
|
12
|
+
// src/wallets/walletConnectors/abcWallet/abcWallet.ts
|
|
13
|
+
import { setTalkenApiClient } from "@talken/talkenkit";
|
|
14
|
+
var abcWallet = (specificOptions) => ({ projectId }) => {
|
|
15
|
+
const talkenApiUrl = specificOptions?.talkenApiUrl || process.env.NEXT_PUBLIC_API_URL || "http://localhost:3001/api/v1";
|
|
16
|
+
const talkenApi = createTalkenApiClient({
|
|
17
|
+
baseUrl: talkenApiUrl,
|
|
18
|
+
debug: specificOptions?.environment === "development"
|
|
19
|
+
});
|
|
20
|
+
setTalkenApiClient(talkenApi);
|
|
21
|
+
const waasUrl = specificOptions?.waasUrl || process.env.NEXT_PUBLIC_ABC_WAAS_URL || process.env.VITE_ABC_WAAS_URL || "";
|
|
22
|
+
const config = {
|
|
23
|
+
waasUrl,
|
|
24
|
+
apiKey: specificOptions?.apiKey,
|
|
25
|
+
plain: specificOptions?.plain || "",
|
|
26
|
+
// Deprecated - not used (secure.ts uses random generation)
|
|
27
|
+
environment: specificOptions?.environment || "development",
|
|
28
|
+
defaultChainId: specificOptions?.defaultChainId,
|
|
29
|
+
defaultSolanaNetwork: specificOptions?.defaultSolanaNetwork,
|
|
30
|
+
defaultBitcoinNetwork: specificOptions?.defaultBitcoinNetwork,
|
|
31
|
+
projectId
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
id: ABC_WALLET_METADATA.id,
|
|
35
|
+
name: ABC_WALLET_METADATA.name,
|
|
36
|
+
rdns: ABC_WALLET_METADATA.rdns,
|
|
37
|
+
iconUrl: async () => (await import("./abcWallet-AYWSIGAG.js")).default,
|
|
38
|
+
iconBackground: ABC_WALLET_METADATA.iconBackground,
|
|
39
|
+
// Embedded wallet - no installation required
|
|
40
|
+
installed: void 0,
|
|
41
|
+
// No download URLs for embedded wallet
|
|
42
|
+
downloadUrls: void 0,
|
|
43
|
+
// Create connector - wrapper function required by Wallet type
|
|
44
|
+
createConnector: (_walletDetails) => abcConnector({ config }),
|
|
45
|
+
// Embedded wallet always available
|
|
46
|
+
hidden: () => false
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
abcWallet
|
|
52
|
+
};
|