-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Finalize Request when staking (#571)
* fix: order list on dashboard * remove console * feat: add finalize service request Co-authored-by: Hildegard Lydia <37687466+hilyds@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export async function finalizeServiceRequest(api, pair, requestId) { | ||
const result = await api.tx.serviceRequest | ||
.finalizeRequest(requestId) | ||
.signAndSend(pair, { nonce: -1 }) | ||
return result.toHuman() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export async function getRequestByOrderId(api, orderId){ | ||
const res = await api.query.serviceRequest.requestByOrderId(orderId) | ||
return res.toHuman() | ||
} | ||
|
||
export async function getRequestById(api, requestId) { | ||
const res = await api.query.serviceRequest.requestById(requestId) | ||
return res.toHuman() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters