Skip to content

Commit

Permalink
Update dapp.js
Browse files Browse the repository at this point in the history
  • Loading branch information
crosschainer authored Sep 4, 2024
1 parent 266d3c2 commit 8472546
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions dapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const XianWalletUtils = {
});
},

sendTransaction: async function(contract, method, kwargs) {
sendTransaction: async function(contract, method, kwargs, stampLimit=0) {
await this.waitForWalletReady();
return new Promise((resolve, reject) => {
this.state.transaction.requests.push(resolve);
Expand All @@ -151,13 +151,21 @@ const XianWalletUtils = {
reject(new Error('Xian Wallet Chrome extension not responding'));
}
}, 30000); // 30 seconds timeout, this requires manual confirmation



let eventDetail = {
contract: contract,
method: method,
kwargs: kwargs
};


if (stampLimit > 0) {
eventDetail.stampLimit = stampLimit;
}

document.dispatchEvent(new CustomEvent('xianWalletSendTx', {
detail: {
contract: contract,
method: method,
kwargs: kwargs
}
detail: eventDetail
}));
});
},
Expand Down

0 comments on commit 8472546

Please sign in to comment.