Pallet Calls


Add Relayer

add a relayer Namespace:
api.tx.xrplBridge.addRelayer
Type:
function addRelayer(
  relayer: SeedPrimitivesSignatureAccountId20
)

Prune Settled Ledger Index (Sudo Only)

Namespace:
api.tx.xrplBridge.pruneSettledLedgerIndex
Type:
function pruneSettledLedgerIndex(
  ledger_index: u32
)

Remove Relayer

remove a relayer Namespace:
api.tx.xrplBridge.removeRelayer
Type:
function removeRelayer(
  relayer: SeedPrimitivesSignatureAccountId20
)

Reset Settled Xrpl Tx Data (Sudo Only)

Namespace:
api.tx.xrplBridge.resetSettledXrplTxData
Type:
function resetSettledXrplTxData(
  highest_settled_ledger_index: u32,
  submission_window_width: u32,
  highest_pruned_ledger_index: Option<u32>,
  settled_tx_data: Option<Vec<(H512,u32,PalletXrplBridgeXrpTransaction,SeedPrimitivesSignatureAccountId20)>>
)

Set Door Address (Sudo Only)

Set XRPL door address managed by this pallet Namespace:
api.tx.xrplBridge.setDoorAddress
Type:
function setDoorAddress(
  door_address: H160
)

Set Door Tx Fee (Sudo Only)

Set the door tx fee amount Namespace:
api.tx.xrplBridge.setDoorTxFee
Type:
function setDoorTxFee(
  fee: u64
)

Set Payment Delay (Sudo Only)

Sets the payment delay payment_delay is a tuple of payment_threshold and delay in blocks Namespace:
api.tx.xrplBridge.setPaymentDelay
Type:
function setPaymentDelay(
  asset_id: u32,
  payment_delay: Option<(u128,u32)>
)

Set Ticket Sequence Current Allocation (Sudo Only)

Set the door account current ticket sequence params for current allocation - force set Namespace:
api.tx.xrplBridge.setTicketSequenceCurrentAllocation
Type:
function setTicketSequenceCurrentAllocation(
  ticket_sequence: u32,
  start_ticket_sequence: u32,
  ticket_bucket_size: u32
)

Set Ticket Sequence Next Allocation

Set the door account ticket sequence params for the next allocation Namespace:
api.tx.xrplBridge.setTicketSequenceNextAllocation
Type:
function setTicketSequenceNextAllocation(
  start_ticket_sequence: u32,
  ticket_bucket_size: u32
)

Set Xrp Source Tag (Sudo Only)

Set the xrp source tag Namespace:
api.tx.xrplBridge.setXrpSourceTag
Type:
function setXrpSourceTag(
  source_tag: u32
)

Submit Challenge

Submit xrp transaction challenge Namespace:
api.tx.xrplBridge.submitChallenge
Type:
function submitChallenge(
  transaction_hash: H512
)

Submit Transaction

Submit xrp transaction Namespace:
api.tx.xrplBridge.submitTransaction
Type:
function submitTransaction(
  ledger_index: u64,
  transaction_hash: H512,
  transaction: PalletXrplBridgeXrplTxData,
  timestamp: u64
)

Withdraw Xrp

Note. Use withdraw instead Withdraw xrp transaction Namespace:
api.tx.xrplBridge.withdrawXrp
Type:
function withdrawXrp(
  amount: u128,
  destination: H160
)

Withdraw Xrp With Destination Tag

Note. Use withdraw instead Withdraw xrp transaction Namespace:
api.tx.xrplBridge.withdrawXrpWithDestinationTag
Type:
function withdrawXrpWithDestinationTag(
  amount: u128,
  destination: H160,
  destination_tag: u32
)

Withdraw

Withdraw asset specified by asset_id. This extrinsic replaces withdrawXrp and withdrawXrpWithDestinationTag Namespace:
api.tx.xrplBridge.withdraw
Type:
function withdraw(
  asset_id: u32,
  amount: u128,
  destination: H160,
  destination_tag: Option<u32>
)

Set Xrpl Asset Map (Sudo Only)

Sets the mapping for an asset to an xrpl symbol Sets both XRPLToAssetId and AssetIdToXRPL Namespace:
api.tx.xrplBridge.setXrplAssetMap
Type:
function setXrplAssetMap(
  asset_id: u32,
  xrpl_currency: PalletXrplBridgeXRPLCurrency,
)

Pallet Storage


Challenge XRP Transaction List

