Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev: add definitions.json generation script #2826

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion packages/ripple-binary-codec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"prepublishOnly": "npm test",
"test": "npm run build && jest --verbose false --silent=false ./test/*.test.ts",
"test:browser": "npm run build && karma start ./karma.config.js",
"lint": "eslint . --ext .ts --ext .test.js"
"lint": "eslint . --ext .ts --ext .test.js",
"generateDefinitions": "node ./tools/generateDefinitions.js"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tried to run this npm script, I got this error message. How should I run it?

➜  xrpl git:(definitions-generation) npm run generateDefinitions ~/rippled
npm error Lifecycle script `generateDefinitions` failed with error:
npm error workspace xrpl@4.0.0
npm error location /Users/ckeshavabs/xrpl.js/packages/xrpl
npm error Missing script: "generateDefinitions"
npm error
npm error To see a list of scripts, run:
npm error   npm run --workspace=xrpl@4.0.0

However, explicitly mentioning the script works as intended: node ./tools/generateDefinitions.js ~/rippled

},
"keywords": [
"ripple",
Expand Down
39 changes: 16 additions & 23 deletions packages/ripple-binary-codec/src/enums/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,31 @@
"Metadata": 10004
},
"LEDGER_ENTRY_TYPES": {
"Any": -3,
"Child": -2,
"Invalid": -1,
"NFTokenOffer": 55,
"Check": 67,
"DID": 73,
"NegativeUNL": 78,
"NFTokenPage": 80,
"SignerList": 83,
"Ticket": 84,
"AccountRoot": 97,
"DirectoryNode": 100,
"RippleState": 114,
"Ticket": 84,
"SignerList": 83,
"Offer": 111,
"Bridge": 105,
"LedgerHashes": 104,
"Amendments": 102,
"LedgerHashes": 104,
"Bridge": 105,
"Offer": 111,
"DepositPreauth": 112,
"XChainOwnedClaimID": 113,
"XChainOwnedCreateAccountClaimID": 116,
"RippleState": 114,
"FeeSettings": 115,
"XChainOwnedCreateAccountClaimID": 116,
"Escrow": 117,
"PayChannel": 120,
"Check": 67,
"DepositPreauth": 112,
"NegativeUNL": 78,
"NFTokenPage": 80,
"NFTokenOffer": 55,
"AMM": 121,
"DID": 73,
"Oracle": 128,
"Any": -3,
"Child": -2,
"Nickname": 110,
"Contract": 99,
"GeneratorMap": 103
"Oracle": 128
mvadari marked this conversation as resolved.
Show resolved Hide resolved
},
"FIELDS": [
[
Expand Down Expand Up @@ -2933,12 +2930,9 @@
"AccountSet": 3,
"EscrowCancel": 4,
"SetRegularKey": 5,
"NickNameSet": 6,
"OfferCreate": 7,
"OfferCancel": 8,
"Contract": 9,
"TicketCreate": 10,
"TicketCancel": 11,
"SignerListSet": 12,
"PaymentChannelCreate": 13,
"PaymentChannelFund": 14,
Expand All @@ -2949,7 +2943,6 @@
"DepositPreauth": 19,
"TrustSet": 20,
"AccountDelete": 21,
"SetHook": 22,
"NFTokenMint": 25,
"NFTokenBurn": 26,
"NFTokenCreateOffer": 27,
Expand Down
Loading
Loading