From cab6d16ad3335214f869c9bb19896e08d1114350 Mon Sep 17 00:00:00 2001 From: Maxime Beauchamp <15185355+baktun14@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:50:44 -0400 Subject: [PATCH] fix(api): default expiration 10y if not set for deployment deposit (#377) --- apps/api/package.json | 2 +- .../services/rpc-message-service/rpc-message.service.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/api/package.json b/apps/api/package.json index ab5c91590..1fd75e3b3 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -1,6 +1,6 @@ { "name": "console-api", - "version": "2.23.1", + "version": "2.23.2", "description": "Api providing data to the deploy tool", "repository": { "type": "git", diff --git a/apps/api/src/billing/services/rpc-message-service/rpc-message.service.ts b/apps/api/src/billing/services/rpc-message-service/rpc-message.service.ts index a2fdc8b1e..589d0169c 100644 --- a/apps/api/src/billing/services/rpc-message-service/rpc-message.service.ts +++ b/apps/api/src/billing/services/rpc-message-service/rpc-message.service.ts @@ -2,6 +2,7 @@ import { DepositDeploymentAuthorization } from "@akashnetwork/akash-api/v1beta3" import { MsgRevoke } from "cosmjs-types/cosmos/authz/v1beta1/tx"; import { BasicAllowance } from "cosmjs-types/cosmos/feegrant/v1beta1/feegrant"; import { MsgGrantAllowance } from "cosmjs-types/cosmos/feegrant/v1beta1/tx"; +import addYears from "date-fns/addYears"; import { singleton } from "tsyringe"; export interface SpendingAuthorizationMsgOptions { @@ -43,7 +44,7 @@ export class RpcMessageService { }; } - getDepositDeploymentGrantMsg({ denom, limit, expiration, granter, grantee }: SpendingAuthorizationMsgOptions) { + getDepositDeploymentGrantMsg({ denom, limit, expiration = addYears(new Date(), 10), granter, grantee }: SpendingAuthorizationMsgOptions) { return { typeUrl: "/cosmos.authz.v1beta1.MsgGrant", value: {