@talken/talkenkit 2.8.3 → 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-6FBGTSSM.js → AbcCredentialManager-WZBF3GHF.js} +1 -1
- package/dist/{abcWallet-7ZZXHG7O.js → abcWallet-EOHU5AIB.js} +2 -2
- package/dist/{chunk-SUYKWM5G.js → chunk-CUPPBGFC.js} +23 -14
- package/dist/{chunk-HX6JUKSS.js → chunk-WGSS57V6.js} +985 -212
- package/dist/config/networks.d.ts +12 -0
- package/dist/gasless/utils/revokeDelegation.d.ts +4 -3
- package/dist/index.css +13 -13
- package/dist/index.js +26 -20
- package/dist/utils/amount.d.ts +17 -0
- package/dist/wallets/walletConnectors/abcWallet/AbcCredentialManager.js +3 -3
- package/dist/wallets/walletConnectors/abcWallet/AbcEvmAutoConnector.js +5 -5
- 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 +6 -6
- package/dist/wallets/walletConnectors/abcWallet/abcBitcoinProvider.js +13 -4
- package/dist/wallets/walletConnectors/abcWallet/abcConnector.js +21 -17
- package/dist/wallets/walletConnectors/abcWallet/abcProvider.d.ts +3 -4
- package/dist/wallets/walletConnectors/abcWallet/abcProvider.js +11 -7
- package/dist/wallets/walletConnectors/abcWallet/abcSolanaProvider.js +22 -18
- 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 +22 -18
- 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 +17 -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 +22 -19
- package/dist/wallets/walletConnectors/abcWallet/api/modules/auth.js +4 -4
- package/dist/wallets/walletConnectors/abcWallet/api/modules/bitcoin.d.ts +17 -3
- package/dist/wallets/walletConnectors/abcWallet/api/modules/bitcoin.js +14 -5
- package/dist/wallets/walletConnectors/abcWallet/api/modules/evm.d.ts +27 -8
- package/dist/wallets/walletConnectors/abcWallet/api/modules/evm.js +13 -4
- 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 +37 -0
- package/dist/wallets/walletConnectors/abcWallet/api/modules/signBodies.js +29 -0
- package/dist/wallets/walletConnectors/abcWallet/api/modules/signingRefresh.d.ts +21 -0
- package/dist/wallets/walletConnectors/abcWallet/api/modules/signingRefresh.js +18 -0
- package/dist/wallets/walletConnectors/abcWallet/api/modules/solana.d.ts +10 -4
- package/dist/wallets/walletConnectors/abcWallet/api/modules/solana.js +10 -2
- 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 +23 -11
- package/dist/wallets/walletConnectors/abcWallet/constants.js +3 -1
- package/dist/wallets/walletConnectors/abcWallet/evmTxType.d.ts +20 -0
- package/dist/wallets/walletConnectors/abcWallet/evmTxType.js +8 -0
- package/dist/wallets/walletConnectors/abcWallet/index.js +45 -40
- 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 +147 -2
- 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 +6 -6
- package/dist/wallets/walletConnectors/abcWallet/utils.js +5 -5
- package/dist/wallets/walletConnectors/abcWallet/walletGeneration.js +6 -6
- package/dist/wallets/walletConnectors/{chunk-CXWASK7L.js → chunk-2M6E3YXU.js} +31 -19
- package/dist/wallets/walletConnectors/{chunk-URTS7ZIZ.js → chunk-365TL36N.js} +36 -31
- package/dist/wallets/walletConnectors/{chunk-7DLZKN46.js → chunk-4CKIGJZD.js} +8 -8
- package/dist/wallets/walletConnectors/{chunk-6FPKKAFI.js → chunk-5SRSGEZR.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-ZOBSRU6L.js → chunk-6MZWQBNQ.js} +28 -7
- package/dist/wallets/walletConnectors/chunk-6X2XITQP.js +71 -0
- package/dist/wallets/walletConnectors/{chunk-ZXG3X6PV.js → chunk-743DKBGG.js} +2 -2
- package/dist/wallets/walletConnectors/chunk-DFG3BSSC.js +341 -0
- package/dist/wallets/walletConnectors/chunk-DKMR2ML5.js +163 -0
- package/dist/wallets/walletConnectors/{chunk-4BG6V5TZ.js → chunk-DRL2CDHT.js} +24 -22
- package/dist/wallets/walletConnectors/{chunk-S6XEM7RM.js → chunk-EGLT3GPM.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-VVXSRRXI.js → chunk-F4JUKZBB.js} +3 -3
- package/dist/wallets/walletConnectors/chunk-GAJ4FJTW.js +382 -0
- package/dist/wallets/walletConnectors/{chunk-4Y7YP4IR.js → chunk-GO6HUJTP.js} +51 -12
- package/dist/wallets/walletConnectors/{chunk-3NWM24MH.js → chunk-HMIFFMGK.js} +22 -8
- package/dist/wallets/walletConnectors/chunk-M4SNNQU2.js +56 -0
- package/dist/wallets/walletConnectors/{chunk-ANBOP6A6.js → chunk-MNGSJBPX.js} +31 -14
- package/dist/wallets/walletConnectors/chunk-OESFVVLA.js +38 -0
- package/dist/wallets/walletConnectors/{chunk-2LOET2LX.js → chunk-OMZSFUVN.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-L3EPZ4NZ.js → chunk-OTLPTGHO.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-XDNFWX2X.js → chunk-P64PMEPU.js} +2 -2
- package/dist/wallets/walletConnectors/{chunk-2LH53QET.js → chunk-PL56SINL.js} +1 -1
- package/dist/wallets/walletConnectors/chunk-RSR35XOZ.js +206 -0
- package/dist/wallets/walletConnectors/{chunk-YNE2UX2Z.js → chunk-SORKIBWX.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-HM73RD2O.js → chunk-SUPFF4EQ.js} +44 -812
- package/dist/wallets/walletConnectors/{chunk-BUAWEYGV.js → chunk-TP4BDK7W.js} +5 -1
- package/dist/wallets/walletConnectors/{chunk-4DGLNUHL.js → chunk-TRFREYPH.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-FWX2HD26.js → chunk-UHVJ6AF6.js} +1 -1
- package/dist/wallets/walletConnectors/{chunk-NEMEHJ72.js → chunk-V6R6WDOQ.js} +1 -1
- package/dist/wallets/walletConnectors/chunk-XGQUYXTL.js +1215 -0
- package/dist/wallets/walletConnectors/{chunk-3Z5DO42M.js → chunk-XPZCOEQL.js} +23 -14
- package/dist/wallets/walletConnectors/{chunk-YFNVHCMA.js → chunk-YPMD3ZHF.js} +33 -18
- package/dist/wallets/walletConnectors/chunk-Z66ETAKN.js +20 -0
- package/dist/wallets/walletConnectors/{chunk-M4YGDOD5.js → chunk-ZBI7MSWF.js} +5 -5
- package/dist/wallets/walletConnectors/chunk-ZWIAZOVB.js +58 -0
- package/dist/wallets/walletConnectors/index.js +73 -69
- package/package.json +1 -1
- package/dist/wallets/walletConnectors/chunk-2KHTFKPP.js +0 -186
- package/dist/wallets/walletConnectors/chunk-3QC567QK.js +0 -94
- package/dist/wallets/walletConnectors/chunk-4K2V7RCL.js +0 -96
- package/dist/wallets/walletConnectors/chunk-4V3HRM2R.js +0 -95
- package/dist/wallets/walletConnectors/chunk-5QYCHHVB.js +0 -98
- package/dist/wallets/walletConnectors/chunk-76M232IF.js +0 -101
- package/dist/wallets/walletConnectors/chunk-7IBMHOYD.js +0 -102
- package/dist/wallets/walletConnectors/chunk-A2DZALFI.js +0 -108
- package/dist/wallets/walletConnectors/chunk-BZPKBSWY.js +0 -66
- package/dist/wallets/walletConnectors/chunk-CEOJSQAI.js +0 -66
- package/dist/wallets/walletConnectors/chunk-CTAFZ5RQ.js +0 -71
- package/dist/wallets/walletConnectors/chunk-DHWJ3552.js +0 -93
- package/dist/wallets/walletConnectors/chunk-EJALZNAR.js +0 -101
- package/dist/wallets/walletConnectors/chunk-FE2BFYJB.js +0 -73
- package/dist/wallets/walletConnectors/chunk-FGYJTUYV.js +0 -94
- package/dist/wallets/walletConnectors/chunk-FVA6H2VF.js +0 -95
- package/dist/wallets/walletConnectors/chunk-GNF5CHDQ.js +0 -102
- package/dist/wallets/walletConnectors/chunk-GZPGNUNF.js +0 -94
- package/dist/wallets/walletConnectors/chunk-HALTGRQW.js +0 -87
- package/dist/wallets/walletConnectors/chunk-ICGK5DGY.js +0 -146
- package/dist/wallets/walletConnectors/chunk-IONL6LMJ.js +0 -71
- package/dist/wallets/walletConnectors/chunk-KNNHGFKJ.js +0 -98
- package/dist/wallets/walletConnectors/chunk-KQDFRZT4.js +0 -65
- package/dist/wallets/walletConnectors/chunk-KQROIRBW.js +0 -27
- package/dist/wallets/walletConnectors/chunk-LKNK2KKU.js +0 -76
- package/dist/wallets/walletConnectors/chunk-NM7YUGLV.js +0 -186
- package/dist/wallets/walletConnectors/chunk-PXL5G2PM.js +0 -96
- package/dist/wallets/walletConnectors/chunk-QB3QLNSL.js +0 -76
- package/dist/wallets/walletConnectors/chunk-QRU6XFHH.js +0 -110
- package/dist/wallets/walletConnectors/chunk-T6RB3SM7.js +0 -73
- package/dist/wallets/walletConnectors/chunk-TA4DDCKN.js +0 -96
- package/dist/wallets/walletConnectors/chunk-TWVKSPTP.js +0 -91
- package/dist/wallets/walletConnectors/chunk-TYJR3KGY.js +0 -46
- package/dist/wallets/walletConnectors/chunk-U5UPCM5V.js +0 -66
- package/dist/wallets/walletConnectors/chunk-V5LGED4F.js +0 -103
- package/dist/wallets/walletConnectors/chunk-WZMFQQ6R.js +0 -108
- package/dist/wallets/walletConnectors/chunk-XS6GJRRA.js +0 -98
- package/dist/wallets/walletConnectors/chunk-XSJUQHR7.js +0 -95
- package/dist/wallets/walletConnectors/chunk-XSX5EECZ.js +0 -96
|
@@ -306,7 +306,8 @@ export interface TalkenEvmSignRequest {
|
|
|
306
306
|
gasPrice?: string;
|
|
307
307
|
maxFeePerGas?: string;
|
|
308
308
|
maxPriorityFeePerGas?: string;
|
|
309
|
-
|
|
309
|
+
/** talken-api accepts exactly these; anything else is 400 (talken-api#908). */
|
|
310
|
+
type?: 'LEGACY' | 'EIP1559';
|
|
310
311
|
pin?: string;
|
|
311
312
|
email?: string;
|
|
312
313
|
}
|
|
@@ -356,6 +357,81 @@ export interface TalkenEvmSignatureResponse {
|
|
|
356
357
|
signature: string;
|
|
357
358
|
txHash?: string;
|
|
358
359
|
}
|
|
360
|
+
/** WaaS EVM quantity: decimal or `0x` hex string, or a safe integer. */
|
|
361
|
+
type TalkenEvmQuantity = string | number;
|
|
362
|
+
/** `POST /sign/tx` */
|
|
363
|
+
export interface TalkenSignTxBody {
|
|
364
|
+
/** talken-api chainKey. A WaaS network name resolves to itself. */
|
|
365
|
+
chainKey: string;
|
|
366
|
+
/** Decimal wei. */
|
|
367
|
+
amountWei: string;
|
|
368
|
+
/** talken-api defaults an absent `to` to the sender. */
|
|
369
|
+
to?: string;
|
|
370
|
+
data?: string;
|
|
371
|
+
nonce?: TalkenEvmQuantity;
|
|
372
|
+
gasLimit?: TalkenEvmQuantity;
|
|
373
|
+
gasPrice?: TalkenEvmQuantity;
|
|
374
|
+
maxFeePerGas?: TalkenEvmQuantity;
|
|
375
|
+
maxPriorityFeePerGas?: TalkenEvmQuantity;
|
|
376
|
+
type?: 'LEGACY' | 'EIP1559';
|
|
377
|
+
pin?: string;
|
|
378
|
+
email?: string;
|
|
379
|
+
}
|
|
380
|
+
/** `POST /sign/typed-data` */
|
|
381
|
+
export interface TalkenSignTypedDataBody {
|
|
382
|
+
chainKey: string;
|
|
383
|
+
domain: Record<string, unknown>;
|
|
384
|
+
types: Record<string, unknown>;
|
|
385
|
+
primaryType: string;
|
|
386
|
+
message: Record<string, unknown>;
|
|
387
|
+
pin?: string;
|
|
388
|
+
email?: string;
|
|
389
|
+
}
|
|
390
|
+
/** `POST /sign/message` */
|
|
391
|
+
export interface TalkenSignMessageBody {
|
|
392
|
+
chainKey: string;
|
|
393
|
+
message: string;
|
|
394
|
+
address?: string;
|
|
395
|
+
signaturePrefix?: 'eip191' | 'native';
|
|
396
|
+
pin?: string;
|
|
397
|
+
email?: string;
|
|
398
|
+
}
|
|
399
|
+
/** `POST /sign/authorization` */
|
|
400
|
+
export interface TalkenSignAuthorizationBody {
|
|
401
|
+
chainKey: string;
|
|
402
|
+
/** `chainId` a JSON integer, `nonce` a decimal string. */
|
|
403
|
+
authorization: {
|
|
404
|
+
chainId: number;
|
|
405
|
+
address: string;
|
|
406
|
+
nonce: string;
|
|
407
|
+
};
|
|
408
|
+
pin?: string;
|
|
409
|
+
email?: string;
|
|
410
|
+
}
|
|
411
|
+
/** `POST /sign/solana` */
|
|
412
|
+
export interface TalkenSignSolanaBody {
|
|
413
|
+
/** Hex-encoded bytes to sign. */
|
|
414
|
+
message: string;
|
|
415
|
+
network?: 'solana' | 'solana_devnet';
|
|
416
|
+
pin?: string;
|
|
417
|
+
keyId?: string;
|
|
418
|
+
encryptedShare?: string;
|
|
419
|
+
secretStore?: string;
|
|
420
|
+
}
|
|
421
|
+
/** `POST /sign/hash` */
|
|
422
|
+
export interface TalkenSignHashBody {
|
|
423
|
+
hash: string;
|
|
424
|
+
chainKey?: string;
|
|
425
|
+
pin?: string;
|
|
426
|
+
email?: string;
|
|
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
|
+
*/
|
|
359
435
|
export interface TalkenTxRawRequest {
|
|
360
436
|
chain?: 'evm' | 'svm' | 'tvm';
|
|
361
437
|
network: string;
|
|
@@ -375,10 +451,17 @@ export interface TalkenTxEvmRequest {
|
|
|
375
451
|
pin?: string;
|
|
376
452
|
data?: string;
|
|
377
453
|
gasLimit?: string;
|
|
454
|
+
gasPrice?: string;
|
|
378
455
|
maxFeePerGas?: string;
|
|
379
456
|
maxPriorityFeePerGas?: string;
|
|
380
457
|
email?: string;
|
|
381
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;
|
|
382
465
|
}
|
|
383
466
|
export interface TalkenTxSvmRequest {
|
|
384
467
|
toAddress: string;
|
|
@@ -390,6 +473,9 @@ export interface TalkenTxSvmRequest {
|
|
|
390
473
|
amount?: string;
|
|
391
474
|
decimals?: number;
|
|
392
475
|
waitForConfirmation?: boolean;
|
|
476
|
+
email?: string;
|
|
477
|
+
/** See {@link TalkenTxEvmRequest.idempotencyKey}. */
|
|
478
|
+
idempotencyKey?: string;
|
|
393
479
|
}
|
|
394
480
|
export interface TalkenTxBtcRequest {
|
|
395
481
|
action?: TalkenBtcAction;
|
|
@@ -406,6 +492,8 @@ export interface TalkenTxBtcRequest {
|
|
|
406
492
|
confirmMaxAttempts?: number;
|
|
407
493
|
minConfirmations?: number;
|
|
408
494
|
email?: string;
|
|
495
|
+
/** See {@link TalkenTxEvmRequest.idempotencyKey}. */
|
|
496
|
+
idempotencyKey?: string;
|
|
409
497
|
}
|
|
410
498
|
export interface TalkenBtcFeeResponse {
|
|
411
499
|
mode: 'fee';
|
|
@@ -448,19 +536,75 @@ export interface TalkenTxTvmRequest {
|
|
|
448
536
|
confirmPollMs?: number;
|
|
449
537
|
confirmMaxAttempts?: number;
|
|
450
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;
|
|
451
543
|
}
|
|
452
544
|
export interface TalkenTxReceipt {
|
|
453
545
|
status: number | null;
|
|
454
546
|
blockNumber: number | null;
|
|
455
547
|
gasUsed: string | null;
|
|
548
|
+
/** EVM `/execute/tx` receipt only. */
|
|
549
|
+
effectiveGasPrice?: string | null;
|
|
456
550
|
}
|
|
457
551
|
export interface TalkenTxResponse {
|
|
458
552
|
txHash: string;
|
|
459
553
|
rawTransaction?: string;
|
|
460
554
|
receipt?: TalkenTxReceipt;
|
|
461
555
|
confirmation?: any;
|
|
462
|
-
/** XRPL engine result code (e.g. 'tesSUCCESS', '
|
|
556
|
+
/** XRPL engine result code (e.g. 'tesSUCCESS', 'terQUEUED') */
|
|
463
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;
|
|
464
608
|
}
|
|
465
609
|
/**
|
|
466
610
|
* XRPL Transaction Engine Result codes
|
|
@@ -496,3 +640,4 @@ export interface TalkenWalletscanNftsRequest {
|
|
|
496
640
|
chainKeys: string;
|
|
497
641
|
walletAddress: string;
|
|
498
642
|
}
|
|
643
|
+
export {};
|
|
@@ -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 "../chunk-YTIJR6EJ.js";
|
|
4
|
-
import "../chunk-PR5O3NNO.js";
|
|
5
|
-
import {
|
|
6
|
-
AbcStorageKey
|
|
7
|
-
} from "../chunk-JU6AJBYS.js";
|
|
8
3
|
import {
|
|
9
4
|
AbcError,
|
|
10
5
|
AbcErrorCode,
|
|
11
6
|
TalkenApiError
|
|
12
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-TP4BDK7W.js";
|
|
13
8
|
import "../chunk-RKQS3OQG.js";
|
|
9
|
+
import "../chunk-YTIJR6EJ.js";
|
|
10
|
+
import "../chunk-PR5O3NNO.js";
|
|
11
|
+
import {
|
|
12
|
+
AbcStorageKey
|
|
13
|
+
} from "../chunk-JU6AJBYS.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";
|
|
21
|
+
import "../chunk-RKQS3OQG.js";
|
|
20
22
|
import "../chunk-YTIJR6EJ.js";
|
|
21
23
|
import "../chunk-PR5O3NNO.js";
|
|
22
24
|
import "../chunk-JU6AJBYS.js";
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-NEMEHJ72.js";
|
|
26
|
-
import "../chunk-3Z5DO42M.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";
|
|
12
|
+
import "../chunk-RKQS3OQG.js";
|
|
11
13
|
import "../chunk-YTIJR6EJ.js";
|
|
12
14
|
import "../chunk-PR5O3NNO.js";
|
|
13
15
|
import "../chunk-JU6AJBYS.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-NEMEHJ72.js";
|
|
17
|
-
import "../chunk-3Z5DO42M.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
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
TalkenBitcoinModule
|
|
7
|
-
} from "./chunk-4Y7YP4IR.js";
|
|
8
|
-
import {
|
|
9
|
-
TalkenEvmModule
|
|
10
|
-
} from "./chunk-ICGK5DGY.js";
|
|
3
|
+
TalkenTronModule
|
|
4
|
+
} from "./chunk-6X2XITQP.js";
|
|
11
5
|
import {
|
|
12
6
|
TalkenSolanaModule
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
TalkenTronModule
|
|
16
|
-
} from "./chunk-TYJR3KGY.js";
|
|
7
|
+
} from "./chunk-HMIFFMGK.js";
|
|
17
8
|
import {
|
|
18
9
|
TalkenWalletModule
|
|
19
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OMZSFUVN.js";
|
|
20
11
|
import {
|
|
21
12
|
TalkenWalletscanModule
|
|
22
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-PL56SINL.js";
|
|
23
14
|
import {
|
|
24
15
|
TalkenXrpModule
|
|
25
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6MZWQBNQ.js";
|
|
17
|
+
import {
|
|
18
|
+
TalkenAuthModule
|
|
19
|
+
} from "./chunk-P64PMEPU.js";
|
|
20
|
+
import {
|
|
21
|
+
TalkenBitcoinModule
|
|
22
|
+
} from "./chunk-GO6HUJTP.js";
|
|
23
|
+
import {
|
|
24
|
+
TalkenEvmModule
|
|
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;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import {
|
|
3
|
+
sendFailure
|
|
4
|
+
} from "./chunk-Z66ETAKN.js";
|
|
5
|
+
import {
|
|
6
|
+
NATIVE_DECIMALS,
|
|
7
|
+
toBaseUnits
|
|
8
|
+
} from "./chunk-XGQUYXTL.js";
|
|
2
9
|
import {
|
|
3
10
|
getCredentialManager
|
|
4
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SORKIBWX.js";
|
|
5
12
|
import {
|
|
6
13
|
AbstractChainProvider
|
|
7
14
|
} from "./chunk-3DHUDD4U.js";
|
|
@@ -278,32 +285,14 @@ var AbcBitcoinProvider = class extends AbstractChainProvider {
|
|
|
278
285
|
}
|
|
279
286
|
const pinHash = getCredentialManager().getPinHash() || "";
|
|
280
287
|
const email = this.getRecoveryEmail();
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
const result = await api.bitcoin.execute({
|
|
284
|
-
action: "signHash",
|
|
288
|
+
const signstr = this.extractHashSignature(
|
|
289
|
+
await api.bitcoin.signHash({
|
|
285
290
|
hash: hashHex,
|
|
286
291
|
pin: pinHash || void 0,
|
|
287
292
|
network: this.network.type,
|
|
288
293
|
...email && { email }
|
|
289
|
-
})
|
|
290
|
-
|
|
291
|
-
} catch (error) {
|
|
292
|
-
logger.warn(
|
|
293
|
-
"BTC signHash endpoint failed, falling back to generic sign/hash:",
|
|
294
|
-
error
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
if (!signstr) {
|
|
298
|
-
signstr = this.extractHashSignature(
|
|
299
|
-
await api.bitcoin.signHash({
|
|
300
|
-
hash: hashHex,
|
|
301
|
-
pin: pinHash || void 0,
|
|
302
|
-
network: this.network.type,
|
|
303
|
-
...email && { email }
|
|
304
|
-
})
|
|
305
|
-
);
|
|
306
|
-
}
|
|
294
|
+
})
|
|
295
|
+
);
|
|
307
296
|
if (!signstr) {
|
|
308
297
|
throw new BitcoinProviderError(
|
|
309
298
|
ProviderErrorCode.INTERNAL_ERROR,
|
|
@@ -348,6 +337,10 @@ var AbcBitcoinProvider = class extends AbstractChainProvider {
|
|
|
348
337
|
"Wallet not connected"
|
|
349
338
|
);
|
|
350
339
|
}
|
|
340
|
+
const amountSats = toBaseUnits(
|
|
341
|
+
params.amount,
|
|
342
|
+
NATIVE_DECIMALS.bitcoin
|
|
343
|
+
).toString();
|
|
351
344
|
try {
|
|
352
345
|
const INPUT_PER_BYTE = 141;
|
|
353
346
|
const BUFFER = 500;
|
|
@@ -380,10 +373,10 @@ var AbcBitcoinProvider = class extends AbstractChainProvider {
|
|
|
380
373
|
);
|
|
381
374
|
}
|
|
382
375
|
const email = this.getRecoveryEmail();
|
|
383
|
-
const satoshis = Math.floor(params.amount * 1e8);
|
|
384
376
|
const result = await api.bitcoin.sendTransaction({
|
|
385
377
|
toAddress: params.toAddress,
|
|
386
|
-
amountSats
|
|
378
|
+
amountSats,
|
|
379
|
+
network: this.network.type,
|
|
387
380
|
pin: pinHash || void 0,
|
|
388
381
|
...email && { email }
|
|
389
382
|
});
|
|
@@ -408,15 +401,23 @@ var AbcBitcoinProvider = class extends AbstractChainProvider {
|
|
|
408
401
|
}
|
|
409
402
|
logger.error("Transaction failed:", error.message);
|
|
410
403
|
if (error.message?.includes("insufficient")) {
|
|
411
|
-
throw
|
|
412
|
-
|
|
404
|
+
throw sendFailure(
|
|
405
|
+
(message, cause) => new BitcoinProviderError(
|
|
406
|
+
ProviderErrorCode.INSUFFICIENT_FUNDS,
|
|
407
|
+
message,
|
|
408
|
+
cause
|
|
409
|
+
),
|
|
413
410
|
"Insufficient BTC balance",
|
|
414
411
|
error
|
|
415
412
|
);
|
|
416
413
|
}
|
|
417
414
|
this.emit("error", error);
|
|
418
|
-
throw
|
|
419
|
-
|
|
415
|
+
throw sendFailure(
|
|
416
|
+
(message, cause) => new BitcoinProviderError(
|
|
417
|
+
ProviderErrorCode.INTERNAL_ERROR,
|
|
418
|
+
message,
|
|
419
|
+
cause
|
|
420
|
+
),
|
|
420
421
|
"Failed to send transaction",
|
|
421
422
|
error
|
|
422
423
|
);
|
|
@@ -458,8 +459,12 @@ var AbcBitcoinProvider = class extends AbstractChainProvider {
|
|
|
458
459
|
} catch (error) {
|
|
459
460
|
logger.error("Transaction broadcast failed:", error.message);
|
|
460
461
|
this.emit("error", error);
|
|
461
|
-
throw
|
|
462
|
-
|
|
462
|
+
throw sendFailure(
|
|
463
|
+
(message, cause) => new BitcoinProviderError(
|
|
464
|
+
ProviderErrorCode.INTERNAL_ERROR,
|
|
465
|
+
message,
|
|
466
|
+
cause
|
|
467
|
+
),
|
|
463
468
|
"Failed to broadcast transaction",
|
|
464
469
|
error
|
|
465
470
|
);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
createAbcEvmProvider
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
createTalkenApiClient
|
|
7
|
-
} from "./chunk-CXWASK7L.js";
|
|
4
|
+
} from "./chunk-SUPFF4EQ.js";
|
|
8
5
|
import {
|
|
9
6
|
resolveTalkenApiUrl
|
|
10
7
|
} from "./chunk-GFWUFYT2.js";
|
|
8
|
+
import {
|
|
9
|
+
createTalkenApiClient
|
|
10
|
+
} from "./chunk-2M6E3YXU.js";
|
|
11
11
|
import {
|
|
12
12
|
getCredentialManager
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SORKIBWX.js";
|
|
14
14
|
import {
|
|
15
15
|
setTalkenApiClient
|
|
16
16
|
} from "./chunk-R6ZE7JAZ.js";
|
|
@@ -28,15 +28,15 @@ import {
|
|
|
28
28
|
loadAuthState,
|
|
29
29
|
loadFromStorage,
|
|
30
30
|
saveAuthState
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-F4JUKZBB.js";
|
|
32
32
|
import {
|
|
33
33
|
STORAGE_NS,
|
|
34
34
|
get,
|
|
35
35
|
remove
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-V6R6WDOQ.js";
|
|
37
37
|
import {
|
|
38
38
|
loadTgAccessKey
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-XPZCOEQL.js";
|
|
40
40
|
|
|
41
41
|
// src/wallets/walletConnectors/abcWallet/abcConnector.ts
|
|
42
42
|
import { getTalkenApiClient } from "@talken/talkenkit";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
getCredentialManager
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SORKIBWX.js";
|
|
5
5
|
import {
|
|
6
6
|
getBitcoinNetwork,
|
|
7
7
|
getEvmNetwork,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-2DFJ6LEN.js";
|
|
15
15
|
import {
|
|
16
16
|
AbcError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TP4BDK7W.js";
|
|
18
18
|
|
|
19
19
|
// src/wallets/walletConnectors/abcWallet/walletGeneration.ts
|
|
20
20
|
import { getTalkenApiClient } from "@talken/talkenkit";
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
|
+
withSigningCredentialRefresh
|
|
4
|
+
} from "./chunk-M4SNNQU2.js";
|
|
5
|
+
import {
|
|
6
|
+
toXrpSendBody
|
|
7
|
+
} from "./chunk-XGQUYXTL.js";
|
|
8
|
+
import {
|
|
9
|
+
SEND_REQUEST_TIMEOUT,
|
|
3
10
|
TALKEN_API_ENDPOINTS
|
|
4
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XPZCOEQL.js";
|
|
5
12
|
|
|
6
13
|
// src/wallets/walletConnectors/abcWallet/api/modules/xrp.ts
|
|
7
14
|
var TalkenXrpModule = class {
|
|
@@ -10,14 +17,28 @@ var TalkenXrpModule = class {
|
|
|
10
17
|
}
|
|
11
18
|
/**
|
|
12
19
|
* Execute XRP transfer (integrated sign + broadcast)
|
|
13
|
-
* POST /
|
|
14
|
-
* - kind=native: XRP transfer
|
|
15
|
-
* - kind=fungible: IOU token transfer
|
|
20
|
+
* POST /execute/send { to, chainKey, amount, token?, issuer?, fee?, destinationTag?, pin, ... }
|
|
21
|
+
* - kind=native: XRP transfer; `amount` (drops) is sent as an XRP `amount`
|
|
22
|
+
* - kind=fungible: IOU token transfer; `amount` is already in human units and
|
|
23
|
+
* is sent unscaled, with `currency` as `token` and `issuer`. `decimals` is
|
|
24
|
+
* never sent: the route refuses it on XRPL.
|
|
25
|
+
* A cold server credential cache (502 "Missing required wallet fields",
|
|
26
|
+
* answered before anything is signed, `details.broadcast: false`) is refreshed
|
|
27
|
+
* once and the same request re-sent under the same key.
|
|
28
|
+
* The route answers once the transaction is submitted (`engineResult`
|
|
29
|
+
* `tesSUCCESS`) or queued (`terQUEUED`, `submissionStatus: 'queued'`);
|
|
30
|
+
* `validated` is always false.
|
|
16
31
|
*/
|
|
17
32
|
async transferXrp(params) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
33
|
+
const body = toXrpSendBody(params);
|
|
34
|
+
return withSigningCredentialRefresh(
|
|
35
|
+
this.client,
|
|
36
|
+
() => this.client.post(
|
|
37
|
+
TALKEN_API_ENDPOINTS.EXECUTE_SEND,
|
|
38
|
+
body,
|
|
39
|
+
{ timeout: SEND_REQUEST_TIMEOUT }
|
|
40
|
+
),
|
|
41
|
+
{ email: params.email }
|
|
21
42
|
);
|
|
22
43
|
}
|
|
23
44
|
/**
|