import type { Token, ChainId, Address } from '@fadroma/agent'; /** Data used for creating a signature as per the SNIP-24 spec: * https://github.com/SecretFoundation/SNIPs/blob/master/SNIP-24.md#permit-content---stdsigndoc * This type is case sensitive! */ export interface SignDoc { readonly chain_id: string; /** Always 0. */ readonly account_number: string; /** Always 0. */ readonly sequence: string; /** Always 0 uscrt + 1 gas */ readonly fee: Token.IFee; /** Always 1 message of type query_permit */ readonly msgs: readonly AminoMsg[]; /** Always empty. */ readonly memo: string; } export interface Permit { params: { permit_name: string; allowed_tokens: Address[]; chain_id: string; permissions: T[]; }; signature: Signature; } export interface Signature { readonly pub_key: Pubkey; readonly signature: string; } export interface Pubkey { readonly type: 'tendermint/PubKeySecp256k1'; readonly value: any; } export interface AminoMsg { readonly type: string; readonly value: any; } /** Used as the `value` field of the {@link AminoMsg} type. */ export interface PermitAminoMsg { permit_name: string; allowed_tokens: Address[]; permissions: T[]; } export declare abstract class PermitSigner { /** The id of the chain for which permits will be signed. */ readonly chainId: ChainId; /** The address which will do the signing and * which will be the address used by the contracts. */ readonly address: Address; static createSignDoc: (chain_id: ChainId, permit_msg: T) => SignDoc; constructor( /** The id of the chain for which permits will be signed. */ chainId: ChainId, /** The address which will do the signing and * which will be the address used by the contracts. */ address: Address); abstract sign(permit_msg: PermitAminoMsg): Promise>; } export declare class PermitSignerKeplr extends PermitSigner { /** Must be a pre-configured instance. */ readonly keplr: KeplrSigningHandle; constructor(chainId: ChainId, address: Address, /** Must be a pre-configured instance. */ keplr: KeplrSigningHandle); sign(permit_msg: PermitAminoMsg): Promise>; } export interface KeplrSigningHandle { signAmino(chain_id: ChainId, address: Address, signDoc: SignDoc, options: { preferNoSetFee: boolean; preferNoSetMemo: boolean; }): Promise>; } //# sourceMappingURL=snip-24.d.ts.map