Skip to content

Commit

Permalink
add isSDK and isAmino
Browse files Browse the repository at this point in the history
  • Loading branch information
Zetazzz committed Nov 16, 2023
1 parent 31f05ec commit 5957cbf
Show file tree
Hide file tree
Showing 14 changed files with 3,027 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Coin } from "../../../cosmos/base/v1beta1/coin";
import { Coin, CoinAmino, CoinSDKType } from "../../../cosmos/base/v1beta1/coin";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { isSet, DeepPartial } from "../../../helpers";
import { GlobalDecoderRegistry } from "../../../registry";
Expand All @@ -18,6 +18,28 @@ export interface DepositDeploymentAuthorizationProtoMsg {
typeUrl: "/akash.deployment.v1beta1.DepositDeploymentAuthorization";
value: Uint8Array;
}
/**
* DepositDeploymentAuthorization allows the grantee to deposit up to spend_limit coins from
* the granter's account for a deployment.
*/
export interface DepositDeploymentAuthorizationAmino {
/**
* SpendLimit is the amount the grantee is authorized to spend from the granter's account for
* the purpose of deployment.
*/
spend_limit?: CoinAmino;
}
export interface DepositDeploymentAuthorizationAminoMsg {
type: "/akash.deployment.v1beta1.DepositDeploymentAuthorization";
value: DepositDeploymentAuthorizationAmino;
}
/**
* DepositDeploymentAuthorization allows the grantee to deposit up to spend_limit coins from
* the granter's account for a deployment.
*/
export interface DepositDeploymentAuthorizationSDKType {
spend_limit: CoinSDKType;
}
function createBaseDepositDeploymentAuthorization(): DepositDeploymentAuthorization {
return {
spendLimit: Coin.fromPartial({})
Expand All @@ -28,6 +50,12 @@ export const DepositDeploymentAuthorization = {
is(o: any): o is DepositDeploymentAuthorization {
return o && (o.$typeUrl === DepositDeploymentAuthorization.typeUrl || Coin.is(o.spendLimit));
},
isSDK(o: any): o is DepositDeploymentAuthorization {
return o && (o.$typeUrl === DepositDeploymentAuthorization.typeUrl || Coin.isSDK(o.spend_limit));
},
isAmino(o: any): o is DepositDeploymentAuthorization {
return o && (o.$typeUrl === DepositDeploymentAuthorization.typeUrl || Coin.isAmino(o.spend_limit));
},
encode(message: DepositDeploymentAuthorization, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
if (message.spendLimit !== undefined) {
Coin.encode(message.spendLimit, writer.uint32(10).fork()).ldelim();
Expand Down Expand Up @@ -68,6 +96,19 @@ export const DepositDeploymentAuthorization = {
}
return message;
},
fromAmino(object: DepositDeploymentAuthorizationAmino): DepositDeploymentAuthorization {
return {
spendLimit: object?.spend_limit ? Coin.fromAmino(object.spend_limit) : undefined
};
},
toAmino(message: DepositDeploymentAuthorization): DepositDeploymentAuthorizationAmino {
const obj: any = {};
obj.spend_limit = message.spendLimit ? Coin.toAmino(message.spendLimit) : undefined;
return obj;
},
fromAminoMsg(object: DepositDeploymentAuthorizationAminoMsg): DepositDeploymentAuthorization {
return DepositDeploymentAuthorization.fromAmino(object.value);
},
fromProtoMsg(message: DepositDeploymentAuthorizationProtoMsg): DepositDeploymentAuthorization {
return DepositDeploymentAuthorization.decode(message.value);
},
Expand Down
Loading

0 comments on commit 5957cbf

Please sign in to comment.