Challenge received for a transaction mapped by hash, will be cleared when validator validates Namespace:
api.query.xrplBridge.challengeXRPTransactionList
Type:
function challengeXRPTransactionList(
  H512
): Option<SeedPrimitivesSignatureAccountId20>

Delayed Payments

Map from DelayedPaymentId to (sender, WithdrawTx) Namespace:
api.query.xrplBridge.delayedPayments
Type:
function delayedPayments(
  u64
): Option<PalletXrplBridgeDelayedWithdrawal>

Delayed Payment Schedule

Map from block number to DelayedPatmentIds scheduled for that block Namespace:
api.query.xrplBridge.delayedPaymentSchedule
Type:
function delayedPaymentSchedule(
  u32
): Option<Vec<u64>>

Door Address

The door address on XRPL Namespace:
api.query.xrplBridge.doorAddress
Type:
function doorAddress(

): Option<H160>

Door Ticket Sequence

The current ticket sequence of the XRPL door account Namespace:
api.query.xrplBridge.doorTicketSequence
Type:
function doorTicketSequence(

): u32

Door Ticket Sequence Params

The Ticket sequence params of the XRPL door account for the current allocation Namespace:
api.query.xrplBridge.doorTicketSequenceParams
Type:
function doorTicketSequenceParams(

): PalletXrplBridgeXrplTicketSequenceParams

Door Ticket Sequence Params Next

The Ticket sequence params of the XRPL door account for the next allocation Namespace:
api.query.xrplBridge.doorTicketSequenceParamsNext
Type:
function doorTicketSequenceParamsNext(

): PalletXrplBridgeXrplTicketSequenceParams

Door Tx Fee

The flat fee for XRPL door txs Namespace:
api.query.xrplBridge.doorTxFee
Type:
function doorTxFee(

): u64

Highest Pruned Ledger Index

Highest pruned XRPL ledger index Namespace:
api.query.xrplBridge.highestPrunedLedgerIndex
Type:
function highestPrunedLedgerIndex(

): u32

Highest Settled Ledger Index

Highest settled XRPL ledger index Namespace:
api.query.xrplBridge.highestSettledLedgerIndex
Type:
function highestSettledLedgerIndex(

): u32

Next Delayed Payment Id

The next available delayedPaymentId Namespace:
api.query.xrplBridge.nextDelayedPaymentId
Type:
function nextDelayedPaymentId(

): u64

Next Delay Process Block

The highest block number that has had all delayed payments processed Namespace:
api.query.xrplBridge.nextDelayProcessBlock
Type:
function nextDelayProcessBlock(

): u32

Payment Delay

Payment delay for any withdraw over the specified Balance threshold Namespace:
api.query.xrplBridge.paymentDelay
Type:
function paymentDelay(
  u32
): Option<(u128,u32)>

Process XRP Transaction

Temporary storage to set the transactions ready to be processed at specified block number Namespace:
api.query.xrplBridge.processXRPTransaction
Type:
function processXRPTransaction(
  u32
): Option<Vec<H512>>

Process XRP Transaction Details

Stores submitted transactions from XRPL waiting to be processed Transactions will be cleared according to the submission window after processing Namespace:
api.query.xrplBridge.processXRPTransactionDetails
Type:
function processXRPTransactionDetails(
  H512
): Option<(u64,PalletXrplBridgeXrpTransaction,SeedPrimitivesSignatureAccountId20)>

Relayer

List of all XRP transaction relayers Namespace:
api.query.xrplBridge.relayer
Type:
function relayer(
  SeedPrimitivesSignatureAccountId20
): Option<bool>

Settled XRP Transaction Details

Settled xrp transactions stored against XRPL ledger index Namespace:
api.query.xrplBridge.settledXRPTransactionDetails
Type:
function settledXRPTransactionDetails(
  u32
): Option<Vec<H512>>

Asset Id To XRPL

Map TRN asset Id to XRPL symbol, storage to keep mapping between TRN -> XRPL tokens/assets Namespace:
api.query.xrplBridge.assetIdToXRPL
Type:
function assetIdToXRPL(
  u32
): Option<PalletXrplBridgeXRPLCurrency>

XRPL To Asset Id

Map XRPL symbol to TRN asset Id, storage to keep mapping between XRPL -> TRN tokens/assets Namespace:
api.query.xrplBridge.xrplToAssetId
Type:
function xrplToAssetId(
  PalletXrplBridgeXRPLCurrency
): Option<u32>

Source Tag

Source tag to be used to indicate the transaction is happening from futureverse Namespace:
api.query.xrplBridge.sourceTag
Type:
function sourceTag(

): u32

Submission Window Width

