Skip to content

Commit

Permalink
Added dynamic fee polling calcs
Browse files Browse the repository at this point in the history
  • Loading branch information
Eengineer1 committed Dec 5, 2024
1 parent b2fb595 commit bcc9c40
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/did-manager/cheqd-did-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -994,11 +994,25 @@ export class CheqdDIDProvider extends AbstractIdentifierProvider {
return tx;
}

// poll gas price
const gasPrice = await sdk.queryGasPrice(args.amount.denom);

// define fee
const fee = {
amount: [
{
amount: (Number(gasPrice.price?.amount ?? '0') * 10 ** 9).toString(),
denom: args.amount.denom,
},
],
gas: '360000',
} satisfies DidStdFee;

const tx = await sdk.signer.sendTokens(
(await (await this.cosmosPayerWallet).getAccounts())[0].address,
args.recipientAddress,
[args.amount],
'auto',
fee,
args.memo
);

Expand Down

0 comments on commit bcc9c40

Please sign in to comment.