forked from totallyswede/cosmos-stake-bot
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcommon.ts
44 lines (36 loc) · 852 Bytes
/
common.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { Decimal } from "@cosmjs/math";
export const E6 = 1000000
export interface IAccountConfiguration{
accountName : string,
mnemonic : string,
chainNames : string,
claimRewards : boolean,
stakeAvailableBalance : boolean,
leaveMinimumBalance : Decimal
}
export interface IChainConfiguration{
chainName : string,
walletPrefix : string,
networkName : string,
tokenDenom : string,
gas:number,
min_tx_fee:string
rpcEndpoint : string,
restEndpoint : string,
customDerivationPath? : string
}
export function GenerateFee( config : IChainConfiguration ){
let fee = "7000";
if(config.tokenDenom == "uosmo"){
fee = "0";
}
return {
amount: [
{
denom: config.tokenDenom,
amount: fee,
},
],
gas: "200000", // 200k
};
}