XRPL transactions submission window width in ledger indexes Namespace:
api.query.xrplBridge.submissionWindowWidth
Type:
function submissionWindowWidth(

): u32

Ticket Sequence Threshold Reached Emitted

Keeps track whether the TicketSequenceThresholdReached event is emitted Namespace:
api.query.xrplBridge.ticketSequenceThresholdReachedEmitted
Type:
function ticketSequenceThresholdReachedEmitted(

): bool

Pallet Events


Door Address Set

Namespace:
api.events.xrplBridge.DoorAddressSet
Type:
type DoorAddressSet = {
  param0: H160
}

Door Next Ticket Sequence Param Set

Namespace:
api.events.xrplBridge.DoorNextTicketSequenceParamSet
Type:
type DoorNextTicketSequenceParamSet = {
  ticket_sequence_start_next: u32,
  ticket_bucket_size_next: u32
}

Door Ticket Sequence Param Set

Namespace:
api.events.xrplBridge.DoorTicketSequenceParamSet
Type:
type DoorTicketSequenceParamSet = {
  ticket_sequence: u32,
  ticket_sequence_start: u32,
  ticket_bucket_size: u32
}

Ledger Index Manual Prune

Namespace:
api.events.xrplBridge.LedgerIndexManualPrune
Type:
type LedgerIndexManualPrune = {
  ledger_index: u32,
  total_cleared: u32
}

Not Supported Transaction

Transaction not supported Namespace:
api.events.xrplBridge.NotSupportedTransaction
Type:
type NotSupportedTransaction = {

}

Payment Delay Removed

The payment delay was removed Namespace:
api.events.xrplBridge.PaymentDelayRemoved
Type:
type PaymentDelayRemoved = {
  asset_id: u32,
}

Payment Delay Set

The payment delay was set Namespace:
api.events.xrplBridge.PaymentDelaySet
Type:
type PaymentDelaySet = {
  asset_id: u32,
  payment_threshold: u128,
  delay: u32
}

Processing Failed

Processing an event failed Namespace:
api.events.xrplBridge.ProcessingFailed
Type:
type ProcessingFailed = {
  param0: u64,
  param1: H512,
  param2: SpRuntimeDispatchError
}

Processing Ok

Processing an event succeeded Namespace:
api.events.xrplBridge.ProcessingOk
Type:
type ProcessingOk = {
  param0: u64,
  param1: H512
}

Relayer Added

Namespace:
api.events.xrplBridge.RelayerAdded
Type:
type RelayerAdded = {
  param0: SeedPrimitivesSignatureAccountId20
}

Relayer Removed

Namespace:
api.events.xrplBridge.RelayerRemoved
Type:
type RelayerRemoved = {
  param0: SeedPrimitivesSignatureAccountId20
}

Ticket Sequence Threshold Reached

Namespace:
api.events.xrplBridge.TicketSequenceThresholdReached
Type:
type TicketSequenceThresholdReached = {
  param0: u32
}

Transaction Added

Namespace:
api.events.xrplBridge.TransactionAdded
Type:
type TransactionAdded = {
  param0: u64,
  param1: H512
}

Transaction Challenge

Namespace:
api.events.xrplBridge.TransactionChallenge
Type:
type TransactionChallenge = {
  param0: u64,
  param1: H512
}

Withdraw Delayed

A withdrawal was delayed as it was above the min_payment threshold Namespace:
api.events.xrplBridge.WithdrawDelayed
Type:
type WithdrawDelayed = {
  sender: SeedPrimitivesSignatureAccountId20,
  asset_id: u32,
  amount: u128,
  destination: H160,
  delayed_payment_id: u64
}

Withdraw Request

Request to withdraw some XRP amount to XRPL Namespace:
api.events.xrplBridge.WithdrawRequest
Type:
type WithdrawRequest = {
  proof_id: u64,
  sender: SeedPrimitivesSignatureAccountId20,
  asset_id: u32,
  amount: u128,
  destination: H160
}

Xrpl Asset Map Set

A new mapping between asset_id and XRPL currency was set Namespace:
api.events.xrplBridge.xrplAssetMapSet
Type:
type XrplAssetMapSet = {
  asset_id: u32,
  xrpl_currency: PalletXrplBridgeXRPLCurrency
}

Pallet Errors


Asset Not Supported

This asset is not supported by the bridge Namespace:
api.errors.xrplBridge.assetNotSupported

Cannot Process More Transactions At That Block

Cannot process more transactions at that block Namespace:
api.errors.xrplBridge.CannotProcessMoreTransactionsAtThatBlock

