@terra-money/core
Version:
This package provides Terra Blockchain client side APIs to support building transaction, singing, or querying chain data.
149 lines (148 loc) • 4.13 kB
TypeScript
export interface Coin {
denom: string;
amount: string;
}
export interface Fee {
gas: string;
amount: Coin[];
}
export interface InOut {
address: string;
coins: Coin[];
}
export interface Signature {
signature: string;
pub_key: {
type: string;
value: string;
};
}
export declare function generateVoteHash(salt: string, exchangeRate: string, denom: string, voter: string): string;
export interface StdTxValue {
fee: Fee;
memo: string;
msg: object[];
signatures: Signature[];
}
export interface StdTx {
type: string;
value: StdTxValue;
}
export declare function buildStdTx(msg: object[], fee: Fee, memo: string): StdTx;
interface MsgExchangeRatePrevote {
type: string;
value: {
hash: string;
denom: string;
feeder: string;
validator: string;
};
}
export declare function buildExchangeRatePrevote(hash: string, denom: string, feeder: string, validator: string): MsgExchangeRatePrevote;
interface MsgExchangeRateVote {
type: string;
value: {
exchange_rate: string;
salt: string;
denom: string;
feeder: string;
validator: string;
};
}
export declare function buildExchangeRateVote(exchangeRate: string, salt: string, denom: string, feeder: string, validator: string): MsgExchangeRateVote;
interface MsgSend {
type: string;
value: {
amount: Coin[];
from_address: string;
to_address: string;
};
}
export declare function buildSend(amount: Coin[], fromAddress: string, toAddress: string): MsgSend;
interface MsgMultiSend {
type: string;
value: {
inputs: InOut[];
outputs: InOut[];
};
}
export declare function buildMultiSend(inputs: InOut[], outputs: InOut[]): MsgMultiSend;
interface MsgSwap {
type: string;
value: {
trader: string;
offer_coin: Coin;
ask_denom: string;
};
}
export declare function buildSwap(trader: string, offerCoin: Coin, askDenom: string): MsgSwap;
interface MsgSetWithdrawAddress {
type: string;
value: {
delegator_address: string;
withdraw_address: string;
};
}
export declare function buildSetWithdrawAddress(delegatorAddress: string, withdrawAddress: string): MsgSetWithdrawAddress;
interface MsgWithdrawDelegatorReward {
type: string;
value: {
delegator_address: string;
validator_address: string;
};
}
export declare function buildWithdrawDelegatorReward(delegatorAddress: string, validatorAddress: string): MsgWithdrawDelegatorReward;
interface MsgDelegate {
type: string;
value: {
delegator_address: string;
validator_address: string;
amount: Coin;
};
}
export declare function buildDelegate(delegatorAddress: string, validatorAddress: string, amount: Coin): MsgDelegate;
interface MsgRedelegate {
type: string;
value: {
delegator_address: string;
validator_src_address: string;
validator_dst_address: string;
amount: Coin;
};
}
export declare function buildRedelegate(delegatorAddress: string, validatorSrcAddress: string, validatorDstAddress: string, amount: Coin): MsgRedelegate;
interface MsgUndelegate {
type: string;
value: {
delegator_address: string;
validator_address: string;
amount: Coin;
};
}
export declare function buildUndelegate(delegatorAddress: string, validatorAddress: string, amount: Coin): MsgUndelegate;
interface MsgDeposit {
type: string;
value: {
proposal_id: string;
depositor: string;
amount: Coin[];
};
}
export declare function buildDeposit(proposalID: string, depositor: string, amount: Coin[]): MsgDeposit;
export declare enum VoteOption {
OptionEmpty = 0,
OptionYes = 1,
OptionAbstain = 2,
OptionNo = 3,
OptionNoWithVeto = 4
}
interface MsgVote {
type: string;
value: {
proposal_id: string;
voter: string;
option: VoteOption;
};
}
export declare function buildVote(proposalID: string, voter: string, option: VoteOption): MsgVote;
export {};