Skip to content

Commit d834680

Browse files
committed
getSettings for DisallowIncoming amendments
1 parent 08c0091 commit d834680

File tree

7 files changed

+241
-276
lines changed

7 files changed

+241
-276
lines changed

package-lock.json

Lines changed: 213 additions & 220 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bithomp/xrpl-api",
3-
"version": "2.2.16",
3+
"version": "2.2.17",
44
"description": "A Bithomp JavaScript/TypeScript library for interacting with the XRP Ledger",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
@@ -43,17 +43,17 @@
4343
"@types/chai": "^4.3.4",
4444
"@types/chai-as-promised": "^7.1.5",
4545
"@types/mocha": "^10.0.1",
46-
"@types/node": "^18.15.5",
46+
"@types/node": "^18.15.11",
4747
"chai": "^4.3.7",
4848
"chai-as-promised": "^7.1.1",
4949
"mocha": "^10.2.0",
5050
"nconf": "^0.12.0",
51-
"prettier": "^2.8.5",
52-
"ts-jest": "^29.0.5",
51+
"prettier": "^2.8.7",
52+
"ts-jest": "^29.1.0",
5353
"ts-node": "^10.9.1",
5454
"tslint": "^6.1.3",
5555
"tslint-config-prettier": "^1.18.0",
56-
"typescript": "^5.0.2"
56+
"typescript": "^5.0.4"
5757
},
5858
"files": [
5959
"lib/**/*"

src/faucet.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ export const FaucetNetworks = {
5151
url: "https://faucet.devnet.rippletest.net/accounts",
5252
format: "xrpl",
5353
},
54-
xls20: {
55-
// xls20, nft-sandbox, and nft are all the same
56-
// https://xls20.bithomp.com
57-
url: "https://faucet-nft.ripple.com/accounts",
58-
format: "xrpl",
59-
},
6054
hooks: {
6155
// the same as hooks-v2, hooks-v1 was discontinued
6256
// https://beta.bithomp.com

src/models/account_info.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ export const AccountRootFlagsKeys = {
1414
noFreeze: LedgerEntry.AccountRootFlags.lsfNoFreeze,
1515
globalFreeze: LedgerEntry.AccountRootFlags.lsfGlobalFreeze,
1616
defaultRipple: LedgerEntry.AccountRootFlags.lsfDefaultRipple,
17+
disallowIncomingNFTokenOffer: LedgerEntry.AccountRootFlags.lsfDisallowIncomingNFTokenOffer,
18+
disallowIncomingCheck: LedgerEntry.AccountRootFlags.lsfDisallowIncomingCheck,
19+
disallowIncomingPayChan: LedgerEntry.AccountRootFlags.lsfDisallowIncomingPayChan,
20+
disallowIncomingTrustline: LedgerEntry.AccountRootFlags.lsfDisallowIncomingTrustline,
1721
};
1822

1923
export interface AccountRootFlagsKeysInterface {
@@ -26,6 +30,10 @@ export interface AccountRootFlagsKeysInterface {
2630
noFreeze?: boolean;
2731
globalFreeze?: boolean;
2832
defaultRipple?: boolean;
33+
disallowIncomingNFTokenOffer?: boolean;
34+
disallowIncomingCheck?: boolean;
35+
disallowIncomingPayChan?: boolean;
36+
disallowIncomingTrustline?: boolean;
2937
}
3038

3139
export const SignerListFlagsKeys = {
@@ -53,7 +61,7 @@ export const AccountFields = {
5361
* domain: "test.bithomp.com",
5462
* }
5563
*/
56-
export function getSettings(accountInfo: any, excludeFalse: boolean = true): object {
64+
export function getSettings(accountInfo: any, excludeFalse: boolean = true): object {
5765
const parsedFlags = parseAccountFlags(accountInfo.Flags, { excludeFalse });
5866
const parsedFields = parseAccountFields(accountInfo, { excludeFalse });
5967

src/models/transaction/nftoken_changes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function parseNFTokenChanges(tx: object): object {
66
return new NFTokenChanges(tx).call();
77
}
88

9-
interface AccountNFTockenChangesInterface {
9+
interface AccountNFTokenChangesInterface {
1010
status: string;
1111
nftokenID: string;
1212
uri?: string;
@@ -50,7 +50,7 @@ class NFTokenChanges {
5050
return true;
5151
}
5252

53-
private addChange(account: string, change: AccountNFTockenChangesInterface): void {
53+
private addChange(account: string, change: AccountNFTokenChangesInterface): void {
5454
if (!this.changes[account]) {
5555
this.changes[account] = [];
5656
}

test/ledger/account_info.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ describe("Client", () => {
157157
passwordSpent: false,
158158
requireAuth: true,
159159
requireDestTag: false,
160+
disallowIncomingCheck: false,
161+
disallowIncomingNFTokenOffer: false,
162+
disallowIncomingPayChan: false,
163+
disallowIncomingTrustline: false,
160164
});
161165
});
162166
});
@@ -202,6 +206,10 @@ describe("Client", () => {
202206
passwordSpent: true,
203207
requireAuth: false,
204208
requireDestTag: false,
209+
disallowIncomingCheck: false,
210+
disallowIncomingNFTokenOffer: false,
211+
disallowIncomingPayChan: false,
212+
disallowIncomingTrustline: false,
205213
});
206214
});
207215

@@ -286,6 +294,10 @@ describe("Client", () => {
286294
globalFreeze: false,
287295
defaultRipple: false,
288296
blackholed: false,
297+
disallowIncomingCheck: false,
298+
disallowIncomingNFTokenOffer: false,
299+
disallowIncomingPayChan: false,
300+
disallowIncomingTrustline: false,
289301
});
290302
});
291303
});