Cannot Prune Active Ledger Index

This ledger index is within the submission window and can’t be pruned Namespace:
api.errors.xrplBridge.CannotPruneActiveLedgerIndex

Delay Schedule At Capacity

The scheduled block cannot hold any more delayed payments Namespace:
api.errors.xrplBridge.DelayScheduleAtCapacity

Door Address Not Set

The door address has not been configured Namespace:
api.errors.xrplBridge.DoorAddressNotSet

Invalid Highest Pruned Index

highest_pruned_ledger_index must be less than highest_settled_ledger_index - submission_window_width Namespace:
api.errors.xrplBridge.InvalidHighestPrunedIndex

Invalid Signers

The signers are not known by ethy Namespace:
api.errors.xrplBridge.InvalidSigners

Next Ticket Sequence Params Invalid

The NextTicketSequenceParams is invalid Namespace:
api.errors.xrplBridge.NextTicketSequenceParamsInvalid

Next Ticket Sequence Params Not Set

The NextTicketSequenceParams has not been set Namespace:
api.errors.xrplBridge.NextTicketSequenceParamsNotSet

No Available Payment Ids

The paymentIds have been exhausted Namespace:
api.errors.xrplBridge.NoAvailablePaymentIds

Not Permitted

Namespace:
api.errors.xrplBridge.NotPermitted

No Transaction Details

There is no settledXRPTransactionDetails for this ledger index Namespace:
api.errors.xrplBridge.NoTransactionDetails

Outside Submission Window

Transaction submitted is outside the submission window Namespace:
api.errors.xrplBridge.OutSideSubmissionWindow

Relayer Does Not Exists

Namespace:
api.errors.xrplBridge.RelayerDoesNotExists

Ticket Sequence Params Invalid

The TicketSequenceParams is invalid Namespace:
api.errors.xrplBridge.TicketSequenceParamsInvalid

Too Many Signers

XRPL does not allow more than 8 signers for door address Namespace:
api.errors.xrplBridge.TooManySigners

Invalid Asset Decimals

The asset decimals are too high to bridge to XRPL Namespace:
api.errors.xrplBridge.InvalidAssetDecimals

Invalid Currency Code

The issued amount currency code is invalid Namespace:
api.errors.xrplBridge.InvalidCurrencyCode

Invalid Mantissa Exponent Conversion

Could not convert Balance to Mantissa Exponent Namespace:
api.errors.xrplBridge.InvalidMantissaExponentConversion

Invalid Symbol Mapping

XRPL symbol to TRN asset id mapping is invalid Namespace:
api.errors.xrplBridge.InvalidSymbolMapping

Asset Rounding Too High

The asset rounding due to saturation is too high, reduce the significant digits Namespace:
api.errors.xrplBridge.AssetRoundingTooHigh

Too Many Transactions Per Ledger

Too Many transactions per ledger Namespace:
api.errors.xrplBridge.TooManyTransactionsPerLedger

Tx Replay

Submitted a duplicate transaction hash Namespace:
api.errors.xrplBridge.TxReplay

Withdraw Invalid Amount

Withdraw amount must be non-zero and < = u64 Namespace:
api.errors.xrplBridge.WithdrawInvalidAmount

Constants


Challenge Period

Challenge Period to wait for a challenge before processing the transaction Namespace:
api.consts.xrplBridge.challengePeriod
Type:
type challengePeriod = u32

Delayed Payment Block Limit

Upper limit to the number of blocks we can check per block for delayed payments Namespace:
api.consts.xrplBridge.delayedPaymentBlockLimit
Type:
type delayedPaymentBlockLimit = u32

Max Delayed Payments Per Block

Maximum number of delayed transactions that can be processed in a single block Namespace:
api.consts.xrplBridge.maxDelayedPaymentsPerBlock
Type:
type maxDelayedPaymentsPerBlock = u32

Max Pruned Transactions Per Block

Maximum number of transactions that can be pruned in on_idle Namespace:
api.consts.xrplBridge.maxPrunedTransactionsPerBlock
Type:
type maxPrunedTransactionsPerBlock = u32

Xrp Asset Id

XRP Asset Id set at runtime Namespace:
api.consts.xrplBridge.xrpAssetId
Type:
type xrpAssetId = u32

Native Asset Id

ROOT Asset Id set at runtime Namespace:
api.consts.xrplBridge.nativeAssetId
Type:
type nativeAssetId = u32

Pallet Id

This pallet’s Id, used for deriving a sovereign account ID Namespace:
api.consts.xrplBridge.palletId
Type:
type palletId = u32