Compare commits

..

1 Commits

Author SHA1 Message Date
Denis Angell
420d6b2c35 Publish
- @transia/ripple-binary-codec@1.4.6-alpha.6
 - @transia/xrpl@2.7.3-alpha.19
2023-11-07 16:29:55 +01:00
12 changed files with 79 additions and 28 deletions

View File

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

View File

@@ -1,6 +1,6 @@
{
"name": "@transia/xrpl",
"version": "2.7.3-alpha.18",
"version": "2.7.3-alpha.19",
"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.5",
"@transia/ripple-binary-codec": "^1.4.6-alpha.6",
"@transia/ripple-keypairs": "^1.1.8-alpha.0",
"bignumber.js": "^9.0.0",
"bip32": "^2.0.6",

View File

@@ -56,7 +56,6 @@ export interface ServerInfoResponse extends BaseResponse {
amendment_blocked?: boolean
/** The version number of the running rippled version. */
build_version: string
initial_sync_duration_us?: string
/**
* Information on the most recently closed ledger that has not been
* validated by consensus. If the most recently validated ledger is
@@ -141,7 +140,6 @@ export interface ServerInfoResponse extends BaseResponse {
* The network id of the server.
*/
network_id?: number
node_size?: string
/**
* Current multiplier to the transaction cost based on
* load to this server.

View File

@@ -23,7 +23,6 @@ export interface ServerStateResponse extends BaseResponse {
state: {
amendment_blocked?: boolean
build_version: string
initial_sync_duration_us?: string
complete_ledgers: string
closed_ledger?: {
age: number
@@ -52,8 +51,6 @@ export interface ServerStateResponse extends BaseResponse {
load_factor_fee_queue?: number
load_factor_fee_reference?: number
load_factor_server?: number
network_id?: number
node_size?: string
peer_disconnects?: string
peer_disconnects_resources?: string
peers: number

View File

@@ -36,7 +36,6 @@ describe('account_info', function () {
account_data: {
Account: testContext.wallet.classicAddress,
Balance: '400000000',
AccountIndex: '1',
Flags: 0,
LedgerEntryType: 'AccountRoot',
OwnerCount: 0,
@@ -66,14 +65,12 @@ describe('account_info', function () {
assert.equal(typeof response.result.account_data.Sequence, 'number')
assert.deepEqual(
omit(response.result.account_data, [
'AccountIndex',
'PreviousTxnID',
'PreviousTxnLgrSeq',
'Sequence',
'index',
]),
omit(expected.result.account_data, [
'AccountIndex',
'PreviousTxnID',
'PreviousTxnLgrSeq',
'Sequence',

View File

@@ -31,13 +31,12 @@ describe('server_info (rippled)', function () {
id: 0,
result: {
info: {
build_version: '2023.10.9-release+391',
initial_sync_duration_us: '443484',
build_version: '1.7.3',
complete_ledgers: '2563-2928',
hostid: '44578fe64241',
io_latency_ms: 1,
jq_trans_overflow: '0',
last_close: { converge_time_s: 0.001, proposers: 0 },
last_close: { converge_time_s: 0.1, proposers: 0 },
load: {
job_types: [
{
@@ -54,8 +53,6 @@ describe('server_info (rippled)', function () {
threads: 1,
},
load_factor: 1,
network_id: 21337,
node_size: 'small',
peer_disconnects: '0',
peer_disconnects_resources: '0',
peers: 0,
@@ -132,7 +129,7 @@ describe('server_info (rippled)', function () {
)
assert.equal(
typeof response.result.info.state_accounting[key].transitions,
'string',
'number',
)
})

View File

@@ -31,13 +31,12 @@ describe('server_state', function () {
id: 0,
result: {
state: {
build_version: '2023.10.9-release+391',
initial_sync_duration_us: '443484',
build_version: '1.7.3',
complete_ledgers: '2563-2932',
io_latency_ms: 1,
jq_trans_overflow: '0',
last_close: {
converge_time: 1,
converge_time: 100,
proposers: 0,
},
load: {
@@ -61,8 +60,6 @@ describe('server_state', function () {
load_factor_fee_queue: 256,
load_factor_fee_reference: 256,
load_factor_server: 256,
network_id: 21337,
node_size: 'small',
peer_disconnects: '0',
peer_disconnects_resources: '0',
peers: 0,
@@ -136,7 +133,7 @@ describe('server_state', function () {
)
assert.equal(
typeof response.result.state.state_accounting[key].transitions,
'string',
'number',
)
})

View File

@@ -75,7 +75,7 @@ describe('subscribe', function () {
command: 'subscribe',
})
// assert.deepEqual(response.result, {})
assert.deepEqual(response.result, {})
assert.equal(response.type, 'response')
},
TIMEOUT,
@@ -86,7 +86,7 @@ describe('subscribe', function () {
command: 'unsubscribe',
})
// assert.deepEqual(response.result, {})
assert.deepEqual(response.result, {})
assert.equal(response.type, 'response')
})

View File

@@ -52,7 +52,6 @@ describe('tx', function () {
Fee: txResponse.result.Fee,
Flags: 0,
LastLedgerSequence: txResponse.result.LastLedgerSequence,
NetworkID: txResponse.result.NetworkID,
Sequence: txResponse.result.Sequence,
SigningPubKey: testContext.wallet.publicKey,
TxnSignature: txResponse.result.TxnSignature,

View File

@@ -36,7 +36,6 @@ export async function setupClient(
client: new Client(server, { timeout: 200000 }),
wallet: Wallet.generate(),
}
context.client.networkID = 21337
return connectWithRetry(context.client).then(async () => {
await fundAccount(context.client, context.wallet, {
count: 20,

View File

@@ -0,0 +1,68 @@
import { Client } from '@transia/xrpl'
import { assert } from 'chai'
import _ from 'lodash'
import {
convertStringToHex,
getNFTokenID,
NFTokenMint,
TransactionMetadata,
} from '../../../src'
// how long before each test case times out
const TIMEOUT = 20000
describe('NFTokenMint', function () {
// TODO: Once we update our integration tests to handle NFTs, replace this client with XrplIntegrationTestContext
it(
'get NFTokenID',
async function () {
const client = new Client('wss://s.altnet.rippletest.net:51233/')
await client.connect()
const { wallet, balance: _balance } = await client.fundWallet()
const tx: NFTokenMint = {
TransactionType: 'NFTokenMint',
Account: wallet.address,
URI: convertStringToHex('https://www.google.com'),
NFTokenTaxon: 0,
}
try {
const response = await client.submitAndWait(tx, {
wallet,
})
assert.equal(response.type, 'response')
assert.equal(
(response.result.meta as TransactionMetadata).TransactionResult,
'tesSUCCESS',
)
const accountNFTs = await client.request({
command: 'account_nfts',
account: wallet.address,
})
const nftokenID =
getNFTokenID(response.result.meta as TransactionMetadata) ??
'undefined'
const accountHasNFT = accountNFTs.result.account_nfts.some(
(value) => value.NFTokenID === nftokenID,
)
assert.isTrue(
accountHasNFT,
`Expected to find an NFT with NFTokenID ${nftokenID} in account ${
wallet.address
} but did not find it.
\n\nHere's what was returned from 'account_nfts' for ${
wallet.address
}: ${JSON.stringify(accountNFTs)}`,
)
} finally {
await client.disconnect()
}
},
TIMEOUT,
)
})

View File

@@ -214,7 +214,6 @@ export async function verifySubmittedTransaction(
assert(data.result)
assert.deepEqual(
omit(data.result, [
'ctid',
'date',
'hash',
'inLedger',