diff --git a/package-lock.json b/package-lock.json index 6eb10f8..9fc91ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "@cheqd/did-provider-cheqd", - "version": "4.2.0", + "version": "4.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cheqd/did-provider-cheqd", - "version": "4.2.0", + "version": "4.3.0", "license": "Apache-2.0", "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", @@ -718,13 +718,17 @@ "dev": true, "license": "MIT" }, + "node_modules/@bufbuild/protobuf": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-2.2.2.tgz", + "integrity": "sha512-UNtPCbrwrenpmrXuRwn9jYpPoweNXj8X5sMvYgsqYyaH8jQ6LfUJSk3dJLnBK+6sfYPrF4iAIo5sd5HQ+tg75A==" + }, "node_modules/@cheqd/sdk": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/@cheqd/sdk/-/sdk-4.0.5.tgz", - "integrity": "sha512-M2PF+fJPfdLj+w4i7D+2hf+hXC1C+p0szchN1lYkQKfFdA17IT459QZ0IqHWbKMRgvEuy392zmh4d0hJVrOwlw==", - "license": "Apache-2.0", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@cheqd/sdk/-/sdk-5.0.1.tgz", + "integrity": "sha512-mB5+1ueZEEzj5b/BJ0FEQ7AyZnFCjOW6o/jpTz0yB4LrvMLGBFlks+2l7P2hbTJ6Ww5IMdXoHVuMGACvKf7kog==", "dependencies": { - "@cheqd/ts-proto": "^3.4.4", + "@cheqd/ts-proto": "^4.0.0", "@cosmjs/amino": "^0.32.4", "@cosmjs/crypto": "^0.32.4", "@cosmjs/encoding": "^0.32.4", @@ -748,13 +752,13 @@ } }, "node_modules/@cheqd/ts-proto": { - "version": "3.4.4", - "resolved": "https://registry.npmjs.org/@cheqd/ts-proto/-/ts-proto-3.4.4.tgz", - "integrity": "sha512-5/H+5U49g4KCCtu5PpQsMyaViMVcZ8PICAsVPLHoH3cttT1LoTHBYF7H0fmAsVPykG4bKBmWyG8uytS85MqV0g==", - "license": "Apache-2.0", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@cheqd/ts-proto/-/ts-proto-4.0.0.tgz", + "integrity": "sha512-UUwk9ntTiEMw0Rqip4Q0mLHsyClK/xOEAiXKTiBi247P/Dq8TYKcl3zNf4BKLymaiNSiWtCj8PYcnI57rF2F1g==", "dependencies": { + "@bufbuild/protobuf": "^2.2.2", "long": "^5.2.3", - "protobufjs": "^7.3.2" + "protobufjs": "^7.4.0" }, "engines": { "node": ">=20.0.0" @@ -763,8 +767,7 @@ "node_modules/@cheqd/ts-proto/node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==", - "license": "Apache-2.0" + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" }, "node_modules/@colors/colors": { "version": "1.5.0", diff --git a/package.json b/package.json index fbc01c8..946a25f 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/did-manager/cheqd-did-provider.ts b/src/did-manager/cheqd-did-provider.ts index 31907d9..2d840c8 100644 --- a/src/did-manager/cheqd-did-provider.ts +++ b/src/did-manager/cheqd-did-provider.ts @@ -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 );