@quantnetwork/overledger-dlt-ripple v1.0.0-beta.5
@quantnetwork/overledger-dlt-ripple
Overledger SDK module for interaction with the Ripple distributed ledger technology.
Installation
Install using npm:
npm install @quantnetwork/overledger-dlt-rippleOr, if you prefer using yarn:
yarn add @quantnetwork/overledger-dlt-rippleAPI Reference
Modules
Typedefs
overledger-dlt-ripple
static
inner
overledger-dlt-ripple.default
Development package for Ripple (XRP Ledger).
overledger-dlt-ripple~Ripple
new Ripple(sdk)
| Param | Type |
|---|---|
| sdk | any |
ripple.name
Name of the DLT
ripple.symbol
Symbol of the DLT
ripple.createAccount()
Create an XRP account
Returns: Account - (privateKey, address)
ripple.setAccount(accountInfo)
| Param | Type | Description |
|---|---|---|
| accountInfo | Account | The standardised account information |
Set an account for signing for a specific DLT
ripple.buildTransaction(thisTransaction)
| Param | Type | Description |
|---|---|---|
| thisTransaction | TransactionXRPRequest | details on the information to include in this transaction for the XRP distributed ledger |
Takes the Overledger definition of a transaction and converts it into a specific XRP transaction
Returns: Transaction - the XRP transaction
ripple._transactionValidation(thisTransaction)
| Param | Description |
|---|---|
| thisTransaction | The transaction request |
validates an OVL transactionRequest according to XRP specific rules
ripple._sign(thisTransaction)
| Param | Type | Description |
|---|---|---|
| thisTransaction | TransactionRequest | an instantiated overledger definition of an XRP transaction |
Takes in an overledger definition of a transaction for XRP, converts it into a form that the XRP distributed ledger will understand, and then signs the transaction
ripple._buildSmartContractQuery(dltAddress, contractQueryDetails)
| Param | Type | Description |
|---|---|---|
| dltAddress | string | the user's XRP address |
| contractQueryDetails | Object | the definition of the smart contract function the user wants to interact with, including information on what parameters to use in the function call. |
Allows a user to build a smart contract query for the XRP distributed ledger (currently not supported for XRP)
Returns: Object - success indicates if this query building was correct, if yes then it will be in the response field of the object
ripple._smartContractQueryValidation(contractQueryDetails)
| Param | Description |
|---|---|
| contractQueryDetails | the query details |
validates an OVL smart contract query according to XRP specific rules
Returns: Object - success indicates if this query building was correct, if yes then it will be in the response field of the object
ripple.computeFeePrice(initialFee, transactionType, fulfillment)
| Param | Description |
|---|---|
| initialFee | |
| transactionType | what type of transaction is this |
| fulfillment | is there an escrow fulfillment to be added to the transaction |
ripple.computeEscrowConditionFulfillment(hashAlgorithmInput)
| Param |
|---|
| hashAlgorithmInput |
Takes a string hash algorith input and generates both the bytecode version of the condition to be placed on the ledger and also the bytecode version of its pre-image fulfillment
ripple.isValidISODateFormat(dateTime)
| Param | Description |
|---|---|
| dateTime | the date to check |
Checking the given parameter passes the ISODate format
ripple.isValidDate(dateTimeCreate, dateTimeCancel)
| Param | Description |
|---|---|
| dateTimeCreate | the escrow creation time |
| dateTimeCancel | the escrow cancelation time |
Checking the given parameter passes the ISODate format
ripple.isValidRippleAddress(address)
| Param | Description |
|---|---|
| address | the address to check |
AtomicSwapXRPParams
Properties
| Name | Type | Description |
|---|---|---|
| allowCancelAfter | Object | from when can the escrow be executed? In ISOString format |
| allowExecuteAfter | Object | from when can the escrow be cancelled? In ISOString format |
| hashAlgorithmInputString | Object | this is the sha256 hash algorithm input as a string. It will NOT be placed on the ledger when creating a transaction. |
| hashAlgorithmCondition | Object | this is if there has been a hash string placed onto another chain and now we want to add it to this chain. |
| escrowSequence | string | The sequence number of the escrow you are executing or cancelling |
| hashAlgorithmFulfillment | string | This is the value to unlock the escrow (the input to the sha256 hash algorithm) |
| owner | string | The address that funded the escrow |
An object used to describe the atomic swap params required for XRP
TrustlineXRPRequest
Properties
| Name | Type | Description |
|---|---|---|
| subType | Object | a redefinition of the TransactionRequest object, to add more XRP specific information |
| feePrice | string | the fee to pay for this transaction to enter the XRP ledger. It is denoted in drops where the current minimum allowed is 12. |
| maxLedgerVersion | string | The maximum ledger version the transaction can be included in |
A generic object used to describe an Overledger transaction request for the XRP Ledger. Note that this object inherits many parameters from TransactionAccountsRequest.
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago