This commit is contained in:
nitowa
2023-08-15 22:28:03 +02:00
commit 1dae68b1c7
5529 changed files with 1659171 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
export declare class DataParser {
static hex_to_ascii(input: any): string;
}
+14
View File
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DataParser = void 0;
class DataParser {
static hex_to_ascii(input) {
var hex = input.toString();
var str = '';
for (var n = 0; n < hex.length; n += 2) {
str += String.fromCharCode(parseInt(hex.substr(n, 2), 16));
}
return str;
}
}
exports.DataParser = DataParser;
+15
View File
@@ -0,0 +1,15 @@
export declare const MSG_DELIM: string;
export declare const MSG_DATA_MAX: number;
export declare const PUBKEY_LEN: number;
export declare const NON_ZERO_TX_HASH: RegExp;
export declare const PTR_FORMAT: RegExp;
export declare const DATA_FORMAT: RegExp;
export declare const SIGNATURE_FORMAT: RegExp;
export declare const SIGNER_FORMAT: RegExp;
export declare const MSG_FORMAT: RegExp;
export declare const AMOUNT_DECIMALS = 18;
export declare const MAX_SUPPLY = 20000000;
export declare const AMOUNT_FORMAT: RegExp;
export declare const MIN_XRP_FEE = "0.00001";
export declare const MIN_XRP_TX_VALUE = "0.000001";
export declare const XRP_ADDRESS: RegExp;
+18
View File
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.XRP_ADDRESS = exports.MIN_XRP_TX_VALUE = exports.MIN_XRP_FEE = exports.AMOUNT_FORMAT = exports.MAX_SUPPLY = exports.AMOUNT_DECIMALS = exports.MSG_FORMAT = exports.SIGNER_FORMAT = exports.SIGNATURE_FORMAT = exports.DATA_FORMAT = exports.PTR_FORMAT = exports.NON_ZERO_TX_HASH = exports.PUBKEY_LEN = exports.MSG_DATA_MAX = exports.MSG_DELIM = void 0;
exports.MSG_DELIM = ' ';
exports.MSG_DATA_MAX = 925;
exports.PUBKEY_LEN = 66;
exports.NON_ZERO_TX_HASH = new RegExp(`[0-9A-F]{64}`);
exports.PTR_FORMAT = new RegExp(`^((${exports.NON_ZERO_TX_HASH.source})|0)`);
exports.DATA_FORMAT = new RegExp(`(.{1,${exports.MSG_DATA_MAX}})`);
exports.SIGNATURE_FORMAT = new RegExp(`(\\S{140}|\\S{142})$`);
exports.SIGNER_FORMAT = new RegExp(`(\\S{${exports.PUBKEY_LEN}})`);
exports.MSG_FORMAT = new RegExp(`${exports.PTR_FORMAT.source}${exports.MSG_DELIM}${exports.DATA_FORMAT.source}`, 'm');
exports.AMOUNT_DECIMALS = 18;
exports.MAX_SUPPLY = 20_000_000;
exports.AMOUNT_FORMAT = new RegExp(`\d+(\.\d{1,${exports.AMOUNT_DECIMALS}})?`);
exports.MIN_XRP_FEE = "0.00001";
exports.MIN_XRP_TX_VALUE = "0.000001";
exports.XRP_ADDRESS = new RegExp(`^([r])([1-9A-HJ-NP-Za-km-z]{24,34})`);
+3
View File
@@ -0,0 +1,3 @@
import { z } from "zod";
export declare const xrp_address_schema: z.ZodString;
export declare const xrp_transaction_hash_schema: z.ZodString;
+8
View File
@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.xrp_transaction_hash_schema = exports.xrp_address_schema = void 0;
const zod_1 = require("zod");
const protocol_constants_1 = require("./protocol.constants");
const xrpio_1 = require("xrpio");
exports.xrp_address_schema = zod_1.z.string().regex(protocol_constants_1.XRP_ADDRESS, "Not a valid XRP address");
exports.xrp_transaction_hash_schema = zod_1.z.string().regex(xrpio_1.NON_ZERO_TX_HASH, "Not a valid XRP transaction hash");