We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import { encode, encodeForSigning } from 'ripple-binary-codec' import { sign } from 'ripple-keypairs' import { type AMMBid, AccountSetAsfFlags, Client, Wallet, xrpToDrops } from 'xrpl' const client = new Client('wss://s.altnet.rippletest.net:51233/') const main = async () => { await client.connect() const account = (await client.fundWallet()).wallet console.log(account.address) await client.submitAndWait( { TransactionType: 'AccountSet', Account: account.address, SetFlag: AccountSetAsfFlags.asfDefaultRipple, }, { wallet: account }, ) await client.submitAndWait( { TransactionType: 'AMMCreate', Account: account.address, Amount: xrpToDrops('10'), Amount2: { issuer: account.address, currency: 'TST', value: '1000000000', }, TradingFee: 0.001, }, { wallet: account }, ) const response = await client.request({ command: 'amm_info', asset: { currency: 'XRP', }, asset2: { issuer: account.address, currency: 'TST', }, }) const lpToken = response.result.amm.lp_token const acountInfo = await client.request({ command: 'account_info', account: account.address }) const Sequence = acountInfo.result.account_data.Sequence const ledgerIndex = await client.getLedgerIndex() const tx = { TransactionType: 'AMMBid', Account: account.address, Fee: '100', Asset: { currency: 'XRP', }, Asset2: { issuer: account.address, currency: 'TST', }, BidMax: { ...lpToken, value: '10000', }, AuthAccounts: [ { AuthAccount: { Account: account.address } }, { AuthAccount: { Account: account.address } }, { AuthAccount: { Account: account.address } }, { AuthAccount: { Account: account.address } }, ], Sequence: Sequence, SigningPubKey: account.publicKey, LastLedgerSequence: ledgerIndex + 4, } as AMMBid tx.TxnSignature = sign(encodeForSigning(tx), account.privateKey) const tx_blob = encode(tx) await client.submitAndWait(tx_blob) await client.disconnect() } main()
Transaction should be failed.
https://testnet.xrpl.org/transactions/D458FC31A063FAD895E122343A9FB6003918043781041CA6508EE814B2DC05C8/simple
rippled-2.2.2 (testnet)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue Description
Steps to Reproduce
Expected Result
Transaction should be failed.
Actual Result
https://testnet.xrpl.org/transactions/D458FC31A063FAD895E122343A9FB6003918043781041CA6508EE814B2DC05C8/simple
Environment
rippled-2.2.2 (testnet)
Supporting Files
The text was updated successfully, but these errors were encountered: