mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-06 22:05:48 +00:00
Compare commits
6 Commits
@transia/r
...
@transia/r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05bea18d66 | ||
|
|
a2576ab74a | ||
|
|
ef3f95475e | ||
|
|
25f267b81f | ||
|
|
4447a7af09 | ||
|
|
62a39c69ce |
6
.github/workflows/codeql-analysis.yml
vendored
6
.github/workflows/codeql-analysis.yml
vendored
@@ -39,7 +39,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
@@ -50,7 +50,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
@@ -64,4 +64,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
uses: github/codeql-action/analyze@v2
|
||||
|
||||
214
package-lock.json
generated
214
package-lock.json
generated
@@ -17141,7 +17141,7 @@
|
||||
},
|
||||
"packages/ripple-address-codec": {
|
||||
"name": "@transia/ripple-address-codec",
|
||||
"version": "4.2.6",
|
||||
"version": "4.2.6-alpha.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"base-x": "^3.0.9",
|
||||
@@ -17153,7 +17153,7 @@
|
||||
},
|
||||
"packages/ripple-binary-codec": {
|
||||
"name": "@transia/ripple-binary-codec",
|
||||
"version": "1.4.4",
|
||||
"version": "1.4.4-alpha.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"assert": "^2.0.0",
|
||||
@@ -17175,9 +17175,21 @@
|
||||
"ieee754": "^1.1.4"
|
||||
}
|
||||
},
|
||||
"packages/ripple-binary-codec/node_modules/ripple-address-codec": {
|
||||
"version": "4.2.5",
|
||||
"resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-4.2.5.tgz",
|
||||
"integrity": "sha512-SZ96zZH+0REeyEcYVFl0vqcsGRXiFXS2RUgHupHhtVkOEk6men53vngVjJwBrSnY+oa6Cri15q1zSni3DEoxNw==",
|
||||
"dependencies": {
|
||||
"base-x": "^3.0.9",
|
||||
"create-hash": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"packages/ripple-keypairs": {
|
||||
"name": "@transia/ripple-keypairs",
|
||||
"version": "1.1.6",
|
||||
"version": "1.1.6-alpha.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"bn.js": "^5.1.1",
|
||||
@@ -17190,9 +17202,21 @@
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"packages/ripple-keypairs/node_modules/ripple-address-codec": {
|
||||
"version": "4.2.5",
|
||||
"resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-4.2.5.tgz",
|
||||
"integrity": "sha512-SZ96zZH+0REeyEcYVFl0vqcsGRXiFXS2RUgHupHhtVkOEk6men53vngVjJwBrSnY+oa6Cri15q1zSni3DEoxNw==",
|
||||
"dependencies": {
|
||||
"base-x": "^3.0.9",
|
||||
"create-hash": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"packages/xrpl": {
|
||||
"name": "@transia/xrpl",
|
||||
"version": "2.7.1",
|
||||
"version": "2.7.1-alpha.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"bignumber.js": "^9.0.0",
|
||||
@@ -17223,6 +17247,58 @@
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"packages/xrpl/node_modules/buffer": {
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz",
|
||||
"integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==",
|
||||
"dependencies": {
|
||||
"base64-js": "^1.0.2",
|
||||
"ieee754": "^1.1.4"
|
||||
}
|
||||
},
|
||||
"packages/xrpl/node_modules/ripple-address-codec": {
|
||||
"version": "4.2.5",
|
||||
"resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-4.2.5.tgz",
|
||||
"integrity": "sha512-SZ96zZH+0REeyEcYVFl0vqcsGRXiFXS2RUgHupHhtVkOEk6men53vngVjJwBrSnY+oa6Cri15q1zSni3DEoxNw==",
|
||||
"dependencies": {
|
||||
"base-x": "^3.0.9",
|
||||
"create-hash": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"packages/xrpl/node_modules/ripple-binary-codec": {
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/ripple-binary-codec/-/ripple-binary-codec-1.4.3.tgz",
|
||||
"integrity": "sha512-P4ALjAJWBJpRApTQO+dJCrHE6mZxm7ypZot9OS0a3RCKOWTReNw0pDWfdhCGh1qXh71TeQnAk4CHdMLwR/76oQ==",
|
||||
"dependencies": {
|
||||
"assert": "^2.0.0",
|
||||
"big-integer": "^1.6.48",
|
||||
"buffer": "5.6.0",
|
||||
"create-hash": "^1.2.0",
|
||||
"decimal.js": "^10.2.0",
|
||||
"ripple-address-codec": "^4.2.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"packages/xrpl/node_modules/ripple-keypairs": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/ripple-keypairs/-/ripple-keypairs-1.1.5.tgz",
|
||||
"integrity": "sha512-wLJXIBsMVazn2Yp/7oP4PvgA4Gd1HtuZLftdEJFNOLgraf82phqa2AnNK3t9f3XeQnApW1jAe/FcFFOY6QUn5w==",
|
||||
"dependencies": {
|
||||
"bn.js": "^5.1.1",
|
||||
"brorand": "^1.0.5",
|
||||
"elliptic": "^6.5.4",
|
||||
"hash.js": "^1.0.3",
|
||||
"ripple-address-codec": "^4.2.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 10"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -19394,6 +19470,15 @@
|
||||
"base64-js": "^1.0.2",
|
||||
"ieee754": "^1.1.4"
|
||||
}
|
||||
},
|
||||
"ripple-address-codec": {
|
||||
"version": "4.2.5",
|
||||
"resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-4.2.5.tgz",
|
||||
"integrity": "sha512-SZ96zZH+0REeyEcYVFl0vqcsGRXiFXS2RUgHupHhtVkOEk6men53vngVjJwBrSnY+oa6Cri15q1zSni3DEoxNw==",
|
||||
"requires": {
|
||||
"base-x": "^3.0.9",
|
||||
"create-hash": "^1.1.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -19405,6 +19490,17 @@
|
||||
"elliptic": "^6.5.4",
|
||||
"hash.js": "^1.0.3",
|
||||
"ripple-address-codec": "^4.2.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"ripple-address-codec": {
|
||||
"version": "4.2.5",
|
||||
"resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-4.2.5.tgz",
|
||||
"integrity": "sha512-SZ96zZH+0REeyEcYVFl0vqcsGRXiFXS2RUgHupHhtVkOEk6men53vngVjJwBrSnY+oa6Cri15q1zSni3DEoxNw==",
|
||||
"requires": {
|
||||
"base-x": "^3.0.9",
|
||||
"create-hash": "^1.1.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@transia/xrpl": {
|
||||
@@ -19432,6 +19528,51 @@
|
||||
"ripple-keypairs": "^1.1.5",
|
||||
"typedoc": "^0.23.24",
|
||||
"ws": "^8.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"buffer": {
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz",
|
||||
"integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==",
|
||||
"requires": {
|
||||
"base64-js": "^1.0.2",
|
||||
"ieee754": "^1.1.4"
|
||||
}
|
||||
},
|
||||
"ripple-address-codec": {
|
||||
"version": "4.2.5",
|
||||
"resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-4.2.5.tgz",
|
||||
"integrity": "sha512-SZ96zZH+0REeyEcYVFl0vqcsGRXiFXS2RUgHupHhtVkOEk6men53vngVjJwBrSnY+oa6Cri15q1zSni3DEoxNw==",
|
||||
"requires": {
|
||||
"base-x": "^3.0.9",
|
||||
"create-hash": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"ripple-binary-codec": {
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/ripple-binary-codec/-/ripple-binary-codec-1.4.3.tgz",
|
||||
"integrity": "sha512-P4ALjAJWBJpRApTQO+dJCrHE6mZxm7ypZot9OS0a3RCKOWTReNw0pDWfdhCGh1qXh71TeQnAk4CHdMLwR/76oQ==",
|
||||
"requires": {
|
||||
"assert": "^2.0.0",
|
||||
"big-integer": "^1.6.48",
|
||||
"buffer": "5.6.0",
|
||||
"create-hash": "^1.2.0",
|
||||
"decimal.js": "^10.2.0",
|
||||
"ripple-address-codec": "^4.2.5"
|
||||
}
|
||||
},
|
||||
"ripple-keypairs": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/ripple-keypairs/-/ripple-keypairs-1.1.5.tgz",
|
||||
"integrity": "sha512-wLJXIBsMVazn2Yp/7oP4PvgA4Gd1HtuZLftdEJFNOLgraf82phqa2AnNK3t9f3XeQnApW1jAe/FcFFOY6QUn5w==",
|
||||
"requires": {
|
||||
"bn.js": "^5.1.1",
|
||||
"brorand": "^1.0.5",
|
||||
"elliptic": "^6.5.4",
|
||||
"hash.js": "^1.0.3",
|
||||
"ripple-address-codec": "^4.2.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@tsconfig/node10": {
|
||||
@@ -28765,6 +28906,15 @@
|
||||
"base64-js": "^1.0.2",
|
||||
"ieee754": "^1.1.4"
|
||||
}
|
||||
},
|
||||
"ripple-address-codec": {
|
||||
"version": "4.2.5",
|
||||
"resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-4.2.5.tgz",
|
||||
"integrity": "sha512-SZ96zZH+0REeyEcYVFl0vqcsGRXiFXS2RUgHupHhtVkOEk6men53vngVjJwBrSnY+oa6Cri15q1zSni3DEoxNw==",
|
||||
"requires": {
|
||||
"base-x": "^3.0.9",
|
||||
"create-hash": "^1.1.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -28776,6 +28926,17 @@
|
||||
"elliptic": "^6.5.4",
|
||||
"hash.js": "^1.0.3",
|
||||
"ripple-address-codec": "^4.2.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"ripple-address-codec": {
|
||||
"version": "4.2.5",
|
||||
"resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-4.2.5.tgz",
|
||||
"integrity": "sha512-SZ96zZH+0REeyEcYVFl0vqcsGRXiFXS2RUgHupHhtVkOEk6men53vngVjJwBrSnY+oa6Cri15q1zSni3DEoxNw==",
|
||||
"requires": {
|
||||
"base-x": "^3.0.9",
|
||||
"create-hash": "^1.1.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"run-async": {
|
||||
@@ -30689,6 +30850,51 @@
|
||||
"ripple-keypairs": "^1.1.5",
|
||||
"typedoc": "^0.23.24",
|
||||
"ws": "^8.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"buffer": {
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz",
|
||||
"integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==",
|
||||
"requires": {
|
||||
"base64-js": "^1.0.2",
|
||||
"ieee754": "^1.1.4"
|
||||
}
|
||||
},
|
||||
"ripple-address-codec": {
|
||||
"version": "4.2.5",
|
||||
"resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-4.2.5.tgz",
|
||||
"integrity": "sha512-SZ96zZH+0REeyEcYVFl0vqcsGRXiFXS2RUgHupHhtVkOEk6men53vngVjJwBrSnY+oa6Cri15q1zSni3DEoxNw==",
|
||||
"requires": {
|
||||
"base-x": "^3.0.9",
|
||||
"create-hash": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"ripple-binary-codec": {
|
||||
"version": "1.4.3",
|
||||
"resolved": "https://registry.npmjs.org/ripple-binary-codec/-/ripple-binary-codec-1.4.3.tgz",
|
||||
"integrity": "sha512-P4ALjAJWBJpRApTQO+dJCrHE6mZxm7ypZot9OS0a3RCKOWTReNw0pDWfdhCGh1qXh71TeQnAk4CHdMLwR/76oQ==",
|
||||
"requires": {
|
||||
"assert": "^2.0.0",
|
||||
"big-integer": "^1.6.48",
|
||||
"buffer": "5.6.0",
|
||||
"create-hash": "^1.2.0",
|
||||
"decimal.js": "^10.2.0",
|
||||
"ripple-address-codec": "^4.2.5"
|
||||
}
|
||||
},
|
||||
"ripple-keypairs": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/ripple-keypairs/-/ripple-keypairs-1.1.5.tgz",
|
||||
"integrity": "sha512-wLJXIBsMVazn2Yp/7oP4PvgA4Gd1HtuZLftdEJFNOLgraf82phqa2AnNK3t9f3XeQnApW1jAe/FcFFOY6QUn5w==",
|
||||
"requires": {
|
||||
"bn.js": "^5.1.1",
|
||||
"brorand": "^1.0.5",
|
||||
"elliptic": "^6.5.4",
|
||||
"hash.js": "^1.0.3",
|
||||
"ripple-address-codec": "^4.2.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"xtend": {
|
||||
|
||||
4
packages/ripple-address-codec/package-lock.json
generated
4
packages/ripple-address-codec/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "ripple-address-codec",
|
||||
"version": "4.2.6",
|
||||
"version": "4.2.6-alpha.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ripple-address-codec",
|
||||
"version": "4.2.6",
|
||||
"version": "4.2.6-alpha.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"base-x": "^3.0.9",
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{
|
||||
"name": "@transia/ripple-address-codec",
|
||||
"version": "4.2.6",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"version": "4.2.6-alpha.0",
|
||||
"description": "encodes/decodes base58 encoded XRP Ledger identifiers",
|
||||
"files": [
|
||||
"dist/*",
|
||||
@@ -15,7 +18,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:XRPLF/xrpl.js.git"
|
||||
"url": "git@github.com/Transia-RnD/xrpl.js/tree/beta"
|
||||
},
|
||||
"prepublish": "tsc -b",
|
||||
"prepublishOnly": "tslint -b ./ && jest",
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{
|
||||
"name": "@transia/ripple-binary-codec",
|
||||
"version": "1.4.4",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"version": "1.4.4-alpha.0",
|
||||
"description": "XRP Ledger binary codec",
|
||||
"files": [
|
||||
"dist/*",
|
||||
@@ -28,7 +31,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:XRPLF/xrpl.js.git"
|
||||
"url": "git@github.com/Transia-RnD/xrpl.js/tree/beta"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/XRPLF/xrpl.js/issues"
|
||||
|
||||
@@ -779,7 +779,7 @@
|
||||
[
|
||||
"LockCount",
|
||||
{
|
||||
"nth": 47,
|
||||
"nth": 49,
|
||||
"isVLEncoded": false,
|
||||
"isSerialized": true,
|
||||
"isSigningField": true,
|
||||
@@ -2315,10 +2315,10 @@
|
||||
"temSEQ_AND_TICKET": -263,
|
||||
"temBAD_NFTOKEN_TRANSFER_FEE": -262,
|
||||
"temAMM_BAD_TOKENS": -261,
|
||||
"temEQUAL_DOOR_ACCOUNTS": -260,
|
||||
"temBAD_XCHAIN_PROOF": -259,
|
||||
"temSIDECHAIN_BAD_ISSUES": -258,
|
||||
"temSIDECHAIN_NONDOOR_OWNER": -257,
|
||||
"temXCHAIN_EQUAL_DOOR_ACCOUNTS": -260,
|
||||
"temXCHAIN_BAD_PROOF": -259,
|
||||
"temXCHAIN_BRIDGE_BAD_ISSUES": -258,
|
||||
"temXCHAIN_BRIDGE_NONDOOR_OWNER": -257,
|
||||
"temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT": -256,
|
||||
"temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT": -255,
|
||||
"temXCHAIN_TOO_MANY_ATTESTATIONS": -254,
|
||||
@@ -2359,7 +2359,8 @@
|
||||
"terNO_RIPPLE": -90,
|
||||
"terQUEUED": -89,
|
||||
"terPRE_TICKET": -88,
|
||||
"terNO_HOOK": -87,
|
||||
"terNO_AMM": -87,
|
||||
"terNO_HOOK": -86,
|
||||
|
||||
"tesSUCCESS": 0,
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{
|
||||
"name": "@transia/ripple-keypairs",
|
||||
"version": "1.1.6",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"version": "1.1.6-alpha.0",
|
||||
"description": "Cryptographic key pairs for the XRP Ledger",
|
||||
"scripts": {
|
||||
"build": "tsc -b",
|
||||
@@ -25,7 +28,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:XRPLF/xrpl.js.git"
|
||||
"url": "git@github.com/Transia-RnD/xrpl.js/tree/beta"
|
||||
},
|
||||
"license": "ISC",
|
||||
"prettier": "@xrplf/prettier-config",
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
{
|
||||
"name": "@transia/xrpl",
|
||||
"version": "2.7.1",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"version": "2.7.1-alpha.0",
|
||||
"license": "ISC",
|
||||
"description": "A TypeScript/JavaScript API for interacting with the XRP Ledger in Node.js and the browser",
|
||||
"files": [
|
||||
@@ -75,7 +78,7 @@
|
||||
"prettier": "@xrplf/prettier-config",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:XRPLF/xrpl.js.git"
|
||||
"url": "git@github.com/Transia-RnD/xrpl.js/tree/beta"
|
||||
},
|
||||
"readmeFilename": "README.md",
|
||||
"engines": {
|
||||
|
||||
@@ -101,6 +101,7 @@ import {
|
||||
getXrpBalance,
|
||||
submit,
|
||||
submitAndWait,
|
||||
getNetworkID,
|
||||
} from '../sugar'
|
||||
import fundWallet from '../Wallet/fundWallet'
|
||||
|
||||
@@ -200,6 +201,13 @@ class Client extends EventEmitter {
|
||||
*/
|
||||
public readonly maxFeeXRP: string
|
||||
|
||||
/**
|
||||
* Network ID of the server this sdk is connected to
|
||||
*
|
||||
* @category Fee
|
||||
*/
|
||||
public networkID: number
|
||||
|
||||
/**
|
||||
* Creates a new Client with a websocket connection to a rippled server.
|
||||
*
|
||||
@@ -218,6 +226,7 @@ class Client extends EventEmitter {
|
||||
|
||||
this.feeCushion = options.feeCushion ?? DEFAULT_FEE_CUSHION
|
||||
this.maxFeeXRP = options.maxFeeXRP ?? DEFAULT_MAX_FEE_XRP
|
||||
this.networkID = 1
|
||||
|
||||
this.connection = new Connection(server, options)
|
||||
|
||||
@@ -634,6 +643,11 @@ class Client extends EventEmitter {
|
||||
*/
|
||||
public getLedgerIndex = getLedgerIndex
|
||||
|
||||
/**
|
||||
* @category Abstraction
|
||||
*/
|
||||
public getNetworkID = getNetworkID
|
||||
|
||||
/**
|
||||
* @category Faucet
|
||||
*/
|
||||
|
||||
@@ -136,6 +136,10 @@ export interface ServerInfoResponse extends BaseResponse {
|
||||
* overall network's load factor.
|
||||
*/
|
||||
load_factor?: number
|
||||
/**
|
||||
* The network id of the server.
|
||||
*/
|
||||
network_id?: number
|
||||
/**
|
||||
* Current multiplier to the transaction cost based on
|
||||
* load to this server.
|
||||
|
||||
@@ -159,7 +159,9 @@ export interface BaseTransaction {
|
||||
* account it says it is from.
|
||||
*/
|
||||
TxnSignature?: string
|
||||
|
||||
/**
|
||||
* The network id of the transaction.
|
||||
*/
|
||||
NetworkID?: number
|
||||
}
|
||||
|
||||
@@ -254,6 +256,9 @@ export function validateBaseTransaction(common: Record<string, unknown>): void {
|
||||
) {
|
||||
throw new ValidationError('BaseTransaction: invalid TxnSignature')
|
||||
}
|
||||
if (common.NetworkID !== undefined && typeof common.NetworkID !== 'number') {
|
||||
throw new ValidationError('BaseTransaction: invalid NetworkID')
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,6 +12,7 @@ import { getFeeXrp } from './getFeeXrp'
|
||||
|
||||
// Expire unconfirmed transactions after 20 ledger versions, approximately 1 minute, by default
|
||||
const LEDGER_OFFSET = 20
|
||||
const RESTRICTED_NETWORKS = 1024
|
||||
interface ClassicAccountAndTag {
|
||||
classicAccount: string
|
||||
tag: number | false | undefined
|
||||
@@ -39,8 +40,10 @@ async function autofill<T extends Transaction>(
|
||||
setValidAddresses(tx)
|
||||
|
||||
setTransactionFlagsToNumber(tx)
|
||||
|
||||
const promises: Array<Promise<void>> = []
|
||||
if (this.networkID > RESTRICTED_NETWORKS && tx.NetworkID == null) {
|
||||
tx.NetworkID = this.networkID
|
||||
}
|
||||
if (tx.Sequence == null) {
|
||||
promises.push(setNextValidSequenceNumber(this, tx))
|
||||
}
|
||||
|
||||
15
packages/xrpl/src/sugar/getNetworkID.ts
Normal file
15
packages/xrpl/src/sugar/getNetworkID.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { Client } from '..'
|
||||
// import { XrplError } from '../errors'
|
||||
|
||||
/**
|
||||
* Returns the network ID of the rippled server.
|
||||
*
|
||||
* @param this - The Client used to connect to the ledger.
|
||||
* @returns The network id.
|
||||
*/
|
||||
export default async function getNetworkID(this: Client): Promise<number> {
|
||||
const response = await this.request({
|
||||
command: 'server_info',
|
||||
})
|
||||
return response.result.info.network_id ?? 1
|
||||
}
|
||||
@@ -7,6 +7,8 @@ export { default as getLedgerIndex } from './getLedgerIndex'
|
||||
export { default as getOrderbook } from './getOrderbook'
|
||||
export { getFeeXrp, getFeeEstimateXrp } from './getFeeXrp'
|
||||
|
||||
export { default as getNetworkID } from './getNetworkID'
|
||||
|
||||
export * from './submit'
|
||||
|
||||
export * from './utils'
|
||||
|
||||
Reference in New Issue
Block a user