Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
support addGasBufferMultiplier in txParams
  • Loading branch information
wk3368 committed Jan 7, 2022
1 parent 3b5c878 commit 0c19027
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/providers/jsonrpc-provider.ts
Expand Up @@ -235,7 +235,10 @@ export class JsonRpcSigner extends Signer {
tx.from = sender;
}

const hexTx = (<any>this.provider.constructor).hexlifyTransaction(tx, { from: true, expiredSecs: true });
const hexTx = (<any>this.provider.constructor).hexlifyTransaction(tx, { from: true, expiredSecs: true, addGasBufferMultiplier: true });
if (tx.addGasBufferMultiplier && typeof tx.addGasBufferMultiplier === 'number') {
hexTx.addGasBufferMultiplier = tx.addGasBufferMultiplier.toString();
}
logger.debug(hexTx);
return this.provider.send("stc_sendTransaction", [hexTx]).then((hash) => {
return hash;
Expand Down
1 change: 1 addition & 0 deletions src/types/index.ts
Expand Up @@ -325,6 +325,7 @@ export interface TransactionRequest {
data?: BytesLike,
value?: BigNumberish,
expiredSecs?: U64;
addGasBufferMultiplier?: U8;

sender?: AccountAddress;
sender_public_key?: HexString;
Expand Down

0 comments on commit 0c19027

Please sign in to comment.