@talken/talkenkit 2.8.4 → 2.8.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/dist/{AbcCredentialManager-QM2BNLSR.js → AbcCredentialManager-WZBF3GHF.js} +1 -1
- package/dist/{abcWallet-4PXYWHYM.js → abcWallet-EOHU5AIB.js} +2 -2
- package/dist/{chunk-PS5CBMY5.js → chunk-CUPPBGFC.js} +13 -6
- package/dist/{chunk-ZISAJ7BZ.js → chunk-WGSS57V6.js} +998 -453
- package/dist/config/networks.d.ts +12 -0
- package/dist/gasless/utils/revokeDelegation.d.ts +4 -3
- package/dist/index.js +27 -21
- package/dist/utils/amount.d.ts +17 -0
- package/dist/wallets/walletConnectors/abcWallet/AbcCredentialManager.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/AbcEvmAutoConnector.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/ProviderError.d.ts +7 -0
- package/dist/wallets/walletConnectors/abcWallet/StorageService.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/abcBitcoinConnector.js +5 -5
- package/dist/wallets/walletConnectors/abcWallet/abcBitcoinProvider.js +13 -4
- package/dist/wallets/walletConnectors/abcWallet/abcConnector.js +19 -18
- package/dist/wallets/walletConnectors/abcWallet/abcProvider.d.ts +3 -4
- package/dist/wallets/walletConnectors/abcWallet/abcProvider.js +9 -6
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaProvider.js +21 -19
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaWalletAdapter.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/abcTronProvider.d.ts +1 -1
- package/dist/wallets/walletConnectors/abcWallet/abcTronProvider.js +13 -4
- package/dist/wallets/walletConnectors/abcWallet/abcWallet.js +20 -19
- package/dist/wallets/walletConnectors/abcWallet/abcXrplProvider.d.ts +18 -1
- package/dist/wallets/walletConnectors/abcWallet/abcXrplProvider.js +17 -6
- package/dist/wallets/walletConnectors/abcWallet/api/ConfigApi.js +2 -2
- package/dist/wallets/walletConnectors/abcWallet/api/TalkenApiClient.js +16 -15
- 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 +21 -20
- package/dist/wallets/walletConnectors/abcWallet/api/modules/auth.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/api/modules/bitcoin.d.ts +16 -2
- package/dist/wallets/walletConnectors/abcWallet/api/modules/bitcoin.js +9 -8
- package/dist/wallets/walletConnectors/abcWallet/api/modules/evm.d.ts +19 -3
- package/dist/wallets/walletConnectors/abcWallet/api/modules/evm.js +8 -7
- package/dist/wallets/walletConnectors/abcWallet/api/modules/executeBodies.d.ts +79 -0
- package/dist/wallets/walletConnectors/abcWallet/api/modules/executeBodies.js +32 -0
- package/dist/wallets/walletConnectors/abcWallet/api/modules/signBodies.d.ts +4 -1
- package/dist/wallets/walletConnectors/abcWallet/api/modules/signBodies.js +6 -2
- package/dist/wallets/walletConnectors/abcWallet/api/modules/signingRefresh.d.ts +6 -2
- package/dist/wallets/walletConnectors/abcWallet/api/modules/signingRefresh.js +5 -5
- package/dist/wallets/walletConnectors/abcWallet/api/modules/solana.d.ts +9 -3
- package/dist/wallets/walletConnectors/abcWallet/api/modules/solana.js +5 -4
- package/dist/wallets/walletConnectors/abcWallet/api/modules/tron.d.ts +10 -4
- package/dist/wallets/walletConnectors/abcWallet/api/modules/tron.js +13 -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 +13 -3
- package/dist/wallets/walletConnectors/abcWallet/api/modules/xrp.js +13 -2
- package/dist/wallets/walletConnectors/abcWallet/constants.d.ts +17 -5
- package/dist/wallets/walletConnectors/abcWallet/constants.js +3 -1
- package/dist/wallets/walletConnectors/abcWallet/index.js +36 -34
- package/dist/wallets/walletConnectors/abcWallet/sendFailure.d.ts +10 -0
- package/dist/wallets/walletConnectors/abcWallet/sendFailure.js +7 -0
- package/dist/wallets/walletConnectors/abcWallet/sessionUtils.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/types/api.types.d.ts +76 -1
- package/dist/wallets/walletConnectors/abcWallet/types/config.types.d.ts +4 -0
- package/dist/wallets/walletConnectors/abcWallet/types/error.types.d.ts +14 -1
- package/dist/wallets/walletConnectors/abcWallet/types/error.types.js +1 -1
- package/dist/wallets/walletConnectors/abcWallet/types.js +5 -5
- package/dist/wallets/walletConnectors/abcWallet/utils.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/walletGeneration.js +5 -5
- package/dist/wallets/walletConnectors/{chunk-KX3IFHJQ.js → chunk-2M6E3YXU.js} +28 -16
- package/dist/wallets/walletConnectors/{chunk-DPYQH3WE.js → chunk-365TL36N.js} +36 -31
- package/dist/wallets/walletConnectors/{chunk-CCUNTMLD.js → chunk-4CKIGJZD.js} +8 -8
- package/dist/wallets/walletConnectors/{chunk-XQTK7NGN.js → chunk-5SRSGEZR.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-HFW2XV2R.js → chunk-6MZWQBNQ.js} +28 -7
- package/dist/wallets/walletConnectors/chunk-6X2XITQP.js +71 -0
- package/dist/wallets/walletConnectors/{chunk-F6EG7H2O.js → chunk-743DKBGG.js} +2 -2
- package/dist/wallets/walletConnectors/chunk-DFG3BSSC.js +341 -0
- package/dist/wallets/walletConnectors/{chunk-ZTIRW7TR.js → chunk-DKMR2ML5.js} +3 -1
- package/dist/wallets/walletConnectors/{chunk-TXB6KXPR.js → chunk-DRL2CDHT.js} +24 -22
- package/dist/wallets/walletConnectors/{chunk-HXYOWG5P.js → chunk-EGLT3GPM.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-YECMDMEA.js → chunk-F4JUKZBB.js} +3 -3
- package/dist/wallets/walletConnectors/chunk-GAJ4FJTW.js +382 -0
- package/dist/wallets/walletConnectors/{chunk-UNLWNVSN.js → chunk-GO6HUJTP.js} +39 -10
- package/dist/wallets/walletConnectors/{chunk-5E7TNMON.js → chunk-HMIFFMGK.js} +18 -7
- package/dist/wallets/walletConnectors/chunk-M4SNNQU2.js +56 -0
- package/dist/wallets/walletConnectors/{chunk-6LPMWYFM.js → chunk-MNGSJBPX.js} +31 -14
- package/dist/wallets/walletConnectors/{chunk-6HR6CEOY.js → chunk-OMZSFUVN.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-75H6DQT6.js → chunk-OTLPTGHO.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-OEZE4GBQ.js → chunk-P64PMEPU.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-F6AHT6K4.js → chunk-PL56SINL.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-YUBS7MJ6.js → chunk-RSR35XOZ.js} +47 -12
- package/dist/wallets/walletConnectors/{chunk-5SHN7JNR.js → chunk-SORKIBWX.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-CIAVEXOY.js → chunk-SUPFF4EQ.js} +37 -811
- package/dist/wallets/walletConnectors/{chunk-BUAWEYGV.js → chunk-TP4BDK7W.js} +5 -1
- package/dist/wallets/walletConnectors/{chunk-FWKMNVWU.js → chunk-TRFREYPH.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-RQYBKCWA.js → chunk-UHVJ6AF6.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-ZITVWA4X.js → chunk-V6R6WDOQ.js} +1 -1
- package/dist/wallets/walletConnectors/chunk-XGQUYXTL.js +1215 -0
- package/dist/wallets/walletConnectors/{chunk-7GBAUSQJ.js → chunk-XPZCOEQL.js} +13 -6
- package/dist/wallets/walletConnectors/{chunk-QTBJ6WNZ.js → chunk-YPMD3ZHF.js} +33 -18
- package/dist/wallets/walletConnectors/chunk-Z66ETAKN.js +20 -0
- package/dist/wallets/walletConnectors/{chunk-HMMEOZDT.js → chunk-ZBI7MSWF.js} +5 -5
- package/dist/wallets/walletConnectors/chunk-ZWIAZOVB.js +58 -0
- package/dist/wallets/walletConnectors/index.js +51 -50
- package/package.json +1 -1
- package/dist/wallets/walletConnectors/chunk-6BHMNR5X.js +0 -46
- package/dist/wallets/walletConnectors/chunk-FLBJ7T4Q.js +0 -44
|
@@ -12,6 +12,8 @@ export interface TalkenTxXrpRequest {
|
|
|
12
12
|
issuer?: string;
|
|
13
13
|
waitForConfirmation?: boolean;
|
|
14
14
|
email?: string;
|
|
15
|
+
/** See `TalkenTxEvmRequest.idempotencyKey`. */
|
|
16
|
+
idempotencyKey?: string;
|
|
15
17
|
}
|
|
16
18
|
export interface TalkenXrpTrustlineRequest {
|
|
17
19
|
issuer: string;
|
|
@@ -27,9 +29,17 @@ export declare class TalkenXrpModule {
|
|
|
27
29
|
constructor(client: TalkenApiClient);
|
|
28
30
|
/**
|
|
29
31
|
* Execute XRP transfer (integrated sign + broadcast)
|
|
30
|
-
* POST /
|
|
31
|
-
* - kind=native: XRP transfer
|
|
32
|
-
* - kind=fungible: IOU token transfer
|
|
32
|
+
* POST /execute/send { to, chainKey, amount, token?, issuer?, fee?, destinationTag?, pin, ... }
|
|
33
|
+
* - kind=native: XRP transfer; `amount` (drops) is sent as an XRP `amount`
|
|
34
|
+
* - kind=fungible: IOU token transfer; `amount` is already in human units and
|
|
35
|
+
* is sent unscaled, with `currency` as `token` and `issuer`. `decimals` is
|
|
36
|
+
* never sent: the route refuses it on XRPL.
|
|
37
|
+
* A cold server credential cache (502 "Missing required wallet fields",
|
|
38
|
+
* answered before anything is signed, `details.broadcast: false`) is refreshed
|
|
39
|
+
* once and the same request re-sent under the same key.
|
|
40
|
+
* The route answers once the transaction is submitted (`engineResult`
|
|
41
|
+
* `tesSUCCESS`) or queued (`terQUEUED`, `submissionStatus: 'queued'`);
|
|
42
|
+
* `validated` is always false.
|
|
33
43
|
*/
|
|
34
44
|
transferXrp(params: TalkenTxXrpRequest): Promise<TalkenTxResponse>;
|
|
35
45
|
/**
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
TalkenXrpModule
|
|
4
|
-
} from "../../../chunk-
|
|
5
|
-
import "../../../chunk-
|
|
4
|
+
} from "../../../chunk-6MZWQBNQ.js";
|
|
5
|
+
import "../../../chunk-M4SNNQU2.js";
|
|
6
|
+
import "../../../chunk-XGQUYXTL.js";
|
|
7
|
+
import "../../../chunk-DKMR2ML5.js";
|
|
8
|
+
import "../../../chunk-SORKIBWX.js";
|
|
9
|
+
import "../../../chunk-3IYXGND5.js";
|
|
10
|
+
import "../../../chunk-TP4BDK7W.js";
|
|
11
|
+
import "../../../chunk-RKQS3OQG.js";
|
|
12
|
+
import "../../../chunk-YTIJR6EJ.js";
|
|
13
|
+
import "../../../chunk-PR5O3NNO.js";
|
|
14
|
+
import "../../../chunk-JU6AJBYS.js";
|
|
15
|
+
import "../../../chunk-V6R6WDOQ.js";
|
|
16
|
+
import "../../../chunk-XPZCOEQL.js";
|
|
6
17
|
export {
|
|
7
18
|
TalkenXrpModule
|
|
8
19
|
};
|
|
@@ -79,6 +79,18 @@ export declare const STORAGE_VERSION = "1.0.0";
|
|
|
79
79
|
* Request timeout (in milliseconds)
|
|
80
80
|
*/
|
|
81
81
|
export declare const REQUEST_TIMEOUT = 30000;
|
|
82
|
+
/**
|
|
83
|
+
* Timeout for a send POST (`/execute/send`, `/execute/tx`), in milliseconds.
|
|
84
|
+
*
|
|
85
|
+
* With `waitForReceipt` the server answers only after its own waits: TRON polls
|
|
86
|
+
* 10 times 3 s apart (27 s of sleeping), Solana 10 times 1.5 s apart (13.5 s),
|
|
87
|
+
* an EVM send waits for the receipt, and every WaaS hop before that (build, sign,
|
|
88
|
+
* broadcast) is capped by the server at 30 s. The 30 s default aborted TRON sends
|
|
89
|
+
* that were still in progress, and an abort after the broadcast hides the hash.
|
|
90
|
+
* 120 s covers the TRON polling plus the build, sign and broadcast hops, and still
|
|
91
|
+
* ends a hung request.
|
|
92
|
+
*/
|
|
93
|
+
export declare const SEND_REQUEST_TIMEOUT = 120000;
|
|
82
94
|
/**
|
|
83
95
|
* Retry configuration
|
|
84
96
|
*/
|
|
@@ -211,15 +223,15 @@ export declare const TALKEN_API_ENDPOINTS: {
|
|
|
211
223
|
readonly SIGN_AUTHORIZATION: "/sign/authorization";
|
|
212
224
|
readonly SIGN_HASH: "/sign/hash";
|
|
213
225
|
readonly SIGN_SVM: "/sign/solana";
|
|
226
|
+
readonly EXECUTE_TX: "/execute/tx";
|
|
227
|
+
readonly EXECUTE_SEND: "/execute/send";
|
|
228
|
+
readonly EXECUTE_BROADCAST: "/execute/broadcast";
|
|
214
229
|
readonly TX_RAW: "/wallet/tx/raw";
|
|
215
|
-
readonly TX_EVM: "/wallet/tx/evm";
|
|
216
|
-
readonly TX_SOL: "/wallet/tx/sol";
|
|
217
|
-
readonly SOLANA_LATEST_BLOCKHASH: "/wallet/solana/latest-blockhash";
|
|
218
|
-
readonly SOLANA_TX_STATUS: "/wallet/solana/tx-status";
|
|
219
230
|
readonly TX_BTC: "/wallet/tx/btc";
|
|
220
231
|
readonly TX_TVM: "/wallet/tx/tvm";
|
|
232
|
+
readonly SOLANA_LATEST_BLOCKHASH: "/wallet/solana/latest-blockhash";
|
|
233
|
+
readonly SOLANA_TX_STATUS: "/wallet/solana/tx-status";
|
|
221
234
|
readonly TRON_UTIL: "/wallet/tron";
|
|
222
|
-
readonly TX_XRP: "/wallet/tx/xrp";
|
|
223
235
|
readonly XRP_UTIL: "/wallet/xrp";
|
|
224
236
|
readonly XRP_TRUSTLINE: "/wallet/xrp/trustline";
|
|
225
237
|
readonly GAS_PRICE: "/wallet/gas/price";
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
PIN_CONFIG,
|
|
16
16
|
REQUEST_TIMEOUT,
|
|
17
17
|
RETRY_CONFIG,
|
|
18
|
+
SEND_REQUEST_TIMEOUT,
|
|
18
19
|
SOCIAL_BUTTONS,
|
|
19
20
|
SOLANA_CHAIN_ID,
|
|
20
21
|
STORAGE_PREFIX,
|
|
@@ -23,7 +24,7 @@ import {
|
|
|
23
24
|
TALKEN_API_ENDPOINTS,
|
|
24
25
|
TOKEN_EXPIRY,
|
|
25
26
|
loadTgAccessKey
|
|
26
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-XPZCOEQL.js";
|
|
27
28
|
export {
|
|
28
29
|
ABC_EVENTS,
|
|
29
30
|
ABC_FEATURES,
|
|
@@ -40,6 +41,7 @@ export {
|
|
|
40
41
|
PIN_CONFIG,
|
|
41
42
|
REQUEST_TIMEOUT,
|
|
42
43
|
RETRY_CONFIG,
|
|
44
|
+
SEND_REQUEST_TIMEOUT,
|
|
43
45
|
SOCIAL_BUTTONS,
|
|
44
46
|
SOLANA_CHAIN_ID,
|
|
45
47
|
STORAGE_PREFIX,
|
|
@@ -10,80 +10,82 @@ import {
|
|
|
10
10
|
refreshAccessToken,
|
|
11
11
|
scheduleProactiveRefresh,
|
|
12
12
|
setupVisibilityRefresh
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-743DKBGG.js";
|
|
14
14
|
import {
|
|
15
15
|
generateMpcWallets,
|
|
16
16
|
recoverMpcWallets,
|
|
17
17
|
validateMpcWallets
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-5SRSGEZR.js";
|
|
19
19
|
import {
|
|
20
20
|
AbcBitcoinProvider,
|
|
21
21
|
BITCOIN_NETWORKS
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-365TL36N.js";
|
|
23
23
|
import {
|
|
24
24
|
AbcSolanaProvider
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-MNGSJBPX.js";
|
|
26
26
|
import "../chunk-JGXJY3SB.js";
|
|
27
|
+
import {
|
|
28
|
+
WalletscanApi
|
|
29
|
+
} from "../chunk-EGLT3GPM.js";
|
|
27
30
|
import {
|
|
28
31
|
ConfigApi
|
|
29
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-OTLPTGHO.js";
|
|
30
33
|
import {
|
|
31
34
|
GasApi
|
|
32
35
|
} from "../chunk-2OHHFQQ7.js";
|
|
33
36
|
import {
|
|
34
37
|
SolanaApi
|
|
35
38
|
} from "../chunk-OTLZVWY7.js";
|
|
36
|
-
import {
|
|
37
|
-
WalletscanApi
|
|
38
|
-
} from "../chunk-HXYOWG5P.js";
|
|
39
39
|
import {
|
|
40
40
|
TokenApi
|
|
41
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-UHVJ6AF6.js";
|
|
42
42
|
import {
|
|
43
43
|
hashPin
|
|
44
44
|
} from "../chunk-OSTBVN45.js";
|
|
45
45
|
import {
|
|
46
46
|
AbcTronProvider,
|
|
47
47
|
TRON_NETWORKS
|
|
48
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-DRL2CDHT.js";
|
|
49
49
|
import {
|
|
50
50
|
AbcXrplProvider,
|
|
51
51
|
XRPL_NETWORKS
|
|
52
|
-
} from "../chunk-
|
|
52
|
+
} from "../chunk-YPMD3ZHF.js";
|
|
53
|
+
import "../chunk-Z66ETAKN.js";
|
|
53
54
|
import {
|
|
54
55
|
AbcBitcoinConnector,
|
|
55
56
|
createAbcBitcoinConnector
|
|
56
|
-
} from "../chunk-
|
|
57
|
+
} from "../chunk-TRFREYPH.js";
|
|
57
58
|
import {
|
|
58
59
|
abcWallet
|
|
59
|
-
} from "../chunk-
|
|
60
|
+
} from "../chunk-ZWIAZOVB.js";
|
|
60
61
|
import {
|
|
61
62
|
abcConnector
|
|
62
|
-
} from "../chunk-
|
|
63
|
+
} from "../chunk-DFG3BSSC.js";
|
|
63
64
|
import {
|
|
64
65
|
AbcEvmProvider,
|
|
65
66
|
createAbcEvmProvider,
|
|
66
67
|
createAbcProvider
|
|
67
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-SUPFF4EQ.js";
|
|
68
69
|
import "../chunk-OESFVVLA.js";
|
|
69
70
|
import {
|
|
70
71
|
TalkenApiClient,
|
|
71
72
|
createTalkenApiClient
|
|
72
|
-
} from "../chunk-
|
|
73
|
-
import "../chunk-
|
|
74
|
-
import "../chunk-
|
|
75
|
-
import "../chunk-
|
|
76
|
-
import "../chunk-
|
|
77
|
-
import "../chunk-
|
|
78
|
-
import "../chunk-
|
|
79
|
-
import "../chunk-
|
|
80
|
-
import "../chunk-
|
|
81
|
-
import "../chunk-
|
|
82
|
-
import "../chunk-6BHMNR5X.js";
|
|
73
|
+
} from "../chunk-GAJ4FJTW.js";
|
|
74
|
+
import "../chunk-HMIFFMGK.js";
|
|
75
|
+
import "../chunk-6X2XITQP.js";
|
|
76
|
+
import "../chunk-OMZSFUVN.js";
|
|
77
|
+
import "../chunk-PL56SINL.js";
|
|
78
|
+
import "../chunk-6MZWQBNQ.js";
|
|
79
|
+
import "../chunk-P64PMEPU.js";
|
|
80
|
+
import "../chunk-GO6HUJTP.js";
|
|
81
|
+
import "../chunk-RSR35XOZ.js";
|
|
82
|
+
import "../chunk-M4SNNQU2.js";
|
|
83
83
|
import "../chunk-GFWUFYT2.js";
|
|
84
|
+
import "../chunk-XGQUYXTL.js";
|
|
85
|
+
import "../chunk-DKMR2ML5.js";
|
|
84
86
|
import {
|
|
85
87
|
getCredentialManager
|
|
86
|
-
} from "../chunk-
|
|
88
|
+
} from "../chunk-SORKIBWX.js";
|
|
87
89
|
import "../chunk-3DHUDD4U.js";
|
|
88
90
|
import "../chunk-R6ZE7JAZ.js";
|
|
89
91
|
import "../chunk-CBKU2ERC.js";
|
|
@@ -122,19 +124,19 @@ import {
|
|
|
122
124
|
saveToStorage,
|
|
123
125
|
validateEmail,
|
|
124
126
|
validatePin
|
|
125
|
-
} from "../chunk-
|
|
127
|
+
} from "../chunk-F4JUKZBB.js";
|
|
126
128
|
import "../chunk-3IYXGND5.js";
|
|
129
|
+
import {
|
|
130
|
+
AbcError,
|
|
131
|
+
AbcErrorCode
|
|
132
|
+
} from "../chunk-TP4BDK7W.js";
|
|
127
133
|
import "../chunk-RKQS3OQG.js";
|
|
128
134
|
import "../chunk-YTIJR6EJ.js";
|
|
129
135
|
import "../chunk-PR5O3NNO.js";
|
|
130
136
|
import {
|
|
131
137
|
AbcStorageKey
|
|
132
138
|
} from "../chunk-JU6AJBYS.js";
|
|
133
|
-
import
|
|
134
|
-
AbcError,
|
|
135
|
-
AbcErrorCode
|
|
136
|
-
} from "../chunk-BUAWEYGV.js";
|
|
137
|
-
import "../chunk-ZITVWA4X.js";
|
|
139
|
+
import "../chunk-V6R6WDOQ.js";
|
|
138
140
|
import {
|
|
139
141
|
ABC_EVENTS,
|
|
140
142
|
ABC_FEATURES,
|
|
@@ -156,7 +158,7 @@ import {
|
|
|
156
158
|
STORAGE_VERSION,
|
|
157
159
|
SUCCESS_MESSAGES,
|
|
158
160
|
TOKEN_EXPIRY
|
|
159
|
-
} from "../chunk-
|
|
161
|
+
} from "../chunk-XPZCOEQL.js";
|
|
160
162
|
export {
|
|
161
163
|
ABC_EVENTS,
|
|
162
164
|
ABC_FEATURES,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ProviderError } from './ProviderError';
|
|
2
|
+
/**
|
|
3
|
+
* A provider error for a failed send, keeping what talken-api said about the
|
|
4
|
+
* outcome. `TalkenApiError` carries `retryable` and `possibleTxHash` from the
|
|
5
|
+
* error envelope (`retryable: false` means the transaction may already be
|
|
6
|
+
* broadcast), and a provider that wraps it in its own error would otherwise
|
|
7
|
+
* bury both in `data`. They are copied to the top level of the thrown error, and
|
|
8
|
+
* the possible hash is added to its message.
|
|
9
|
+
*/
|
|
10
|
+
export declare function sendFailure<T extends ProviderError>(create: (message: string, cause: unknown) => T, message: string, cause: unknown): T;
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
refreshAccessToken,
|
|
11
11
|
scheduleProactiveRefresh,
|
|
12
12
|
setupVisibilityRefresh
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-743DKBGG.js";
|
|
14
14
|
import "../chunk-2DFJ6LEN.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-V6R6WDOQ.js";
|
|
16
|
+
import "../chunk-XPZCOEQL.js";
|
|
17
17
|
export {
|
|
18
18
|
SESSION_EXPIRED_EVENT,
|
|
19
19
|
SessionExpiredError,
|
|
@@ -425,6 +425,13 @@ export interface TalkenSignHashBody {
|
|
|
425
425
|
pin?: string;
|
|
426
426
|
email?: string;
|
|
427
427
|
}
|
|
428
|
+
/**
|
|
429
|
+
* `evm.sendRawTransaction` broadcasts a signed EVM transaction through
|
|
430
|
+
* `/execute/broadcast`. `chain: 'tvm'` (raw TRON) stays on the legacy route.
|
|
431
|
+
* The SVM fields below (`chain: 'svm'`, `serializedTx`, `pin`, `fromAddress`) are
|
|
432
|
+
* no longer supported: a Solana request is refused. Send a Solana transfer with
|
|
433
|
+
* `solana.transfer`, or sign with `solana.sign`.
|
|
434
|
+
*/
|
|
428
435
|
export interface TalkenTxRawRequest {
|
|
429
436
|
chain?: 'evm' | 'svm' | 'tvm';
|
|
430
437
|
network: string;
|
|
@@ -444,10 +451,17 @@ export interface TalkenTxEvmRequest {
|
|
|
444
451
|
pin?: string;
|
|
445
452
|
data?: string;
|
|
446
453
|
gasLimit?: string;
|
|
454
|
+
gasPrice?: string;
|
|
447
455
|
maxFeePerGas?: string;
|
|
448
456
|
maxPriorityFeePerGas?: string;
|
|
449
457
|
email?: string;
|
|
450
458
|
waitForReceipt?: boolean;
|
|
459
|
+
/**
|
|
460
|
+
* One key per user send action. A caller that re-sends the same action (a
|
|
461
|
+
* credential-refresh retry) passes the same key; without one, `sendTransaction`
|
|
462
|
+
* generates a key for the call.
|
|
463
|
+
*/
|
|
464
|
+
idempotencyKey?: string;
|
|
451
465
|
}
|
|
452
466
|
export interface TalkenTxSvmRequest {
|
|
453
467
|
toAddress: string;
|
|
@@ -459,6 +473,9 @@ export interface TalkenTxSvmRequest {
|
|
|
459
473
|
amount?: string;
|
|
460
474
|
decimals?: number;
|
|
461
475
|
waitForConfirmation?: boolean;
|
|
476
|
+
email?: string;
|
|
477
|
+
/** See {@link TalkenTxEvmRequest.idempotencyKey}. */
|
|
478
|
+
idempotencyKey?: string;
|
|
462
479
|
}
|
|
463
480
|
export interface TalkenTxBtcRequest {
|
|
464
481
|
action?: TalkenBtcAction;
|
|
@@ -475,6 +492,8 @@ export interface TalkenTxBtcRequest {
|
|
|
475
492
|
confirmMaxAttempts?: number;
|
|
476
493
|
minConfirmations?: number;
|
|
477
494
|
email?: string;
|
|
495
|
+
/** See {@link TalkenTxEvmRequest.idempotencyKey}. */
|
|
496
|
+
idempotencyKey?: string;
|
|
478
497
|
}
|
|
479
498
|
export interface TalkenBtcFeeResponse {
|
|
480
499
|
mode: 'fee';
|
|
@@ -517,19 +536,75 @@ export interface TalkenTxTvmRequest {
|
|
|
517
536
|
confirmPollMs?: number;
|
|
518
537
|
confirmMaxAttempts?: number;
|
|
519
538
|
email?: string;
|
|
539
|
+
/** kind=trc20: the token's decimals. Required; there is no default. */
|
|
540
|
+
decimals?: number;
|
|
541
|
+
/** See {@link TalkenTxEvmRequest.idempotencyKey}. */
|
|
542
|
+
idempotencyKey?: string;
|
|
520
543
|
}
|
|
521
544
|
export interface TalkenTxReceipt {
|
|
522
545
|
status: number | null;
|
|
523
546
|
blockNumber: number | null;
|
|
524
547
|
gasUsed: string | null;
|
|
548
|
+
/** EVM `/execute/tx` receipt only. */
|
|
549
|
+
effectiveGasPrice?: string | null;
|
|
525
550
|
}
|
|
526
551
|
export interface TalkenTxResponse {
|
|
527
552
|
txHash: string;
|
|
528
553
|
rawTransaction?: string;
|
|
529
554
|
receipt?: TalkenTxReceipt;
|
|
530
555
|
confirmation?: any;
|
|
531
|
-
/** XRPL engine result code (e.g. 'tesSUCCESS', '
|
|
556
|
+
/** XRPL engine result code (e.g. 'tesSUCCESS', 'terQUEUED') */
|
|
532
557
|
engineResult?: XrplEngineResult;
|
|
558
|
+
/** XRPL `/execute/send`: `queued` for `terQUEUED`, else `submitted`. */
|
|
559
|
+
submissionStatus?: 'submitted' | 'queued';
|
|
560
|
+
/** XRPL `/execute/send`: always `false`; the ledger has not validated it yet. */
|
|
561
|
+
validated?: boolean;
|
|
562
|
+
}
|
|
563
|
+
/** `POST /execute/tx` (EVM transfer or contract call, signed and broadcast). */
|
|
564
|
+
export interface TalkenExecuteTxBody {
|
|
565
|
+
chainKey: string;
|
|
566
|
+
to?: string;
|
|
567
|
+
/** Decimal wei. */
|
|
568
|
+
amountWei: string;
|
|
569
|
+
data?: string;
|
|
570
|
+
gasLimit?: string;
|
|
571
|
+
gasPrice?: string;
|
|
572
|
+
maxFeePerGas?: string;
|
|
573
|
+
maxPriorityFeePerGas?: string;
|
|
574
|
+
pin?: string;
|
|
575
|
+
email?: string;
|
|
576
|
+
waitForReceipt?: boolean;
|
|
577
|
+
idempotencyKey?: string;
|
|
578
|
+
}
|
|
579
|
+
/** `POST /execute/send` (native or token transfer, signed and broadcast). */
|
|
580
|
+
export interface TalkenExecuteSendBody {
|
|
581
|
+
chainKey: string;
|
|
582
|
+
to: string;
|
|
583
|
+
/** Plain decimal in human units, e.g. "0.29". */
|
|
584
|
+
amount: string;
|
|
585
|
+
/** SPL mint, TRC-20 contract or XRPL currency code. Absent for the native coin. */
|
|
586
|
+
token?: string;
|
|
587
|
+
/** Integer in [0, 255]; required with `token` except on XRPL, where it is refused. */
|
|
588
|
+
decimals?: number;
|
|
589
|
+
/** XRPL issued tokens only. */
|
|
590
|
+
issuer?: string;
|
|
591
|
+
/** XRPL only. */
|
|
592
|
+
destinationTag?: number;
|
|
593
|
+
/** XRPL only: drops. */
|
|
594
|
+
fee?: string;
|
|
595
|
+
/** TRON TRC-20 only: sun, a JSON integer. */
|
|
596
|
+
feeLimit?: number;
|
|
597
|
+
/** Bitcoin only: whole sat/vB, a decimal string. */
|
|
598
|
+
feeRate?: string;
|
|
599
|
+
pin?: string;
|
|
600
|
+
email?: string;
|
|
601
|
+
waitForReceipt?: boolean;
|
|
602
|
+
idempotencyKey?: string;
|
|
603
|
+
}
|
|
604
|
+
/** `POST /execute/broadcast` (already-signed EVM transaction bytes). */
|
|
605
|
+
export interface TalkenExecuteBroadcastBody {
|
|
606
|
+
chainKey: string;
|
|
607
|
+
transaction: string;
|
|
533
608
|
}
|
|
534
609
|
/**
|
|
535
610
|
* XRPL Transaction Engine Result codes
|
|
@@ -233,5 +233,9 @@ export interface TalkenApiResponse<T = unknown> {
|
|
|
233
233
|
code: string;
|
|
234
234
|
message: string;
|
|
235
235
|
details?: unknown;
|
|
236
|
+
/** Present on a send failure; `false` when the broadcast may have happened. */
|
|
237
|
+
retryable?: boolean;
|
|
238
|
+
/** Present when a possibly-sent transaction's hash is known. */
|
|
239
|
+
possibleTxHash?: string;
|
|
236
240
|
};
|
|
237
241
|
}
|
|
@@ -30,7 +30,20 @@ export declare class TalkenApiError extends Error {
|
|
|
30
30
|
code: string;
|
|
31
31
|
statusCode: number;
|
|
32
32
|
details?: unknown;
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
|
+
* `error.retryable` from the response envelope. `false` on a send whose
|
|
35
|
+
* broadcast may already have happened: do not resubmit it.
|
|
36
|
+
*/
|
|
37
|
+
retryable?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The hash a possibly-sent transaction would carry (`error.possibleTxHash`,
|
|
40
|
+
* else `details.possibleTxHash`). Reconcile it before sending again.
|
|
41
|
+
*/
|
|
42
|
+
possibleTxHash?: string;
|
|
43
|
+
constructor(code: string, message: string, statusCode: number, details?: unknown, outcome?: {
|
|
44
|
+
retryable?: boolean;
|
|
45
|
+
possibleTxHash?: string;
|
|
46
|
+
});
|
|
34
47
|
}
|
|
35
48
|
export type TalkenBtcNetwork = 'bitcoin' | 'bitcoin_testnet';
|
|
36
49
|
export type TalkenBtcAction = 'transfer' | 'generate' | 'signHash' | 'finalize';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../chunk-3IYXGND5.js";
|
|
3
|
+
import {
|
|
4
|
+
AbcError,
|
|
5
|
+
AbcErrorCode,
|
|
6
|
+
TalkenApiError
|
|
7
|
+
} from "../chunk-TP4BDK7W.js";
|
|
3
8
|
import "../chunk-RKQS3OQG.js";
|
|
4
9
|
import "../chunk-YTIJR6EJ.js";
|
|
5
10
|
import "../chunk-PR5O3NNO.js";
|
|
6
11
|
import {
|
|
7
12
|
AbcStorageKey
|
|
8
13
|
} from "../chunk-JU6AJBYS.js";
|
|
9
|
-
import {
|
|
10
|
-
AbcError,
|
|
11
|
-
AbcErrorCode,
|
|
12
|
-
TalkenApiError
|
|
13
|
-
} from "../chunk-BUAWEYGV.js";
|
|
14
14
|
export {
|
|
15
15
|
AbcError,
|
|
16
16
|
AbcErrorCode,
|
|
@@ -15,15 +15,15 @@ import {
|
|
|
15
15
|
saveToStorage,
|
|
16
16
|
validateEmail,
|
|
17
17
|
validatePin
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-F4JUKZBB.js";
|
|
19
19
|
import "../chunk-3IYXGND5.js";
|
|
20
|
+
import "../chunk-TP4BDK7W.js";
|
|
20
21
|
import "../chunk-RKQS3OQG.js";
|
|
21
22
|
import "../chunk-YTIJR6EJ.js";
|
|
22
23
|
import "../chunk-PR5O3NNO.js";
|
|
23
24
|
import "../chunk-JU6AJBYS.js";
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-7GBAUSQJ.js";
|
|
25
|
+
import "../chunk-V6R6WDOQ.js";
|
|
26
|
+
import "../chunk-XPZCOEQL.js";
|
|
27
27
|
export {
|
|
28
28
|
calculateExpiryTimestamp,
|
|
29
29
|
clearAuthState,
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
generateMpcWallets,
|
|
4
4
|
recoverMpcWallets,
|
|
5
5
|
validateMpcWallets
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-5SRSGEZR.js";
|
|
7
|
+
import "../chunk-SORKIBWX.js";
|
|
8
8
|
import "../chunk-KXPCOVNY.js";
|
|
9
9
|
import "../chunk-2DFJ6LEN.js";
|
|
10
10
|
import "../chunk-3IYXGND5.js";
|
|
11
|
+
import "../chunk-TP4BDK7W.js";
|
|
11
12
|
import "../chunk-RKQS3OQG.js";
|
|
12
13
|
import "../chunk-YTIJR6EJ.js";
|
|
13
14
|
import "../chunk-PR5O3NNO.js";
|
|
14
15
|
import "../chunk-JU6AJBYS.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-7GBAUSQJ.js";
|
|
16
|
+
import "../chunk-V6R6WDOQ.js";
|
|
17
|
+
import "../chunk-XPZCOEQL.js";
|
|
18
18
|
export {
|
|
19
19
|
generateMpcWallets,
|
|
20
20
|
recoverMpcWallets,
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
TalkenTronModule
|
|
4
|
+
} from "./chunk-6X2XITQP.js";
|
|
5
|
+
import {
|
|
6
|
+
TalkenSolanaModule
|
|
7
|
+
} from "./chunk-HMIFFMGK.js";
|
|
2
8
|
import {
|
|
3
9
|
TalkenWalletModule
|
|
4
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OMZSFUVN.js";
|
|
5
11
|
import {
|
|
6
12
|
TalkenWalletscanModule
|
|
7
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-PL56SINL.js";
|
|
8
14
|
import {
|
|
9
15
|
TalkenXrpModule
|
|
10
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6MZWQBNQ.js";
|
|
11
17
|
import {
|
|
12
18
|
TalkenAuthModule
|
|
13
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-P64PMEPU.js";
|
|
14
20
|
import {
|
|
15
21
|
TalkenBitcoinModule
|
|
16
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-GO6HUJTP.js";
|
|
17
23
|
import {
|
|
18
24
|
TalkenEvmModule
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import {
|
|
21
|
-
TalkenSolanaModule
|
|
22
|
-
} from "./chunk-5E7TNMON.js";
|
|
23
|
-
import {
|
|
24
|
-
TalkenTronModule
|
|
25
|
-
} from "./chunk-6BHMNR5X.js";
|
|
25
|
+
} from "./chunk-RSR35XOZ.js";
|
|
26
26
|
import {
|
|
27
27
|
createLogger
|
|
28
28
|
} from "./chunk-2DFJ6LEN.js";
|
|
29
29
|
import {
|
|
30
30
|
TalkenApiError
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-TP4BDK7W.js";
|
|
32
32
|
import {
|
|
33
33
|
STORAGE_NS,
|
|
34
34
|
get,
|
|
35
35
|
remove,
|
|
36
36
|
set
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-V6R6WDOQ.js";
|
|
38
38
|
import {
|
|
39
39
|
DEFAULT_TALKEN_API_CONFIG,
|
|
40
40
|
TOKEN_EXPIRY,
|
|
41
41
|
loadTgAccessKey
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-XPZCOEQL.js";
|
|
43
43
|
|
|
44
44
|
// src/wallets/walletConnectors/abcWallet/api/TalkenApiClient.ts
|
|
45
45
|
var logger = createLogger("TalkenApiClient");
|
|
@@ -52,6 +52,16 @@ function saveToken(key, value) {
|
|
|
52
52
|
function removeToken(key) {
|
|
53
53
|
remove(STORAGE_NS.API, key);
|
|
54
54
|
}
|
|
55
|
+
function errorOutcome(error, details) {
|
|
56
|
+
const fromDetails = typeof details === "object" && details !== null ? details.possibleTxHash : void 0;
|
|
57
|
+
const hash = error?.possibleTxHash ?? fromDetails;
|
|
58
|
+
return {
|
|
59
|
+
...typeof error?.retryable === "boolean" && {
|
|
60
|
+
retryable: error.retryable
|
|
61
|
+
},
|
|
62
|
+
...typeof hash === "string" && hash !== "" && { possibleTxHash: hash }
|
|
63
|
+
};
|
|
64
|
+
}
|
|
55
65
|
var TalkenApiClient = class _TalkenApiClient {
|
|
56
66
|
constructor(config) {
|
|
57
67
|
this.accessToken = null;
|
|
@@ -311,11 +321,13 @@ var TalkenApiClient = class _TalkenApiClient {
|
|
|
311
321
|
if (this.config.debug) {
|
|
312
322
|
logger.error(`Error: ${errCode} - ${errMsg}`);
|
|
313
323
|
}
|
|
324
|
+
const details = data.error?.details || data.details;
|
|
314
325
|
throw new TalkenApiError(
|
|
315
326
|
errCode,
|
|
316
327
|
errMsg,
|
|
317
328
|
response.status,
|
|
318
|
-
|
|
329
|
+
details,
|
|
330
|
+
errorOutcome(data.error, details)
|
|
319
331
|
);
|
|
320
332
|
}
|
|
321
333
|
return data.data ?? data;
|