Compare commits

...

12 Commits

Author SHA1 Message Date
Denis Angell
d98d2e5fdb Publish
- @transia/ripple-binary-codec@1.4.6-alpha.10
 - @transia/xahau-models@2.7.3-alpha.29
 - @transia/xrpl@2.7.3-alpha.28
2024-06-19 10:45:51 +02:00
Denis Angell
da39e14d46 Update definitions.json 2024-06-19 10:44:29 +02:00
Denis Angell
ae43c75504 Update package.json 2024-06-19 10:43:19 +02:00
Denis Angell
4ae9839f68 update models package name 2024-05-31 10:33:05 +02:00
Denis Angell
f77d135bb8 add first ledger sequence 2024-05-31 10:32:56 +02:00
Denis Angell
720880a383 add xrpl-models package 2024-05-23 18:26:23 +02:00
Denis Angell
1dbf35dbcb Update remit.ts 2024-05-19 11:18:03 +02:00
Denis Angell
d6411baf10 Update claimReward.ts 2024-05-19 11:17:55 +02:00
Denis Angell
ab86bae582 add missing root flags 2024-05-19 11:17:51 +02:00
Denis Angell
cb61711298 Publish
- @transia/xrpl@2.7.3-alpha.27
2024-05-10 10:02:19 +02:00
Denis Angell
b449a62c5b Update remit.ts 2024-05-10 10:00:01 +02:00
Denis Angell
5183289719 add Incoming Remit flag 2024-04-23 18:20:50 +02:00
11 changed files with 89 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@transia/ripple-binary-codec",
"version": "1.4.6-alpha.9",
"version": "1.4.6-alpha.10",
"description": "XRP Ledger binary codec",
"files": [
"dist/*",

View File

@@ -2649,6 +2649,7 @@
"terNO_HOOK": -86,
"tesSUCCESS": 0,
"tesPARTIAL": 1,
"tecCLAIM": 100,
"tecPATH_PARTIAL": 101,

View File

@@ -0,0 +1,25 @@
{
"name": "@transia/xahau-models",
"version": "2.7.3-alpha.29",
"description": "",
"private": false,
"main": "dist/models/index.js",
"files": [
"dist/**/*"
],
"author": {
"name": "Denis Angell",
"url": "https://github.com/dangell7"
},
"license": "MIT",
"scripts": {},
"dependencies": {
"@types/node": "^20.4.2",
"ts-node": "^10.9.1",
"typescript": "^5.1.6"
},
"engines": {
"node": ">=12.0.0",
"npm": ">=7.0.0"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@transia/xrpl",
"version": "2.7.3-alpha.26",
"version": "2.7.3-alpha.28",
"license": "ISC",
"description": "A TypeScript/JavaScript API for interacting with the XRP Ledger in Node.js and the browser",
"files": [
@@ -23,7 +23,7 @@
},
"dependencies": {
"@transia/ripple-address-codec": "^4.2.8-alpha.0",
"@transia/ripple-binary-codec": "^1.4.6-alpha.9",
"@transia/ripple-binary-codec": "^1.4.6-alpha.10",
"@transia/ripple-keypairs": "^1.1.8-alpha.0",
"bignumber.js": "^9.0.0",
"bip32": "^2.0.6",
@@ -54,6 +54,7 @@
"build": "run-s build:lib build:snippets build:web",
"build:snippets": "tsc --build ./snippets/tsconfig.json",
"build:lib": "tsc --build tsconfig.build.json",
"build:models": "tsc --build tsconfig.models.json",
"build:web": "webpack",
"build:browserTests": "webpack --config ./test/webpack.config.js",
"analyze": "run-s build:web --analyze",

View File

@@ -72,6 +72,16 @@ export default interface AccountRoot extends BaseLedgerEntry {
* account to each other.
*/
TransferRate?: number
NFTokenMinter?: string
MintedNFTokens?: number
BurnedNFTokens?: number
HookStateCount?: number
HookNamespaces?: string[]
RewardLgrFirst?: number
RewardLgrLast?: number
RewardTime?: number
RewardAccumulator?: number
FirstNFTokenSequence?: number
ImportSequence?: string
GovernanceFlags?: string
GovernanceMarks?: string
@@ -136,6 +146,10 @@ export interface AccountRootFlagsInterface {
* Disallow incoming Trustlines from other accounts.
*/
lsfDisallowIncomingTrustline?: boolean
/**
* Disallow incoming Trustlines from other accounts.
*/
lsfDisallowIncomingRemit?: boolean
}
export enum AccountRootFlags {
@@ -192,4 +206,12 @@ export enum AccountRootFlags {
* Disallow incoming Trustlines from other accounts.
*/
lsfDisallowIncomingTrustline = 0x20000000,
/**
* The account has issued a URIToken.
*/
lsfURITokenIssuer = 0x40000000,
/**
* Disallow incoming Remits from other accounts.
*/
lsfDisallowIncomingRemit = 0x80000000,
}

View File

@@ -57,6 +57,8 @@ export enum AccountSetAsfFlags {
asfDisallowIncomingPayChan = 14,
/** Disallow other accounts from creating incoming Trustlines */
asfDisallowIncomingTrustline = 15,
/** Disallow other accounts from sending incoming Remits */
asfDisallowIncomingRemit = 16,
}
/**

View File

@@ -1,6 +1,17 @@
import { ValidationError } from '../../errors'
import { BaseTransaction, validateBaseTransaction } from './common'
/**
* Transaction Flags for an ClaimReward Transaction.
*
* @category Transaction Flags
*/
export enum ClaimRewardFlags {
/**
* If set, indicates that the user would like to opt out of rewards.
*/
tfOptOut = 0x00000001,
}
/**
* ClaimReward is a transaction model that allows an account to claim rewards.
@@ -9,6 +20,7 @@ import { BaseTransaction, validateBaseTransaction } from './common'
*/
export interface ClaimReward extends BaseTransaction {
TransactionType: 'ClaimReward'
Flags?: number | ClaimRewardFlags
/** The unique address of the issuer where the reward.c hook is installed. */
Issuer?: string
}

View File

@@ -170,6 +170,10 @@ export interface BaseTransaction {
* The network id of the transaction.
*/
NetworkID?: number
/**
*
*/
FirstLedgerSequence?: number
/**
* The hook parameters of the transaction.
*/

View File

@@ -4,7 +4,7 @@ import { isHex } from '../utils'
import { BaseTransaction, validateBaseTransaction } from './common'
const MAX_URI_LENGTH = 256
const MAX_URI_LENGTH = 512
const DIGEST_LENGTH = 64
const MAX_ARRAY_LENGTH = 32
const MAX_BLOB_LENGTH = 1024
@@ -32,6 +32,10 @@ export interface Remit extends BaseTransaction {
*
*/
MintURIToken?: MintURIToken
/**
*
*/
URITokenIDs?: string[]
/**
* Arbitrary 256-bit hash representing a specific reason or identifier for
* this payment.
@@ -69,7 +73,7 @@ export function validateRemit(tx: Record<string, unknown>): void {
if (tx.DestinationTag != null && typeof tx.DestinationTag !== 'number') {
throw new ValidationError('Remit: DestinationTag must be a number')
}
if (tx.Inform === tx.Account || tx.inform === tx.Destination) {
if (tx.Inform === tx.Account || tx.Inform === tx.Destination) {
throw new ValidationError(
'Remit: Inform must not be equal to the account or destination',
)

View File

@@ -166,7 +166,8 @@ describe('Models Utils', function () {
AccountRootFlags.lsfDisallowIncomingNFTokenOffer |
AccountRootFlags.lsfDisallowIncomingCheck |
AccountRootFlags.lsfDisallowIncomingPayChan |
AccountRootFlags.lsfDisallowIncomingTrustline
AccountRootFlags.lsfDisallowIncomingTrustline |
AccountRootFlags.lsfDisallowIncomingRemit
const parsed = parseAccountRootFlags(accountRootFlags)
@@ -183,7 +184,8 @@ describe('Models Utils', function () {
parsed.lsfDisallowIncomingNFTokenOffer &&
parsed.lsfDisallowIncomingCheck &&
parsed.lsfDisallowIncomingPayChan &&
parsed.lsfDisallowIncomingTrustline,
parsed.lsfDisallowIncomingTrustline &&
parsed.lsfDisallowIncomingRemit,
)
})
@@ -203,6 +205,7 @@ describe('Models Utils', function () {
assert.isUndefined(parsed.lsfDisallowIncomingCheck)
assert.isUndefined(parsed.lsfDisallowIncomingPayChan)
assert.isUndefined(parsed.lsfDisallowIncomingTrustline)
assert.isUndefined(parsed.lsfDisallowIncomingRemit)
})
})
})

View File

@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "../xrpl-models/dist"
},
"include": ["./src/models/**/*.ts", "./src/errors.ts"],
}