test/ledger/nft_info.test.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,6 @@ import { expect } from "chai";
33
import { Client } from "../../src/index";
44

55
describe("Client", () => {
6-
describe("xls20", () => {
7-
before(async function () {
8-
Client.setup(nconf.get("xrpl:connections:xls20net"));
9-
await Client.connect();
10-
});
11-
12-
describe("getNftInfo", () => {
13-
it("works for active", async function () {
14-
const result: any = await Client.getNftInfo("000B0000C124E14881533A9AFE4A5F481795C17003A9FACF0000099B00000000");
15-
expect(result).to.eql({
16-
nft_id: "000B0000C124E14881533A9AFE4A5F481795C17003A9FACF0000099B00000000",
17-
ledger_index: 75217,
18-
owner: "rJcEbVWJ7xFjL8J9LsbxBMVSRY2C7DU7rz",
19-
is_burned: false,
20-
flags: 11,
21-
transfer_fee: 0,
22-
issuer: "rJcEbVWJ7xFjL8J9LsbxBMVSRY2C7DU7rz",
23-
nft_taxon: 0,
24-
nft_sequence: 0,
25-
uri: "ipfs://QmQjDvDhfHcMyUgDAxKig4AoMTtS5JrsfpiEEpFa3F9QRt",
26-
validated: true,
27-
});
28-
});
29-
30-
it("works for burned", async function () {
31-
const result: any = await Client.getNftInfo("000F0032B6AB2D2C748939F237E1B9ACB589875CB957455E78E2DBCD00000032");
32-
expect(result).to.eql({
33-
nft_id: "000F0032B6AB2D2C748939F237E1B9ACB589875CB957455E78E2DBCD00000032",
34-
ledger_index: 310315,
35-
owner: "rUoevHvHkU8H7NN7W4fMRXyz6ipM1TNxDe",
36-
is_burned: true,
37-
flags: 15,
38-
transfer_fee: 50,
39-
issuer: "rHe1sToM6nQ37FzrGdC9WWCqJKaaRLscgJ",
40-
nft_taxon: 0,
41-
nft_sequence: 50,
42-
validated: true,
43-
});
44-
});
45-
});
46-
});
47-
486
describe("mainnet", () => {
497
before(async function () {
508
this.timeout(10000);

0 commit comments

Comments
 (0)