CodeChain-io/codechain-sdk-js

Use RPC to get the minimum transaction fee

sgkim126 opened this issue · 0 comments

export function getMinimumFee(tx: Transaction): number {
switch (tx.type()) {
case "pay":
return 100;
case "setRegularKey":
return 10000;
case "store":
return 5000;
case "remove":
return 5000;
case "mintAsset":
return 100000;
case "transferAsset":
return 100;
case "changeAssetScheme":
return 100000;
case "increaseAssetSupply":
return 100000;
case "wrapCCC":
return 100000;
case "unwrapCCC":
return 100;
default:
return 10;
}
}

Currently, the minimum fee is hardcoded.
Please change it to use chain_getMinTransactionFee