Skip to content

Commit bcc9c40

Browse files
committed
Added dynamic fee polling calcs
1 parent b2fb595 commit bcc9c40

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/did-manager/cheqd-did-provider.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,11 +994,25 @@ export class CheqdDIDProvider extends AbstractIdentifierProvider {
994994
return tx;
995995
}
996996

997+
// poll gas price
998+
const gasPrice = await sdk.queryGasPrice(args.amount.denom);
999+
1000+
// define fee
1001+
const fee = {
1002+
amount: [
1003+
{
1004+
amount: (Number(gasPrice.price?.amount ?? '0') * 10 ** 9).toString(),
1005+
denom: args.amount.denom,
1006+
},
1007+
],
1008+
gas: '360000',
1009+
} satisfies DidStdFee;
1010+
9971011
const tx = await sdk.signer.sendTokens(
9981012
(await (await this.cosmosPayerWallet).getAccounts())[0].address,
9991013
args.recipientAddress,
10001014
[args.amount],
1001-
'auto',
1015+
fee,
10021016
args.memo
10031017
);
10041018

0 commit comments

Comments
 (0)