mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-05 05:15:48 +00:00
31 lines
814 B
Plaintext
31 lines
814 B
Plaintext
## prepareOrder
|
|
|
|
`prepareOrder(address: string, order: Object, instructions: Object): Promise<Object>`
|
|
|
|
Prepare an order transaction. The prepared transaction must subsequently be [signed](#sign) and [submitted](#submit).
|
|
|
|
### Parameters
|
|
|
|
<%- renderSchema('input/prepare-order.json') %>
|
|
|
|
### Return Value
|
|
|
|
This method returns a promise that resolves with an object with the following structure:
|
|
|
|
<aside class="notice">
|
|
All "prepare*" methods have the same return type.
|
|
</aside>
|
|
|
|
<%- renderSchema('output/prepare.json') %>
|
|
|
|
### Example
|
|
|
|
```javascript
|
|
const address = 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59';
|
|
const order = <%- importFile('test/fixtures/requests/prepare-order.json') %>;
|
|
return api.prepareOrder(address, order)
|
|
.then(prepared => {/* ... */});
|
|
```
|
|
|
|
<%- renderFixture('responses/prepare-order.json') %>
|