handle partial_tx in handleApiReturn
This commit is contained in:
parent
cf18e46e17
commit
e224921f86
@ -658,6 +658,15 @@ export default class Services {
|
|||||||
|
|
||||||
public async handleApiReturn(apiReturn: ApiReturn) {
|
public async handleApiReturn(apiReturn: ApiReturn) {
|
||||||
console.log(apiReturn);
|
console.log(apiReturn);
|
||||||
|
if (apiReturn.partial_tx) {
|
||||||
|
try {
|
||||||
|
const res = this.sdkClient.sign_transaction(apiReturn.partial_tx);
|
||||||
|
apiReturn.new_tx_to_send = res.new_tx_to_send;
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Failed to sign transaction:', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (apiReturn.new_tx_to_send && apiReturn.new_tx_to_send.transaction.length != 0) {
|
if (apiReturn.new_tx_to_send && apiReturn.new_tx_to_send.transaction.length != 0) {
|
||||||
await this.sendNewTxMessage(JSON.stringify(apiReturn.new_tx_to_send));
|
await this.sendNewTxMessage(JSON.stringify(apiReturn.new_tx_to_send));
|
||||||
await new Promise(r => setTimeout(r, 500));
|
await new Promise(r => setTimeout(r, 500));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user