mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-05 13:25:48 +00:00
Compare commits
9 Commits
@transia/x
...
@transia/x
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b234ec8ec | ||
|
|
c7a001e7e9 | ||
|
|
e24cbccc2b | ||
|
|
53310f699a | ||
|
|
46de80131a | ||
|
|
7981faf92f | ||
|
|
0cf024cab1 | ||
|
|
ab34fbeced | ||
|
|
254ac23893 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@transia/ripple-binary-codec",
|
||||
"version": "1.4.6-alpha.3",
|
||||
"version": "1.4.6-alpha.4",
|
||||
"description": "XRP Ledger binary codec",
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
"NFTokenPage": 80,
|
||||
"NFTokenOffer": 55,
|
||||
"URIToken": 85,
|
||||
"UNLReport": 82,
|
||||
"Any": -3,
|
||||
"Child": -2,
|
||||
"Nickname": 110,
|
||||
|
||||
@@ -105,6 +105,11 @@ let json_omitted = {
|
||||
}
|
||||
|
||||
const NegativeUNL = require('./fixtures/negative-unl.json')
|
||||
const UNLReport = {
|
||||
tx: require('./fixtures/unl-report.json'),
|
||||
binary: require('./fixtures/unl-report-binary.json'),
|
||||
meta: require('./fixtures/unl-report-meta-binary.json'),
|
||||
}
|
||||
|
||||
function bytesListTest() {
|
||||
const list = new BytesList()
|
||||
@@ -229,6 +234,18 @@ function NegativeUNLTest() {
|
||||
})
|
||||
}
|
||||
|
||||
function UNLReportTest() {
|
||||
test('can serialize UNLReport', () => {
|
||||
expect(encode(UNLReport.tx)).toEqual(UNLReport.binary)
|
||||
})
|
||||
test('can serialize UNLReport metadata', () => {
|
||||
expect(encode(UNLReport.tx.meta)).toEqual(UNLReport.meta)
|
||||
})
|
||||
test('can deserialize UNLReport metadata', () => {
|
||||
expect(decode(UNLReport.meta)).toEqual(UNLReport.tx.meta)
|
||||
})
|
||||
}
|
||||
|
||||
function omitUndefinedTest() {
|
||||
test('omits fields with undefined value', () => {
|
||||
let encodedOmitted = encode(json_omitted)
|
||||
@@ -286,4 +303,5 @@ describe('Binary Serialization', function () {
|
||||
describe('OmitUndefined', omitUndefinedTest)
|
||||
describe('TicketTest', ticketTest)
|
||||
describe('NFToken', nfTokenTest)
|
||||
describe('UNLReport', UNLReportTest)
|
||||
})
|
||||
|
||||
1
packages/ripple-binary-codec/test/fixtures/unl-report-binary.json
vendored
Normal file
1
packages/ripple-binary-codec/test/fixtures/unl-report-binary.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"120068240000000026006D2E00684000000000000000730081140000000000000000000000000000000000000000E05F7121ED93B2BE467CAD2F9F56FB3A82BDFF17F84B09E34232DDE8FAF2FC72382F142655E1"
|
||||
1
packages/ripple-binary-codec/test/fixtures/unl-report-meta-binary.json
vendored
Normal file
1
packages/ripple-binary-codec/test/fixtures/unl-report-meta-binary.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"201C00000000F8E51100525661E32E7A24A238F1C619D5F9DDCC41A94B33B66C0163F7EFCC8A19C9FD6F28DCE6F05FE05F7121ED3ABC6740983BFB13FFD9728EBCC365A2877877D368FC28990819522300C92A698114A53F8465478D79DC0C764F0FB2B67AE92465FD5EE1E05F7121ED49F82B2FFD537F224A1E0A10DEEFC3C25CE3882979E6B327C9F18603D21F0A2281142BF2A77E25382EC1DEF521D81D24BC0FDD35BC9BE1E05F7121ED79EB0F6A9F01A039235E536D19F812B55ACF540C9E22CF62C271E0D42BFF51748114C45147960400DB6B763110CBCE8D641E9365F24EE1E05F7121ED93B2BE467CAD2F9F56FB3A82BDFF17F84B09E34232DDE8FAF2FC72382F142655811408BCFB092DEE1BF0F2662AECE4DCC62C4AECCB8AE1E05F7121ED96F581FED430E8CBE1F08B37408857001D4118D49FBB594B0BE007C2DBFFD3678114A4EF485B50A7D91DF45450A680FAC31C53367B2DE1E05F7121EDCF31B8F683345E1C49B4A1D85BF2731E55E7D6781F3D4BF45EE7ADF2D2FB340281144D854497B48F1A41EF04E09DB656A11AAD01A703E1E05F7121EDDF197FC59A7FAA09EB1AD60A4638BA6201DD51497B5C08A1745115098E229E0E811446550CBD2B655081662AE3159B0488DE27EC0592E1F1E1E72200000000F05EE05E7121ED264807102805220DA0F312E71FC2C69E1552C9C5790F6C25E3729DEB573D5860811478339DD5880A994A5CB6E56CB7ED13FEEF201928E1F1F05FE05F7121ED93B2BE467CAD2F9F56FB3A82BDFF17F84B09E34232DDE8FAF2FC72382F142655811408BCFB092DEE1BF0F2662AECE4DCC62C4AECCB8AE1F1E1E1F1031000"
|
||||
89
packages/ripple-binary-codec/test/fixtures/unl-report.json
vendored
Normal file
89
packages/ripple-binary-codec/test/fixtures/unl-report.json
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"Account": "",
|
||||
"ActiveValidator": {
|
||||
"PublicKey": "ED93B2BE467CAD2F9F56FB3A82BDFF17F84B09E34232DDE8FAF2FC72382F142655"
|
||||
},
|
||||
"Fee": "0",
|
||||
"LedgerSequence": 7155200,
|
||||
"Sequence": 0,
|
||||
"SigningPubKey": "",
|
||||
"TransactionType": "UNLReport",
|
||||
"hash": "0878863F758F74A5CBD35691CDAB625A3BCD35B21B440E20545C4757DDB0CA43",
|
||||
"meta": {
|
||||
"AffectedNodes": [
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"ActiveValidators": [
|
||||
{
|
||||
"ActiveValidator": {
|
||||
"Account": "roUo3ygV92bdhfE1v9LGpPETXvJv2kQv5",
|
||||
"PublicKey": "ED93B2BE467CAD2F9F56FB3A82BDFF17F84B09E34232DDE8FAF2FC72382F142655"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Flags": 0,
|
||||
"ImportVLKeys": [
|
||||
{
|
||||
"ImportVLKey": {
|
||||
"Account": "rBxZvQBY551DJ21g9AC1Qc9ASQowqcskbF",
|
||||
"PublicKey": "ED264807102805220DA0F312E71FC2C69E1552C9C5790F6C25E3729DEB573D5860"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"LedgerEntryType": "UNLReport",
|
||||
"LedgerIndex": "61E32E7A24A238F1C619D5F9DDCC41A94B33B66C0163F7EFCC8A19C9FD6F28DC",
|
||||
"PreviousFields": {
|
||||
"ActiveValidators": [
|
||||
{
|
||||
"ActiveValidator": {
|
||||
"Account": "rGhk2uLd8ShzX2Zrcgn8sQk1LWBG4jjEwf",
|
||||
"PublicKey": "ED3ABC6740983BFB13FFD9728EBCC365A2877877D368FC28990819522300C92A69"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ActiveValidator": {
|
||||
"Account": "rnr4kwS1VkJhvjVRuq2fbWZtEdN2HbpVVu",
|
||||
"PublicKey": "ED49F82B2FFD537F224A1E0A10DEEFC3C25CE3882979E6B327C9F18603D21F0A22"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ActiveValidator": {
|
||||
"Account": "rJupFrPPYgUNFBdoSqhMEJ22hiHKiZSHXQ",
|
||||
"PublicKey": "ED79EB0F6A9F01A039235E536D19F812B55ACF540C9E22CF62C271E0D42BFF5174"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ActiveValidator": {
|
||||
"Account": "roUo3ygV92bdhfE1v9LGpPETXvJv2kQv5",
|
||||
"PublicKey": "ED93B2BE467CAD2F9F56FB3A82BDFF17F84B09E34232DDE8FAF2FC72382F142655"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ActiveValidator": {
|
||||
"Account": "rGsa7f4arJ8JE9ok9LCht6jCu5xBKUKVMq",
|
||||
"PublicKey": "ED96F581FED430E8CBE1F08B37408857001D4118D49FBB594B0BE007C2DBFFD367"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ActiveValidator": {
|
||||
"Account": "r3htgPchiR2r8kMGzPK3Wfv3WTrpaRKjtU",
|
||||
"PublicKey": "EDCF31B8F683345E1C49B4A1D85BF2731E55E7D6781F3D4BF45EE7ADF2D2FB3402"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ActiveValidator": {
|
||||
"Account": "rfQtB8m51sdbWgcmddRX2mMjMpSxzX1AGr",
|
||||
"PublicKey": "EDDF197FC59A7FAA09EB1AD60A4638BA6201DD51497B5C08A1745115098E229E0E"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex": 0,
|
||||
"TransactionResult": "tesSUCCESS"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@transia/xrpl",
|
||||
"version": "2.7.3-alpha.13",
|
||||
"version": "2.7.3-alpha.17",
|
||||
"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.3",
|
||||
"@transia/ripple-binary-codec": "^1.4.6-alpha.4",
|
||||
"@transia/ripple-keypairs": "^1.1.8-alpha.0",
|
||||
"bignumber.js": "^9.0.0",
|
||||
"bip32": "^2.0.6",
|
||||
|
||||
@@ -9,6 +9,7 @@ import FeeSettings from './FeeSettings'
|
||||
import Hook from './Hook'
|
||||
import HookDefinition from './HookDefinition'
|
||||
import HookState from './HookState'
|
||||
import ImportVLSequence from './ImportVLSequence'
|
||||
import LedgerHashes from './LedgerHashes'
|
||||
import NegativeUNL from './NegativeUNL'
|
||||
import Offer from './Offer'
|
||||
@@ -16,6 +17,8 @@ import PayChannel from './PayChannel'
|
||||
import RippleState from './RippleState'
|
||||
import SignerList from './SignerList'
|
||||
import Ticket from './Ticket'
|
||||
import UNLReport from './UNLReport'
|
||||
import URIToken from './URIToken'
|
||||
|
||||
type LedgerEntry =
|
||||
| AccountRoot
|
||||
@@ -29,6 +32,7 @@ type LedgerEntry =
|
||||
| Hook
|
||||
| HookDefinition
|
||||
| HookState
|
||||
| ImportVLSequence
|
||||
| LedgerHashes
|
||||
| NegativeUNL
|
||||
| Offer
|
||||
@@ -36,5 +40,7 @@ type LedgerEntry =
|
||||
| RippleState
|
||||
| SignerList
|
||||
| Ticket
|
||||
| UNLReport
|
||||
| URIToken
|
||||
|
||||
export default LedgerEntry
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import BaseLedgerEntry from './BaseLedgerEntry'
|
||||
|
||||
interface ImportVLKey {
|
||||
PublicKey: string
|
||||
Account?: string
|
||||
ImportVLKey: {
|
||||
PublicKey: string
|
||||
Account?: string
|
||||
}
|
||||
}
|
||||
interface ActiveValidators {
|
||||
PublicKey: string
|
||||
Account?: string
|
||||
interface ActiveValidator {
|
||||
ActiveValidator: {
|
||||
PublicKey: string
|
||||
Account?: string
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -24,7 +28,7 @@ export default interface UNLReport extends BaseLedgerEntry {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
ActiveValidators?: ActiveValidators[]
|
||||
ActiveValidators?: ActiveValidator[]
|
||||
/**
|
||||
* The identifying hash of the transaction that most recently modified this
|
||||
* object.
|
||||
|
||||
@@ -52,6 +52,6 @@ export {
|
||||
SignerList,
|
||||
SignerListFlags,
|
||||
Ticket,
|
||||
URIToken,
|
||||
UNLReport,
|
||||
URIToken,
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ValidationError } from '../../errors'
|
||||
import { Amount } from '../common'
|
||||
import { isHex } from '../utils'
|
||||
|
||||
import { BaseTransaction, GlobalFlags, validateBaseTransaction } from './common'
|
||||
@@ -74,6 +75,23 @@ export interface URITokenMint extends BaseTransaction {
|
||||
*/
|
||||
URI: string
|
||||
|
||||
/**
|
||||
* Indicates the amount expected or offered for the Token.
|
||||
*
|
||||
* The amount must be non-zero, except when this is a sell
|
||||
* offer and the asset is XRP. This would indicate that the current
|
||||
* owner of the token is giving it away free, either to anyone at all,
|
||||
* or to the account identified by the Destination field.
|
||||
*/
|
||||
Amount?: Amount
|
||||
|
||||
/**
|
||||
* If present, indicates that this offer may only be
|
||||
* accepted by the specified account. Attempts by other
|
||||
* accounts to accept this offer MUST fail.
|
||||
*/
|
||||
Destination?: string
|
||||
|
||||
Digest?: string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user