@aeternity/aepp-sdk
Version:
SDK for the æternity blockchain
170 lines (162 loc) • 5.93 kB
JavaScript
import BigNumber from 'bignumber.js';
import { mapObject } from '../../utils/other.js';
/**
* @category transaction builder
*/
export const DRY_RUN_ACCOUNT = {
pub: 'ak_11111111111111111111111111111111273Yts',
amount: 100000000000000000000000000000000000n
};
/**
* @category account generalized
* @deprecated transaction builder will ensure that gas doesn't exceed the maximum value by itself
*/
export const MAX_AUTH_FUN_GAS = 50000;
/**
* @category utils
*/
/**
* @category AENS
*/
/**
* @category transaction builder
*/
export const MIN_GAS_PRICE = 1e9; // TODO: don't use number for ae
/**
* @category AENS
* @see {@link https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L67}
* @deprecated use {@link getMinimumNameFee} instead
*/
export const NAME_FEE_MULTIPLIER = 1e14;
/**
* The next bid should be at least 5% bigger than the previous one
* @category AENS
* @deprecated use {@link computeBidFee} instead
*/
export const NAME_FEE_BID_INCREMENT = 0.05;
/**
* Approximately 1 day
* @category AENS
* @see {@link https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L272}
* @deprecated use {@link computeAuctionEndBlock} instead
*/
export const NAME_BID_TIMEOUT_BLOCKS = 480;
/**
* This is the max length for a domain that requires a base fee to be paid
* @category AENS
* @deprecated use {@link getMinimumNameFee} instead
*/
export const NAME_MAX_LENGTH_FEE = 31;
/**
* @category AENS
* @see {@link https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L290}
* @see {@link https://github.com/aeternity/protocol/blob/master/AENS.md#protocol-fees-and-protection-times}
* @deprecated use {@link getMinimumNameFee} instead
*/
export const NAME_BID_RANGES = mapObject({
31: 3,
30: 5,
29: 8,
28: 13,
27: 21,
26: 34,
25: 55,
24: 89,
23: 144,
22: 233,
21: 377,
20: 610,
19: 987,
18: 1597,
17: 2584,
16: 4181,
15: 6765,
14: 10946,
13: 17711,
12: 28657,
11: 46368,
10: 75025,
9: 121393,
8: 196418,
7: 317811,
6: 514229,
5: 832040,
4: 1346269,
3: 2178309,
2: 3524578,
1: 5702887
}, ([key, value]) => [key, new BigNumber(value).times(NAME_FEE_MULTIPLIER)]);
/**
* @category chain
*/
export let ConsensusProtocolVersion = /*#__PURE__*/function (ConsensusProtocolVersion) {
ConsensusProtocolVersion[ConsensusProtocolVersion["Ceres"] = 6] = "Ceres";
return ConsensusProtocolVersion;
}({});
/**
* @category contract
* @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}
*/
export let VmVersion = /*#__PURE__*/function (VmVersion) {
VmVersion[VmVersion["NoVm"] = 0] = "NoVm";
VmVersion[VmVersion["Sophia"] = 1] = "Sophia";
VmVersion[VmVersion["SophiaImprovementsMinerva"] = 3] = "SophiaImprovementsMinerva";
VmVersion[VmVersion["SophiaImprovementsFortuna"] = 4] = "SophiaImprovementsFortuna";
VmVersion[VmVersion["Fate"] = 5] = "Fate";
VmVersion[VmVersion["SophiaImprovementsLima"] = 6] = "SophiaImprovementsLima";
VmVersion[VmVersion["Fate2"] = 7] = "Fate2";
VmVersion[VmVersion["Fate3"] = 8] = "Fate3";
return VmVersion;
}({});
/**
* @category contract
* @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/contracts/contract_vms.md#virtual-machines-on-the-%C3%A6ternity-blockchain}
*/
export let AbiVersion = /*#__PURE__*/function (AbiVersion) {
AbiVersion[AbiVersion["NoAbi"] = 0] = "NoAbi";
AbiVersion[AbiVersion["Sophia"] = 1] = "Sophia";
AbiVersion[AbiVersion["Fate"] = 3] = "Fate";
return AbiVersion;
}({});
/**
* Enum with tag types
* @category transaction builder
* @see {@link https://github.com/aeternity/protocol/blob/0f6dee3d9d1e8e2469816798f5c7587a6c918f94/serializations.md#binary-serialization}
* @see {@link https://github.com/aeternity/aeserialization/blob/eb68fe331bd476910394966b7f5ede7a74d37e35/src/aeser_chain_objects.erl#L39-L97}
*/
// TODO: implement serialisation for commented-out tags
export let Tag = /*#__PURE__*/function (Tag) {
Tag[Tag["SignedTx"] = 11] = "SignedTx";
Tag[Tag["SpendTx"] = 12] = "SpendTx";
Tag[Tag["OracleRegisterTx"] = 22] = "OracleRegisterTx";
Tag[Tag["OracleQueryTx"] = 23] = "OracleQueryTx";
/**
* @deprecated use `OracleRespondTx` instead
*/
Tag[Tag["OracleResponseTx"] = 24] = "OracleResponseTx";
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
Tag[Tag["OracleRespondTx"] = 24] = "OracleRespondTx";
Tag[Tag["OracleExtendTx"] = 25] = "OracleExtendTx";
Tag[Tag["NameClaimTx"] = 32] = "NameClaimTx";
Tag[Tag["NamePreclaimTx"] = 33] = "NamePreclaimTx";
Tag[Tag["NameUpdateTx"] = 34] = "NameUpdateTx";
Tag[Tag["NameRevokeTx"] = 35] = "NameRevokeTx";
Tag[Tag["NameTransferTx"] = 36] = "NameTransferTx";
Tag[Tag["ContractCreateTx"] = 42] = "ContractCreateTx";
Tag[Tag["ContractCallTx"] = 43] = "ContractCallTx";
Tag[Tag["ChannelCreateTx"] = 50] = "ChannelCreateTx";
Tag[Tag["ChannelDepositTx"] = 51] = "ChannelDepositTx";
Tag[Tag["ChannelWithdrawTx"] = 52] = "ChannelWithdrawTx";
Tag[Tag["ChannelForceProgressTx"] = 521] = "ChannelForceProgressTx";
Tag[Tag["ChannelCloseMutualTx"] = 53] = "ChannelCloseMutualTx";
Tag[Tag["ChannelCloseSoloTx"] = 54] = "ChannelCloseSoloTx";
Tag[Tag["ChannelSlashTx"] = 55] = "ChannelSlashTx";
Tag[Tag["ChannelSettleTx"] = 56] = "ChannelSettleTx";
Tag[Tag["ChannelOffChainTx"] = 57] = "ChannelOffChainTx";
Tag[Tag["ChannelSnapshotSoloTx"] = 59] = "ChannelSnapshotSoloTx";
Tag[Tag["GaAttachTx"] = 80] = "GaAttachTx";
Tag[Tag["GaMetaTx"] = 81] = "GaMetaTx";
Tag[Tag["PayingForTx"] = 82] = "PayingForTx";
return Tag;
}({});
//# sourceMappingURL=constants.js.map