Skip to content

Commit

Permalink
feat: Bump sdk and ts-proto to support v3 protocol release (#524)
Browse files Browse the repository at this point in the history
* feat: Bump sdk and ts-proto to support v3 protocol release

* Added dynamic fee polling calcs

---------

Co-authored-by: Tasos Derisiotis <[email protected]>
  • Loading branch information
DaevMithran and Eengineer1 authored Dec 5, 2024
1 parent d12253b commit 090cff4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 19 deletions.
35 changes: 19 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
]
},
"dependencies": {
"@cheqd/sdk": "^4.0.5",
"@cheqd/ts-proto": "^3.4.4",
"@cheqd/sdk": "^5.0.1",
"@cheqd/ts-proto": "^4.0.0",
"@cosmjs/amino": "^0.32.4",
"@cosmjs/crypto": "^0.32.4",
"@cosmjs/proto-signing": "^0.32.4",
Expand Down
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 090cff4

Please sign in to comment.