@waiaas/adapter-ripple 2.13.0

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.
@@ -0,0 +1,68 @@
1
+ /**
2
+ * RippleAdapter -- IChainAdapter implementation for XRP Ledger.
3
+ *
4
+ * Uses xrpl.js v4.x Client for WebSocket RPC communication.
5
+ * Supports native XRP transfers, balance queries, fee estimation, and nonce retrieval.
6
+ * Trust Line tokens (Phase 472), NFTs (Phase 473) will extend this adapter.
7
+ *
8
+ * @see Phase 471-01 (scaffold + connection + balance + fee + nonce)
9
+ * @see Phase 471-02 (transaction pipeline + AdapterPool wiring)
10
+ */
11
+ import type { IChainAdapter, ChainType, NetworkType, TransferRequest, UnsignedTransaction, SimulationResult, SubmitResult, BalanceInfo, HealthInfo, AssetInfo, FeeEstimate, TokenInfo, TokenTransferParams, ContractCallParams, ApproveParams, BatchParams, ParsedTransaction, SignedTransaction, NftTransferParams, NftApproveParams } from '@waiaas/core';
12
+ export declare class RippleAdapter implements IChainAdapter {
13
+ readonly chain: ChainType;
14
+ readonly network: NetworkType;
15
+ private client;
16
+ private _connected;
17
+ private serverInfo;
18
+ constructor(network: NetworkType);
19
+ connect(rpcUrl: string): Promise<void>;
20
+ disconnect(): Promise<void>;
21
+ isConnected(): boolean;
22
+ getHealth(): Promise<HealthInfo>;
23
+ getBalance(address: string): Promise<BalanceInfo>;
24
+ buildTransaction(request: TransferRequest): Promise<UnsignedTransaction>;
25
+ simulateTransaction(tx: UnsignedTransaction): Promise<SimulationResult>;
26
+ signTransaction(tx: UnsignedTransaction, privateKey: Uint8Array): Promise<Uint8Array>;
27
+ submitTransaction(signedTx: Uint8Array): Promise<SubmitResult>;
28
+ waitForConfirmation(txHash: string, timeoutMs?: number): Promise<SubmitResult>;
29
+ getAssets(address: string): Promise<AssetInfo[]>;
30
+ estimateFee(_request: TransferRequest | TokenTransferParams): Promise<FeeEstimate>;
31
+ buildTokenTransfer(request: TokenTransferParams): Promise<UnsignedTransaction>;
32
+ getTokenInfo(tokenAddress: string): Promise<TokenInfo>;
33
+ buildContractCall(request: ContractCallParams): Promise<UnsignedTransaction>;
34
+ buildApprove(request: ApproveParams): Promise<UnsignedTransaction>;
35
+ buildBatch(_request: BatchParams): Promise<UnsignedTransaction>;
36
+ getTransactionFee(tx: UnsignedTransaction): Promise<bigint>;
37
+ getCurrentNonce(address: string): Promise<number>;
38
+ parseTransaction(rawTx: string): Promise<ParsedTransaction>;
39
+ signExternalTransaction(rawTx: string, privateKey: Uint8Array): Promise<SignedTransaction>;
40
+ buildNftTransferTx(request: NftTransferParams): Promise<UnsignedTransaction>;
41
+ transferNft(request: NftTransferParams, privateKey: Uint8Array): Promise<SubmitResult>;
42
+ approveNft(_request: NftApproveParams): Promise<UnsignedTransaction>;
43
+ /**
44
+ * Build an XRPL native transaction from a Transaction object.
45
+ * Shared autofill/fee-margin/serialize pattern used by buildContractCall.
46
+ */
47
+ private buildXrplNativeTx;
48
+ private getClient;
49
+ private refreshServerInfo;
50
+ /**
51
+ * Parse Destination Tag from memo field.
52
+ * Supports numeric string ("12345") or JSON with destinationTag field.
53
+ */
54
+ private parseDestinationTag;
55
+ /**
56
+ * Check if error is "Account not found" (actNotFound).
57
+ */
58
+ private isActNotFound;
59
+ /**
60
+ * Check if error is "Transaction not found" (txnNotFound).
61
+ */
62
+ private isTxNotFound;
63
+ /**
64
+ * Map xrpl.js errors to ChainError.
65
+ */
66
+ private mapError;
67
+ }
68
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,kBAA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