mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Use object instead of Object (#936)
This commit is contained in:
@@ -1135,7 +1135,7 @@ return api.getLedgerVersion().then(ledgerVersion => {
|
|||||||
|
|
||||||
## getTransaction
|
## getTransaction
|
||||||
|
|
||||||
`getTransaction(id: string, options: Object): Promise<Object>`
|
`getTransaction(id: string, options: object): Promise<object>`
|
||||||
|
|
||||||
Retrieves a transaction by its [Transaction ID](#transaction-id).
|
Retrieves a transaction by its [Transaction ID](#transaction-id).
|
||||||
|
|
||||||
@@ -1287,7 +1287,7 @@ return api.getTransaction(id).then(transaction => {
|
|||||||
|
|
||||||
## getTransactions
|
## getTransactions
|
||||||
|
|
||||||
`getTransactions(address: string, options: Object): Promise<Array<Object>>`
|
`getTransactions(address: string, options: object): Promise<Array<object>>`
|
||||||
|
|
||||||
Retrieves historical transactions of an account.
|
Retrieves historical transactions of an account.
|
||||||
|
|
||||||
@@ -1519,7 +1519,7 @@ return api.getTransactions(address).then(transaction => {
|
|||||||
|
|
||||||
## getTrustlines
|
## getTrustlines
|
||||||
|
|
||||||
`getTrustlines(address: string, options: Object): Promise<Array<Object>>`
|
`getTrustlines(address: string, options: object): Promise<Array<object>>`
|
||||||
|
|
||||||
Returns trustlines for a specified account.
|
Returns trustlines for a specified account.
|
||||||
|
|
||||||
@@ -1664,7 +1664,7 @@ return api.getTrustlines(address).then(trustlines =>
|
|||||||
|
|
||||||
## getBalances
|
## getBalances
|
||||||
|
|
||||||
`getBalances(address: string, options: Object): Promise<Array<Object>>`
|
`getBalances(address: string, options: object): Promise<Array<object>>`
|
||||||
|
|
||||||
Returns balances for a specified account.
|
Returns balances for a specified account.
|
||||||
|
|
||||||
@@ -1831,7 +1831,7 @@ return api.getBalances(address).then(balances =>
|
|||||||
|
|
||||||
## getBalanceSheet
|
## getBalanceSheet
|
||||||
|
|
||||||
`getBalanceSheet(address: string, options: Object): Promise<Object>`
|
`getBalanceSheet(address: string, options: object): Promise<object>`
|
||||||
|
|
||||||
Returns aggregate balances by currency plus a breakdown of assets and obligations for a specified account.
|
Returns aggregate balances by currency plus a breakdown of assets and obligations for a specified account.
|
||||||
|
|
||||||
@@ -1927,7 +1927,7 @@ return api.getBalanceSheet(address).then(balanceSheet =>
|
|||||||
|
|
||||||
## getPaths
|
## getPaths
|
||||||
|
|
||||||
`getPaths(pathfind: Object): Promise<Array<Object>>`
|
`getPaths(pathfind: object): Promise<Array<object>>`
|
||||||
|
|
||||||
Finds paths to send a payment. Paths are options for how to route a payment.
|
Finds paths to send a payment. Paths are options for how to route a payment.
|
||||||
|
|
||||||
@@ -2049,7 +2049,7 @@ return api.getPaths(pathfind)
|
|||||||
|
|
||||||
## getOrders
|
## getOrders
|
||||||
|
|
||||||
`getOrders(address: string, options: Object): Promise<Array<Object>>`
|
`getOrders(address: string, options: object): Promise<Array<object>>`
|
||||||
|
|
||||||
Returns open orders for the specified account. Open orders are orders that have not yet been fully executed and are still in the order book.
|
Returns open orders for the specified account. Open orders are orders that have not yet been fully executed and are still in the order book.
|
||||||
|
|
||||||
@@ -2430,7 +2430,7 @@ return api.getOrders(address).then(orders =>
|
|||||||
|
|
||||||
## getOrderbook
|
## getOrderbook
|
||||||
|
|
||||||
`getOrderbook(address: string, orderbook: Object, options: Object): Promise<Object>`
|
`getOrderbook(address: string, orderbook: object, options: object): Promise<object>`
|
||||||
|
|
||||||
Returns open orders for the specified account. Open orders are orders that have not yet been fully executed and are still in the order book.
|
Returns open orders for the specified account. Open orders are orders that have not yet been fully executed and are still in the order book.
|
||||||
|
|
||||||
@@ -3534,7 +3534,7 @@ return api.getOrderbook(address, orderbook)
|
|||||||
|
|
||||||
## getSettings
|
## getSettings
|
||||||
|
|
||||||
`getSettings(address: string, options: Object): Promise<Object>`
|
`getSettings(address: string, options: object): Promise<object>`
|
||||||
|
|
||||||
Returns settings for the specified account. Note: For account data that is not modifiable by the user, see [getAccountInfo](#getaccountinfo).
|
Returns settings for the specified account. Note: For account data that is not modifiable by the user, see [getAccountInfo](#getaccountinfo).
|
||||||
|
|
||||||
@@ -3613,7 +3613,7 @@ return api.getSettings(address).then(settings =>
|
|||||||
|
|
||||||
## getAccountInfo
|
## getAccountInfo
|
||||||
|
|
||||||
`getAccountInfo(address: string, options: Object): Promise<Object>`
|
`getAccountInfo(address: string, options: object): Promise<object>`
|
||||||
|
|
||||||
Returns information for the specified account. Note: For account data that is modifiable by the user, see [getSettings](#getsettings).
|
Returns information for the specified account. Note: For account data that is modifiable by the user, see [getSettings](#getsettings).
|
||||||
|
|
||||||
@@ -3986,7 +3986,7 @@ return api.getAccountObjects(address: address).then(objects =>
|
|||||||
|
|
||||||
## getPaymentChannel
|
## getPaymentChannel
|
||||||
|
|
||||||
`getPaymentChannel(id: string): Promise<Object>`
|
`getPaymentChannel(id: string): Promise<object>`
|
||||||
|
|
||||||
Returns specified payment channel.
|
Returns specified payment channel.
|
||||||
|
|
||||||
@@ -4042,7 +4042,7 @@ return api.getPaymentChannel(channelId).then(channel =>
|
|||||||
|
|
||||||
## getLedger
|
## getLedger
|
||||||
|
|
||||||
`getLedger(options: Object): Promise<Object>`
|
`getLedger(options: object): Promise<object>`
|
||||||
|
|
||||||
Returns header information for the specified ledger (or the most recent validated ledger if no ledger is specified). Optionally, all the transactions that were validated in the ledger or the account state information can be returned with the ledger header.
|
Returns header information for the specified ledger (or the most recent validated ledger if no ledger is specified). Optionally, all the transactions that were validated in the ledger or the account state information can be returned with the ledger header.
|
||||||
|
|
||||||
@@ -4105,7 +4105,7 @@ return api.getLedger()
|
|||||||
|
|
||||||
## preparePayment
|
## preparePayment
|
||||||
|
|
||||||
`preparePayment(address: string, payment: Object, instructions: Object): Promise<Object>`
|
`preparePayment(address: string, payment: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a payment transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a payment transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4175,7 +4175,7 @@ return api.preparePayment(address, payment).then(prepared =>
|
|||||||
|
|
||||||
## prepareTrustline
|
## prepareTrustline
|
||||||
|
|
||||||
`prepareTrustline(address: string, trustline: Object, instructions: Object): Promise<Object>`
|
`prepareTrustline(address: string, trustline: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a trustline transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a trustline transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4243,7 +4243,7 @@ return api.prepareTrustline(address, trustline).then(prepared =>
|
|||||||
|
|
||||||
## prepareOrder
|
## prepareOrder
|
||||||
|
|
||||||
`prepareOrder(address: string, order: Object, instructions: Object): Promise<Object>`
|
`prepareOrder(address: string, order: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare an order transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare an order transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4311,7 +4311,7 @@ return api.prepareOrder(address, order)
|
|||||||
|
|
||||||
## prepareOrderCancellation
|
## prepareOrderCancellation
|
||||||
|
|
||||||
`prepareOrderCancellation(address: string, orderCancellation: Object, instructions: Object): Promise<Object>`
|
`prepareOrderCancellation(address: string, orderCancellation: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare an order cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare an order cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4364,7 +4364,7 @@ return api.prepareOrderCancellation(address, orderCancellation)
|
|||||||
|
|
||||||
## prepareSettings
|
## prepareSettings
|
||||||
|
|
||||||
`prepareSettings(address: string, settings: Object, instructions: Object): Promise<Object>`
|
`prepareSettings(address: string, settings: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a settings transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a settings transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4428,7 +4428,7 @@ return api.prepareSettings(address, settings)
|
|||||||
|
|
||||||
## prepareEscrowCreation
|
## prepareEscrowCreation
|
||||||
|
|
||||||
`prepareEscrowCreation(address: string, escrowCreation: Object, instructions: Object): Promise<Object>`
|
`prepareEscrowCreation(address: string, escrowCreation: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare an escrow creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare an escrow creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4492,7 +4492,7 @@ return api.prepareEscrowCreation(address, escrowCreation).then(prepared =>
|
|||||||
|
|
||||||
## prepareEscrowCancellation
|
## prepareEscrowCancellation
|
||||||
|
|
||||||
`prepareEscrowCancellation(address: string, escrowCancellation: Object, instructions: Object): Promise<Object>`
|
`prepareEscrowCancellation(address: string, escrowCancellation: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare an escrow cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare an escrow cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4548,7 +4548,7 @@ return api.prepareEscrowCancellation(address, escrowCancellation).then(prepared
|
|||||||
|
|
||||||
## prepareEscrowExecution
|
## prepareEscrowExecution
|
||||||
|
|
||||||
`prepareEscrowExecution(address: string, escrowExecution: Object, instructions: Object): Promise<Object>`
|
`prepareEscrowExecution(address: string, escrowExecution: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare an escrow execution transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare an escrow execution transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4606,7 +4606,7 @@ return api.prepareEscrowExecution(address, escrowExecution).then(prepared =>
|
|||||||
|
|
||||||
## preparePaymentChannelCreate
|
## preparePaymentChannelCreate
|
||||||
|
|
||||||
`preparePaymentChannelCreate(address: string, paymentChannelCreate: Object, instructions: Object): Promise<Object>`
|
`preparePaymentChannelCreate(address: string, paymentChannelCreate: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a payment channel creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a payment channel creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4664,7 +4664,7 @@ return api.preparePaymentChannelCreate(address, paymentChannelCreate).then(prepa
|
|||||||
|
|
||||||
## preparePaymentChannelClaim
|
## preparePaymentChannelClaim
|
||||||
|
|
||||||
`preparePaymentChannelClaim(address: string, paymentChannelClaim: Object, instructions: Object): Promise<Object>`
|
`preparePaymentChannelClaim(address: string, paymentChannelClaim: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a payment channel claim transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a payment channel claim transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4719,7 +4719,7 @@ return api.preparePaymentChannelClaim(address, paymentChannelClaim).then(prepare
|
|||||||
|
|
||||||
## preparePaymentChannelFund
|
## preparePaymentChannelFund
|
||||||
|
|
||||||
`preparePaymentChannelFund(address: string, paymentChannelFund: Object, instructions: Object): Promise<Object>`
|
`preparePaymentChannelFund(address: string, paymentChannelFund: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a payment channel fund transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a payment channel fund transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4775,7 +4775,7 @@ return api.preparePaymentChannelFund(address, paymentChannelFund).then(prepared
|
|||||||
|
|
||||||
## prepareCheckCreate
|
## prepareCheckCreate
|
||||||
|
|
||||||
`prepareCheckCreate(address: string, checkCreate: Object, instructions: Object): Promise<Object>`
|
`prepareCheckCreate(address: string, checkCreate: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a Check creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a Check creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4834,7 +4834,7 @@ return api.prepareCheckCreate(address, checkCreate).then(prepared =>
|
|||||||
|
|
||||||
## prepareCheckCancel
|
## prepareCheckCancel
|
||||||
|
|
||||||
`prepareCheckCancel(address: string, checkCancel: Object, instructions: Object): Promise<Object>`
|
`prepareCheckCancel(address: string, checkCancel: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a Check cancellation transaction. This cancels an unredeemed Check, removing it from the ledger without sending any money. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a Check cancellation transaction. This cancels an unredeemed Check, removing it from the ledger without sending any money. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4889,7 +4889,7 @@ return api.prepareCheckCancel(address, checkCancel).then(prepared =>
|
|||||||
|
|
||||||
## prepareCheckCash
|
## prepareCheckCash
|
||||||
|
|
||||||
`prepareCheckCash(address: string, checkCash: Object, instructions: Object): Promise<Object>`
|
`prepareCheckCash(address: string, checkCash: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a Check cashing transaction. This redeems a Check to receive up to the amount authorized by the corresponding CheckCreate transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a Check cashing transaction. This redeems a Check to receive up to the amount authorized by the corresponding CheckCreate transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
@@ -4949,8 +4949,8 @@ return api.prepareCheckCash(address, checkCash).then(prepared =>
|
|||||||
## sign
|
## sign
|
||||||
|
|
||||||
```
|
```
|
||||||
sign(txJSON: string, secret: string, options: Object): {signedTransaction: string, id: string}
|
sign(txJSON: string, secret: string, options: object): {signedTransaction: string, id: string}
|
||||||
sign(txJSON: string, keypair: Object, options: Object): {signedTransaction: string, id: string}
|
sign(txJSON: string, keypair: object, options: object): {signedTransaction: string, id: string}
|
||||||
```
|
```
|
||||||
|
|
||||||
Sign a prepared transaction. The signed transaction must subsequently be [submitted](#submit).
|
Sign a prepared transaction. The signed transaction must subsequently be [submitted](#submit).
|
||||||
@@ -5034,7 +5034,7 @@ return api.combine(signedTransactions);
|
|||||||
|
|
||||||
## submit
|
## submit
|
||||||
|
|
||||||
`submit(signedTransaction: string): Promise<Object>`
|
`submit(signedTransaction: string): Promise<object>`
|
||||||
|
|
||||||
Submits a signed transaction. The transaction is not guaranteed to succeed; it must be verified with [getTransaction](#gettransaction).
|
Submits a signed transaction. The transaction is not guaranteed to succeed; it must be verified with [getTransaction](#gettransaction).
|
||||||
|
|
||||||
@@ -5270,7 +5270,7 @@ true
|
|||||||
|
|
||||||
## computeLedgerHash
|
## computeLedgerHash
|
||||||
|
|
||||||
`computeLedgerHash(ledger: Object): string`
|
`computeLedgerHash(ledger: object): string`
|
||||||
|
|
||||||
Compute the hash of a ledger.
|
Compute the hash of a ledger.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## computeLedgerHash
|
## computeLedgerHash
|
||||||
|
|
||||||
`computeLedgerHash(ledger: Object): string`
|
`computeLedgerHash(ledger: object): string`
|
||||||
|
|
||||||
Compute the hash of a ledger.
|
Compute the hash of a ledger.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## getAccountInfo
|
## getAccountInfo
|
||||||
|
|
||||||
`getAccountInfo(address: string, options: Object): Promise<Object>`
|
`getAccountInfo(address: string, options: object): Promise<object>`
|
||||||
|
|
||||||
Returns information for the specified account. Note: For account data that is modifiable by the user, see [getSettings](#getsettings).
|
Returns information for the specified account. Note: For account data that is modifiable by the user, see [getSettings](#getsettings).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## getBalanceSheet
|
## getBalanceSheet
|
||||||
|
|
||||||
`getBalanceSheet(address: string, options: Object): Promise<Object>`
|
`getBalanceSheet(address: string, options: object): Promise<object>`
|
||||||
|
|
||||||
Returns aggregate balances by currency plus a breakdown of assets and obligations for a specified account.
|
Returns aggregate balances by currency plus a breakdown of assets and obligations for a specified account.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## getBalances
|
## getBalances
|
||||||
|
|
||||||
`getBalances(address: string, options: Object): Promise<Array<Object>>`
|
`getBalances(address: string, options: object): Promise<Array<object>>`
|
||||||
|
|
||||||
Returns balances for a specified account.
|
Returns balances for a specified account.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## getLedger
|
## getLedger
|
||||||
|
|
||||||
`getLedger(options: Object): Promise<Object>`
|
`getLedger(options: object): Promise<object>`
|
||||||
|
|
||||||
Returns header information for the specified ledger (or the most recent validated ledger if no ledger is specified). Optionally, all the transactions that were validated in the ledger or the account state information can be returned with the ledger header.
|
Returns header information for the specified ledger (or the most recent validated ledger if no ledger is specified). Optionally, all the transactions that were validated in the ledger or the account state information can be returned with the ledger header.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## getOrderbook
|
## getOrderbook
|
||||||
|
|
||||||
`getOrderbook(address: string, orderbook: Object, options: Object): Promise<Object>`
|
`getOrderbook(address: string, orderbook: object, options: object): Promise<object>`
|
||||||
|
|
||||||
Returns open orders for the specified account. Open orders are orders that have not yet been fully executed and are still in the order book.
|
Returns open orders for the specified account. Open orders are orders that have not yet been fully executed and are still in the order book.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## getOrders
|
## getOrders
|
||||||
|
|
||||||
`getOrders(address: string, options: Object): Promise<Array<Object>>`
|
`getOrders(address: string, options: object): Promise<Array<object>>`
|
||||||
|
|
||||||
Returns open orders for the specified account. Open orders are orders that have not yet been fully executed and are still in the order book.
|
Returns open orders for the specified account. Open orders are orders that have not yet been fully executed and are still in the order book.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## getPaths
|
## getPaths
|
||||||
|
|
||||||
`getPaths(pathfind: Object): Promise<Array<Object>>`
|
`getPaths(pathfind: object): Promise<Array<object>>`
|
||||||
|
|
||||||
Finds paths to send a payment. Paths are options for how to route a payment.
|
Finds paths to send a payment. Paths are options for how to route a payment.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## getPaymentChannel
|
## getPaymentChannel
|
||||||
|
|
||||||
`getPaymentChannel(id: string): Promise<Object>`
|
`getPaymentChannel(id: string): Promise<object>`
|
||||||
|
|
||||||
Returns specified payment channel.
|
Returns specified payment channel.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## getSettings
|
## getSettings
|
||||||
|
|
||||||
`getSettings(address: string, options: Object): Promise<Object>`
|
`getSettings(address: string, options: object): Promise<object>`
|
||||||
|
|
||||||
Returns settings for the specified account. Note: For account data that is not modifiable by the user, see [getAccountInfo](#getaccountinfo).
|
Returns settings for the specified account. Note: For account data that is not modifiable by the user, see [getAccountInfo](#getaccountinfo).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## getTransaction
|
## getTransaction
|
||||||
|
|
||||||
`getTransaction(id: string, options: Object): Promise<Object>`
|
`getTransaction(id: string, options: object): Promise<object>`
|
||||||
|
|
||||||
Retrieves a transaction by its [Transaction ID](#transaction-id).
|
Retrieves a transaction by its [Transaction ID](#transaction-id).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## getTransactions
|
## getTransactions
|
||||||
|
|
||||||
`getTransactions(address: string, options: Object): Promise<Array<Object>>`
|
`getTransactions(address: string, options: object): Promise<Array<object>>`
|
||||||
|
|
||||||
Retrieves historical transactions of an account.
|
Retrieves historical transactions of an account.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## getTrustlines
|
## getTrustlines
|
||||||
|
|
||||||
`getTrustlines(address: string, options: Object): Promise<Array<Object>>`
|
`getTrustlines(address: string, options: object): Promise<Array<object>>`
|
||||||
|
|
||||||
Returns trustlines for a specified account.
|
Returns trustlines for a specified account.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## prepareCheckCancel
|
## prepareCheckCancel
|
||||||
|
|
||||||
`prepareCheckCancel(address: string, checkCancel: Object, instructions: Object): Promise<Object>`
|
`prepareCheckCancel(address: string, checkCancel: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a Check cancellation transaction. This cancels an unredeemed Check, removing it from the ledger without sending any money. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a Check cancellation transaction. This cancels an unredeemed Check, removing it from the ledger without sending any money. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## prepareCheckCash
|
## prepareCheckCash
|
||||||
|
|
||||||
`prepareCheckCash(address: string, checkCash: Object, instructions: Object): Promise<Object>`
|
`prepareCheckCash(address: string, checkCash: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a Check cashing transaction. This redeems a Check to receive up to the amount authorized by the corresponding CheckCreate transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a Check cashing transaction. This redeems a Check to receive up to the amount authorized by the corresponding CheckCreate transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## prepareCheckCreate
|
## prepareCheckCreate
|
||||||
|
|
||||||
`prepareCheckCreate(address: string, checkCreate: Object, instructions: Object): Promise<Object>`
|
`prepareCheckCreate(address: string, checkCreate: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a Check creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a Check creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## prepareEscrowCancellation
|
## prepareEscrowCancellation
|
||||||
|
|
||||||
`prepareEscrowCancellation(address: string, escrowCancellation: Object, instructions: Object): Promise<Object>`
|
`prepareEscrowCancellation(address: string, escrowCancellation: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare an escrow cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare an escrow cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## prepareEscrowCreation
|
## prepareEscrowCreation
|
||||||
|
|
||||||
`prepareEscrowCreation(address: string, escrowCreation: Object, instructions: Object): Promise<Object>`
|
`prepareEscrowCreation(address: string, escrowCreation: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare an escrow creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare an escrow creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## prepareEscrowExecution
|
## prepareEscrowExecution
|
||||||
|
|
||||||
`prepareEscrowExecution(address: string, escrowExecution: Object, instructions: Object): Promise<Object>`
|
`prepareEscrowExecution(address: string, escrowExecution: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare an escrow execution transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare an escrow execution transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## prepareOrder
|
## prepareOrder
|
||||||
|
|
||||||
`prepareOrder(address: string, order: Object, instructions: Object): Promise<Object>`
|
`prepareOrder(address: string, order: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare an order transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare an order transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## prepareOrderCancellation
|
## prepareOrderCancellation
|
||||||
|
|
||||||
`prepareOrderCancellation(address: string, orderCancellation: Object, instructions: Object): Promise<Object>`
|
`prepareOrderCancellation(address: string, orderCancellation: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare an order cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare an order cancellation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## preparePayment
|
## preparePayment
|
||||||
|
|
||||||
`preparePayment(address: string, payment: Object, instructions: Object): Promise<Object>`
|
`preparePayment(address: string, payment: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a payment transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a payment transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## preparePaymentChannelClaim
|
## preparePaymentChannelClaim
|
||||||
|
|
||||||
`preparePaymentChannelClaim(address: string, paymentChannelClaim: Object, instructions: Object): Promise<Object>`
|
`preparePaymentChannelClaim(address: string, paymentChannelClaim: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a payment channel claim transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a payment channel claim transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## preparePaymentChannelCreate
|
## preparePaymentChannelCreate
|
||||||
|
|
||||||
`preparePaymentChannelCreate(address: string, paymentChannelCreate: Object, instructions: Object): Promise<Object>`
|
`preparePaymentChannelCreate(address: string, paymentChannelCreate: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a payment channel creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a payment channel creation transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## preparePaymentChannelFund
|
## preparePaymentChannelFund
|
||||||
|
|
||||||
`preparePaymentChannelFund(address: string, paymentChannelFund: Object, instructions: Object): Promise<Object>`
|
`preparePaymentChannelFund(address: string, paymentChannelFund: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a payment channel fund transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a payment channel fund transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## prepareSettings
|
## prepareSettings
|
||||||
|
|
||||||
`prepareSettings(address: string, settings: Object, instructions: Object): Promise<Object>`
|
`prepareSettings(address: string, settings: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a settings transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a settings transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## prepareTrustline
|
## prepareTrustline
|
||||||
|
|
||||||
`prepareTrustline(address: string, trustline: Object, instructions: Object): Promise<Object>`
|
`prepareTrustline(address: string, trustline: object, instructions: object): Promise<object>`
|
||||||
|
|
||||||
Prepare a trustline transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
Prepare a trustline transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
## sign
|
## sign
|
||||||
|
|
||||||
```
|
```
|
||||||
sign(txJSON: string, secret: string, options: Object): {signedTransaction: string, id: string}
|
sign(txJSON: string, secret: string, options: object): {signedTransaction: string, id: string}
|
||||||
sign(txJSON: string, keypair: Object, options: Object): {signedTransaction: string, id: string}
|
sign(txJSON: string, keypair: object, options: object): {signedTransaction: string, id: string}
|
||||||
```
|
```
|
||||||
|
|
||||||
Sign a prepared transaction. The signed transaction must subsequently be [submitted](#submit).
|
Sign a prepared transaction. The signed transaction must subsequently be [submitted](#submit).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## submit
|
## submit
|
||||||
|
|
||||||
`submit(signedTransaction: string): Promise<Object>`
|
`submit(signedTransaction: string): Promise<object>`
|
||||||
|
|
||||||
Submits a signed transaction. The transaction is not guaranteed to succeed; it must be verified with [getTransaction](#gettransaction).
|
Submits a signed transaction. The transaction is not guaranteed to succeed; it must be verified with [getTransaction](#gettransaction).
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ function setPrototypeOf(object, prototype) {
|
|||||||
object.__proto__ = prototype
|
object.__proto__ = prototype
|
||||||
}
|
}
|
||||||
|
|
||||||
function getConstructorName(object: Object): string {
|
function getConstructorName(object: object): string {
|
||||||
// hack for internet explorer
|
// hack for internet explorer
|
||||||
if (!object.constructor.name) {
|
if (!object.constructor.name) {
|
||||||
return object.constructor.toString().match(/^function\s+([^(]*)/)![1]
|
return object.constructor.toString().match(/^function\s+([^(]*)/)![1]
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export type GetServerInfoResponse = {
|
|||||||
hostID: string,
|
hostID: string,
|
||||||
ioLatencyMs: number,
|
ioLatencyMs: number,
|
||||||
load?: {
|
load?: {
|
||||||
jobTypes: Array<Object>,
|
jobTypes: Array<object>,
|
||||||
threads: number
|
threads: number
|
||||||
},
|
},
|
||||||
lastClose: {
|
lastClose: {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as assert from 'assert'
|
import * as assert from 'assert'
|
||||||
|
|
||||||
function parseOrderCancellation(tx: any): Object {
|
function parseOrderCancellation(tx: any): object {
|
||||||
assert(tx.TransactionType === 'OfferCancel')
|
assert(tx.TransactionType === 'OfferCancel')
|
||||||
return {
|
return {
|
||||||
orderSequence: tx.OfferSequence
|
orderSequence: tx.OfferSequence
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import * as assert from 'assert'
|
|||||||
import {parseMemos} from './utils'
|
import {parseMemos} from './utils'
|
||||||
import {removeUndefined} from '../../common'
|
import {removeUndefined} from '../../common'
|
||||||
|
|
||||||
function parseEscrowCancellation(tx: any): Object {
|
function parseEscrowCancellation(tx: any): object {
|
||||||
assert(tx.TransactionType === 'EscrowCancel')
|
assert(tx.TransactionType === 'EscrowCancel')
|
||||||
|
|
||||||
return removeUndefined({
|
return removeUndefined({
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import parseAmount from './amount'
|
|||||||
import {parseTimestamp, parseMemos} from './utils'
|
import {parseTimestamp, parseMemos} from './utils'
|
||||||
import {removeUndefined} from '../../common'
|
import {removeUndefined} from '../../common'
|
||||||
|
|
||||||
function parseEscrowCreation(tx: any): Object {
|
function parseEscrowCreation(tx: any): object {
|
||||||
assert(tx.TransactionType === 'EscrowCreate')
|
assert(tx.TransactionType === 'EscrowCreate')
|
||||||
|
|
||||||
return removeUndefined({
|
return removeUndefined({
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import * as assert from 'assert'
|
|||||||
import {parseMemos} from './utils'
|
import {parseMemos} from './utils'
|
||||||
import {removeUndefined} from '../../common'
|
import {removeUndefined} from '../../common'
|
||||||
|
|
||||||
function parseEscrowExecution(tx: any): Object {
|
function parseEscrowExecution(tx: any): object {
|
||||||
assert(tx.TransactionType === 'EscrowFinish')
|
assert(tx.TransactionType === 'EscrowFinish')
|
||||||
|
|
||||||
return removeUndefined({
|
return removeUndefined({
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ function parseField(info, value) {
|
|||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseFields(data: any): Object {
|
function parseFields(data: any): object {
|
||||||
const settings: any = {}
|
const settings: any = {}
|
||||||
for (const fieldName in AccountFields) {
|
for (const fieldName in AccountFields) {
|
||||||
const fieldValue = data[fieldName]
|
const fieldValue = data[fieldName]
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export type FormattedLedger = {
|
|||||||
parentCloseTime: string,
|
parentCloseTime: string,
|
||||||
totalDrops: string,
|
totalDrops: string,
|
||||||
transactionHash: string,
|
transactionHash: string,
|
||||||
transactions?: Array<Object>,
|
transactions?: Array<object>,
|
||||||
transactionHashes?: Array<string>,
|
transactionHashes?: Array<string>,
|
||||||
rawState?: string,
|
rawState?: string,
|
||||||
stateHashes?: Array<string>
|
stateHashes?: Array<string>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ function removeAnyCounterpartyEncoding(address: string, amount: Amount) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createAdjustment(
|
function createAdjustment(
|
||||||
address: string, adjustmentWithoutAddress: Object): any {
|
address: string, adjustmentWithoutAddress: object): any {
|
||||||
const amountKey = _.keys(adjustmentWithoutAddress)[0]
|
const amountKey = _.keys(adjustmentWithoutAddress)[0]
|
||||||
const amount = adjustmentWithoutAddress[amountKey]
|
const amount = adjustmentWithoutAddress[amountKey]
|
||||||
return _.set({address: address}, amountKey,
|
return _.set({address: address}, amountKey,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {removeUndefined, txFlags} from '../../common'
|
|||||||
import parseAmount from './amount'
|
import parseAmount from './amount'
|
||||||
const claimFlags = txFlags.PaymentChannelClaim
|
const claimFlags = txFlags.PaymentChannelClaim
|
||||||
|
|
||||||
function parsePaymentChannelClaim(tx: any): Object {
|
function parsePaymentChannelClaim(tx: any): object {
|
||||||
assert(tx.TransactionType === 'PaymentChannelClaim')
|
assert(tx.TransactionType === 'PaymentChannelClaim')
|
||||||
|
|
||||||
return removeUndefined({
|
return removeUndefined({
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {parseTimestamp} from './utils'
|
|||||||
import {removeUndefined} from '../../common'
|
import {removeUndefined} from '../../common'
|
||||||
import parseAmount from './amount'
|
import parseAmount from './amount'
|
||||||
|
|
||||||
function parsePaymentChannelCreate(tx: any): Object {
|
function parsePaymentChannelCreate(tx: any): object {
|
||||||
assert(tx.TransactionType === 'PaymentChannelCreate')
|
assert(tx.TransactionType === 'PaymentChannelCreate')
|
||||||
|
|
||||||
return removeUndefined({
|
return removeUndefined({
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {parseTimestamp} from './utils'
|
|||||||
import {removeUndefined} from '../../common'
|
import {removeUndefined} from '../../common'
|
||||||
import parseAmount from './amount'
|
import parseAmount from './amount'
|
||||||
|
|
||||||
function parsePaymentChannelFund(tx: any): Object {
|
function parsePaymentChannelFund(tx: any): object {
|
||||||
assert(tx.TransactionType === 'PaymentChannelFund')
|
assert(tx.TransactionType === 'PaymentChannelFund')
|
||||||
|
|
||||||
return removeUndefined({
|
return removeUndefined({
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ function removeGenericCounterparty(amount, address) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Payment specification
|
// Payment specification
|
||||||
function parsePayment(tx: any): Object {
|
function parsePayment(tx: any): object {
|
||||||
assert(tx.TransactionType === 'Payment')
|
assert(tx.TransactionType === 'Payment')
|
||||||
|
|
||||||
const source = {
|
const source = {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ function parseFlag(flagsValue, trueValue, falseValue) {
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseTrustline(tx: any): Object {
|
function parseTrustline(tx: any): object {
|
||||||
assert(tx.TransactionType === 'TrustSet')
|
assert(tx.TransactionType === 'TrustSet')
|
||||||
|
|
||||||
return removeUndefined({
|
return removeUndefined({
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ function isPendingLedgerVersion(connection: Connection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
function ensureLedgerVersion(options: any
|
function ensureLedgerVersion(options: any
|
||||||
): Promise<Object> {
|
): Promise<object> {
|
||||||
if (Boolean(options) && options.ledgerVersion !== undefined &&
|
if (Boolean(options) && options.ledgerVersion !== undefined &&
|
||||||
options.ledgerVersion !== null
|
options.ledgerVersion !== null
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ import keypairs = require('ripple-keypairs')
|
|||||||
import * as common from '../common'
|
import * as common from '../common'
|
||||||
const {errors, validate} = common
|
const {errors, validate} = common
|
||||||
|
|
||||||
function generateAddress(options?: Object): Object {
|
function generateAddress(options?: object): object {
|
||||||
const secret = keypairs.generateSeed(options)
|
const secret = keypairs.generateSeed(options)
|
||||||
const keypair = keypairs.deriveKeypair(secret)
|
const keypair = keypairs.deriveKeypair(secret)
|
||||||
const address = keypairs.deriveAddress(keypair.publicKey)
|
const address = keypairs.deriveAddress(keypair.publicKey)
|
||||||
return {secret, address}
|
return {secret, address}
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateAddressAPI(options?: Object): Object {
|
function generateAddressAPI(options?: object): object {
|
||||||
validate.generateAddress({options})
|
validate.generateAddress({options})
|
||||||
try {
|
try {
|
||||||
return generateAddress(options)
|
return generateAddress(options)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ function disconnect(): Promise<void> {
|
|||||||
return this.connection.disconnect()
|
return this.connection.disconnect()
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatLedgerClose(ledgerClose: any): Object {
|
function formatLedgerClose(ledgerClose: any): object {
|
||||||
return {
|
return {
|
||||||
baseFeeXRP: common.dropsToXrp(ledgerClose.fee_base),
|
baseFeeXRP: common.dropsToXrp(ledgerClose.fee_base),
|
||||||
ledgerHash: ledgerClose.ledger_hash,
|
ledgerHash: ledgerClose.ledger_hash,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ function compareSigners(a, b) {
|
|||||||
.comparedTo(addressToBigNumber(b.Signer.Account))
|
.comparedTo(addressToBigNumber(b.Signer.Account))
|
||||||
}
|
}
|
||||||
|
|
||||||
function combine(signedTransactions: Array<string>): Object {
|
function combine(signedTransactions: Array<string>): object {
|
||||||
validate.combine({signedTransactions})
|
validate.combine({signedTransactions})
|
||||||
|
|
||||||
// TODO: signedTransactions is an array of strings in the documentation, but
|
// TODO: signedTransactions is an array of strings in the documentation, but
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export type EscrowCancellation = {
|
|||||||
|
|
||||||
function createEscrowCancellationTransaction(account: string,
|
function createEscrowCancellationTransaction(account: string,
|
||||||
payment: EscrowCancellation
|
payment: EscrowCancellation
|
||||||
): Object {
|
): object {
|
||||||
const txJSON: any = {
|
const txJSON: any = {
|
||||||
TransactionType: 'EscrowCancel',
|
TransactionType: 'EscrowCancel',
|
||||||
Account: account,
|
Account: account,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export type EscrowCreation = {
|
|||||||
|
|
||||||
function createEscrowCreationTransaction(account: string,
|
function createEscrowCreationTransaction(account: string,
|
||||||
payment: EscrowCreation
|
payment: EscrowCreation
|
||||||
): Object {
|
): object {
|
||||||
const txJSON: any = {
|
const txJSON: any = {
|
||||||
TransactionType: 'EscrowCreate',
|
TransactionType: 'EscrowCreate',
|
||||||
Account: account,
|
Account: account,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export type EscrowExecution = {
|
|||||||
|
|
||||||
function createEscrowExecutionTransaction(account: string,
|
function createEscrowExecutionTransaction(account: string,
|
||||||
payment: EscrowExecution
|
payment: EscrowExecution
|
||||||
): Object {
|
): object {
|
||||||
const txJSON: any = {
|
const txJSON: any = {
|
||||||
TransactionType: 'EscrowFinish',
|
TransactionType: 'EscrowFinish',
|
||||||
Account: account,
|
Account: account,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {Instructions, Prepare} from './types'
|
|||||||
|
|
||||||
function createOrderCancellationTransaction(account: string,
|
function createOrderCancellationTransaction(account: string,
|
||||||
orderCancellation: any
|
orderCancellation: any
|
||||||
): Object {
|
): object {
|
||||||
const txJSON: any = {
|
const txJSON: any = {
|
||||||
TransactionType: 'OfferCancel',
|
TransactionType: 'OfferCancel',
|
||||||
Account: account,
|
Account: account,
|
||||||
@@ -17,7 +17,7 @@ function createOrderCancellationTransaction(account: string,
|
|||||||
return txJSON
|
return txJSON
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepareOrderCancellation(address: string, orderCancellation: Object,
|
function prepareOrderCancellation(address: string, orderCancellation: object,
|
||||||
instructions: Instructions = {}
|
instructions: Instructions = {}
|
||||||
): Promise<Prepare> {
|
): Promise<Prepare> {
|
||||||
validate.prepareOrderCancellation({address, orderCancellation, instructions})
|
validate.prepareOrderCancellation({address, orderCancellation, instructions})
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export type PaymentChannelClaim = {
|
|||||||
|
|
||||||
function createPaymentChannelClaimTransaction(account: string,
|
function createPaymentChannelClaimTransaction(account: string,
|
||||||
claim: PaymentChannelClaim
|
claim: PaymentChannelClaim
|
||||||
): Object {
|
): object {
|
||||||
const txJSON: any = {
|
const txJSON: any = {
|
||||||
Account: account,
|
Account: account,
|
||||||
TransactionType: 'PaymentChannelClaim',
|
TransactionType: 'PaymentChannelClaim',
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export type PaymentChannelCreate = {
|
|||||||
|
|
||||||
function createPaymentChannelCreateTransaction(account: string,
|
function createPaymentChannelCreateTransaction(account: string,
|
||||||
paymentChannel: PaymentChannelCreate
|
paymentChannel: PaymentChannelCreate
|
||||||
): Object {
|
): object {
|
||||||
const txJSON: any = {
|
const txJSON: any = {
|
||||||
Account: account,
|
Account: account,
|
||||||
TransactionType: 'PaymentChannelCreate',
|
TransactionType: 'PaymentChannelCreate',
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export type PaymentChannelFund = {
|
|||||||
|
|
||||||
function createPaymentChannelFundTransaction(account: string,
|
function createPaymentChannelFundTransaction(account: string,
|
||||||
fund: PaymentChannelFund
|
fund: PaymentChannelFund
|
||||||
): Object {
|
): object {
|
||||||
const txJSON: any = {
|
const txJSON: any = {
|
||||||
Account: account,
|
Account: account,
|
||||||
TransactionType: 'PaymentChannelFund',
|
TransactionType: 'PaymentChannelFund',
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ function createMaximalAmount(amount: Amount): Amount {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createPaymentTransaction(address: string, paymentArgument: Payment
|
function createPaymentTransaction(address: string, paymentArgument: Payment
|
||||||
): Object {
|
): object {
|
||||||
const payment = _.cloneDeep(paymentArgument)
|
const payment = _.cloneDeep(paymentArgument)
|
||||||
applyAnyCounterpartyEncoding(payment)
|
applyAnyCounterpartyEncoding(payment)
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ function setTransactionFlags(txJSON: any, values: FormattedSettings) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTransactionFields(txJSON: Object, input: FormattedSettings) {
|
function setTransactionFields(txJSON: object, input: FormattedSettings) {
|
||||||
const fieldSchema = AccountFields
|
const fieldSchema = AccountFields
|
||||||
for (const fieldName in fieldSchema) {
|
for (const fieldName in fieldSchema) {
|
||||||
const field = fieldSchema[fieldName]
|
const field = fieldSchema[fieldName]
|
||||||
@@ -67,7 +67,7 @@ function convertTransferRate(transferRate: number | string): number | string {
|
|||||||
return (new BigNumber(transferRate)).shift(9).toNumber()
|
return (new BigNumber(transferRate)).shift(9).toNumber()
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatSignerEntry(signer: WeightedSigner): Object {
|
function formatSignerEntry(signer: WeightedSigner): object {
|
||||||
return {
|
return {
|
||||||
SignerEntry: {
|
SignerEntry: {
|
||||||
Account: signer.address,
|
Account: signer.address,
|
||||||
@@ -114,7 +114,7 @@ function createSettingsTransactionWithoutMemos(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createSettingsTransaction(account: string, settings: FormattedSettings
|
function createSettingsTransaction(account: string, settings: FormattedSettings
|
||||||
): Object {
|
): object {
|
||||||
const txJSON = createSettingsTransactionWithoutMemos(account, settings)
|
const txJSON = createSettingsTransactionWithoutMemos(account, settings)
|
||||||
if (settings.memos !== undefined) {
|
if (settings.memos !== undefined) {
|
||||||
txJSON.Memos = _.map(settings.memos, utils.convertMemo)
|
txJSON.Memos = _.map(settings.memos, utils.convertMemo)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {xrpToDrops} from '../common'
|
|||||||
import {RippleAPI} from '../api'
|
import {RippleAPI} from '../api'
|
||||||
const validate = utils.common.validate
|
const validate = utils.common.validate
|
||||||
|
|
||||||
function computeSignature(tx: Object, privateKey: string, signAs?: string) {
|
function computeSignature(tx: object, privateKey: string, signAs?: string) {
|
||||||
const signingData = signAs
|
const signingData = signAs
|
||||||
? binary.encodeForMultisigning(tx, signAs)
|
? binary.encodeForMultisigning(tx, signAs)
|
||||||
: binary.encodeForSigning(tx)
|
: binary.encodeForSigning(tx)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ function convertQuality(quality) {
|
|||||||
|
|
||||||
function createTrustlineTransaction(account: string,
|
function createTrustlineTransaction(account: string,
|
||||||
trustline: FormattedTrustlineSpecification
|
trustline: FormattedTrustlineSpecification
|
||||||
): Object {
|
): object {
|
||||||
const limit = {
|
const limit = {
|
||||||
currency: trustline.currency,
|
currency: trustline.currency,
|
||||||
issuer: trustline.counterparty,
|
issuer: trustline.counterparty,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export type Submit = {
|
|||||||
engineResultCode: number,
|
engineResultCode: number,
|
||||||
engineResultMessage?: string,
|
engineResultMessage?: string,
|
||||||
txBlob?: string,
|
txBlob?: string,
|
||||||
txJson?: Object
|
txJson?: object
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OfferCreateTransaction {
|
export interface OfferCreateTransaction {
|
||||||
@@ -72,7 +72,7 @@ export type Outcome = {
|
|||||||
value: string
|
value: string
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
orderbookChanges: Object,
|
orderbookChanges: object,
|
||||||
timestamp?: string
|
timestamp?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ function prepareTransaction(txJSON: any, api: RippleAPI,
|
|||||||
const account = txJSON.Account
|
const account = txJSON.Account
|
||||||
setCanonicalFlag(txJSON)
|
setCanonicalFlag(txJSON)
|
||||||
|
|
||||||
function prepareMaxLedgerVersion(): Promise<Object> {
|
function prepareMaxLedgerVersion(): Promise<object> {
|
||||||
if (instructions.maxLedgerVersion !== undefined) {
|
if (instructions.maxLedgerVersion !== undefined) {
|
||||||
if (instructions.maxLedgerVersion !== null) {
|
if (instructions.maxLedgerVersion !== null) {
|
||||||
txJSON.LastLedgerSequence = instructions.maxLedgerVersion
|
txJSON.LastLedgerSequence = instructions.maxLedgerVersion
|
||||||
@@ -60,7 +60,7 @@ function prepareTransaction(txJSON: any, api: RippleAPI,
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepareFee(): Promise<Object> {
|
function prepareFee(): Promise<object> {
|
||||||
const multiplier = instructions.signersCount === undefined ? 1 :
|
const multiplier = instructions.signersCount === undefined ? 1 :
|
||||||
instructions.signersCount + 1
|
instructions.signersCount + 1
|
||||||
if (instructions.fee !== undefined) {
|
if (instructions.fee !== undefined) {
|
||||||
@@ -94,7 +94,7 @@ function prepareTransaction(txJSON: any, api: RippleAPI,
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function prepareSequence(): Promise<Object> {
|
async function prepareSequence(): Promise<object> {
|
||||||
if (instructions.sequence !== undefined) {
|
if (instructions.sequence !== undefined) {
|
||||||
txJSON.Sequence = instructions.sequence
|
txJSON.Sequence = instructions.sequence
|
||||||
return Promise.resolve(txJSON)
|
return Promise.resolve(txJSON)
|
||||||
|
|||||||
Reference in New Issue
Block a user