mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
Pull out explicit fee constants
This commit is contained in:
parent
83bb1021aa
commit
6783b273f8
@ -12,6 +12,36 @@ import {
|
|||||||
StdSignature,
|
StdSignature,
|
||||||
} from "./types";
|
} from "./types";
|
||||||
|
|
||||||
|
const defaultUploadFee: StdFee = {
|
||||||
|
amount: [
|
||||||
|
{
|
||||||
|
amount: "5000",
|
||||||
|
denom: "ucosm",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
gas: "1000000", // one million
|
||||||
|
};
|
||||||
|
|
||||||
|
const defaultInitFee: StdFee = {
|
||||||
|
amount: [
|
||||||
|
{
|
||||||
|
amount: "5000",
|
||||||
|
denom: "ucosm",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
gas: "500000", // 500k
|
||||||
|
};
|
||||||
|
|
||||||
|
const defaultExecFee: StdFee = {
|
||||||
|
amount: [
|
||||||
|
{
|
||||||
|
amount: "5000",
|
||||||
|
denom: "ucosm",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
gas: "200000", // 200k
|
||||||
|
};
|
||||||
|
|
||||||
export interface SigningCallback {
|
export interface SigningCallback {
|
||||||
(signBytes: Uint8Array): Promise<StdSignature>;
|
(signBytes: Uint8Array): Promise<StdSignature>;
|
||||||
}
|
}
|
||||||
@ -108,16 +138,7 @@ export class CosmWasmClient {
|
|||||||
builder: "",
|
builder: "",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const fee: StdFee = {
|
const fee = defaultUploadFee;
|
||||||
amount: [
|
|
||||||
{
|
|
||||||
amount: "5000000",
|
|
||||||
denom: "ucosm",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
gas: "89000000",
|
|
||||||
};
|
|
||||||
|
|
||||||
const { accountNumber, sequence } = await this.getNonce();
|
const { accountNumber, sequence } = await this.getNonce();
|
||||||
const chainId = await this.chainId();
|
const chainId = await this.chainId();
|
||||||
const signBytes = makeSignBytes([storeCodeMsg], fee, chainId, memo, accountNumber, sequence);
|
const signBytes = makeSignBytes([storeCodeMsg], fee, chainId, memo, accountNumber, sequence);
|
||||||
@ -153,16 +174,7 @@ export class CosmWasmClient {
|
|||||||
init_funds: transferAmount || [],
|
init_funds: transferAmount || [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const fee: StdFee = {
|
const fee = defaultInitFee;
|
||||||
amount: [
|
|
||||||
{
|
|
||||||
amount: "5000000",
|
|
||||||
denom: "ucosm",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
gas: "89000000",
|
|
||||||
};
|
|
||||||
|
|
||||||
const { accountNumber, sequence } = await this.getNonce();
|
const { accountNumber, sequence } = await this.getNonce();
|
||||||
const chainId = await this.chainId();
|
const chainId = await this.chainId();
|
||||||
const signBytes = makeSignBytes([instantiateMsg], fee, chainId, memo, accountNumber, sequence);
|
const signBytes = makeSignBytes([instantiateMsg], fee, chainId, memo, accountNumber, sequence);
|
||||||
@ -196,16 +208,7 @@ export class CosmWasmClient {
|
|||||||
sent_funds: transferAmount || [],
|
sent_funds: transferAmount || [],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const fee: StdFee = {
|
const fee = defaultExecFee;
|
||||||
amount: [
|
|
||||||
{
|
|
||||||
amount: "5000000",
|
|
||||||
denom: "ucosm",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
gas: "89000000",
|
|
||||||
};
|
|
||||||
|
|
||||||
const { accountNumber, sequence } = await this.getNonce();
|
const { accountNumber, sequence } = await this.getNonce();
|
||||||
const chainId = await this.chainId();
|
const chainId = await this.chainId();
|
||||||
const signBytes = makeSignBytes([executeMsg], fee, chainId, memo, accountNumber, sequence);
|
const signBytes = makeSignBytes([executeMsg], fee, chainId, memo, accountNumber, sequence);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user