mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Compare commits
14 Commits
@transia/r
...
xahau-dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04286221c2 | ||
|
|
e4e13302ad | ||
|
|
d98d2e5fdb | ||
|
|
da39e14d46 | ||
|
|
ae43c75504 | ||
|
|
4ae9839f68 | ||
|
|
f77d135bb8 | ||
|
|
720880a383 | ||
|
|
1dbf35dbcb | ||
|
|
d6411baf10 | ||
|
|
ab86bae582 | ||
|
|
cb61711298 | ||
|
|
b449a62c5b | ||
|
|
5183289719 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@transia/ripple-binary-codec",
|
"name": "@transia/ripple-binary-codec",
|
||||||
"version": "1.4.6-alpha.9",
|
"version": "1.4.6-alpha.10",
|
||||||
"description": "XRP Ledger binary codec",
|
"description": "XRP Ledger binary codec",
|
||||||
"files": [
|
"files": [
|
||||||
"dist/*",
|
"dist/*",
|
||||||
|
|||||||
@@ -2649,6 +2649,7 @@
|
|||||||
"terNO_HOOK": -86,
|
"terNO_HOOK": -86,
|
||||||
|
|
||||||
"tesSUCCESS": 0,
|
"tesSUCCESS": 0,
|
||||||
|
"tesPARTIAL": 1,
|
||||||
|
|
||||||
"tecCLAIM": 100,
|
"tecCLAIM": 100,
|
||||||
"tecPATH_PARTIAL": 101,
|
"tecPATH_PARTIAL": 101,
|
||||||
|
|||||||
25
packages/xrpl-models/package.json
Normal file
25
packages/xrpl-models/package.json
Normal 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@transia/xrpl",
|
"name": "@transia/xrpl",
|
||||||
"version": "2.7.3-alpha.26",
|
"version": "2.7.3-alpha.28",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"description": "A TypeScript/JavaScript API for interacting with the XRP Ledger in Node.js and the browser",
|
"description": "A TypeScript/JavaScript API for interacting with the XRP Ledger in Node.js and the browser",
|
||||||
"files": [
|
"files": [
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@transia/ripple-address-codec": "^4.2.8-alpha.0",
|
"@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",
|
"@transia/ripple-keypairs": "^1.1.8-alpha.0",
|
||||||
"bignumber.js": "^9.0.0",
|
"bignumber.js": "^9.0.0",
|
||||||
"bip32": "^2.0.6",
|
"bip32": "^2.0.6",
|
||||||
@@ -54,6 +54,7 @@
|
|||||||
"build": "run-s build:lib build:snippets build:web",
|
"build": "run-s build:lib build:snippets build:web",
|
||||||
"build:snippets": "tsc --build ./snippets/tsconfig.json",
|
"build:snippets": "tsc --build ./snippets/tsconfig.json",
|
||||||
"build:lib": "tsc --build tsconfig.build.json",
|
"build:lib": "tsc --build tsconfig.build.json",
|
||||||
|
"build:models": "tsc --build tsconfig.models.json",
|
||||||
"build:web": "webpack",
|
"build:web": "webpack",
|
||||||
"build:browserTests": "webpack --config ./test/webpack.config.js",
|
"build:browserTests": "webpack --config ./test/webpack.config.js",
|
||||||
"analyze": "run-s build:web --analyze",
|
"analyze": "run-s build:web --analyze",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export interface IssuedCurrencyAmount extends IssuedCurrency {
|
|||||||
|
|
||||||
export type Amount = IssuedCurrencyAmount | string
|
export type Amount = IssuedCurrencyAmount | string
|
||||||
|
|
||||||
export type AmountEntry = Amount
|
export type AmountEntry = { AmountEntry: { Amount: Amount } }
|
||||||
|
|
||||||
export interface Signer {
|
export interface Signer {
|
||||||
Signer: {
|
Signer: {
|
||||||
@@ -87,7 +87,7 @@ export interface HookParameter {
|
|||||||
/**
|
/**
|
||||||
* The value of the parameter.
|
* The value of the parameter.
|
||||||
*/
|
*/
|
||||||
HookParameterValue: string
|
HookParameterValue?: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,16 @@ export default interface AccountRoot extends BaseLedgerEntry {
|
|||||||
* account to each other.
|
* account to each other.
|
||||||
*/
|
*/
|
||||||
TransferRate?: number
|
TransferRate?: number
|
||||||
|
NFTokenMinter?: string
|
||||||
|
MintedNFTokens?: number
|
||||||
|
BurnedNFTokens?: number
|
||||||
|
HookStateCount?: number
|
||||||
|
HookNamespaces?: string[]
|
||||||
|
RewardLgrFirst?: number
|
||||||
|
RewardLgrLast?: number
|
||||||
|
RewardTime?: number
|
||||||
|
RewardAccumulator?: number
|
||||||
|
FirstNFTokenSequence?: number
|
||||||
ImportSequence?: string
|
ImportSequence?: string
|
||||||
GovernanceFlags?: string
|
GovernanceFlags?: string
|
||||||
GovernanceMarks?: string
|
GovernanceMarks?: string
|
||||||
@@ -136,6 +146,10 @@ export interface AccountRootFlagsInterface {
|
|||||||
* Disallow incoming Trustlines from other accounts.
|
* Disallow incoming Trustlines from other accounts.
|
||||||
*/
|
*/
|
||||||
lsfDisallowIncomingTrustline?: boolean
|
lsfDisallowIncomingTrustline?: boolean
|
||||||
|
/**
|
||||||
|
* Disallow incoming Trustlines from other accounts.
|
||||||
|
*/
|
||||||
|
lsfDisallowIncomingRemit?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum AccountRootFlags {
|
export enum AccountRootFlags {
|
||||||
@@ -192,4 +206,12 @@ export enum AccountRootFlags {
|
|||||||
* Disallow incoming Trustlines from other accounts.
|
* Disallow incoming Trustlines from other accounts.
|
||||||
*/
|
*/
|
||||||
lsfDisallowIncomingTrustline = 0x20000000,
|
lsfDisallowIncomingTrustline = 0x20000000,
|
||||||
|
/**
|
||||||
|
* The account has issued a URIToken.
|
||||||
|
*/
|
||||||
|
lsfURITokenIssuer = 0x40000000,
|
||||||
|
/**
|
||||||
|
* Disallow incoming Remits from other accounts.
|
||||||
|
*/
|
||||||
|
lsfDisallowIncomingRemit = 0x80000000,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ export enum AccountSetAsfFlags {
|
|||||||
asfDisallowIncomingPayChan = 14,
|
asfDisallowIncomingPayChan = 14,
|
||||||
/** Disallow other accounts from creating incoming Trustlines */
|
/** Disallow other accounts from creating incoming Trustlines */
|
||||||
asfDisallowIncomingTrustline = 15,
|
asfDisallowIncomingTrustline = 15,
|
||||||
|
/** Disallow other accounts from sending incoming Remits */
|
||||||
|
asfDisallowIncomingRemit = 16,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,17 @@
|
|||||||
import { ValidationError } from '../../errors'
|
import { ValidationError } from '../../errors'
|
||||||
|
|
||||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
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.
|
* 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 {
|
export interface ClaimReward extends BaseTransaction {
|
||||||
TransactionType: 'ClaimReward'
|
TransactionType: 'ClaimReward'
|
||||||
|
Flags?: number | ClaimRewardFlags
|
||||||
/** The unique address of the issuer where the reward.c hook is installed. */
|
/** The unique address of the issuer where the reward.c hook is installed. */
|
||||||
Issuer?: string
|
Issuer?: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,6 +170,10 @@ export interface BaseTransaction {
|
|||||||
* The network id of the transaction.
|
* The network id of the transaction.
|
||||||
*/
|
*/
|
||||||
NetworkID?: number
|
NetworkID?: number
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
FirstLedgerSequence?: number
|
||||||
/**
|
/**
|
||||||
* The hook parameters of the transaction.
|
* The hook parameters of the transaction.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { isHex } from '../utils'
|
|||||||
|
|
||||||
import { BaseTransaction, validateBaseTransaction } from './common'
|
import { BaseTransaction, validateBaseTransaction } from './common'
|
||||||
|
|
||||||
const MAX_URI_LENGTH = 256
|
const MAX_URI_LENGTH = 512
|
||||||
const DIGEST_LENGTH = 64
|
const DIGEST_LENGTH = 64
|
||||||
const MAX_ARRAY_LENGTH = 32
|
const MAX_ARRAY_LENGTH = 32
|
||||||
const MAX_BLOB_LENGTH = 1024
|
const MAX_BLOB_LENGTH = 1024
|
||||||
@@ -32,6 +32,10 @@ export interface Remit extends BaseTransaction {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
MintURIToken?: MintURIToken
|
MintURIToken?: MintURIToken
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
URITokenIDs?: string[]
|
||||||
/**
|
/**
|
||||||
* Arbitrary 256-bit hash representing a specific reason or identifier for
|
* Arbitrary 256-bit hash representing a specific reason or identifier for
|
||||||
* this payment.
|
* this payment.
|
||||||
@@ -69,7 +73,7 @@ export function validateRemit(tx: Record<string, unknown>): void {
|
|||||||
if (tx.DestinationTag != null && typeof tx.DestinationTag !== 'number') {
|
if (tx.DestinationTag != null && typeof tx.DestinationTag !== 'number') {
|
||||||
throw new ValidationError('Remit: DestinationTag must be a 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(
|
throw new ValidationError(
|
||||||
'Remit: Inform must not be equal to the account or destination',
|
'Remit: Inform must not be equal to the account or destination',
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -166,7 +166,8 @@ describe('Models Utils', function () {
|
|||||||
AccountRootFlags.lsfDisallowIncomingNFTokenOffer |
|
AccountRootFlags.lsfDisallowIncomingNFTokenOffer |
|
||||||
AccountRootFlags.lsfDisallowIncomingCheck |
|
AccountRootFlags.lsfDisallowIncomingCheck |
|
||||||
AccountRootFlags.lsfDisallowIncomingPayChan |
|
AccountRootFlags.lsfDisallowIncomingPayChan |
|
||||||
AccountRootFlags.lsfDisallowIncomingTrustline
|
AccountRootFlags.lsfDisallowIncomingTrustline |
|
||||||
|
AccountRootFlags.lsfDisallowIncomingRemit
|
||||||
|
|
||||||
const parsed = parseAccountRootFlags(accountRootFlags)
|
const parsed = parseAccountRootFlags(accountRootFlags)
|
||||||
|
|
||||||
@@ -183,7 +184,8 @@ describe('Models Utils', function () {
|
|||||||
parsed.lsfDisallowIncomingNFTokenOffer &&
|
parsed.lsfDisallowIncomingNFTokenOffer &&
|
||||||
parsed.lsfDisallowIncomingCheck &&
|
parsed.lsfDisallowIncomingCheck &&
|
||||||
parsed.lsfDisallowIncomingPayChan &&
|
parsed.lsfDisallowIncomingPayChan &&
|
||||||
parsed.lsfDisallowIncomingTrustline,
|
parsed.lsfDisallowIncomingTrustline &&
|
||||||
|
parsed.lsfDisallowIncomingRemit,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -203,6 +205,7 @@ describe('Models Utils', function () {
|
|||||||
assert.isUndefined(parsed.lsfDisallowIncomingCheck)
|
assert.isUndefined(parsed.lsfDisallowIncomingCheck)
|
||||||
assert.isUndefined(parsed.lsfDisallowIncomingPayChan)
|
assert.isUndefined(parsed.lsfDisallowIncomingPayChan)
|
||||||
assert.isUndefined(parsed.lsfDisallowIncomingTrustline)
|
assert.isUndefined(parsed.lsfDisallowIncomingTrustline)
|
||||||
|
assert.isUndefined(parsed.lsfDisallowIncomingRemit)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
8
packages/xrpl/tsconfig.models.json
Normal file
8
packages/xrpl/tsconfig.models.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"rootDir": "./src",
|
||||||
|
"outDir": "../xrpl-models/dist"
|
||||||
|
},
|
||||||
|
"include": ["./src/models/**/*.ts", "./src/errors.ts"],
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user