@blockbima/xrpl-integration 0.1.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,107 @@
1
+ import { Client, type Wallet } from "xrpl";
2
+ import { type TrustlineInfo, type XRPBalanceResult, type IOUBalanceResult, type SendXRPOptions, type SendIOUOptions, type TransactionResult } from "../types/index.js";
3
+ /**
4
+ * Singleton wrapper client for XRP Ledger interactions
5
+ * Provides a simplified interface for common XRPL operations
6
+ */
7
+ export declare class XRPLClient {
8
+ private static instance;
9
+ private client;
10
+ private networkUrl;
11
+ private _isConnected;
12
+ /**
13
+ * Private constructor to enforce singleton pattern
14
+ * @param networkUrl - WebSocket URL for the XRPL node
15
+ */
16
+ private constructor();
17
+ /**
18
+ * Gets the singleton instance of XRPLClient
19
+ * @param networkUrl - Optional WebSocket URL for the XRPL node (only used on first call)
20
+ * @returns The singleton XRPLClient instance
21
+ */
22
+ static getInstance(networkUrl?: string): XRPLClient;
23
+ /**
24
+ * Resets the singleton instance (useful for testing or changing networks)
25
+ * Will disconnect if currently connected
26
+ */
27
+ static resetInstance(): Promise<void>;
28
+ /**
29
+ * Gets the current connection status
30
+ */
31
+ get isConnected(): boolean;
32
+ /**
33
+ * Gets the current network URL
34
+ */
35
+ get network(): string;
36
+ /**
37
+ * Gets the underlying xrpl.js Client instance
38
+ * Use with caution - prefer using wrapper methods
39
+ */
40
+ get rawClient(): Client;
41
+ /**
42
+ * Connects to the XRPL network
43
+ * @throws XRPLClientError if connection fails
44
+ */
45
+ connect(): Promise<void>;
46
+ /**
47
+ * Disconnects from the XRPL network
48
+ */
49
+ disconnect(): Promise<void>;
50
+ /**
51
+ * Ensures the client is connected before performing operations
52
+ * @throws XRPLClientError if not connected
53
+ */
54
+ private ensureConnected;
55
+ /**
56
+ * Gets the XRP balance for an account
57
+ * @param address - The account address to query
58
+ * @returns The XRP balance information
59
+ * @throws XRPLClientError if account not found or other error
60
+ */
61
+ getXRPBalance(address: string): Promise<XRPBalanceResult>;
62
+ /**
63
+ * Gets the IOU token balance for an account
64
+ * @param address - The account address to query
65
+ * @param currency - The currency code
66
+ * @param issuer - The token issuer address
67
+ * @returns The IOU balance information
68
+ * @throws XRPLClientError if trustline not found or other error
69
+ */
70
+ getIOUBalance(address: string, currency: string, issuer: string): Promise<IOUBalanceResult>;
71
+ /**
72
+ * Sends XRP from one account to another
73
+ * @param options - The send options
74
+ * @returns The transaction result
75
+ * @throws XRPLClientError if transaction fails
76
+ */
77
+ sendXRP(options: SendXRPOptions): Promise<TransactionResult>;
78
+ /**
79
+ * Sends IOU tokens from one account to another
80
+ * @param options - The send options
81
+ * @returns The transaction result
82
+ * @throws XRPLClientError if transaction fails
83
+ */
84
+ sendIOU(options: SendIOUOptions): Promise<TransactionResult>;
85
+ /**
86
+ * Checks if a trustline exists between an account and an issuer
87
+ * @param address - The account address to check
88
+ * @param currency - The currency code
89
+ * @param issuer - The token issuer address
90
+ * @returns Trustline information including whether it exists
91
+ */
92
+ checkTrustline(address: string, currency: string, issuer: string): Promise<TrustlineInfo>;
93
+ /**
94
+ * Gets all trustlines for an account
95
+ * @param address - The account address to query
96
+ * @returns Array of trustline information
97
+ */
98
+ getAllTrustlines(address: string): Promise<TrustlineInfo[]>;
99
+ /**
100
+ * Funds a wallet on testnet/devnet using the faucet
101
+ * Only works on test networks
102
+ * @param wallet - Optional wallet to fund (creates new one if not provided)
103
+ * @returns The funded wallet
104
+ */
105
+ fundWallet(wallet?: Wallet): Promise<Wallet>;
106
+ }
107
+ //# sourceMappingURL=XRPLClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XRPLClient.d.ts","sourceRoot":"","sources":["../../src/client/XRPLClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,KAAK,MAAM,EAKZ,MAAM,MAAM,CAAC;AACd,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,c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G;IACU,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IA0CxE;;;;;OAKG;IACU,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAM1D"}
@@ -0,0 +1,377 @@
1
+ import { Client, } from "xrpl";
2
+ import { XRPLClientError, XRPLClientErrorType, NETWORKS, } from "../types/index.js";
3
+ import { validateAddress, validateAmount, convertXRPToDrops, convertDropsToXRP, createMemo, } from "../utils/index.js";
4
+ /**
5
+ * Singleton wrapper client for XRP Ledger interactions
6
+ * Provides a simplified interface for common XRPL operations
7
+ */
8
+ export class XRPLClient {
9
+ static instance = null;
10
+ client;
11
+ networkUrl;
12
+ _isConnected = false;
13
+ /**
14
+ * Private constructor to enforce singleton pattern
15
+ * @param networkUrl - WebSocket URL for the XRPL node
16
+ */
17
+ constructor(networkUrl = NETWORKS.TESTNET) {
18
+ this.networkUrl = networkUrl;
19
+ this.client = new Client(networkUrl);
20
+ // Set up connection event handlers
21
+ this.client.on("connected", () => {
22
+ this._isConnected = true;
23
+ });
24
+ this.client.on("disconnected", () => {
25
+ this._isConnected = false;
26
+ });
27
+ }
28
+ /**
29
+ * Gets the singleton instance of XRPLClient
30
+ * @param networkUrl - Optional WebSocket URL for the XRPL node (only used on first call)
31
+ * @returns The singleton XRPLClient instance
32
+ */
33
+ static getInstance(networkUrl) {
34
+ if (!XRPLClient.instance) {
35
+ XRPLClient.instance = new XRPLClient(networkUrl);
36
+ }
37
+ return XRPLClient.instance;
38
+ }
39
+ /**
40
+ * Resets the singleton instance (useful for testing or changing networks)
41
+ * Will disconnect if currently connected
42
+ */
43
+ static async resetInstance() {
44
+ if (XRPLClient.instance) {
45
+ await XRPLClient.instance.disconnect();
46
+ XRPLClient.instance = null;
47
+ }
48
+ }
49
+ /**
50
+ * Gets the current connection status
51
+ */
52
+ get isConnected() {
53
+ return this._isConnected && this.client.isConnected();
54
+ }
55
+ /**
56
+ * Gets the current network URL
57
+ */
58
+ get network() {
59
+ return this.networkUrl;
60
+ }
61
+ /**
62
+ * Gets the underlying xrpl.js Client instance
63
+ * Use with caution - prefer using wrapper methods
64
+ */
65
+ get rawClient() {
66
+ return this.client;
67
+ }
68
+ /**
69
+ * Connects to the XRPL network
70
+ * @throws XRPLClientError if connection fails
71
+ */
72
+ async connect() {
73
+ if (this.isConnected) {
74
+ return;
75
+ }
76
+ try {
77
+ await this.client.connect();
78
+ this._isConnected = true;
79
+ }
80
+ catch (error) {
81
+ throw new XRPLClientError(XRPLClientErrorType.CONNECTION_ERROR, `Failed to connect to XRPL network at ${this.networkUrl}`, error);
82
+ }
83
+ }
84
+ /**
85
+ * Disconnects from the XRPL network
86
+ */
87
+ async disconnect() {
88
+ if (!this.isConnected) {
89
+ return;
90
+ }
91
+ await this.client.disconnect();
92
+ this._isConnected = false;
93
+ }
94
+ /**
95
+ * Ensures the client is connected before performing operations
96
+ * @throws XRPLClientError if not connected
97
+ */
98
+ ensureConnected() {
99
+ if (!this.isConnected) {
100
+ throw new XRPLClientError(XRPLClientErrorType.NOT_CONNECTED, "Client is not connected. Call connect() first.");
101
+ }
102
+ }
103
+ /**
104
+ * Gets the XRP balance for an account
105
+ * @param address - The account address to query
106
+ * @returns The XRP balance information
107
+ * @throws XRPLClientError if account not found or other error
108
+ */
109
+ async getXRPBalance(address) {
110
+ this.ensureConnected();
111
+ validateAddress(address);
112
+ try {
113
+ const response = await this.client.request({
114
+ command: "account_info",
115
+ account: address,
116
+ ledger_index: "validated",
117
+ });
118
+ const balanceDrops = response.result.account_data.Balance;
119
+ const balance = convertDropsToXRP(balanceDrops);
120
+ return {
121
+ address,
122
+ balance,
123
+ balanceDrops,
124
+ };
125
+ }
126
+ catch (error) {
127
+ if (error instanceof Error &&
128
+ error.message.includes("actNotFound")) {
129
+ throw new XRPLClientError(XRPLClientErrorType.ACCOUNT_NOT_FOUND, `Account not found: ${address}`, error);
130
+ }
131
+ throw error;
132
+ }
133
+ }
134
+ /**
135
+ * Gets the IOU token balance for an account
136
+ * @param address - The account address to query
137
+ * @param currency - The currency code
138
+ * @param issuer - The token issuer address
139
+ * @returns The IOU balance information
140
+ * @throws XRPLClientError if trustline not found or other error
141
+ */
142
+ async getIOUBalance(address, currency, issuer) {
143
+ this.ensureConnected();
144
+ validateAddress(address);
145
+ validateAddress(issuer);
146
+ try {
147
+ const response = await this.client.request({
148
+ command: "account_lines",
149
+ account: address,
150
+ peer: issuer,
151
+ ledger_index: "validated",
152
+ });
153
+ const trustline = response.result.lines.find((line) => line.currency === currency);
154
+ if (!trustline) {
155
+ return {
156
+ address,
157
+ currency,
158
+ issuer,
159
+ balance: "0",
160
+ };
161
+ }
162
+ return {
163
+ address,
164
+ currency,
165
+ issuer,
166
+ balance: trustline.balance,
167
+ };
168
+ }
169
+ catch (error) {
170
+ if (error instanceof Error &&
171
+ error.message.includes("actNotFound")) {
172
+ throw new XRPLClientError(XRPLClientErrorType.ACCOUNT_NOT_FOUND, `Account not found: ${address}`, error);
173
+ }
174
+ throw error;
175
+ }
176
+ }
177
+ /**
178
+ * Sends XRP from one account to another
179
+ * @param options - The send options
180
+ * @returns The transaction result
181
+ * @throws XRPLClientError if transaction fails
182
+ */
183
+ async sendXRP(options) {
184
+ this.ensureConnected();
185
+ validateAddress(options.destination);
186
+ validateAmount(options.amount);
187
+ const payment = {
188
+ TransactionType: "Payment",
189
+ Account: options.wallet.address,
190
+ Destination: options.destination,
191
+ Amount: convertXRPToDrops(options.amount),
192
+ };
193
+ // Add destination tag if provided
194
+ if (options.destinationTag !== undefined) {
195
+ payment.DestinationTag = options.destinationTag;
196
+ }
197
+ // Add memo if provided
198
+ if (options.memo) {
199
+ payment.Memos = createMemo(options.memo);
200
+ }
201
+ try {
202
+ const prepared = await this.client.autofill(payment);
203
+ const response = await this.client.submitAndWait(prepared, {
204
+ wallet: options.wallet,
205
+ });
206
+ const success = typeof response.result.meta === "object" &&
207
+ response.result.meta !== null &&
208
+ "TransactionResult" in response.result.meta &&
209
+ response.result.meta.TransactionResult === "tesSUCCESS";
210
+ return {
211
+ success,
212
+ hash: response.result.hash,
213
+ ledgerIndex: response.result.ledger_index,
214
+ response,
215
+ };
216
+ }
217
+ catch (error) {
218
+ throw new XRPLClientError(XRPLClientErrorType.TRANSACTION_FAILED, `Failed to send XRP: ${error instanceof Error ? error.message : String(error)}`, error);
219
+ }
220
+ }
221
+ /**
222
+ * Sends IOU tokens from one account to another
223
+ * @param options - The send options
224
+ * @returns The transaction result
225
+ * @throws XRPLClientError if transaction fails
226
+ */
227
+ async sendIOU(options) {
228
+ this.ensureConnected();
229
+ validateAddress(options.destination);
230
+ validateAddress(options.issuer);
231
+ validateAmount(options.amount);
232
+ const payment = {
233
+ TransactionType: "Payment",
234
+ Account: options.wallet.address,
235
+ Destination: options.destination,
236
+ Amount: {
237
+ currency: options.currency,
238
+ issuer: options.issuer,
239
+ value: options.amount,
240
+ },
241
+ };
242
+ // Add destination tag if provided
243
+ if (options.destinationTag !== undefined) {
244
+ payment.DestinationTag = options.destinationTag;
245
+ }
246
+ // Add memo if provided
247
+ if (options.memo) {
248
+ payment.Memos = createMemo(options.memo);
249
+ }
250
+ try {
251
+ const prepared = await this.client.autofill(payment);
252
+ const response = await this.client.submitAndWait(prepared, {
253
+ wallet: options.wallet,
254
+ });
255
+ const success = typeof response.result.meta === "object" &&
256
+ response.result.meta !== null &&
257
+ "TransactionResult" in response.result.meta &&
258
+ response.result.meta.TransactionResult === "tesSUCCESS";
259
+ return {
260
+ success,
261
+ hash: response.result.hash,
262
+ ledgerIndex: response.result.ledger_index,
263
+ response,
264
+ };
265
+ }
266
+ catch (error) {
267
+ throw new XRPLClientError(XRPLClientErrorType.TRANSACTION_FAILED, `Failed to send IOU: ${error instanceof Error ? error.message : String(error)}`, error);
268
+ }
269
+ }
270
+ /**
271
+ * Checks if a trustline exists between an account and an issuer
272
+ * @param address - The account address to check
273
+ * @param currency - The currency code
274
+ * @param issuer - The token issuer address
275
+ * @returns Trustline information including whether it exists
276
+ */
277
+ async checkTrustline(address, currency, issuer) {
278
+ this.ensureConnected();
279
+ validateAddress(address);
280
+ validateAddress(issuer);
281
+ try {
282
+ const response = await this.client.request({
283
+ command: "account_lines",
284
+ account: address,
285
+ peer: issuer,
286
+ ledger_index: "validated",
287
+ });
288
+ const trustline = response.result.lines.find((line) => line.currency === currency);
289
+ if (!trustline) {
290
+ return {
291
+ exists: false,
292
+ currency,
293
+ issuer,
294
+ balance: "0",
295
+ limit: "0",
296
+ limitPeer: "0",
297
+ qualityIn: 0,
298
+ qualityOut: 0,
299
+ };
300
+ }
301
+ return {
302
+ exists: true,
303
+ currency: trustline.currency,
304
+ issuer,
305
+ balance: trustline.balance,
306
+ limit: trustline.limit,
307
+ limitPeer: trustline.limit_peer,
308
+ qualityIn: trustline.quality_in ?? 0,
309
+ qualityOut: trustline.quality_out ?? 0,
310
+ authorized: trustline.authorized,
311
+ peerAuthorized: trustline.peer_authorized,
312
+ noRipple: trustline.no_ripple,
313
+ noRipplePeer: trustline.no_ripple_peer,
314
+ freeze: trustline.freeze,
315
+ freezePeer: trustline.freeze_peer,
316
+ };
317
+ }
318
+ catch (error) {
319
+ if (error instanceof Error &&
320
+ error.message.includes("actNotFound")) {
321
+ throw new XRPLClientError(XRPLClientErrorType.ACCOUNT_NOT_FOUND, `Account not found: ${address}`, error);
322
+ }
323
+ throw error;
324
+ }
325
+ }
326
+ /**
327
+ * Gets all trustlines for an account
328
+ * @param address - The account address to query
329
+ * @returns Array of trustline information
330
+ */
331
+ async getAllTrustlines(address) {
332
+ this.ensureConnected();
333
+ validateAddress(address);
334
+ try {
335
+ const response = await this.client.request({
336
+ command: "account_lines",
337
+ account: address,
338
+ ledger_index: "validated",
339
+ });
340
+ return response.result.lines.map((line) => ({
341
+ exists: true,
342
+ currency: line.currency,
343
+ issuer: line.account,
344
+ balance: line.balance,
345
+ limit: line.limit,
346
+ limitPeer: line.limit_peer,
347
+ qualityIn: line.quality_in ?? 0,
348
+ qualityOut: line.quality_out ?? 0,
349
+ authorized: line.authorized,
350
+ peerAuthorized: line.peer_authorized,
351
+ noRipple: line.no_ripple,
352
+ noRipplePeer: line.no_ripple_peer,
353
+ freeze: line.freeze,
354
+ freezePeer: line.freeze_peer,
355
+ }));
356
+ }
357
+ catch (error) {
358
+ if (error instanceof Error &&
359
+ error.message.includes("actNotFound")) {
360
+ throw new XRPLClientError(XRPLClientErrorType.ACCOUNT_NOT_FOUND, `Account not found: ${address}`, error);
361
+ }
362
+ throw error;
363
+ }
364
+ }
365
+ /**
366
+ * Funds a wallet on testnet/devnet using the faucet
367
+ * Only works on test networks
368
+ * @param wallet - Optional wallet to fund (creates new one if not provided)
369
+ * @returns The funded wallet
370
+ */
371
+ async fundWallet(wallet) {
372
+ this.ensureConnected();
373
+ const result = await this.client.fundWallet(wallet);
374
+ return result.wallet;
375
+ }
376
+ }
377
+ //# sourceMappingURL=XRPLClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"XRPLClient.js","sourceRoot":"","sources":["../../src/client/XRPLClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,GAMP,MAAM,MAAM,CAAC;AACd,OAAO,EAQL,eAAe,EACf,mBAAmB,EACnB,QAAQ,GACT,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,GACX,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,OAAO,UAAU;IACb,MAAM,CAAC,QAAQ,GAAsB,IAAI,CAAC;IAC1C,MAAM,CAAS;IACf,UAAU,CAAS;IACnB,YAAY,GAAY,KAAK,CAAC;IAEtC;;;OAGG;IACH,YAAoB,aAAqB,QAAQ,CAAC,OAAO;QACvD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;QAErC,mCAAmC;QACnC,IAA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e,EAAE,CAAC;QAEvB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACpD,OAAO,MAAM,CAAC,MAAM,CAAC;IACvB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { XRPLClient } from "./client/XRPLClient.js";
2
+ export type { NetworkConfig, TrustlineInfo, XRPBalanceResult, IOUBalanceResult, SendXRPOptions, SendIOUOptions, TransactionResult, } from "./types/index.js";
3
+ export { NETWORKS, type NetworkType, XRPLClientError, XRPLClientErrorType, } from "./types/index.js";
4
+ export { validateAddress, isValidAddress, convertXRPToDrops, convertDropsToXRP, validateAmount, formatCurrencyCode, encodeCurrencyCode, createMemo, decodeMemo, } from "./utils/index.js";
5
+ export type { Wallet, TxResponse } from "xrpl";
6
+ export { Wallet as WalletClass } from "xrpl";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,YAAY,EACV,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,QAAQ,EACR,KAAK,WAAW,EAChB,eAAe,EACf,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,UAAU,GACX,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,MAAM,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ // Main client export
2
+ export { XRPLClient } from "./client/XRPLClient.js";
3
+ export { NETWORKS, XRPLClientError, XRPLClientErrorType, } from "./types/index.js";
4
+ // Utility exports
5
+ export { validateAddress, isValidAddress, convertXRPToDrops, convertDropsToXRP, validateAmount, formatCurrencyCode, encodeCurrencyCode, createMemo, decodeMemo, } from "./utils/index.js";
6
+ export { Wallet as WalletClass } from "xrpl";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAapD,OAAO,EACL,QAAQ,EAER,eAAe,EACf,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAE1B,kBAAkB;AAClB,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACV,UAAU,GACX,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,MAAM,CAAC"}
@@ -0,0 +1,146 @@
1
+ import type { TxResponse, Wallet } from "xrpl";
2
+ /**
3
+ * Network configuration options
4
+ */
5
+ export interface NetworkConfig {
6
+ /** WebSocket URL for the XRPL node */
7
+ url: string;
8
+ /** Optional connection timeout in milliseconds */
9
+ connectionTimeout?: number;
10
+ }
11
+ /**
12
+ * Predefined network URLs
13
+ */
14
+ export declare const NETWORKS: {
15
+ readonly MAINNET: "wss://xrplcluster.com/";
16
+ readonly MAINNET_RIPPLE: "wss://s1.ripple.com/";
17
+ readonly TESTNET: "wss://s.altnet.rippletest.net:51233/";
18
+ readonly DEVNET: "wss://s.devnet.rippletest.net:51233/";
19
+ };
20
+ export type NetworkType = keyof typeof NETWORKS;
21
+ /**
22
+ * Information about an IOU trustline
23
+ */
24
+ export interface TrustlineInfo {
25
+ /** Whether the trustline exists */
26
+ exists: boolean;
27
+ /** The currency code */
28
+ currency: string;
29
+ /** The issuer address */
30
+ issuer: string;
31
+ /** Current balance of the trustline */
32
+ balance: string;
33
+ /** Maximum amount the account trusts the issuer for */
34
+ limit: string;
35
+ /** Maximum amount the issuer trusts the account for */
36
+ limitPeer: string;
37
+ /** Quality in (exchange rate) */
38
+ qualityIn: number;
39
+ /** Quality out (exchange rate) */
40
+ qualityOut: number;
41
+ /** Whether the account has authorized the trustline */
42
+ authorized?: boolean | undefined;
43
+ /** Whether the peer has authorized the trustline */
44
+ peerAuthorized?: boolean | undefined;
45
+ /** Whether the trustline has the no-ripple flag */
46
+ noRipple?: boolean | undefined;
47
+ /** Whether the peer has the no-ripple flag */
48
+ noRipplePeer?: boolean | undefined;
49
+ /** Whether the trustline is frozen */
50
+ freeze?: boolean | undefined;
51
+ /** Whether the peer has frozen the trustline */
52
+ freezePeer?: boolean | undefined;
53
+ }
54
+ /**
55
+ * Result of an XRP balance query
56
+ */
57
+ export interface XRPBalanceResult {
58
+ /** The account address */
59
+ address: string;
60
+ /** Balance in XRP (not drops) */
61
+ balance: string;
62
+ /** Balance in drops */
63
+ balanceDrops: string;
64
+ }
65
+ /**
66
+ * Result of an IOU balance query
67
+ */
68
+ export interface IOUBalanceResult {
69
+ /** The account address */
70
+ address: string;
71
+ /** The currency code */
72
+ currency: string;
73
+ /** The issuer address */
74
+ issuer: string;
75
+ /** Balance amount */
76
+ balance: string;
77
+ }
78
+ /**
79
+ * Options for sending XRP
80
+ */
81
+ export interface SendXRPOptions {
82
+ /** The wallet to send from */
83
+ wallet: Wallet;
84
+ /** Destination address */
85
+ destination: string;
86
+ /** Amount in XRP (not drops) */
87
+ amount: string;
88
+ /** Optional destination tag */
89
+ destinationTag?: number;
90
+ /** Optional memo */
91
+ memo?: string;
92
+ }
93
+ /**
94
+ * Options for sending IOU tokens
95
+ */
96
+ export interface SendIOUOptions {
97
+ /** The wallet to send from */
98
+ wallet: Wallet;
99
+ /** Destination address */
100
+ destination: string;
101
+ /** Currency code */
102
+ currency: string;
103
+ /** Issuer address */
104
+ issuer: string;
105
+ /** Amount to send */
106
+ amount: string;
107
+ /** Optional destination tag */
108
+ destinationTag?: number;
109
+ /** Optional memo */
110
+ memo?: string;
111
+ }
112
+ /**
113
+ * Result of a transaction submission
114
+ */
115
+ export interface TransactionResult {
116
+ /** Whether the transaction was successful */
117
+ success: boolean;
118
+ /** Transaction hash */
119
+ hash: string;
120
+ /** Ledger index the transaction was validated in */
121
+ ledgerIndex?: number | undefined;
122
+ /** Full transaction response from xrpl.js */
123
+ response: TxResponse;
124
+ }
125
+ /**
126
+ * Error types for the XRPL client
127
+ */
128
+ export declare enum XRPLClientErrorType {
129
+ CONNECTION_ERROR = "CONNECTION_ERROR",
130
+ NOT_CONNECTED = "NOT_CONNECTED",
131
+ ACCOUNT_NOT_FOUND = "ACCOUNT_NOT_FOUND",
132
+ TRUSTLINE_NOT_FOUND = "TRUSTLINE_NOT_FOUND",
133
+ INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
134
+ TRANSACTION_FAILED = "TRANSACTION_FAILED",
135
+ INVALID_ADDRESS = "INVALID_ADDRESS",
136
+ INVALID_AMOUNT = "INVALID_AMOUNT"
137
+ }
138
+ /**
139
+ * Custom error class for XRPL client errors
140
+ */
141
+ export declare class XRPLClientError extends Error {
142
+ readonly type: XRPLClientErrorType;
143
+ readonly details?: unknown;
144
+ constructor(type: XRPLClientErrorType, message: string, details?: unknown);
145
+ }
146
+ //# sourceMappingURL=index.d.ts.map