interchainjs
Version:
InterchainJS is a JavaScript library for interacting with Cosmos SDK based blockchains.
323 lines (322 loc) • 12.1 kB
TypeScript
import { Coin, CoinAmino } from "../../base/v1beta1/coin";
import { Duration, DurationAmino } from "../../../google/protobuf/duration";
import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any";
import { BinaryReader, BinaryWriter } from "../../../binary";
import { DeepPartial } from "../../../helpers";
/**
* BasicAllowance implements Allowance with a one-time grant of coins
* that optionally expires. The grantee can use up to SpendLimit to cover fees.
* @name BasicAllowance
* @package cosmos.feegrant.v1beta1
* @see proto type: cosmos.feegrant.v1beta1.BasicAllowance
*/
export interface BasicAllowance {
$typeUrl?: "/cosmos.feegrant.v1beta1.BasicAllowance";
/**
* spend_limit specifies the maximum amount of coins that can be spent
* by this allowance and will be updated as coins are spent. If it is
* empty, there is no spend limit and any amount of coins can be spent.
*/
spendLimit: Coin[];
/**
* expiration specifies an optional time when this allowance expires
*/
expiration?: Date;
}
export interface BasicAllowanceProtoMsg {
typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance";
value: Uint8Array;
}
/**
* BasicAllowance implements Allowance with a one-time grant of coins
* that optionally expires. The grantee can use up to SpendLimit to cover fees.
* @name BasicAllowanceAmino
* @package cosmos.feegrant.v1beta1
* @see proto type: cosmos.feegrant.v1beta1.BasicAllowance
*/
export interface BasicAllowanceAmino {
/**
* spend_limit specifies the maximum amount of coins that can be spent
* by this allowance and will be updated as coins are spent. If it is
* empty, there is no spend limit and any amount of coins can be spent.
*/
spend_limit: CoinAmino[];
/**
* expiration specifies an optional time when this allowance expires
*/
expiration?: string;
}
export interface BasicAllowanceAminoMsg {
type: "cosmos-sdk/BasicAllowance";
value: BasicAllowanceAmino;
}
/**
* PeriodicAllowance extends Allowance to allow for both a maximum cap,
* as well as a limit per time period.
* @name PeriodicAllowance
* @package cosmos.feegrant.v1beta1
* @see proto type: cosmos.feegrant.v1beta1.PeriodicAllowance
*/
export interface PeriodicAllowance {
$typeUrl?: "/cosmos.feegrant.v1beta1.PeriodicAllowance";
/**
* basic specifies a struct of `BasicAllowance`
*/
basic: BasicAllowance;
/**
* period specifies the time duration in which period_spend_limit coins can
* be spent before that allowance is reset
*/
period: Duration;
/**
* period_spend_limit specifies the maximum number of coins that can be spent
* in the period
*/
periodSpendLimit: Coin[];
/**
* period_can_spend is the number of coins left to be spent before the period_reset time
*/
periodCanSpend: Coin[];
/**
* period_reset is the time at which this period resets and a new one begins,
* it is calculated from the start time of the first transaction after the
* last period ended
*/
periodReset: Date;
}
export interface PeriodicAllowanceProtoMsg {
typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance";
value: Uint8Array;
}
/**
* PeriodicAllowance extends Allowance to allow for both a maximum cap,
* as well as a limit per time period.
* @name PeriodicAllowanceAmino
* @package cosmos.feegrant.v1beta1
* @see proto type: cosmos.feegrant.v1beta1.PeriodicAllowance
*/
export interface PeriodicAllowanceAmino {
/**
* basic specifies a struct of `BasicAllowance`
*/
basic: BasicAllowanceAmino;
/**
* period specifies the time duration in which period_spend_limit coins can
* be spent before that allowance is reset
*/
period: DurationAmino;
/**
* period_spend_limit specifies the maximum number of coins that can be spent
* in the period
*/
period_spend_limit: CoinAmino[];
/**
* period_can_spend is the number of coins left to be spent before the period_reset time
*/
period_can_spend: CoinAmino[];
/**
* period_reset is the time at which this period resets and a new one begins,
* it is calculated from the start time of the first transaction after the
* last period ended
*/
period_reset: string;
}
export interface PeriodicAllowanceAminoMsg {
type: "cosmos-sdk/PeriodicAllowance";
value: PeriodicAllowanceAmino;
}
/**
* AllowedMsgAllowance creates allowance only for specified message types.
* @name AllowedMsgAllowance
* @package cosmos.feegrant.v1beta1
* @see proto type: cosmos.feegrant.v1beta1.AllowedMsgAllowance
*/
export interface AllowedMsgAllowance {
$typeUrl?: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance";
/**
* allowance can be any of basic and periodic fee allowance.
*/
allowance?: BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any | undefined;
/**
* allowed_messages are the messages for which the grantee has the access.
*/
allowedMessages: string[];
}
export interface AllowedMsgAllowanceProtoMsg {
typeUrl: "/cosmos.feegrant.v1beta1.AllowedMsgAllowance";
value: Uint8Array;
}
export type AllowedMsgAllowanceEncoded = Omit<AllowedMsgAllowance, "allowance"> & {
/**
* allowance can be any of basic and periodic fee allowance.
*/
allowance?: BasicAllowanceProtoMsg | PeriodicAllowanceProtoMsg | AllowedMsgAllowanceProtoMsg | AnyProtoMsg | undefined;
};
/**
* AllowedMsgAllowance creates allowance only for specified message types.
* @name AllowedMsgAllowanceAmino
* @package cosmos.feegrant.v1beta1
* @see proto type: cosmos.feegrant.v1beta1.AllowedMsgAllowance
*/
export interface AllowedMsgAllowanceAmino {
/**
* allowance can be any of basic and periodic fee allowance.
*/
allowance?: AnyAmino;
/**
* allowed_messages are the messages for which the grantee has the access.
*/
allowed_messages: string[];
}
export interface AllowedMsgAllowanceAminoMsg {
type: "cosmos-sdk/AllowedMsgAllowance";
value: AllowedMsgAllowanceAmino;
}
/**
* Grant is stored in the KVStore to record a grant with full context
* @name Grant
* @package cosmos.feegrant.v1beta1
* @see proto type: cosmos.feegrant.v1beta1.Grant
*/
export interface Grant {
/**
* granter is the address of the user granting an allowance of their funds.
*/
granter: string;
/**
* grantee is the address of the user being granted an allowance of another user's funds.
*/
grantee: string;
/**
* allowance can be any of basic, periodic, allowed fee allowance.
*/
allowance?: BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any | undefined;
}
export interface GrantProtoMsg {
typeUrl: "/cosmos.feegrant.v1beta1.Grant";
value: Uint8Array;
}
export type GrantEncoded = Omit<Grant, "allowance"> & {
/**
* allowance can be any of basic, periodic, allowed fee allowance.
*/
allowance?: BasicAllowanceProtoMsg | PeriodicAllowanceProtoMsg | AllowedMsgAllowanceProtoMsg | AnyProtoMsg | undefined;
};
/**
* Grant is stored in the KVStore to record a grant with full context
* @name GrantAmino
* @package cosmos.feegrant.v1beta1
* @see proto type: cosmos.feegrant.v1beta1.Grant
*/
export interface GrantAmino {
/**
* granter is the address of the user granting an allowance of their funds.
*/
granter: string;
/**
* grantee is the address of the user being granted an allowance of another user's funds.
*/
grantee: string;
/**
* allowance can be any of basic, periodic, allowed fee allowance.
*/
allowance?: AnyAmino;
}
export interface GrantAminoMsg {
type: "cosmos-sdk/Grant";
value: GrantAmino;
}
/**
* BasicAllowance implements Allowance with a one-time grant of coins
* that optionally expires. The grantee can use up to SpendLimit to cover fees.
* @name BasicAllowance
* @package cosmos.feegrant.v1beta1
* @see proto type: cosmos.feegrant.v1beta1.BasicAllowance
*/
export declare const BasicAllowance: {
typeUrl: string;
aminoType: string;
is(o: any): o is BasicAllowance;
isAmino(o: any): o is BasicAllowanceAmino;
encode(message: BasicAllowance, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): BasicAllowance;
fromPartial(object: DeepPartial<BasicAllowance>): BasicAllowance;
fromAmino(object: BasicAllowanceAmino): BasicAllowance;
toAmino(message: BasicAllowance): BasicAllowanceAmino;
fromAminoMsg(object: BasicAllowanceAminoMsg): BasicAllowance;
toAminoMsg(message: BasicAllowance): BasicAllowanceAminoMsg;
fromProtoMsg(message: BasicAllowanceProtoMsg): BasicAllowance;
toProto(message: BasicAllowance): Uint8Array;
toProtoMsg(message: BasicAllowance): BasicAllowanceProtoMsg;
registerTypeUrl(): void;
};
/**
* PeriodicAllowance extends Allowance to allow for both a maximum cap,
* as well as a limit per time period.
* @name PeriodicAllowance
* @package cosmos.feegrant.v1beta1
* @see proto type: cosmos.feegrant.v1beta1.PeriodicAllowance
*/
export declare const PeriodicAllowance: {
typeUrl: string;
aminoType: string;
is(o: any): o is PeriodicAllowance;
isAmino(o: any): o is PeriodicAllowanceAmino;
encode(message: PeriodicAllowance, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): PeriodicAllowance;
fromPartial(object: DeepPartial<PeriodicAllowance>): PeriodicAllowance;
fromAmino(object: PeriodicAllowanceAmino): PeriodicAllowance;
toAmino(message: PeriodicAllowance): PeriodicAllowanceAmino;
fromAminoMsg(object: PeriodicAllowanceAminoMsg): PeriodicAllowance;
toAminoMsg(message: PeriodicAllowance): PeriodicAllowanceAminoMsg;
fromProtoMsg(message: PeriodicAllowanceProtoMsg): PeriodicAllowance;
toProto(message: PeriodicAllowance): Uint8Array;
toProtoMsg(message: PeriodicAllowance): PeriodicAllowanceProtoMsg;
registerTypeUrl(): void;
};
/**
* AllowedMsgAllowance creates allowance only for specified message types.
* @name AllowedMsgAllowance
* @package cosmos.feegrant.v1beta1
* @see proto type: cosmos.feegrant.v1beta1.AllowedMsgAllowance
*/
export declare const AllowedMsgAllowance: {
typeUrl: string;
aminoType: string;
is(o: any): o is AllowedMsgAllowance;
isAmino(o: any): o is AllowedMsgAllowanceAmino;
encode(message: AllowedMsgAllowance, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): AllowedMsgAllowance;
fromPartial(object: DeepPartial<AllowedMsgAllowance>): AllowedMsgAllowance;
fromAmino(object: AllowedMsgAllowanceAmino): AllowedMsgAllowance;
toAmino(message: AllowedMsgAllowance): AllowedMsgAllowanceAmino;
fromAminoMsg(object: AllowedMsgAllowanceAminoMsg): AllowedMsgAllowance;
toAminoMsg(message: AllowedMsgAllowance): AllowedMsgAllowanceAminoMsg;
fromProtoMsg(message: AllowedMsgAllowanceProtoMsg): AllowedMsgAllowance;
toProto(message: AllowedMsgAllowance): Uint8Array;
toProtoMsg(message: AllowedMsgAllowance): AllowedMsgAllowanceProtoMsg;
registerTypeUrl(): void;
};
/**
* Grant is stored in the KVStore to record a grant with full context
* @name Grant
* @package cosmos.feegrant.v1beta1
* @see proto type: cosmos.feegrant.v1beta1.Grant
*/
export declare const Grant: {
typeUrl: string;
aminoType: string;
is(o: any): o is Grant;
isAmino(o: any): o is GrantAmino;
encode(message: Grant, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): Grant;
fromPartial(object: DeepPartial<Grant>): Grant;
fromAmino(object: GrantAmino): Grant;
toAmino(message: Grant): GrantAmino;
fromAminoMsg(object: GrantAminoMsg): Grant;
toAminoMsg(message: Grant): GrantAminoMsg;
fromProtoMsg(message: GrantProtoMsg): Grant;
toProto(message: Grant): Uint8Array;
toProtoMsg(message: Grant): GrantProtoMsg;
registerTypeUrl(): void;
};