@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.
- package/LICENSE +21 -0
- package/README.md +152 -0
- package/dist/__tests__/XRPLClient.test.d.ts +2 -0
- package/dist/__tests__/XRPLClient.test.d.ts.map +1 -0
- package/dist/__tests__/XRPLClient.test.js +121 -0
- package/dist/__tests__/XRPLClient.test.js.map +1 -0
- package/dist/__tests__/types.test.d.ts +2 -0
- package/dist/__tests__/types.test.d.ts.map +1 -0
- package/dist/__tests__/types.test.js +103 -0
- package/dist/__tests__/types.test.js.map +1 -0
- package/dist/__tests__/utils.test.d.ts +2 -0
- package/dist/__tests__/utils.test.d.ts.map +1 -0
- package/dist/__tests__/utils.test.js +194 -0
- package/dist/__tests__/utils.test.js.map +1 -0
- package/dist/client/XRPLClient.d.ts +107 -0
- package/dist/client/XRPLClient.d.ts.map +1 -0
- package/dist/client/XRPLClient.js +377 -0
- package/dist/client/XRPLClient.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +146 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +38 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +66 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +135 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CA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AAE,mBAAmB,CAAC;IAC1C,SAAgB,OAAO,CAAC,EAAE,OAAO,CAAC;gBAEtB,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO;CAO1E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Predefined network URLs
|
|
3
|
+
*/
|
|
4
|
+
export const NETWORKS = {
|
|
5
|
+
MAINNET: "wss://xrplcluster.com/",
|
|
6
|
+
MAINNET_RIPPLE: "wss://s1.ripple.com/",
|
|
7
|
+
TESTNET: "wss://s.altnet.rippletest.net:51233/",
|
|
8
|
+
DEVNET: "wss://s.devnet.rippletest.net:51233/",
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Error types for the XRPL client
|
|
12
|
+
*/
|
|
13
|
+
export var XRPLClientErrorType;
|
|
14
|
+
(function (XRPLClientErrorType) {
|
|
15
|
+
XRPLClientErrorType["CONNECTION_ERROR"] = "CONNECTION_ERROR";
|
|
16
|
+
XRPLClientErrorType["NOT_CONNECTED"] = "NOT_CONNECTED";
|
|
17
|
+
XRPLClientErrorType["ACCOUNT_NOT_FOUND"] = "ACCOUNT_NOT_FOUND";
|
|
18
|
+
XRPLClientErrorType["TRUSTLINE_NOT_FOUND"] = "TRUSTLINE_NOT_FOUND";
|
|
19
|
+
XRPLClientErrorType["INSUFFICIENT_BALANCE"] = "INSUFFICIENT_BALANCE";
|
|
20
|
+
XRPLClientErrorType["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
|
|
21
|
+
XRPLClientErrorType["INVALID_ADDRESS"] = "INVALID_ADDRESS";
|
|
22
|
+
XRPLClientErrorType["INVALID_AMOUNT"] = "INVALID_AMOUNT";
|
|
23
|
+
})(XRPLClientErrorType || (XRPLClientErrorType = {}));
|
|
24
|
+
/**
|
|
25
|
+
* Custom error class for XRPL client errors
|
|
26
|
+
*/
|
|
27
|
+
export class XRPLClientError extends Error {
|
|
28
|
+
type;
|
|
29
|
+
details;
|
|
30
|
+
constructor(type, message, details) {
|
|
31
|
+
super(message);
|
|
32
|
+
this.name = "XRPLClientError";
|
|
33
|
+
this.type = type;
|
|
34
|
+
this.details = details;
|
|
35
|
+
Object.setPrototypeOf(this, XRPLClientError.prototype);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,OAAO,EAAE,wBAAwB;IACjC,cAAc,EAAE,sBAAsB;IACtC,OAAO,EAAE,sCAAsC;IAC/C,MAAM,EAAE,sCAAsC;CACtC,CAAC;AAkHX;;GAEG;AACH,MAAM,CAAN,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,4DAAqC,CAAA;IACrC,sDAA+B,CAAA;IAC/B,8DAAuC,CAAA;IACvC,kEAA2C,CAAA;IAC3C,oEAA6C,CAAA;IAC7C,gEAAyC,CAAA;IACzC,0DAAmC,CAAA;IACnC,wDAAiC,CAAA;AACnC,CAAC,EATW,mBAAmB,KAAnB,mBAAmB,QAS9B;AAED;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACxB,IAAI,CAAsB;IAC1B,OAAO,CAAW;IAElC,YAAY,IAAyB,EAAE,OAAe,EAAE,OAAiB;QACvE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates an XRP Ledger classic address
|
|
3
|
+
* @param address - The address to validate
|
|
4
|
+
* @returns true if valid
|
|
5
|
+
* @throws XRPLClientError if invalid
|
|
6
|
+
*/
|
|
7
|
+
export declare function validateAddress(address: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Checks if an address is valid without throwing
|
|
10
|
+
* @param address - The address to check
|
|
11
|
+
* @returns true if valid, false otherwise
|
|
12
|
+
*/
|
|
13
|
+
export declare function isValidAddress(address: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Converts XRP amount to drops (smallest unit)
|
|
16
|
+
* @param xrp - Amount in XRP
|
|
17
|
+
* @returns Amount in drops as string
|
|
18
|
+
* @throws XRPLClientError if amount is invalid
|
|
19
|
+
*/
|
|
20
|
+
export declare function convertXRPToDrops(xrp: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Converts drops to XRP
|
|
23
|
+
* @param drops - Amount in drops
|
|
24
|
+
* @returns Amount in XRP as string
|
|
25
|
+
* @throws XRPLClientError if amount is invalid
|
|
26
|
+
*/
|
|
27
|
+
export declare function convertDropsToXRP(drops: string | number): string;
|
|
28
|
+
/**
|
|
29
|
+
* Validates that an amount is a valid positive number
|
|
30
|
+
* @param amount - The amount to validate
|
|
31
|
+
* @returns true if valid
|
|
32
|
+
* @throws XRPLClientError if invalid
|
|
33
|
+
*/
|
|
34
|
+
export declare function validateAmount(amount: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Formats a currency code for display
|
|
37
|
+
* Standard currency codes are 3 characters, hex codes are 40 characters
|
|
38
|
+
* @param currency - The currency code
|
|
39
|
+
* @returns Formatted currency code
|
|
40
|
+
*/
|
|
41
|
+
export declare function formatCurrencyCode(currency: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Encodes a currency code to the XRPL format
|
|
44
|
+
* Standard codes (3 chars) are returned as-is
|
|
45
|
+
* Longer codes are hex-encoded with zero padding
|
|
46
|
+
* @param currency - The currency code to encode
|
|
47
|
+
* @returns Encoded currency code
|
|
48
|
+
*/
|
|
49
|
+
export declare function encodeCurrencyCode(currency: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Creates a memo object for transactions
|
|
52
|
+
* @param memo - The memo text
|
|
53
|
+
* @returns Memo array for transaction
|
|
54
|
+
*/
|
|
55
|
+
export declare function createMemo(memo: string): {
|
|
56
|
+
Memo: {
|
|
57
|
+
MemoData: string;
|
|
58
|
+
};
|
|
59
|
+
}[];
|
|
60
|
+
/**
|
|
61
|
+
* Decodes a memo from hex to string
|
|
62
|
+
* @param memoData - The hex-encoded memo data
|
|
63
|
+
* @returns Decoded memo string
|
|
64
|
+
*/
|
|
65
|
+
export declare function decodeMemo(memoData: string): string;
|
|
66
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAQxD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAUrD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAUhE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAStD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAgB3D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAc3D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EAAE,CAQzE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMnD"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { isValidClassicAddress, xrpToDrops, dropsToXrp } from "xrpl";
|
|
2
|
+
import { XRPLClientError, XRPLClientErrorType } from "../types/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Validates an XRP Ledger classic address
|
|
5
|
+
* @param address - The address to validate
|
|
6
|
+
* @returns true if valid
|
|
7
|
+
* @throws XRPLClientError if invalid
|
|
8
|
+
*/
|
|
9
|
+
export function validateAddress(address) {
|
|
10
|
+
if (!isValidClassicAddress(address)) {
|
|
11
|
+
throw new XRPLClientError(XRPLClientErrorType.INVALID_ADDRESS, `Invalid XRP Ledger address: ${address}`);
|
|
12
|
+
}
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Checks if an address is valid without throwing
|
|
17
|
+
* @param address - The address to check
|
|
18
|
+
* @returns true if valid, false otherwise
|
|
19
|
+
*/
|
|
20
|
+
export function isValidAddress(address) {
|
|
21
|
+
return isValidClassicAddress(address);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Converts XRP amount to drops (smallest unit)
|
|
25
|
+
* @param xrp - Amount in XRP
|
|
26
|
+
* @returns Amount in drops as string
|
|
27
|
+
* @throws XRPLClientError if amount is invalid
|
|
28
|
+
*/
|
|
29
|
+
export function convertXRPToDrops(xrp) {
|
|
30
|
+
try {
|
|
31
|
+
return xrpToDrops(xrp);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
throw new XRPLClientError(XRPLClientErrorType.INVALID_AMOUNT, `Invalid XRP amount: ${xrp}`, error);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Converts drops to XRP
|
|
39
|
+
* @param drops - Amount in drops
|
|
40
|
+
* @returns Amount in XRP as string
|
|
41
|
+
* @throws XRPLClientError if amount is invalid
|
|
42
|
+
*/
|
|
43
|
+
export function convertDropsToXRP(drops) {
|
|
44
|
+
try {
|
|
45
|
+
return String(dropsToXrp(drops));
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
throw new XRPLClientError(XRPLClientErrorType.INVALID_AMOUNT, `Invalid drops amount: ${drops}`, error);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Validates that an amount is a valid positive number
|
|
53
|
+
* @param amount - The amount to validate
|
|
54
|
+
* @returns true if valid
|
|
55
|
+
* @throws XRPLClientError if invalid
|
|
56
|
+
*/
|
|
57
|
+
export function validateAmount(amount) {
|
|
58
|
+
const num = parseFloat(amount);
|
|
59
|
+
if (isNaN(num) || num <= 0) {
|
|
60
|
+
throw new XRPLClientError(XRPLClientErrorType.INVALID_AMOUNT, `Invalid amount: ${amount}. Must be a positive number.`);
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Formats a currency code for display
|
|
66
|
+
* Standard currency codes are 3 characters, hex codes are 40 characters
|
|
67
|
+
* @param currency - The currency code
|
|
68
|
+
* @returns Formatted currency code
|
|
69
|
+
*/
|
|
70
|
+
export function formatCurrencyCode(currency) {
|
|
71
|
+
// If it's a hex currency code (40 characters), try to decode it
|
|
72
|
+
if (currency.length === 40) {
|
|
73
|
+
try {
|
|
74
|
+
// Remove trailing zeros and convert from hex
|
|
75
|
+
const hex = currency.replace(/0+$/, "");
|
|
76
|
+
const decoded = Buffer.from(hex, "hex").toString("utf8");
|
|
77
|
+
// Only return decoded if it's printable ASCII
|
|
78
|
+
if (/^[\x20-\x7E]+$/.test(decoded)) {
|
|
79
|
+
return decoded;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
// If decoding fails, return the original hex
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return currency;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Encodes a currency code to the XRPL format
|
|
90
|
+
* Standard codes (3 chars) are returned as-is
|
|
91
|
+
* Longer codes are hex-encoded with zero padding
|
|
92
|
+
* @param currency - The currency code to encode
|
|
93
|
+
* @returns Encoded currency code
|
|
94
|
+
*/
|
|
95
|
+
export function encodeCurrencyCode(currency) {
|
|
96
|
+
// Standard 3-character codes
|
|
97
|
+
if (currency.length === 3 && /^[A-Z0-9]{3}$/i.test(currency)) {
|
|
98
|
+
return currency.toUpperCase();
|
|
99
|
+
}
|
|
100
|
+
// Already hex-encoded
|
|
101
|
+
if (currency.length === 40 && /^[0-9A-F]+$/i.test(currency)) {
|
|
102
|
+
return currency.toUpperCase();
|
|
103
|
+
}
|
|
104
|
+
// Encode as hex with zero padding
|
|
105
|
+
const hex = Buffer.from(currency, "utf8").toString("hex").toUpperCase();
|
|
106
|
+
return hex.padEnd(40, "0");
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Creates a memo object for transactions
|
|
110
|
+
* @param memo - The memo text
|
|
111
|
+
* @returns Memo array for transaction
|
|
112
|
+
*/
|
|
113
|
+
export function createMemo(memo) {
|
|
114
|
+
return [
|
|
115
|
+
{
|
|
116
|
+
Memo: {
|
|
117
|
+
MemoData: Buffer.from(memo, "utf8").toString("hex").toUpperCase(),
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Decodes a memo from hex to string
|
|
124
|
+
* @param memoData - The hex-encoded memo data
|
|
125
|
+
* @returns Decoded memo string
|
|
126
|
+
*/
|
|
127
|
+
export function decodeMemo(memoData) {
|
|
128
|
+
try {
|
|
129
|
+
return Buffer.from(memoData, "hex").toString("utf8");
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
return memoData;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=index.js.map
|
|
@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G,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;IACxE,OAAO,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO;QACL;YACE,IAAI,EAAE;gBACJ,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE;aAClE;SACF;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blockbima/xrpl-integration",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A lightweight wrapper for the XRP Ledger using xrpl.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "ts-node src/index.ts",
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"start": "node dist/index.js",
|
|
22
|
+
"prepublishOnly": "npm run build",
|
|
23
|
+
"clean": "rm -rf dist",
|
|
24
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
25
|
+
"test:coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"xrpl",
|
|
29
|
+
"xrp",
|
|
30
|
+
"blockbima",
|
|
31
|
+
"blockchain",
|
|
32
|
+
"cryptocurrency"
|
|
33
|
+
],
|
|
34
|
+
"author": "Mohammed Mwijaa <mm.mwijaa@gmail.com>",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"homepage": "https://github.com/shamba-network/xrpl-integration",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/shamba-network/xrpl-integration/issues"
|
|
39
|
+
},
|
|
40
|
+
"docs": "https://github.com/shamba-network/xrpl-integration/blob/main/README.md",
|
|
41
|
+
"type": "module",
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=18.0.0"
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://github.com/shamba-network/xrpl-integration.git"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/jest": "^30.0.0",
|
|
51
|
+
"@types/node": "^25.0.10",
|
|
52
|
+
"jest": "^30.2.0",
|
|
53
|
+
"ts-jest": "^29.4.6",
|
|
54
|
+
"ts-node": "^10.9.2",
|
|
55
|
+
"typescript": "^5.9.3"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"xrpl": "^4.5.0"
|
|
59
|
+
}
|
|
60
|
+
}
|