"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SYSTEM_VERSION_RPC_CALL = exports.SUPPORTED_VERSION_RANGE = exports.ROOT_TYPES = exports.CLASSIC_TICKER_OWNER_DID = exports.CLASSIC_CLAIM_SIGNATURE_PREFIX = exports.MAX_PAGE_SIZE = exports.DEFAULT_GQL_PAGE_SIZE = exports.TREASURY_MODULE_ADDRESS = exports.MAX_CONCURRENT_REQUESTS = exports.DEFAULT_SS58_FORMAT = exports.IGNORE_CHECKSUM = exports.DEFAULT_MAX_BATCH_ELEMENTS = exports.MAX_BATCH_ELEMENTS = exports.DUMMY_ACCOUNT_ID = exports.MAX_BALANCE = exports.MAX_MEMO_LENGTH = exports.MAX_MODULE_LENGTH = exports.MAX_TICKER_LENGTH = exports.MAX_DECIMALS = void 0;
const bignumber_js_1 = __importDefault(require("bignumber.js"));
const types_1 = require("../polkadot/types");
const types_2 = require("../types");
/**
 * Maximum amount of decimals for on-chain values
 */
exports.MAX_DECIMALS = 6;
exports.MAX_TICKER_LENGTH = 12;
exports.MAX_MODULE_LENGTH = 32;
exports.MAX_MEMO_LENGTH = 32;
/**
 * Biggest possible number for on-chain balances
 */
exports.MAX_BALANCE = new bignumber_js_1.default(Math.pow(10, 12));
/**
 * Account ID used for certain calls that require it when the SDK is instanced without one
 */
exports.DUMMY_ACCOUNT_ID = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
/**
 * Map of transaction tags to the theoretical limit of transactions that a batch of that type supports.
 *   This takes block size into account
 */
exports.MAX_BATCH_ELEMENTS = {
    [types_1.TxTags.asset.AddDocuments]: 20,
    [types_1.TxTags.asset.RemoveDocuments]: 20,
    [types_1.TxTags.identity.RemoveAuthorization]: 100,
    [types_1.TxTags.identity.AddClaim]: 200,
    [types_1.TxTags.identity.RevokeClaim]: 200,
    [types_1.TxTags.complianceManager.RemoveDefaultTrustedClaimIssuer]: 200,
    [types_1.TxTags.complianceManager.AddDefaultTrustedClaimIssuer]: 200,
    [types_1.TxTags.settlement.AddInstruction]: 50,
    [types_1.TxTags.settlement.AddAndAffirmInstruction]: 50,
    [types_1.TxTags.capitalDistribution.PushBenefit]: 1000,
};
exports.DEFAULT_MAX_BATCH_ELEMENTS = 20;
/**
 * Whether or not to ingnore the checksum when encoding/decoding polkadot addresses
 */
exports.IGNORE_CHECKSUM = true;
/**
 * Default format for Keyrings (used when the chain doesn't specify one)
 */
exports.DEFAULT_SS58_FORMAT = 42;
exports.MAX_CONCURRENT_REQUESTS = 200;
exports.TREASURY_MODULE_ADDRESS = 'modlpm/trsry';
exports.DEFAULT_GQL_PAGE_SIZE = 25;
/**
 * Limit to the page size used when fetching large amounts of data from the chain (same goes for `.multi` calls)
 */
exports.MAX_PAGE_SIZE = 1000;
/**
 * Prefix for the data that must be signed in Ethereum by a classic Ticker owner in order
 *   to claim their Ticker
 */
exports.CLASSIC_CLAIM_SIGNATURE_PREFIX = 'classic_claim';
/**
 * "Systematic DID" that owns all classic Tickers until they are claimed by their real owners
 */
exports.CLASSIC_TICKER_OWNER_DID = '0x73797374656d3a706f6c796d6174685f636c61737369635f6d69670000000000';
const didTypes = ['IdentityId'];
const addressTypes = [
    'AccountId',
    'AccountIdOf',
    'LookupTarget',
    'Address',
    'AuthorityId',
    'SessionKey',
    'ValidatorId',
    'AuthorityId',
    'KeyType',
    'SessionKey',
];
const balanceTypes = ['Amount', 'AssetOf', 'Balance', 'BalanceOf'];
const numberTypes = ['u8', 'u16', 'u32', 'u64', 'u128', 'u256', 'U256', 'BlockNumber'];
const textTypes = ['String', 'Text', 'Ticker'];
const booleanTypes = ['bool'];
const dateTypes = ['Moment'];
const rootTypes = {};
didTypes.forEach(type => {
    rootTypes[type] = types_2.TransactionArgumentType.Did;
});
addressTypes.forEach(type => {
    rootTypes[type] = types_2.TransactionArgumentType.Address;
});
balanceTypes.forEach(type => {
    rootTypes[type] = types_2.TransactionArgumentType.Balance;
});
numberTypes.forEach(type => {
    rootTypes[type] = types_2.TransactionArgumentType.Number;
});
textTypes.forEach(type => {
    rootTypes[type] = types_2.TransactionArgumentType.Text;
});
booleanTypes.forEach(type => {
    rootTypes[type] = types_2.TransactionArgumentType.Boolean;
});
dateTypes.forEach(type => {
    rootTypes[type] = types_2.TransactionArgumentType.Date;
});
/**
 * Maps chain types to more human-readable `TransactionArgumentType`s
 */
exports.ROOT_TYPES = rootTypes;
/**
 * The Polymesh version range that is compatible with this version of the SDK
 */
exports.SUPPORTED_VERSION_RANGE = '4.0.x';
exports.SYSTEM_VERSION_RPC_CALL = {
    jsonrpc: '2.0',
    method: 'system_version',
    params: [],
};
//# sourceMappingURL=constants.js.map