@talken/talkenkit 2.7.5-beta.2 → 2.7.5-beta.3
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/AbcCredentialManager-6FBGTSSM.js +7 -0
- package/dist/abcWallet-6BIO6Q6T.js +184 -0
- package/dist/chunk-PZ4TCLAJ.js +7816 -0
- package/dist/chunk-SUYKWM5G.js +451 -0
- package/dist/components/ConfirmationModal/NonEvmSignConfirmationModal.d.ts +1 -1
- package/dist/components/ConfirmationModal/NonEvmTransferConfirmationModal.d.ts +1 -1
- package/dist/components/ConfirmationModal/SignConfirmationModal.d.ts +1 -1
- package/dist/components/ConfirmationModal/TransactionConfirmationModal.d.ts +2 -1
- package/dist/components/ConfirmationModal/constants.d.ts +0 -4
- package/dist/components/RainbowKitProvider/RainbowKitProvider.d.ts +31 -1
- package/dist/components/TransactionResultModal/TransactionResultModal.css.d.ts +3 -0
- package/dist/components/TransactionResultModal/TransactionResultModal.d.ts +1 -1
- package/dist/config/networks.d.ts +2 -1
- package/dist/gasless/GaslessConfigSingleton.d.ts +11 -0
- package/dist/gasless/api/ChainConfigApi.d.ts +20 -0
- package/dist/gasless/api/RelayerApi.d.ts +25 -0
- package/dist/gasless/api/TokenCapabilityApi.d.ts +12 -0
- package/dist/gasless/config.d.ts +12 -0
- package/dist/gasless/hooks/useGaslessTransfer.d.ts +18 -0
- package/dist/gasless/index.d.ts +12 -0
- package/dist/gasless/services/Eip7702Service.d.ts +80 -0
- package/dist/gasless/services/GaslessFeeService.d.ts +55 -0
- package/dist/gasless/services/GaslessTransferService.d.ts +61 -0
- package/dist/gasless/services/PermitSignService.d.ts +28 -0
- package/dist/gasless/signer/AbcWaasSigner.d.ts +27 -0
- package/dist/gasless/signer/GaslessSigner.d.ts +43 -0
- package/dist/gasless/signer/WagmiSigner.d.ts +63 -0
- package/dist/gasless/signer/index.d.ts +4 -0
- package/dist/gasless/types.d.ts +298 -0
- package/dist/gasless/utils/delegationGuard.d.ts +50 -0
- package/dist/gasless/utils/feeTokenResolver.d.ts +35 -0
- package/dist/gasless/utils/revokeDelegation.d.ts +55 -0
- package/dist/gasless/utils/transferDetector.d.ts +20 -0
- package/dist/hooks/internal/abcEmbeddedWallet.d.ts +1 -1
- package/dist/hooks/useXrplWallet.d.ts +77 -0
- package/dist/index.css +41 -37
- package/dist/index.d.ts +7 -2
- package/dist/index.js +2282 -1448
- package/dist/providers/AbcAuthProvider.d.ts +2 -1
- package/dist/providers/SignConfirmationProvider/SignConfirmationProvider.d.ts +1 -1
- package/dist/providers/SignConfirmationProvider/index.d.ts +1 -1
- package/dist/providers/SignConfirmationProvider/types.d.ts +14 -1
- package/dist/providers/SignConfirmationProvider/useTransactionResolver.d.ts +2 -1
- package/dist/providers/TransactionResultProvider/types.d.ts +7 -1
- package/dist/wallets/walletConnectors/abcWallet/AbcCredentialManager.d.ts +2 -0
- package/dist/wallets/walletConnectors/abcWallet/AbcCredentialManager.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/AbcEvmAutoConnector.js +5 -5
- package/dist/wallets/walletConnectors/abcWallet/AbstractChainProvider.d.ts +5 -0
- package/dist/wallets/walletConnectors/abcWallet/AbstractChainProvider.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/ProviderError.d.ts +3 -0
- package/dist/wallets/walletConnectors/abcWallet/ProviderError.js +5 -3
- package/dist/wallets/walletConnectors/abcWallet/StorageService.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/abcBitcoinConnector.js +8 -8
- package/dist/wallets/walletConnectors/abcWallet/abcBitcoinProvider.js +7 -7
- package/dist/wallets/walletConnectors/abcWallet/abcConnector.js +22 -21
- package/dist/wallets/walletConnectors/abcWallet/abcProvider.d.ts +16 -0
- package/dist/wallets/walletConnectors/abcWallet/abcProvider.js +11 -11
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaProvider.js +22 -21
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaWalletAdapter.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/abcTronProvider.js +7 -7
- package/dist/wallets/walletConnectors/abcWallet/abcWallet.js +23 -22
- package/dist/wallets/walletConnectors/abcWallet/abcXrplProvider.d.ts +99 -0
- package/dist/wallets/walletConnectors/abcWallet/abcXrplProvider.js +19 -0
- package/dist/wallets/walletConnectors/abcWallet/api/ConfigApi.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/api/TalkenApiClient.d.ts +3 -0
- package/dist/wallets/walletConnectors/abcWallet/api/TalkenApiClient.js +15 -14
- package/dist/wallets/walletConnectors/abcWallet/api/TokenApi.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/api/WalletscanApi.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/api/index.js +20 -19
- package/dist/wallets/walletConnectors/abcWallet/api/modules/auth.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/api/modules/bitcoin.js +5 -5
- package/dist/wallets/walletConnectors/abcWallet/api/modules/evm.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/api/modules/solana.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/api/modules/tron.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/api/modules/wallet.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/api/modules/walletscan.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/api/modules/xrp.d.ts +85 -0
- package/dist/wallets/walletConnectors/abcWallet/api/modules/xrp.js +8 -0
- package/dist/wallets/walletConnectors/abcWallet/constants.d.ts +9 -0
- package/dist/wallets/walletConnectors/abcWallet/constants.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/index.d.ts +5 -0
- package/dist/wallets/walletConnectors/abcWallet/index.js +71 -56
- package/dist/wallets/walletConnectors/abcWallet/networkConfig.d.ts +31 -3
- package/dist/wallets/walletConnectors/abcWallet/networkConfig.js +11 -3
- package/dist/wallets/walletConnectors/abcWallet/sessionUtils.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/types/api.types.d.ts +3 -1
- package/dist/wallets/walletConnectors/abcWallet/types/auth.types.d.ts +3 -1
- package/dist/wallets/walletConnectors/abcWallet/types/config.types.d.ts +1 -0
- package/dist/wallets/walletConnectors/abcWallet/types/config.types.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/types/wallet.types.d.ts +15 -1
- package/dist/wallets/walletConnectors/abcWallet/types.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/utils.js +5 -5
- package/dist/wallets/walletConnectors/abcWallet/walletGeneration.d.ts +2 -1
- package/dist/wallets/walletConnectors/abcWallet/walletGeneration.js +8 -8
- 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-2LH53QET.js +71 -0
- package/dist/wallets/walletConnectors/chunk-2LOET2LX.js +64 -0
- package/dist/wallets/walletConnectors/chunk-2XNFYA54.js +492 -0
- package/dist/wallets/walletConnectors/chunk-326CQ42T.js +378 -0
- package/dist/wallets/walletConnectors/chunk-3NWM24MH.js +61 -0
- package/dist/wallets/walletConnectors/chunk-3Z5DO42M.js +240 -0
- package/dist/wallets/walletConnectors/chunk-4Y7YP4IR.js +115 -0
- package/dist/wallets/walletConnectors/chunk-AJ2YNYCD.js +277 -0
- package/dist/wallets/walletConnectors/chunk-BOHX6ZNO.js +3030 -0
- package/dist/wallets/walletConnectors/chunk-E4B4UELA.js +3030 -0
- package/dist/wallets/walletConnectors/chunk-F74FF7OS.js +370 -0
- package/dist/wallets/walletConnectors/chunk-FWX2HD26.js +30 -0
- package/dist/wallets/walletConnectors/chunk-ICGK5DGY.js +146 -0
- package/dist/wallets/walletConnectors/chunk-IGZOEVKN.js +58 -0
- package/dist/wallets/walletConnectors/chunk-IJJQA3AB.js +218 -0
- package/dist/wallets/walletConnectors/chunk-JU6AJBYS.js +20 -0
- package/dist/wallets/walletConnectors/chunk-KTVJLN3O.js +58 -0
- package/dist/wallets/walletConnectors/chunk-L3EPZ4NZ.js +52 -0
- package/dist/wallets/walletConnectors/chunk-LQI5HRAB.js +218 -0
- package/dist/wallets/walletConnectors/chunk-LTN4JK3R.js +340 -0
- package/dist/wallets/walletConnectors/chunk-MGVZ2TUF.js +318 -0
- package/dist/wallets/walletConnectors/chunk-MU46EEQT.js +128 -0
- package/dist/wallets/walletConnectors/chunk-MY7UE4VE.js +240 -0
- package/dist/wallets/walletConnectors/chunk-NEMEHJ72.js +93 -0
- package/dist/wallets/walletConnectors/chunk-NF72HTDP.js +378 -0
- package/dist/wallets/walletConnectors/chunk-QI5BHIHY.js +318 -0
- package/dist/wallets/walletConnectors/chunk-QLPGMWGT.js +132 -0
- package/dist/wallets/walletConnectors/chunk-QODJUJ3A.js +370 -0
- package/dist/wallets/walletConnectors/chunk-TBWPVX5M.js +148 -0
- package/dist/wallets/walletConnectors/chunk-TLRR3FFT.js +132 -0
- package/dist/wallets/walletConnectors/chunk-TM6YD43A.js +341 -0
- package/dist/wallets/walletConnectors/chunk-TYJR3KGY.js +46 -0
- package/dist/wallets/walletConnectors/chunk-UPQCNBIW.js +341 -0
- package/dist/wallets/walletConnectors/chunk-VVXSRRXI.js +189 -0
- package/dist/wallets/walletConnectors/chunk-WHL6MSKS.js +492 -0
- package/dist/wallets/walletConnectors/chunk-WZ4ZJB74.js +340 -0
- package/dist/wallets/walletConnectors/chunk-X3DT5G3F.js +215 -0
- package/dist/wallets/walletConnectors/chunk-XDNFWX2X.js +199 -0
- package/dist/wallets/walletConnectors/chunk-YNE2UX2Z.js +137 -0
- package/dist/wallets/walletConnectors/chunk-YXWHHI4S.js +64 -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 +109 -108
- 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 +1 -1
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/wallets/walletConnectors/abcWallet/constants.ts
|
|
4
|
+
var DEFAULT_ABC_CONFIG = {
|
|
5
|
+
environment: "development",
|
|
6
|
+
talkenApiUrl: ""
|
|
7
|
+
};
|
|
8
|
+
var TOKEN_EXPIRY = {
|
|
9
|
+
ACCESS_TOKEN: 10 * 60 * 1e3,
|
|
10
|
+
// 10 minutes
|
|
11
|
+
REFRESH_TOKEN: 60 * 60 * 1e3,
|
|
12
|
+
// 60 minutes
|
|
13
|
+
REFRESH_BUFFER: 60 * 1e3
|
|
14
|
+
// Refresh 60s before expiry (increased for network latency tolerance)
|
|
15
|
+
};
|
|
16
|
+
var AUTH_PROVIDERS = {
|
|
17
|
+
EMAIL: "email",
|
|
18
|
+
GOOGLE: "google",
|
|
19
|
+
APPLE: "apple",
|
|
20
|
+
TELEGRAM: "telegram",
|
|
21
|
+
TWITTER: "twitter"
|
|
22
|
+
};
|
|
23
|
+
var CHAIN_TYPES = {
|
|
24
|
+
EVM: "evm",
|
|
25
|
+
SOLANA: "solana",
|
|
26
|
+
BITCOIN: "bitcoin"
|
|
27
|
+
};
|
|
28
|
+
var SOLANA_CHAIN_ID = 900;
|
|
29
|
+
var BITCOIN_CHAIN_ID = 800;
|
|
30
|
+
var EVM_CHAINS = {
|
|
31
|
+
ETHEREUM_MAINNET: 1,
|
|
32
|
+
ETHEREUM_GOERLI: 5,
|
|
33
|
+
ETHEREUM_SEPOLIA: 11155111,
|
|
34
|
+
POLYGON_MAINNET: 137,
|
|
35
|
+
POLYGON_MUMBAI: 80001,
|
|
36
|
+
BSC_MAINNET: 56,
|
|
37
|
+
BSC_TESTNET: 97,
|
|
38
|
+
ARBITRUM_MAINNET: 42161,
|
|
39
|
+
ARBITRUM_GOERLI: 421613,
|
|
40
|
+
OPTIMISM_MAINNET: 10,
|
|
41
|
+
OPTIMISM_GOERLI: 420,
|
|
42
|
+
AVALANCHE_MAINNET: 43114,
|
|
43
|
+
AVALANCHE_FUJI: 43113,
|
|
44
|
+
KLAYTN_MAINNET: 8217,
|
|
45
|
+
KLAYTN_BAOBAB: 1001
|
|
46
|
+
};
|
|
47
|
+
var PIN_CONFIG = {
|
|
48
|
+
MIN_LENGTH: 6,
|
|
49
|
+
MAX_LENGTH: 6,
|
|
50
|
+
MAX_ATTEMPTS: 5,
|
|
51
|
+
LOCKOUT_DURATION: 15 * 60 * 1e3
|
|
52
|
+
// 15 minutes
|
|
53
|
+
};
|
|
54
|
+
var STORAGE_VERSION = "1.0.0";
|
|
55
|
+
var REQUEST_TIMEOUT = 3e4;
|
|
56
|
+
var RETRY_CONFIG = {
|
|
57
|
+
MAX_RETRIES: 3,
|
|
58
|
+
RETRY_DELAY: 1e3,
|
|
59
|
+
// 1 second
|
|
60
|
+
BACKOFF_MULTIPLIER: 2
|
|
61
|
+
};
|
|
62
|
+
var ABC_WALLET_METADATA = {
|
|
63
|
+
id: "abc",
|
|
64
|
+
name: "ABC Wallet",
|
|
65
|
+
iconBackground: "#ffffff",
|
|
66
|
+
rdns: "com.abcwallet"
|
|
67
|
+
};
|
|
68
|
+
var MODAL_CONFIG = {
|
|
69
|
+
WIDTH: 400,
|
|
70
|
+
MAX_WIDTH: "90vw",
|
|
71
|
+
BORDER_RADIUS: 16,
|
|
72
|
+
PADDING: 24
|
|
73
|
+
};
|
|
74
|
+
var SOCIAL_BUTTONS = [
|
|
75
|
+
{
|
|
76
|
+
provider: AUTH_PROVIDERS.GOOGLE,
|
|
77
|
+
label: "Google",
|
|
78
|
+
iconName: "google"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
provider: AUTH_PROVIDERS.APPLE,
|
|
82
|
+
label: "Apple",
|
|
83
|
+
iconName: "apple"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
provider: AUTH_PROVIDERS.TELEGRAM,
|
|
87
|
+
label: "Telegram",
|
|
88
|
+
iconName: "telegram"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
provider: AUTH_PROVIDERS.TWITTER,
|
|
92
|
+
label: "X (Twitter)",
|
|
93
|
+
iconName: "twitter"
|
|
94
|
+
}
|
|
95
|
+
];
|
|
96
|
+
var ERROR_MESSAGES = {
|
|
97
|
+
INVALID_CREDENTIALS: "Invalid email or password",
|
|
98
|
+
TOKEN_EXPIRED: "Your session has expired. Please login again.",
|
|
99
|
+
WALLET_NOT_FOUND: "Wallet not found. Please create a new wallet.",
|
|
100
|
+
INVALID_PIN: "Invalid PIN code",
|
|
101
|
+
NETWORK_ERROR: "Network error. Please check your connection.",
|
|
102
|
+
SIGNATURE_FAILED: "Failed to sign transaction",
|
|
103
|
+
USER_CANCELLED: "User cancelled the operation",
|
|
104
|
+
UNKNOWN_ERROR: "An unknown error occurred",
|
|
105
|
+
INVALID_OTP: "Invalid or expired OTP code",
|
|
106
|
+
EMAIL_REQUIRED: "Email address is required",
|
|
107
|
+
PIN_REQUIRED: "PIN code is required",
|
|
108
|
+
WALLET_GENERATION_FAILED: "Failed to generate wallet"
|
|
109
|
+
};
|
|
110
|
+
var SUCCESS_MESSAGES = {
|
|
111
|
+
LOGIN_SUCCESS: "Successfully logged in",
|
|
112
|
+
WALLET_CREATED: "Wallet created successfully",
|
|
113
|
+
TRANSACTION_SENT: "Transaction sent successfully",
|
|
114
|
+
OTP_SENT: "OTP code sent to your email"
|
|
115
|
+
};
|
|
116
|
+
var ABC_EVENTS = {
|
|
117
|
+
CONNECT: "abc:connect",
|
|
118
|
+
DISCONNECT: "abc:disconnect",
|
|
119
|
+
ACCOUNTS_CHANGED: "abc:accountsChanged",
|
|
120
|
+
CHAIN_CHANGED: "abc:chainChanged",
|
|
121
|
+
ERROR: "abc:error",
|
|
122
|
+
AUTH_STATE_CHANGED: "abc:authStateChanged"
|
|
123
|
+
};
|
|
124
|
+
var STORAGE_PREFIX = "talkenkit_abc_";
|
|
125
|
+
var DEBUG_MODE = true;
|
|
126
|
+
var ABC_FEATURES = {
|
|
127
|
+
EMAIL_LOGIN: true,
|
|
128
|
+
SOCIAL_LOGIN: true,
|
|
129
|
+
MULTI_CHAIN: true,
|
|
130
|
+
EVM_SUPPORT: true,
|
|
131
|
+
SOLANA_SUPPORT: true,
|
|
132
|
+
BITCOIN_SUPPORT: false,
|
|
133
|
+
// Future feature
|
|
134
|
+
GASLESS_TRANSACTIONS: false,
|
|
135
|
+
// Future feature
|
|
136
|
+
SOCIAL_RECOVERY: false
|
|
137
|
+
// Future feature
|
|
138
|
+
};
|
|
139
|
+
var DEFAULT_TALKEN_API_CONFIG = {
|
|
140
|
+
baseUrl: void 0,
|
|
141
|
+
timeout: REQUEST_TIMEOUT
|
|
142
|
+
};
|
|
143
|
+
var TALKEN_API_ENDPOINTS = {
|
|
144
|
+
// ── Auth (single action-based endpoint) ─────────────────────────────
|
|
145
|
+
AUTH: "/wallet/auth",
|
|
146
|
+
// ── Wallet ──────────────────────────────────────────────────────────
|
|
147
|
+
WALLET_MPC: "/wallet/mpc",
|
|
148
|
+
WALLET_ADDRESS: "/wallet/address",
|
|
149
|
+
WALLET_SCAN: "/wallet/scan",
|
|
150
|
+
WALLET_BTC: "/wallet/btc",
|
|
151
|
+
// ── EVM Sign (WaaS proxy) ───────────────────────────────────────────
|
|
152
|
+
SIGN_EVM: "/wallet/sign/evm",
|
|
153
|
+
SIGN_TYPED: "/wallet/sign/evm/typed",
|
|
154
|
+
SIGN_PERSONAL: "/wallet/sign/evm/personal",
|
|
155
|
+
SIGN_AUTHORIZATION: "/wallet/sign/authorization",
|
|
156
|
+
// ── Hash Sign (secp256k1, universal: EVM/BTC/TVM) ───────────────────
|
|
157
|
+
SIGN_HASH: "/wallet/sign/hash",
|
|
158
|
+
// ── SOL Sign (WaaS proxy) ───────────────────────────────────────────
|
|
159
|
+
SIGN_SVM: "/wallet/sign/sol",
|
|
160
|
+
// ── TX ──────────────────────────────────────────────────────────────
|
|
161
|
+
TX_RAW: "/wallet/tx/raw",
|
|
162
|
+
TX_EVM: "/wallet/tx/evm",
|
|
163
|
+
TX_SOL: "/wallet/tx/sol",
|
|
164
|
+
SOLANA_LATEST_BLOCKHASH: "/wallet/solana/latest-blockhash",
|
|
165
|
+
SOLANA_TX_STATUS: "/wallet/solana/tx-status",
|
|
166
|
+
TX_BTC: "/wallet/tx/btc",
|
|
167
|
+
TX_TVM: "/wallet/tx/tvm",
|
|
168
|
+
TRON_UTIL: "/wallet/tron",
|
|
169
|
+
TX_XRP: "/wallet/tx/xrp",
|
|
170
|
+
XRP_UTIL: "/wallet/xrp",
|
|
171
|
+
XRP_TRUSTLINE: "/wallet/xrp/trustline",
|
|
172
|
+
// ── Gas (WaaS proxy) ───────────────────────────────────────────────
|
|
173
|
+
GAS_PRICE: "/wallet/gas/price",
|
|
174
|
+
GAS_SUGGESTED: "/wallet/gas/suggested",
|
|
175
|
+
GAS_ESTIMATE: "/wallet/gas/estimate",
|
|
176
|
+
// ── Nonce / Balance / eth_call (WaaS proxy) ───────────────────────
|
|
177
|
+
NONCE: "/wallet/nonce",
|
|
178
|
+
ADDRESS_BALANCE: "/wallet/address/balance",
|
|
179
|
+
ETH_CALL: "/wallet/contract/eth-call",
|
|
180
|
+
// ── Relayer ────────────────────────────────────────────────────────
|
|
181
|
+
RELAYER_FEE_ESTIMATE: "/relayer/estimate-fee",
|
|
182
|
+
RELAYER_EXECUTE: "/relayer/execute",
|
|
183
|
+
RELAYER_BALANCE: "/wallet/balance/relayer",
|
|
184
|
+
// ── Config / Runtime ───────────────────────────────────────────────
|
|
185
|
+
CONFIG_TX_STATUS: "/config/tx-status",
|
|
186
|
+
CONFIG_CHAIN: "/config/chain",
|
|
187
|
+
// ── Tokens ─────────────────────────────────────────────────────────
|
|
188
|
+
TOKENS_BALANCES: "/tokens/balances",
|
|
189
|
+
TOKENS_CAPABILITIES: "/tokens/capabilities",
|
|
190
|
+
// ── EIP-7702 ──────────────────────────────────────────────────────
|
|
191
|
+
EXECUTION_NONCE: "/wallet/execution-nonce",
|
|
192
|
+
WALLET_CODE: "/wallet/code",
|
|
193
|
+
// ── Agent Access Key ──────────────────────────────────────────────
|
|
194
|
+
ACCESS_KEYS: "/agent/access-keys"
|
|
195
|
+
};
|
|
196
|
+
var AK_ENV_SUFFIX = {
|
|
197
|
+
production: "live",
|
|
198
|
+
staging: "stg",
|
|
199
|
+
development: "dev",
|
|
200
|
+
localhost: "local"
|
|
201
|
+
};
|
|
202
|
+
function getAkStorageKey() {
|
|
203
|
+
const env = typeof process !== "undefined" && process.env?.NEXT_PUBLIC_ENVIRONMENT || typeof process !== "undefined" && process.env?.NEXT_PUBLIC_PHASE || "development";
|
|
204
|
+
return `talken_ak_${AK_ENV_SUFFIX[env] || "dev"}`;
|
|
205
|
+
}
|
|
206
|
+
function loadTgAccessKey() {
|
|
207
|
+
if (typeof localStorage === "undefined")
|
|
208
|
+
return null;
|
|
209
|
+
try {
|
|
210
|
+
return localStorage.getItem(getAkStorageKey()) || null;
|
|
211
|
+
} catch {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// src/wallets/walletConnectors/abcWallet/StorageService.ts
|
|
217
|
+
var STORAGE_NS = {
|
|
218
|
+
/** ABC WaaS auth state, wallets, encrypted tokens */
|
|
219
|
+
ABC: STORAGE_PREFIX,
|
|
220
|
+
/** TalkenApiClient bearer tokens, access key */
|
|
221
|
+
API: "talken_api_"
|
|
222
|
+
};
|
|
223
|
+
function getStorage(type = "local") {
|
|
224
|
+
if (typeof window === "undefined")
|
|
225
|
+
return null;
|
|
226
|
+
try {
|
|
227
|
+
return type === "session" ? sessionStorage : localStorage;
|
|
228
|
+
} catch {
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
function get(namespace, key, type = "local") {
|
|
233
|
+
const storage = getStorage(type);
|
|
234
|
+
if (!storage)
|
|
235
|
+
return null;
|
|
236
|
+
try {
|
|
237
|
+
return storage.getItem(`${namespace}${key}`);
|
|
238
|
+
} catch {
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
function set(namespace, key, value, type = "local") {
|
|
243
|
+
const storage = getStorage(type);
|
|
244
|
+
if (!storage)
|
|
245
|
+
return;
|
|
246
|
+
try {
|
|
247
|
+
storage.setItem(`${namespace}${key}`, value);
|
|
248
|
+
} catch {
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
function remove(namespace, key, type = "local") {
|
|
252
|
+
const storage = getStorage(type);
|
|
253
|
+
if (!storage)
|
|
254
|
+
return;
|
|
255
|
+
try {
|
|
256
|
+
storage.removeItem(`${namespace}${key}`);
|
|
257
|
+
} catch {
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
function clearNamespace(namespace, type = "local") {
|
|
261
|
+
const storage = getStorage(type);
|
|
262
|
+
if (!storage)
|
|
263
|
+
return;
|
|
264
|
+
try {
|
|
265
|
+
const keysToRemove = [];
|
|
266
|
+
for (let i = 0; i < storage.length; i++) {
|
|
267
|
+
const key = storage.key(i);
|
|
268
|
+
if (key?.startsWith(namespace)) {
|
|
269
|
+
keysToRemove.push(key);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
for (const key of keysToRemove) {
|
|
273
|
+
storage.removeItem(key);
|
|
274
|
+
}
|
|
275
|
+
} catch {
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
function getJSON(namespace, key, type = "local") {
|
|
279
|
+
const raw = get(namespace, key, type);
|
|
280
|
+
if (!raw)
|
|
281
|
+
return null;
|
|
282
|
+
try {
|
|
283
|
+
return JSON.parse(raw);
|
|
284
|
+
} catch {
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
function setJSON(namespace, key, value, type = "local") {
|
|
289
|
+
try {
|
|
290
|
+
set(namespace, key, JSON.stringify(value), type);
|
|
291
|
+
} catch {
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// src/wallets/walletConnectors/abcWallet/AbcCredentialManager.ts
|
|
296
|
+
var AbcCredentialManager = class _AbcCredentialManager {
|
|
297
|
+
constructor() {
|
|
298
|
+
this.pinHash = null;
|
|
299
|
+
this.email_ = null;
|
|
300
|
+
this.restoreEmailFromStorage();
|
|
301
|
+
}
|
|
302
|
+
static getInstance() {
|
|
303
|
+
if (!_AbcCredentialManager.instance) {
|
|
304
|
+
_AbcCredentialManager.instance = new _AbcCredentialManager();
|
|
305
|
+
}
|
|
306
|
+
return _AbcCredentialManager.instance;
|
|
307
|
+
}
|
|
308
|
+
// ── PIN Hash (memory + sessionStorage) ───────────────────────────
|
|
309
|
+
// PIN hash is the bearer credential for MPC signing. Primary storage
|
|
310
|
+
// is in-memory, with sessionStorage as a fallback so PIN survives
|
|
311
|
+
// HMR and soft page navigation (but not tab close).
|
|
312
|
+
//
|
|
313
|
+
// ⚠ Security trade-off: sessionStorage is accessible to same-origin
|
|
314
|
+
// scripts. An XSS vulnerability on the host dApp could read the hash
|
|
315
|
+
// and use it for MPC signing. The hash alone cannot recover the raw
|
|
316
|
+
// PIN, but it IS a bearer token for transaction signing.
|
|
317
|
+
// Mitigations: host dApp must enforce strict CSP, sanitize inputs,
|
|
318
|
+
// and avoid inline scripts. Consider reverting to memory-only if the
|
|
319
|
+
// HMR/refresh UX trade-off is not acceptable for production.
|
|
320
|
+
setPinHash(hash) {
|
|
321
|
+
this.pinHash = hash;
|
|
322
|
+
set(STORAGE_NS.ABC, "pin_hash", hash, "session");
|
|
323
|
+
}
|
|
324
|
+
getPinHash() {
|
|
325
|
+
if (this.pinHash)
|
|
326
|
+
return this.pinHash;
|
|
327
|
+
const cached = get(STORAGE_NS.ABC, "pin_hash", "session");
|
|
328
|
+
if (cached) {
|
|
329
|
+
this.pinHash = cached;
|
|
330
|
+
return cached;
|
|
331
|
+
}
|
|
332
|
+
return null;
|
|
333
|
+
}
|
|
334
|
+
clearPinHash() {
|
|
335
|
+
this.pinHash = null;
|
|
336
|
+
remove(STORAGE_NS.ABC, "pin_hash", "session");
|
|
337
|
+
}
|
|
338
|
+
// ── Email ─────────────────────────────────────────────────────────
|
|
339
|
+
setEmail(email) {
|
|
340
|
+
this.email_ = email;
|
|
341
|
+
set(STORAGE_NS.ABC, "saved_email", email);
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Get recovery email.
|
|
345
|
+
* Priority: in-memory → auth_state JSON → saved_email localStorage
|
|
346
|
+
*/
|
|
347
|
+
getEmail() {
|
|
348
|
+
if (this.email_)
|
|
349
|
+
return this.email_;
|
|
350
|
+
const authState = getJSON(
|
|
351
|
+
STORAGE_NS.ABC,
|
|
352
|
+
"auth_state"
|
|
353
|
+
);
|
|
354
|
+
if (authState) {
|
|
355
|
+
const email = authState?.user?.email || authState?.wallet?.email;
|
|
356
|
+
if (typeof email === "string" && email.trim()) {
|
|
357
|
+
this.email_ = email.trim();
|
|
358
|
+
return this.email_;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
const saved = get(STORAGE_NS.ABC, "saved_email");
|
|
362
|
+
if (saved?.trim()) {
|
|
363
|
+
this.email_ = saved.trim();
|
|
364
|
+
return this.email_;
|
|
365
|
+
}
|
|
366
|
+
return null;
|
|
367
|
+
}
|
|
368
|
+
// ── EVM Signing Credentials (sessionStorage — tab-scoped) ────────
|
|
369
|
+
setEvmSigningCredentials(creds) {
|
|
370
|
+
setJSON(STORAGE_NS.ABC, "evm_signing_creds", creds, "session");
|
|
371
|
+
}
|
|
372
|
+
getEvmSigningCredentials() {
|
|
373
|
+
const parsed = getJSON(
|
|
374
|
+
STORAGE_NS.ABC,
|
|
375
|
+
"evm_signing_creds",
|
|
376
|
+
"session"
|
|
377
|
+
);
|
|
378
|
+
if (parsed?.uid && parsed?.wid && parsed?.sid && parsed?.pvencstr && parsed?.encryptDevicePassword) {
|
|
379
|
+
return parsed;
|
|
380
|
+
}
|
|
381
|
+
return null;
|
|
382
|
+
}
|
|
383
|
+
clearEvmSigningCredentials() {
|
|
384
|
+
remove(STORAGE_NS.ABC, "evm_signing_creds", "session");
|
|
385
|
+
}
|
|
386
|
+
// ── Lifecycle ─────────────────────────────────────────────────────
|
|
387
|
+
/**
|
|
388
|
+
* Restore email from localStorage on initialization.
|
|
389
|
+
* PIN hash is intentionally NOT restored (memory-only).
|
|
390
|
+
*/
|
|
391
|
+
restoreEmailFromStorage() {
|
|
392
|
+
if (typeof window === "undefined")
|
|
393
|
+
return;
|
|
394
|
+
this.getEmail();
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Clear all credentials (logout).
|
|
398
|
+
*/
|
|
399
|
+
clear() {
|
|
400
|
+
this.clearPinHash();
|
|
401
|
+
this.email_ = null;
|
|
402
|
+
this.clearEvmSigningCredentials();
|
|
403
|
+
this.clearLegacyPinStorage();
|
|
404
|
+
}
|
|
405
|
+
/** Remove legacy PIN hash from sessionStorage (pre-v2.7 migration) */
|
|
406
|
+
clearLegacyPinStorage() {
|
|
407
|
+
if (typeof window !== "undefined") {
|
|
408
|
+
try {
|
|
409
|
+
sessionStorage.removeItem("talkenkit_abc_pin_hash");
|
|
410
|
+
} catch {
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
function getCredentialManager() {
|
|
416
|
+
return AbcCredentialManager.getInstance();
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export {
|
|
420
|
+
DEFAULT_ABC_CONFIG,
|
|
421
|
+
TOKEN_EXPIRY,
|
|
422
|
+
AUTH_PROVIDERS,
|
|
423
|
+
CHAIN_TYPES,
|
|
424
|
+
SOLANA_CHAIN_ID,
|
|
425
|
+
BITCOIN_CHAIN_ID,
|
|
426
|
+
EVM_CHAINS,
|
|
427
|
+
PIN_CONFIG,
|
|
428
|
+
STORAGE_VERSION,
|
|
429
|
+
REQUEST_TIMEOUT,
|
|
430
|
+
RETRY_CONFIG,
|
|
431
|
+
ABC_WALLET_METADATA,
|
|
432
|
+
MODAL_CONFIG,
|
|
433
|
+
SOCIAL_BUTTONS,
|
|
434
|
+
ERROR_MESSAGES,
|
|
435
|
+
SUCCESS_MESSAGES,
|
|
436
|
+
ABC_EVENTS,
|
|
437
|
+
STORAGE_PREFIX,
|
|
438
|
+
DEBUG_MODE,
|
|
439
|
+
ABC_FEATURES,
|
|
440
|
+
DEFAULT_TALKEN_API_CONFIG,
|
|
441
|
+
TALKEN_API_ENDPOINTS,
|
|
442
|
+
loadTgAccessKey,
|
|
443
|
+
STORAGE_NS,
|
|
444
|
+
get,
|
|
445
|
+
set,
|
|
446
|
+
remove,
|
|
447
|
+
clearNamespace,
|
|
448
|
+
getJSON,
|
|
449
|
+
setJSON,
|
|
450
|
+
getCredentialManager
|
|
451
|
+
};
|
|
@@ -6,4 +6,4 @@ export interface NonEvmSignConfirmationModalProps {
|
|
|
6
6
|
onConfirm: () => void;
|
|
7
7
|
request: NonEvmSignRequest;
|
|
8
8
|
}
|
|
9
|
-
export declare function NonEvmSignConfirmationModal({ isOpen, onClose, onConfirm, request, }: NonEvmSignConfirmationModalProps): React.
|
|
9
|
+
export declare function NonEvmSignConfirmationModal({ isOpen, onClose, onConfirm, request, }: NonEvmSignConfirmationModalProps): React.ReactPortal | null;
|
|
@@ -6,4 +6,4 @@ export interface NonEvmTransferConfirmationModalProps {
|
|
|
6
6
|
onConfirm: () => void;
|
|
7
7
|
request: NonEvmTransferRequest;
|
|
8
8
|
}
|
|
9
|
-
export declare function NonEvmTransferConfirmationModal({ isOpen, onClose, onConfirm, request, }: NonEvmTransferConfirmationModalProps): React.
|
|
9
|
+
export declare function NonEvmTransferConfirmationModal({ isOpen, onClose, onConfirm, request, }: NonEvmTransferConfirmationModalProps): React.ReactPortal | null;
|
|
@@ -14,4 +14,4 @@ export interface SignConfirmationModalProps {
|
|
|
14
14
|
/** Whether message section is expanded by default */
|
|
15
15
|
defaultExpanded?: boolean;
|
|
16
16
|
}
|
|
17
|
-
export declare function SignConfirmationModal({ isOpen, onClose, onConfirm, message, walletAddress: _walletAddress, chainId: _chainId, chainName: _chainName, requestOrigin, requestOriginIcon, defaultExpanded, }: SignConfirmationModalProps): React.
|
|
17
|
+
export declare function SignConfirmationModal({ isOpen, onClose, onConfirm, message, walletAddress: _walletAddress, chainId: _chainId, chainName: _chainName, requestOrigin, requestOriginIcon, defaultExpanded, }: SignConfirmationModalProps): React.ReactPortal | null;
|
|
@@ -5,8 +5,9 @@ export interface TransactionConfirmationModalProps {
|
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
onConfirm: (resolved?: ResolvedTransactionRequest) => void;
|
|
7
7
|
transaction: ResolvedTransactionRequest;
|
|
8
|
+
isEstimatingGasless?: boolean;
|
|
8
9
|
requestOrigin?: string;
|
|
9
10
|
requestOriginIcon?: string;
|
|
10
11
|
defaultDataExpanded?: boolean;
|
|
11
12
|
}
|
|
12
|
-
export declare function TransactionConfirmationModal({ isOpen, onClose, onConfirm, transaction, requestOrigin, requestOriginIcon, defaultDataExpanded, }: TransactionConfirmationModalProps): React.
|
|
13
|
+
export declare function TransactionConfirmationModal({ isOpen, onClose, onConfirm, transaction, isEstimatingGasless, requestOrigin, requestOriginIcon, defaultDataExpanded, }: TransactionConfirmationModalProps): React.ReactPortal | null;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ConfirmationModal shared constants
|
|
3
3
|
*/
|
|
4
|
-
/**
|
|
5
|
-
* Generate a token placeholder icon as a data URI SVG.
|
|
6
|
-
* Shows the token symbol (up to 3 characters) in a gray circle.
|
|
7
|
-
*/
|
|
8
4
|
export declare function getTokenPlaceholderIcon(symbol?: string): string;
|
|
9
5
|
/**
|
|
10
6
|
* Default token icon placeholder (generic "?" fallback)
|
|
@@ -2,6 +2,7 @@ import React, { type ReactNode } from 'react';
|
|
|
2
2
|
import type { Chain } from 'wagmi/chains';
|
|
3
3
|
import type { ThemeVars } from '../../css/sprinkles.css';
|
|
4
4
|
import type { Locale } from '../../locales';
|
|
5
|
+
import type { GaslessConfig } from '../../gasless/types';
|
|
5
6
|
import type { SolanaConfig } from '../../solana/config';
|
|
6
7
|
import type { ConfirmationThemeColors } from '../ConfirmationModal/ConfirmationThemeContext';
|
|
7
8
|
import { type DisclaimerComponent } from './AppContext';
|
|
@@ -63,5 +64,34 @@ export interface RainbowKitProviderProps {
|
|
|
63
64
|
* @default false
|
|
64
65
|
*/
|
|
65
66
|
showSignConfirmation?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Gasless ERC-20 token transfer configuration.
|
|
69
|
+
* When provided with `enabled: true`, ERC-20 transfers via ABC WaaS
|
|
70
|
+
* are automatically routed through the relayer (no gas token needed).
|
|
71
|
+
* Falls back to normal gas mode on estimation failure.
|
|
72
|
+
*
|
|
73
|
+
* The provider internally stabilizes serializable fields (enabled,
|
|
74
|
+
* projectFeeTokens, etc.) to prevent unnecessary re-renders.
|
|
75
|
+
* For best performance, memoize the config object and stabilize
|
|
76
|
+
* callback props with `useCallback`:
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* const gasless = useMemo(() => ({
|
|
81
|
+
* enabled: true,
|
|
82
|
+
* projectFeeTokens: [...],
|
|
83
|
+
* onDelegationError: handleError,
|
|
84
|
+
* }), [handleError]);
|
|
85
|
+
*
|
|
86
|
+
* <RainbowKitProvider gasless={gasless}>
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
gasless?: GaslessConfig;
|
|
90
|
+
/**
|
|
91
|
+
* Disable the built-in TransactionResult modal
|
|
92
|
+
* When true, the modal will not be shown after transactions
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
disableTransactionResult?: boolean;
|
|
66
96
|
}
|
|
67
|
-
export declare function RainbowKitProvider({ appInfo, avatar, children, coolMode, autoReconnect, id, initialChain, locale, modalSize, showRecentTransactions, theme, solanaConfig, mobileMode, showSignConfirmation, }: RainbowKitProviderProps): React.JSX.Element;
|
|
97
|
+
export declare function RainbowKitProvider({ appInfo, avatar, children, coolMode, autoReconnect, id, initialChain, locale, modalSize, showRecentTransactions, theme, solanaConfig, mobileMode, showSignConfirmation, gasless, disableTransactionResult, }: RainbowKitProviderProps): React.JSX.Element;
|
|
@@ -3,6 +3,9 @@ export declare const confirmButton: string;
|
|
|
3
3
|
export declare const header: string;
|
|
4
4
|
export declare const headerTitle: string;
|
|
5
5
|
export declare const iconCircle: string;
|
|
6
|
+
export declare const iconCircleSuccess: string;
|
|
7
|
+
export declare const iconCircleFailed: string;
|
|
8
|
+
export declare const iconCirclePending: string;
|
|
6
9
|
export declare const infoSection: string;
|
|
7
10
|
export declare const row: string;
|
|
8
11
|
export declare const label: string;
|
|
@@ -5,5 +5,5 @@ interface TransactionResultModalProps {
|
|
|
5
5
|
data: TransactionResultData | null;
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
}
|
|
8
|
-
export declare function TransactionResultModal({ isOpen, data, onClose, }: TransactionResultModalProps): React.
|
|
8
|
+
export declare function TransactionResultModal({ isOpen, data, onClose, }: TransactionResultModalProps): React.ReactPortal | null;
|
|
9
9
|
export {};
|
|
@@ -14,7 +14,8 @@ export declare enum NetworkType {
|
|
|
14
14
|
BITCOIN = "Bitcoin",
|
|
15
15
|
TRON = "TRX",
|
|
16
16
|
ICP = "ICP",
|
|
17
|
-
SOLANA = "Solana"
|
|
17
|
+
SOLANA = "Solana",
|
|
18
|
+
XRPL = "XRPL"
|
|
18
19
|
}
|
|
19
20
|
export interface NetworkConfig {
|
|
20
21
|
/** Chain ID (EVM chains) or network identifier (non-EVM chains) */
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GaslessConfig Singleton
|
|
3
|
+
*
|
|
4
|
+
* Bridges the React GaslessConfigProvider with class-based providers
|
|
5
|
+
* (AbcProvider) that cannot consume React context directly.
|
|
6
|
+
*
|
|
7
|
+
* Pattern: identical to TransactionResultSingleton.
|
|
8
|
+
*/
|
|
9
|
+
import type { GaslessConfig } from './types';
|
|
10
|
+
export declare function setGaslessConfig(config: GaslessConfig | null): void;
|
|
11
|
+
export declare function getGaslessConfig(): GaslessConfig | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RuntimeChainConfig, TokenBalance } from '../types';
|
|
2
|
+
export declare class ChainConfigApi {
|
|
3
|
+
private configCache;
|
|
4
|
+
private balanceCache;
|
|
5
|
+
/**
|
|
6
|
+
* Get runtime chain config (eip7702Delegate, token addresses, etc.).
|
|
7
|
+
* GET /config/chain/{chainKey}
|
|
8
|
+
*
|
|
9
|
+
* Cached for 60 minutes.
|
|
10
|
+
*/
|
|
11
|
+
getChainConfig(chainKey: string): Promise<RuntimeChainConfig>;
|
|
12
|
+
/**
|
|
13
|
+
* Get token balances for an address on a chain.
|
|
14
|
+
* GET /tokens/balances?address={address}&chainKey={chainKey}
|
|
15
|
+
*
|
|
16
|
+
* Cached for 30 seconds.
|
|
17
|
+
*/
|
|
18
|
+
getTokenBalances(address: string, chainKey: string): Promise<TokenBalance[]>;
|
|
19
|
+
clearCache(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RelayExecuteRequest, RelayExecuteResponse, RelayerBalanceInfo, RelayerEstimateFeeParams, RelayerFeeEstimate } from '../types';
|
|
2
|
+
export declare class RelayerApi {
|
|
3
|
+
estimateFee(params: RelayerEstimateFeeParams): Promise<RelayerFeeEstimate>;
|
|
4
|
+
execute(params: RelayExecuteRequest): Promise<RelayExecuteResponse>;
|
|
5
|
+
getRelayerBalance(chainKey: string): Promise<RelayerBalanceInfo>;
|
|
6
|
+
/**
|
|
7
|
+
* Get EIP-7702 execution nonce for an address on a chain.
|
|
8
|
+
*
|
|
9
|
+
* Known issue (testnet only): The server's /wallet/execution-nonce endpoint
|
|
10
|
+
* reads the wrong storage slot on testnet due to an older delegate contract
|
|
11
|
+
* (Sepolia), causing it to always return a stale nonce of 0. Production
|
|
12
|
+
* contracts are unaffected.
|
|
13
|
+
*
|
|
14
|
+
* Previously, a client-side dev-only fallback (devNonceFallback.ts) worked
|
|
15
|
+
* around this by calling eth_getStorageAt directly via hardcoded testnet
|
|
16
|
+
* public RPCs. That fallback has been removed to eliminate external RPC
|
|
17
|
+
* dependencies. The proper fix is to update the server endpoint to read
|
|
18
|
+
* the correct storage slot (0x1). Note that the Talken API does not expose
|
|
19
|
+
* an eth_getStorageAt proxy (AbcEvmProvider treats it as UNSUPPORTED_METHOD),
|
|
20
|
+
* so there is no client-side alternative.
|
|
21
|
+
*
|
|
22
|
+
* @see https://sepolia.etherscan.io/address/0x0733De884289DA5D1349db8d09D7b14f4Ab1EF5c
|
|
23
|
+
*/
|
|
24
|
+
getExecutionNonce(chainKey: string, address: string): Promise<string>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TokenCapabilities } from '../types';
|
|
2
|
+
export declare class TokenCapabilityApi {
|
|
3
|
+
private cache;
|
|
4
|
+
/**
|
|
5
|
+
* Get EIP-3009 / ERC-2612 capabilities for a token on a chain.
|
|
6
|
+
* GET /tokens/capabilities/{chainKey}/{tokenAddress}
|
|
7
|
+
*
|
|
8
|
+
* Results are cached for 60 minutes.
|
|
9
|
+
*/
|
|
10
|
+
getCapabilities(chainKey: string, tokenAddress: string): Promise<TokenCapabilities>;
|
|
11
|
+
clearCache(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { GaslessConfig, GaslessConfigProviderProps } from './types';
|
|
3
|
+
export declare function GaslessConfigProvider({ config, children, }: GaslessConfigProviderProps): React.JSX.Element;
|
|
4
|
+
/**
|
|
5
|
+
* Access the gasless configuration.
|
|
6
|
+
* Returns null when gasless is not configured (graceful degradation).
|
|
7
|
+
*/
|
|
8
|
+
export declare function useGaslessConfig(): GaslessConfig | null;
|
|
9
|
+
/**
|
|
10
|
+
* Check if gasless is enabled in the current context.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useGaslessEnabled(): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UseGaslessTransferReturn } from '../types';
|
|
2
|
+
interface UseGaslessTransferParams {
|
|
3
|
+
chainId?: number;
|
|
4
|
+
address?: string;
|
|
5
|
+
tokenAddress?: string;
|
|
6
|
+
toAddress?: string;
|
|
7
|
+
amount?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* React hook for gasless ERC-20 token transfers.
|
|
11
|
+
*
|
|
12
|
+
* Handles fee estimation, mode determination, and execution.
|
|
13
|
+
* Automatically detects wallet type and creates the appropriate signer:
|
|
14
|
+
* - ABC WaaS wallets → AbcWaasSigner (MPC signing with PIN)
|
|
15
|
+
* - External wallets (MetaMask, etc.) → WagmiSigner (local signing)
|
|
16
|
+
*/
|
|
17
|
+
export declare function useGaslessTransfer(params?: UseGaslessTransferParams): UseGaslessTransferReturn;
|
|
18
|
+
export {};
|