Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
2d1756a
add basic support
mvadari Mar 10, 2025
2727e2b
reorg escrow tests
mvadari Mar 11, 2025
6987461
fix rbc ignoring unknown fields
mvadari Mar 11, 2025
168c08d
add tests, fix issues
mvadari Mar 11, 2025
93cf7d5
fix test
mvadari Mar 11, 2025
d6e84d8
update FeeSettings
mvadari Mar 25, 2025
da1a30e
bump versions
mvadari Mar 26, 2025
4934ad3
update package-lock
mvadari Mar 26, 2025
670d99e
add faucet
mvadari Mar 28, 2025
735bb6b
fix faucet
mvadari Mar 28, 2025
57cb6b2
remove console
mvadari Mar 28, 2025
9b383a0
Merge branch 'main' into smart-escrows
mvadari Mar 28, 2025
bfae078
update beta version
mvadari Mar 28, 2025
377a693
Merge branch 'main' into smart-escrows
mvadari Apr 23, 2025
2412156
update for Devnet 2
mvadari Apr 29, 2025
836aaa0
Merge branch 'main' into smart-escrows
mvadari Apr 29, 2025
169e5f4
update definitions
mvadari May 2, 2025
3e422a0
bump versions
mvadari May 2, 2025
a5e2e34
npm i
mvadari May 2, 2025
b0a58b6
Merge branch 'main' into smart-escrows
mvadari May 29, 2025
da1d820
fix integration test
mvadari May 29, 2025
d866d66
update versions
mvadari May 29, 2025
0bb80b0
Merge branch 'main' into smart-escrows
mvadari Jun 5, 2025
64ad891
Merge branch 'main' into smart-escrows
mvadari Jun 8, 2025
69d74c6
Merge branch 'main' into smart-escrows
mvadari Jul 3, 2025
8c10cb5
Merge branch 'main' into smart-escrows
mvadari Jul 8, 2025
dc2c789
bump version
mvadari Jul 10, 2025
f16a41f
Update CONTRIBUTING.md
mvadari Jul 10, 2025
9356310
update contributing
mvadari Jul 10, 2025
3955258
Merge branch 'main' into smart-escrows
mvadari Jul 30, 2025
038048a
fix tests
mvadari Jul 30, 2025
bfdbae1
fix tests
mvadari Jul 30, 2025
ef575cc
add metadata fields
mvadari Aug 4, 2025
b986b1d
bump version
mvadari Aug 4, 2025
d3fde69
fix nvmrc
mvadari Aug 4, 2025
e70528e
update fee
mvadari Sep 12, 2025
e491978
Merge branch 'main' into smart-escrows
mvadari Sep 12, 2025
09e7df1
fix tests
mvadari Sep 12, 2025
f9f0f21
fix linter
mvadari Sep 12, 2025
b691db9
update FeeSettings/SetFee
mvadari Sep 12, 2025
b253346
make changes to binary codec
mvadari Sep 15, 2025
7cf28e0
add more tests
mvadari Sep 15, 2025
d93eff4
bump versions
mvadari Sep 15, 2025
8222105
fix int32
mvadari Sep 15, 2025
2176863
bump version
mvadari Sep 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ Note: The same updated config can be used to update xrpl-py's CI as well.
10. Checkout `main` and `git pull` (you can skip this step for a beta since you already have the latest version of the beta branch).
11. Actually publish the packages with one of the following:

- Stable release: Run `npx lerna publish from-package --yes`
- Beta release: Run `npx lerna publish from-package --dist-tag beta --yes`
Notice this allows developers to install the package with `npm add xrpl@beta`
- Stable release: Run `npx lerna publish from-package --yes --registry=https://registry.npmjs.org`
- Beta release: Run `npx lerna publish from-package --dist-tag beta --yes --registry=https://registry.npmjs.org`
Notice this allows developers to install the package with `npm add xrpl@beta`. Custom tags are also supported and are recommended for amendment betas.

12. If requested, enter your [npmjs.com](https://npmjs.com) OTP (one-time password) to complete publication.

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ripple-binary-codec/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ripple-binary-codec",
"version": "2.5.0",
"version": "2.6.0-smartescrow.2",
"description": "XRP Ledger binary codec",
"files": [
"dist/*",
Expand Down
76 changes: 76 additions & 0 deletions packages/ripple-binary-codec/src/enums/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,56 @@
"type": "UInt32"
}
],
[
"ExtensionComputeLimit",
{
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 53,
"type": "UInt32"
}
],
[
"ExtensionSizeLimit",
{
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 54,
"type": "UInt32"
}
],
[
"GasPrice",
{
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 55,
"type": "UInt32"
}
],
[
"ComputationAllowance",
{
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 56,
"type": "UInt32"
}
],
[
"GasUsed",
{
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 57,
"type": "UInt32"
}
],
[
"IndexNext",
{
Expand Down Expand Up @@ -1890,6 +1940,16 @@
"type": "Blob"
}
],
[
"FinishFunction",
{
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": true,
"nth": 32,
"type": "Blob"
}
],
[
"Account",
{
Expand Down Expand Up @@ -2130,6 +2190,16 @@
"type": "Number"
}
],
[
"WasmReturnCode",
{
"isSerialized": true,
"isSigningField": true,
"isVLEncoded": false,
"nth": 1,
"type": "Int32"
}
],
[
"TransactionMetaData",
{
Expand Down Expand Up @@ -3159,6 +3229,7 @@
"tecUNFUNDED_AMM": 162,
"tecUNFUNDED_OFFER": 103,
"tecUNFUNDED_PAYMENT": 104,
"tecWASM_REJECTED": 199,
"tecWRONG_ASSET": 194,
"tecXCHAIN_ACCOUNT_CREATE_PAST": 181,
"tecXCHAIN_ACCOUNT_CREATE_TOO_MANY": 182,
Expand Down Expand Up @@ -3197,8 +3268,10 @@
"tefNOT_MULTI_SIGNING": -184,
"tefNO_AUTH_REQUIRED": -191,
"tefNO_TICKET": -180,
"tefNO_WASM": -177,
"tefPAST_SEQ": -190,
"tefTOO_BIG": -181,
"tefWASM_FIELD_NOT_INCLUDED": -176,
"tefWRONG_PRIOR": -189,

"telBAD_DOMAIN": -398,
Expand Down Expand Up @@ -3246,6 +3319,7 @@
"temBAD_TICK_SIZE": -269,
"temBAD_TRANSFER_FEE": -251,
"temBAD_TRANSFER_RATE": -280,
"temBAD_WASM": -249,
"temBAD_WEIGHT": -270,
"temCANNOT_PREAUTH_SELF": -267,
"temDISABLED": -273,
Expand Down Expand Up @@ -3366,6 +3440,8 @@
"Hash160": 17,
"Hash192": 21,
"Hash256": 5,
"Int32": 10,
"Int64": 11,
"Issue": 24,
"LedgerEntry": 10002,
"Metadata": 10004,
Expand Down
3 changes: 3 additions & 0 deletions packages/ripple-binary-codec/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Hash128 } from './hash-128'
import { Hash160 } from './hash-160'
import { Hash192 } from './hash-192'
import { Hash256 } from './hash-256'
import { Int32 } from './int-32'
import { Issue } from './issue'
import { STNumber } from './st-number'
import { PathSet } from './path-set'
Expand All @@ -29,6 +30,7 @@ const coreTypes: Record<string, typeof SerializedType> = {
Hash160,
Hash192,
Hash256,
Int32,
Issue,
Number: STNumber,
PathSet,
Expand Down Expand Up @@ -57,6 +59,7 @@ export {
Hash160,
Hash192,
Hash256,
Int32,
PathSet,
STArray,
STObject,
Expand Down
57 changes: 57 additions & 0 deletions packages/ripple-binary-codec/src/types/int-32.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { UInt } from './uint'
import { BinaryParser } from '../serdes/binary-parser'
import { readInt32BE, writeInt32BE } from '../utils'

/**
* Derived Int class for serializing/deserializing 32 bit Int
*/
class Int32 extends UInt {
protected static readonly width: number = 32 / 8 // 4
static readonly defaultInt32: Int32 = new Int32(new Uint8Array(Int32.width))

constructor(bytes: Uint8Array) {
super(bytes ?? Int32.defaultInt32.bytes)
}

static fromParser(parser: BinaryParser): UInt {
return new Int32(parser.read(Int32.width))
}

/**
* Construct a Int32 object from a number
*
* @param val Int32 object or number
*/
static from<T extends Int32 | number | string>(val: T): Int32 {
if (val instanceof Int32) {
return val
}

const buf = new Uint8Array(Int32.width)

if (typeof val === 'string') {
const num = Number.parseInt(val)
writeInt32BE(buf, num, 0)
return new Int32(buf)
}

if (typeof val === 'number') {
Int32.checkUintRange(val, -2147483648, 2147483647)
writeInt32BE(buf, val, 0)
return new Int32(buf)
}

throw new Error('Cannot construct Int32 from given value')
}

/**
* get the value of a Int32 object
*
* @returns the number represented by this.bytes
*/
valueOf(): number {
return readInt32BE(this.bytes, 0)
}
}

export { Int32 }
Loading
Loading