+221
-409
@@ -1,4 +0,4 @@ | ||
| import { Address, Slice, Cell, Dictionary } from "@ton/core"; | ||
| import { Address, Slice, Cell, Dictionary, ExtraCurrency } from "@ton/core"; | ||
| export declare function configParseMasterAddress(slice: Slice | null | undefined): Address | null; | ||
| export declare function parseValidatorSet(slice: Slice): { | ||
| export type ValidatorSet = { | ||
| timeSince: number; | ||
@@ -8,3 +8,3 @@ timeUntil: number; | ||
| main: number; | ||
| totalWeight: null; | ||
| totalWeight: bigint | null; | ||
| list: Dictionary<number, { | ||
@@ -15,15 +15,5 @@ publicKey: Buffer; | ||
| }>; | ||
| } | { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: bigint; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | undefined; | ||
| export declare function parseBridge(slice: Slice): { | ||
| }; | ||
| export declare function parseValidatorSet(slice: Slice): ValidatorSet | null; | ||
| export type BridgeParams = { | ||
| bridgeAddress: Address; | ||
@@ -34,2 +24,3 @@ oracleMultisigAddress: Address; | ||
| }; | ||
| export declare function parseBridge(slice: Slice): BridgeParams; | ||
| export declare function configParseMasterAddressRequired(slice: Slice | null | undefined): Address; | ||
@@ -41,2 +32,11 @@ export declare function configParse5(slice: Slice | null | undefined): { | ||
| }; | ||
| export declare function configParse6(slice: Slice | null | undefined): { | ||
| mintNewPrice: bigint; | ||
| mintAddPrice: bigint; | ||
| } | null; | ||
| export declare function configParse7(slice: Slice | null | undefined): { | ||
| toMint: ExtraCurrency; | ||
| }; | ||
| export declare function configParse9(slice: Slice | null | undefined): Set<number>; | ||
| export declare function configParse10(slice: Slice | null | undefined): Set<number>; | ||
| export declare function configParse13(slice: Slice | null | undefined): { | ||
@@ -47,2 +47,6 @@ deposit: bigint; | ||
| }; | ||
| export declare function configParse14(slice: Slice | null | undefined): { | ||
| masterchainBlockFee: bigint; | ||
| workchainBlockFee: bigint; | ||
| }; | ||
| export declare function configParse15(slice: Slice | null | undefined): { | ||
@@ -77,3 +81,3 @@ validatorsElectedFor: number; | ||
| }; | ||
| export declare function configParse40(slice: Slice | null | undefined): { | ||
| export type ValidatorsPunishmentConfig = { | ||
| defaultFlatFine: bigint; | ||
@@ -90,3 +94,4 @@ defaultProportionaFine: bigint; | ||
| mediumProportionalMult: number; | ||
| } | null; | ||
| }; | ||
| export declare function configParse40(slice: Slice | null | undefined): ValidatorsPunishmentConfig | null; | ||
| export declare function configParseWorkchainDescriptor(slice: Slice): WorkchainDescriptor; | ||
@@ -121,33 +126,38 @@ export type WcSplitMergeTimings = { | ||
| export declare function configParse12(slice: Slice | null | undefined): Dictionary<number, WorkchainDescriptor>; | ||
| export declare function configParseValidatorSet(slice: Slice | null | undefined): { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: null; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: bigint; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | null | undefined; | ||
| export declare function configParseBridge(slice: Slice | null | undefined): { | ||
| export declare function configParseValidatorSet(slice: Slice | null | undefined): ValidatorSet | null; | ||
| export declare function configParseBridge(slice: Slice | null | undefined): BridgeParams | null; | ||
| export type JettonBridgeParamsV0 = { | ||
| bridgeAddress: Address; | ||
| oracleMultisigAddress: Address; | ||
| oracles: Map<string, Buffer>; | ||
| oracleAddress: Address; | ||
| oracles: { | ||
| addr: Address; | ||
| pubkey: Buffer; | ||
| }[]; | ||
| flags: number; | ||
| bridgeBurnFee: bigint; | ||
| jettonBridgePrices?: undefined; | ||
| externalChainAddress?: undefined; | ||
| }; | ||
| export type JettonBridgeParamsV1 = { | ||
| bridgeAddress: Address; | ||
| oracleAddress: Address; | ||
| oracles: { | ||
| addr: Address; | ||
| pubkey: Buffer; | ||
| }[]; | ||
| flags: number; | ||
| bridgeBurnFee?: undefined; | ||
| jettonBridgePrices: { | ||
| bridgeBurnFee: bigint; | ||
| bridgeMintFee: bigint; | ||
| walletMinTonsForStorage: bigint; | ||
| walletGasConsumption: bigint; | ||
| minterMinTonsForStorage: bigint; | ||
| discoverGasConsumption: bigint; | ||
| }; | ||
| externalChainAddress: Buffer; | ||
| } | null; | ||
| export type GasLimitsPrices = ReturnType<typeof configParseGasLimitsPrices>; | ||
| export declare function configParseGasLimitsPrices(slice: Slice | null | undefined): { | ||
| }; | ||
| export type JettonBridgeParams = JettonBridgeParamsV0 | JettonBridgeParamsV1; | ||
| export declare function loadJettonBridgeParams(slice: Slice | null | undefined): JettonBridgeParams | null; | ||
| export type GasLimitsPrices = { | ||
| flatLimit: bigint; | ||
@@ -158,3 +168,3 @@ flatGasPrice: bigint; | ||
| gasLimit: bigint; | ||
| specialGasLimit: bigint; | ||
| specialGasLimit?: bigint; | ||
| gasCredit: bigint; | ||
@@ -164,14 +174,22 @@ blockGasLimit: bigint; | ||
| deleteDueLimit: bigint; | ||
| } | { | ||
| gasPrice: bigint; | ||
| gasLimit: bigint; | ||
| gasCredit: bigint; | ||
| blockGasLimit: bigint; | ||
| freezeDueLimit: bigint; | ||
| deleteDueLimit: bigint; | ||
| specialGasLimit?: undefined; | ||
| }; | ||
| }; | ||
| export type MsgPrices = ReturnType<typeof configParseMsgPrices>; | ||
| export declare function configParseMsgPrices(slice: Slice | null | undefined): { | ||
| export declare function configParseGasLimitsPrices(slice: Slice | null | undefined): GasLimitsPrices; | ||
| export type LimitParams = { | ||
| underload: number; | ||
| softLimit: number; | ||
| hardLimit: number; | ||
| }; | ||
| export type BlockLimits = { | ||
| bytes: LimitParams; | ||
| gas: LimitParams; | ||
| ltDelta: LimitParams; | ||
| collatedData?: LimitParams; | ||
| importedMsgQueue?: { | ||
| maxBytes: number; | ||
| maxMsgs: number; | ||
| }; | ||
| }; | ||
| export declare function configParseBlockLimits(slice: Slice | null | undefined): BlockLimits; | ||
| export type MsgPrices = { | ||
| lumpPrice: bigint; | ||
@@ -184,3 +202,4 @@ bitPrice: bigint; | ||
| }; | ||
| export declare function configParse28(slice: Slice | null | undefined): { | ||
| export declare function configParseMsgPrices(slice: Slice | null | undefined): MsgPrices; | ||
| export type CatchainConfigOld = { | ||
| masterCatchainLifetime: number; | ||
@@ -192,5 +211,4 @@ shardCatchainLifetime: number; | ||
| suffleMasterValidators?: undefined; | ||
| } | { | ||
| flags: number; | ||
| suffleMasterValidators: boolean; | ||
| }; | ||
| export type CatchainConfigNew = { | ||
| masterCatchainLifetime: number; | ||
@@ -200,4 +218,8 @@ shardCatchainLifetime: number; | ||
| shardValidatorsCount: number; | ||
| flags: number; | ||
| suffleMasterValidators: boolean; | ||
| }; | ||
| export declare function configParse29(slice: Slice | null | undefined): { | ||
| export type CatchainConfig = CatchainConfigOld | CatchainConfigNew; | ||
| export declare function configParse28(slice: Slice | null | undefined): CatchainConfig; | ||
| export type ConsensusConfigOld = { | ||
| roundCandidates: number; | ||
@@ -215,5 +237,4 @@ nextCandidateDelay: number; | ||
| catchainMaxBlocksCoeff?: undefined; | ||
| } | { | ||
| flags: number; | ||
| newCatchainIds: boolean; | ||
| }; | ||
| export type ConsensusConfigNew = { | ||
| roundCandidates: number; | ||
@@ -227,7 +248,8 @@ nextCandidateDelay: number; | ||
| maxColaltedBytes: number; | ||
| flags: number; | ||
| newCatchainIds: boolean; | ||
| protoVersion?: undefined; | ||
| catchainMaxBlocksCoeff?: undefined; | ||
| } | { | ||
| flags: number; | ||
| newCatchainIds: boolean; | ||
| }; | ||
| export type ConsensusConfigV3 = { | ||
| roundCandidates: number; | ||
@@ -241,7 +263,8 @@ nextCandidateDelay: number; | ||
| maxColaltedBytes: number; | ||
| flags: number; | ||
| newCatchainIds: boolean; | ||
| protoVersion: number; | ||
| catchainMaxBlocksCoeff?: undefined; | ||
| } | { | ||
| flags: number; | ||
| newCatchainIds: boolean; | ||
| }; | ||
| export type ConsensusConfigV4 = { | ||
| roundCandidates: number; | ||
@@ -255,6 +278,19 @@ nextCandidateDelay: number; | ||
| maxColaltedBytes: number; | ||
| flags: number; | ||
| newCatchainIds: boolean; | ||
| protoVersion: number; | ||
| catchainMaxBlocksCoeff: number; | ||
| }; | ||
| export declare function parseProposalSetup(slice: Slice): { | ||
| export type ConsensusConfig = ConsensusConfigOld | ConsensusConfigNew | ConsensusConfigV3 | ConsensusConfigV4; | ||
| export declare function configParse29(slice: Slice | null | undefined): ConsensusConfig; | ||
| export declare function configParse31(slice: Slice | null | undefined): Address[]; | ||
| export declare function configParse44(slice: Slice | null | undefined): { | ||
| addresses: Address[]; | ||
| suspendedUntil: number; | ||
| }; | ||
| export declare function configParse45(slice: Slice | null | undefined): { | ||
| hash: Buffer; | ||
| gasUsed: bigint; | ||
| }[]; | ||
| export type ProposalSetup = { | ||
| minTotalRounds: number; | ||
@@ -269,24 +305,8 @@ maxTotalRounds: number; | ||
| }; | ||
| export declare function parseVotingSetup(slice: Slice | null | undefined): { | ||
| normalParams: { | ||
| minTotalRounds: number; | ||
| maxTotalRounds: number; | ||
| minWins: number; | ||
| maxLoses: number; | ||
| minStoreSec: number; | ||
| maxStoreSec: number; | ||
| bitPrice: number; | ||
| cellPrice: number; | ||
| }; | ||
| criticalParams: { | ||
| minTotalRounds: number; | ||
| maxTotalRounds: number; | ||
| minWins: number; | ||
| maxLoses: number; | ||
| minStoreSec: number; | ||
| maxStoreSec: number; | ||
| bitPrice: number; | ||
| cellPrice: number; | ||
| }; | ||
| export declare function parseProposalSetup(slice: Slice): ProposalSetup; | ||
| export type VotingSetup = { | ||
| normalParams: ProposalSetup; | ||
| criticalParams: ProposalSetup; | ||
| }; | ||
| export declare function parseVotingSetup(slice: Slice | null | undefined): VotingSetup; | ||
| export declare function loadConfigParamById(configBase64: string, id: number): Cell; | ||
@@ -310,24 +330,77 @@ export declare function loadConfigParamsAsSlice(configBase64: string): Map<number, Slice>; | ||
| workchains: Dictionary<number, WorkchainDescriptor>; | ||
| voting: { | ||
| normalParams: { | ||
| minTotalRounds: number; | ||
| maxTotalRounds: number; | ||
| minWins: number; | ||
| maxLoses: number; | ||
| minStoreSec: number; | ||
| maxStoreSec: number; | ||
| bitPrice: number; | ||
| cellPrice: number; | ||
| }; | ||
| criticalParams: { | ||
| minTotalRounds: number; | ||
| maxTotalRounds: number; | ||
| minWins: number; | ||
| maxLoses: number; | ||
| minStoreSec: number; | ||
| maxStoreSec: number; | ||
| bitPrice: number; | ||
| cellPrice: number; | ||
| }; | ||
| voting: VotingSetup; | ||
| validators: { | ||
| minStake: bigint; | ||
| maxStake: bigint; | ||
| minTotalStake: bigint; | ||
| maxStakeFactor: number; | ||
| maxValidators: number; | ||
| maxMainValidators: number; | ||
| minValidators: number; | ||
| validatorsElectedFor: number; | ||
| electorsStartBefore: number; | ||
| electorsEndBefore: number; | ||
| stakeHeldFor: number; | ||
| }; | ||
| storagePrices: StoragePrices[]; | ||
| gasPrices: { | ||
| masterchain: GasLimitsPrices; | ||
| workchain: GasLimitsPrices; | ||
| }; | ||
| msgPrices: { | ||
| masterchain: MsgPrices; | ||
| workchain: MsgPrices; | ||
| }; | ||
| validatorSets: { | ||
| prevValidators: ValidatorSet | null; | ||
| prevTempValidators: ValidatorSet | null; | ||
| currentValidators: ValidatorSet | null; | ||
| currentTempValidators: ValidatorSet | null; | ||
| nextValidators: ValidatorSet | null; | ||
| nextTempValidators: ValidatorSet | null; | ||
| }; | ||
| validatorsPunish: ValidatorsPunishmentConfig | null; | ||
| bridges: { | ||
| ethereum: BridgeParams | null; | ||
| binance: BridgeParams | null; | ||
| polygon: BridgeParams | null; | ||
| }; | ||
| catchain: CatchainConfig; | ||
| consensus: ConsensusConfig; | ||
| }; | ||
| export declare function parseFullerConfig(configs: Map<number, Slice>): { | ||
| configAddress: Address; | ||
| electorAddress: Address; | ||
| minterAddress: Address | null; | ||
| feeCollectorAddress: Address | null; | ||
| dnsRootAddress: Address | null; | ||
| burningConfig: { | ||
| blackholeAddr: Address | null; | ||
| feeBurnNominator: number; | ||
| feeBurnDenominator: number; | ||
| }; | ||
| extraCurrenciesMintPrices: { | ||
| mintNewPrice: bigint; | ||
| mintAddPrice: bigint; | ||
| } | null; | ||
| extraCurrencies: { | ||
| toMint: ExtraCurrency; | ||
| }; | ||
| globalVersion: { | ||
| version: number; | ||
| capabilities: bigint; | ||
| }; | ||
| configMandatoryParams: Set<number>; | ||
| configCriticalParams: Set<number>; | ||
| voting: VotingSetup; | ||
| workchains: Dictionary<number, WorkchainDescriptor>; | ||
| complaintCost: { | ||
| deposit: bigint; | ||
| bitPrice: bigint; | ||
| cellPrice: bigint; | ||
| }; | ||
| blockCreationRewards: { | ||
| masterchainBlockFee: bigint; | ||
| workchainBlockFee: bigint; | ||
| }; | ||
| validators: { | ||
@@ -348,304 +421,43 @@ minStake: bigint; | ||
| gasPrices: { | ||
| masterchain: { | ||
| flatLimit: bigint; | ||
| flatGasPrice: bigint; | ||
| other: { | ||
| gasPrice: bigint; | ||
| gasLimit: bigint; | ||
| specialGasLimit: bigint; | ||
| gasCredit: bigint; | ||
| blockGasLimit: bigint; | ||
| freezeDueLimit: bigint; | ||
| deleteDueLimit: bigint; | ||
| } | { | ||
| gasPrice: bigint; | ||
| gasLimit: bigint; | ||
| gasCredit: bigint; | ||
| blockGasLimit: bigint; | ||
| freezeDueLimit: bigint; | ||
| deleteDueLimit: bigint; | ||
| specialGasLimit?: undefined; | ||
| }; | ||
| }; | ||
| workchain: { | ||
| flatLimit: bigint; | ||
| flatGasPrice: bigint; | ||
| other: { | ||
| gasPrice: bigint; | ||
| gasLimit: bigint; | ||
| specialGasLimit: bigint; | ||
| gasCredit: bigint; | ||
| blockGasLimit: bigint; | ||
| freezeDueLimit: bigint; | ||
| deleteDueLimit: bigint; | ||
| } | { | ||
| gasPrice: bigint; | ||
| gasLimit: bigint; | ||
| gasCredit: bigint; | ||
| blockGasLimit: bigint; | ||
| freezeDueLimit: bigint; | ||
| deleteDueLimit: bigint; | ||
| specialGasLimit?: undefined; | ||
| }; | ||
| }; | ||
| masterchain: GasLimitsPrices; | ||
| workchain: GasLimitsPrices; | ||
| }; | ||
| blockLimits: { | ||
| masterchain: BlockLimits; | ||
| workchain: BlockLimits; | ||
| }; | ||
| msgPrices: { | ||
| masterchain: { | ||
| lumpPrice: bigint; | ||
| bitPrice: bigint; | ||
| cellPrice: bigint; | ||
| ihrPriceFactor: number; | ||
| firstFrac: number; | ||
| nextFrac: number; | ||
| }; | ||
| workchain: { | ||
| lumpPrice: bigint; | ||
| bitPrice: bigint; | ||
| cellPrice: bigint; | ||
| ihrPriceFactor: number; | ||
| firstFrac: number; | ||
| nextFrac: number; | ||
| }; | ||
| masterchain: MsgPrices; | ||
| workchain: MsgPrices; | ||
| }; | ||
| catchain: CatchainConfig; | ||
| consensus: ConsensusConfig; | ||
| fundamentalSmcAddr: Address[]; | ||
| validatorSets: { | ||
| prevValidators: { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: null; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: bigint; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | null | undefined; | ||
| prevTempValidators: { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: null; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: bigint; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | null | undefined; | ||
| currentValidators: { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: null; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: bigint; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | null | undefined; | ||
| currentTempValidators: { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: null; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: bigint; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | null | undefined; | ||
| nextValidators: { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: null; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: bigint; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | null | undefined; | ||
| nextTempValidators: { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: null; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | { | ||
| timeSince: number; | ||
| timeUntil: number; | ||
| total: number; | ||
| main: number; | ||
| totalWeight: bigint; | ||
| list: Dictionary<number, { | ||
| publicKey: Buffer; | ||
| weight: bigint; | ||
| adnlAddress: Buffer | null; | ||
| }>; | ||
| } | null | undefined; | ||
| prevValidators: ValidatorSet | null; | ||
| prevTempValidators: ValidatorSet | null; | ||
| currentValidators: ValidatorSet | null; | ||
| currentTempValidators: ValidatorSet | null; | ||
| nextValidators: ValidatorSet | null; | ||
| nextTempValidators: ValidatorSet | null; | ||
| }; | ||
| validatorsPunish: { | ||
| defaultFlatFine: bigint; | ||
| defaultProportionaFine: bigint; | ||
| severityFlatMult: number; | ||
| severityProportionalMult: number; | ||
| unfunishableInterval: number; | ||
| longInterval: number; | ||
| longFlatMult: number; | ||
| longProportionalMult: number; | ||
| mediumInterval: number; | ||
| mediumFlatMult: number; | ||
| mediumProportionalMult: number; | ||
| } | null; | ||
| validatorsPunish: ValidatorsPunishmentConfig | null; | ||
| suspended: { | ||
| addresses: Address[]; | ||
| suspendedUntil: number; | ||
| }; | ||
| precompiledContracts: { | ||
| hash: Buffer; | ||
| gasUsed: bigint; | ||
| }[]; | ||
| bridges: { | ||
| ethereum: { | ||
| bridgeAddress: Address; | ||
| oracleMultisigAddress: Address; | ||
| oracles: Map<string, Buffer>; | ||
| externalChainAddress: Buffer; | ||
| } | null; | ||
| binance: { | ||
| bridgeAddress: Address; | ||
| oracleMultisigAddress: Address; | ||
| oracles: Map<string, Buffer>; | ||
| externalChainAddress: Buffer; | ||
| } | null; | ||
| polygon: { | ||
| bridgeAddress: Address; | ||
| oracleMultisigAddress: Address; | ||
| oracles: Map<string, Buffer>; | ||
| externalChainAddress: Buffer; | ||
| } | null; | ||
| ethereum: BridgeParams | null; | ||
| binance: BridgeParams | null; | ||
| polygon: BridgeParams | null; | ||
| }; | ||
| catchain: { | ||
| masterCatchainLifetime: number; | ||
| shardCatchainLifetime: number; | ||
| shardValidatorsLifetime: number; | ||
| shardValidatorsCount: number; | ||
| flags?: undefined; | ||
| suffleMasterValidators?: undefined; | ||
| } | { | ||
| flags: number; | ||
| suffleMasterValidators: boolean; | ||
| masterCatchainLifetime: number; | ||
| shardCatchainLifetime: number; | ||
| shardValidatorsLifetime: number; | ||
| shardValidatorsCount: number; | ||
| tokenBridges: { | ||
| ethereum: JettonBridgeParams | null; | ||
| binance: JettonBridgeParams | null; | ||
| polygon: JettonBridgeParams | null; | ||
| }; | ||
| consensus: { | ||
| roundCandidates: number; | ||
| nextCandidateDelay: number; | ||
| consensusTimeout: number; | ||
| fastAttempts: number; | ||
| attemptDuration: number; | ||
| catchainMaxDeps: number; | ||
| maxBlockBytes: number; | ||
| maxColaltedBytes: number; | ||
| flags?: undefined; | ||
| newCatchainIds?: undefined; | ||
| protoVersion?: undefined; | ||
| catchainMaxBlocksCoeff?: undefined; | ||
| } | { | ||
| flags: number; | ||
| newCatchainIds: boolean; | ||
| roundCandidates: number; | ||
| nextCandidateDelay: number; | ||
| consensusTimeout: number; | ||
| fastAttempts: number; | ||
| attemptDuration: number; | ||
| catchainMaxDeps: number; | ||
| maxBlockBytes: number; | ||
| maxColaltedBytes: number; | ||
| protoVersion?: undefined; | ||
| catchainMaxBlocksCoeff?: undefined; | ||
| } | { | ||
| flags: number; | ||
| newCatchainIds: boolean; | ||
| roundCandidates: number; | ||
| nextCandidateDelay: number; | ||
| consensusTimeout: number; | ||
| fastAttempts: number; | ||
| attemptDuration: number; | ||
| catchainMaxDeps: number; | ||
| maxBlockBytes: number; | ||
| maxColaltedBytes: number; | ||
| protoVersion: number; | ||
| catchainMaxBlocksCoeff?: undefined; | ||
| } | { | ||
| flags: number; | ||
| newCatchainIds: boolean; | ||
| roundCandidates: number; | ||
| nextCandidateDelay: number; | ||
| consensusTimeout: number; | ||
| fastAttempts: number; | ||
| attemptDuration: number; | ||
| catchainMaxDeps: number; | ||
| maxBlockBytes: number; | ||
| maxColaltedBytes: number; | ||
| protoVersion: number; | ||
| catchainMaxBlocksCoeff: number; | ||
| }; | ||
| }; |
+343
-46
@@ -8,3 +8,8 @@ "use strict"; | ||
| exports.configParse5 = configParse5; | ||
| exports.configParse6 = configParse6; | ||
| exports.configParse7 = configParse7; | ||
| exports.configParse9 = configParse9; | ||
| exports.configParse10 = configParse10; | ||
| exports.configParse13 = configParse13; | ||
| exports.configParse14 = configParse14; | ||
| exports.configParse15 = configParse15; | ||
@@ -20,6 +25,11 @@ exports.configParse16 = configParse16; | ||
| exports.configParseBridge = configParseBridge; | ||
| exports.loadJettonBridgeParams = loadJettonBridgeParams; | ||
| exports.configParseGasLimitsPrices = configParseGasLimitsPrices; | ||
| exports.configParseBlockLimits = configParseBlockLimits; | ||
| exports.configParseMsgPrices = configParseMsgPrices; | ||
| exports.configParse28 = configParse28; | ||
| exports.configParse29 = configParse29; | ||
| exports.configParse31 = configParse31; | ||
| exports.configParse44 = configParse44; | ||
| exports.configParse45 = configParse45; | ||
| exports.parseProposalSetup = parseProposalSetup; | ||
@@ -30,2 +40,3 @@ exports.parseVotingSetup = parseVotingSetup; | ||
| exports.parseFullConfig = parseFullConfig; | ||
| exports.parseFullerConfig = parseFullerConfig; | ||
| const core_1 = require("@ton/core"); | ||
@@ -43,3 +54,3 @@ function configParseMasterAddress(slice) { | ||
| if (slice.loadUint(32) !== 0x8e81278a) { | ||
| throw Error('Invalid config'); | ||
| throw Error('Invalid publicKey'); | ||
| } | ||
@@ -69,3 +80,3 @@ return slice.loadBuffer(32); | ||
| else { | ||
| throw Error('Invalid config'); | ||
| throw Error('Invalid validator description dict'); | ||
| } | ||
@@ -107,2 +118,3 @@ } | ||
| } | ||
| return null; | ||
| } | ||
@@ -127,3 +139,3 @@ function parseBridge(slice) { | ||
| if (!slice) { | ||
| throw Error('Invalid config'); | ||
| throw Error('Invalid master address'); | ||
| } | ||
@@ -134,3 +146,3 @@ return configParseMasterAddress(slice); | ||
| if (!slice) { | ||
| throw Error('Invalid config'); | ||
| throw Error('No config5 slice'); | ||
| } | ||
@@ -148,24 +160,78 @@ const magic = slice.loadUint(8); | ||
| } | ||
| throw new Error('Invalid config'); | ||
| throw new Error('Invalid config5'); | ||
| } | ||
| // _ mint_new_price:Grams mint_add_price:Grams = ConfigParam 6; | ||
| function configParse6(slice) { | ||
| if (!slice) { | ||
| // no param in mainnet for now, so throwing will cause crash of parseFullConfig() | ||
| return null; | ||
| } | ||
| const mintNewPrice = slice.loadCoins(); | ||
| const mintAddPrice = slice.loadCoins(); | ||
| return { | ||
| mintNewPrice, | ||
| mintAddPrice | ||
| }; | ||
| } | ||
| // extra_currencies$_ dict:(HashmapE 32 (VarUInteger 32)) = ExtraCurrencyCollection; | ||
| // _ to_mint:ExtraCurrencyCollection = ConfigParam 7; | ||
| function configParse7(slice) { | ||
| if (!slice) { | ||
| throw Error('No config7 slice'); | ||
| } | ||
| return { | ||
| toMint: (0, core_1.loadExtraCurrency)(slice.loadRef()), | ||
| }; | ||
| } | ||
| // _ mandatory_params:(Hashmap 32 True) = ConfigParam 9; | ||
| function configParse9(slice) { | ||
| if (!slice) { | ||
| throw Error('No config9 slice'); | ||
| } | ||
| return new Set(slice.loadDictDirect(core_1.Dictionary.Keys.Int(32), core_1.Dictionary.Values.Uint(0)).keys()); | ||
| } | ||
| // _ critical_params:(Hashmap 32 True) = ConfigParam 10; | ||
| function configParse10(slice) { | ||
| if (!slice) { | ||
| throw Error('No config10 slice'); | ||
| } | ||
| return new Set(slice.loadDictDirect(core_1.Dictionary.Keys.Int(32), core_1.Dictionary.Values.Uint(0)).keys()); | ||
| } | ||
| function configParse13(slice) { | ||
| if (!slice) { | ||
| throw Error('Invalid config'); | ||
| throw Error('No config13 slice'); | ||
| } | ||
| const magic = slice.loadUint(8); | ||
| if (magic === 0x1a) { | ||
| const deposit = slice.loadCoins(); | ||
| const bitPrice = slice.loadCoins(); | ||
| const cellPrice = slice.loadCoins(); | ||
| return { | ||
| deposit, | ||
| bitPrice, | ||
| cellPrice | ||
| }; | ||
| if (magic !== 0x1a) { | ||
| throw new Error('Invalid config13'); | ||
| } | ||
| throw new Error('Invalid config'); | ||
| const deposit = slice.loadCoins(); | ||
| const bitPrice = slice.loadCoins(); | ||
| const cellPrice = slice.loadCoins(); | ||
| return { | ||
| deposit, | ||
| bitPrice, | ||
| cellPrice | ||
| }; | ||
| } | ||
| // block_grams_created#6b masterchain_block_fee:Grams basechain_block_fee:Grams = BlockCreateFees; | ||
| // _ BlockCreateFees = ConfigParam 14; | ||
| function configParse14(slice) { | ||
| if (!slice) { | ||
| throw Error('No config14 slice'); | ||
| } | ||
| const magic = slice.loadUint(8); | ||
| if (magic !== 0x6b) { | ||
| throw new Error('Invalid config14'); | ||
| } | ||
| const masterchainBlockFee = slice.loadCoins(); | ||
| const workchainBlockFee = slice.loadCoins(); | ||
| return { | ||
| masterchainBlockFee, | ||
| workchainBlockFee | ||
| }; | ||
| } | ||
| function configParse15(slice) { | ||
| if (!slice) { | ||
| throw Error('Invalid config'); | ||
| throw Error('No config15 slice'); | ||
| } | ||
@@ -185,3 +251,3 @@ const validatorsElectedFor = slice.loadUint(32); | ||
| if (!slice) { | ||
| throw Error('Invalid config'); | ||
| throw Error('No config16 slice'); | ||
| } | ||
@@ -199,3 +265,3 @@ const maxValidators = slice.loadUint(16); | ||
| if (!slice) { | ||
| throw Error('Invalid config'); | ||
| throw Error('No config17 slice'); | ||
| } | ||
@@ -220,3 +286,3 @@ const minStake = slice.loadCoins(); | ||
| if (header !== 0xcc) { | ||
| throw Error('Invalid config'); | ||
| throw Error('Invalid storage prices dict'); | ||
| } | ||
@@ -239,3 +305,3 @@ const utime_since = src.loadUint(32); | ||
| if (!slice) { | ||
| throw Error('Invalid config'); | ||
| throw Error('No config18 slice'); | ||
| } | ||
@@ -264,3 +330,3 @@ return slice.loadDictDirect(core_1.Dictionary.Keys.Buffer(4), StoragePricesDictValue).values(); | ||
| if (header !== 1) { | ||
| throw Error('Invalid config'); | ||
| throw Error('Invalid config40'); | ||
| } | ||
@@ -295,3 +361,3 @@ const defaultFlatFine = slice.loadCoins(); | ||
| if (!(constructorTag == 0xA6 || constructorTag == 0xA7)) { | ||
| throw Error('Invalid config'); | ||
| throw Error('Invalid workchain descriptor'); | ||
| } | ||
@@ -311,3 +377,3 @@ const enabledSince = slice.loadUint(32); | ||
| if (!slice.loadUint(4)) { | ||
| throw Error('Invalid config'); | ||
| throw Error('Not basic workchain descriptor'); | ||
| } | ||
@@ -368,3 +434,3 @@ const vmVersion = slice.loadInt(32); | ||
| if (!slice) { | ||
| throw Error('Invalid config'); | ||
| throw Error('No config12 slice'); | ||
| } | ||
@@ -389,2 +455,64 @@ const wd = slice.loadDict(core_1.Dictionary.Keys.Uint(32), WorkchainDescriptorDictValue); | ||
| } | ||
| function loadJettonBridgeParams(slice) { | ||
| if (!slice) { | ||
| return null; | ||
| } | ||
| const magic = slice.loadUint(8); | ||
| // jetton_bridge_params_v0#00 bridge_address:bits256 oracles_address:bits256 oracles:(HashmapE 256 uint256) | ||
| // state_flags:uint8 burn_bridge_fee:Coins = JettonBridgeParams; | ||
| if (magic === 0x00) { | ||
| const bridgeAddress = new core_1.Address(-1, slice.loadBuffer(32)); | ||
| const oracleAddress = new core_1.Address(-1, slice.loadBuffer(32)); | ||
| const oraclesRaw = slice.loadDict(core_1.Dictionary.Keys.Buffer(32), core_1.Dictionary.Values.Buffer(32)); | ||
| const oracles = [...oraclesRaw].map(e => ({ | ||
| addr: new core_1.Address(-1, e[0]), | ||
| pubkey: e[1], | ||
| })); | ||
| const flags = slice.loadUint(8); | ||
| const bridgeBurnFee = slice.loadCoins(); | ||
| return { | ||
| bridgeAddress, | ||
| oracleAddress, | ||
| oracles, | ||
| flags, | ||
| bridgeBurnFee | ||
| }; | ||
| } | ||
| // jetton_bridge_params_v1#01 bridge_address:bits256 oracles_address:bits256 oracles:(HashmapE 256 uint256) | ||
| // state_flags:uint8 prices:^JettonBridgePrices external_chain_address:bits256 = JettonBridgeParams; | ||
| if (magic === 0x01) { | ||
| const bridgeAddress = new core_1.Address(-1, slice.loadBuffer(32)); | ||
| const oracleAddress = new core_1.Address(-1, slice.loadBuffer(32)); | ||
| const oraclesRaw = slice.loadDict(core_1.Dictionary.Keys.Buffer(32), core_1.Dictionary.Values.Buffer(32)); | ||
| const oracles = [...oraclesRaw].map(e => ({ | ||
| addr: new core_1.Address(-1, e[0]), | ||
| pubkey: e[1], | ||
| })); | ||
| const flags = slice.loadUint(8); | ||
| const pricesRef = slice.loadRef().beginParse(); | ||
| const bridgeBurnFee = pricesRef.loadCoins(); | ||
| const bridgeMintFee = pricesRef.loadCoins(); | ||
| const walletMinTonsForStorage = pricesRef.loadCoins(); | ||
| const walletGasConsumption = pricesRef.loadCoins(); | ||
| const minterMinTonsForStorage = pricesRef.loadCoins(); | ||
| const discoverGasConsumption = pricesRef.loadCoins(); | ||
| const externalChainAddress = slice.loadBuffer(32); | ||
| return { | ||
| bridgeAddress, | ||
| oracleAddress, | ||
| oracles, | ||
| flags, | ||
| jettonBridgePrices: { | ||
| bridgeBurnFee, | ||
| bridgeMintFee, | ||
| walletMinTonsForStorage, | ||
| walletGasConsumption, | ||
| minterMinTonsForStorage, | ||
| discoverGasConsumption | ||
| }, | ||
| externalChainAddress | ||
| }; | ||
| } | ||
| throw new Error('Invalid msg prices param'); | ||
| } | ||
| function parseGasLimitsInternal(slice) { | ||
@@ -427,3 +555,3 @@ const tag = slice.loadUint(8); | ||
| else { | ||
| throw Error('Invalid config'); | ||
| throw Error('Invalid gas limits internal'); | ||
| } | ||
@@ -433,3 +561,3 @@ } | ||
| if (!slice) { | ||
| throw Error('Invalid config'); | ||
| throw Error('No gas limits slice'); | ||
| } | ||
@@ -448,8 +576,70 @@ const tag = slice.loadUint(8); | ||
| else { | ||
| throw Error('Invalid config'); | ||
| throw Error('Invalid gas limits'); | ||
| } | ||
| } | ||
| // param_limits#c3 underload:# soft_limit:# { underload <= soft_limit } | ||
| // hard_limit:# { soft_limit <= hard_limit } = ParamLimits; | ||
| function configParseLimitParams(slice) { | ||
| const paramsLimitTag = slice.loadUint(8); | ||
| if (paramsLimitTag !== 0xc3) { | ||
| throw Error('Invalid params limit slice'); | ||
| } | ||
| const underload = slice.loadUint(32); | ||
| const softLimit = slice.loadUint(32); | ||
| const hardLimit = slice.loadUint(32); | ||
| if ((underload > softLimit) || (softLimit > hardLimit)) { | ||
| throw Error('Incosistent limitParams'); | ||
| } | ||
| return { | ||
| underload, | ||
| softLimit, | ||
| hardLimit | ||
| }; | ||
| } | ||
| function configParseBlockLimits(slice) { | ||
| if (!slice) { | ||
| throw Error('No block limits slice'); | ||
| } | ||
| const blockLimitTag = slice.loadUint(8); | ||
| // block_limits#5d bytes:ParamLimits gas:ParamLimits lt_delta:ParamLimits = BlockLimits; | ||
| if (blockLimitTag === 0x5d) { | ||
| const bytes = configParseLimitParams(slice); | ||
| const gas = configParseLimitParams(slice); | ||
| const ltDelta = configParseLimitParams(slice); | ||
| return { | ||
| bytes, | ||
| gas, | ||
| ltDelta | ||
| }; | ||
| } | ||
| // imported_msg_queue_limits#d3 max_bytes:# max_msgs:# = ImportedMsgQueueLimits; | ||
| // block_limits_v2#5e bytes:ParamLimits gas:ParamLimits lt_delta:ParamLimits | ||
| // collated_data:ParamLimits imported_msg_queue:ImportedMsgQueueLimits = BlockLimits; | ||
| if (blockLimitTag === 0x5e) { | ||
| const bytes = configParseLimitParams(slice); | ||
| const gas = configParseLimitParams(slice); | ||
| const ltDelta = configParseLimitParams(slice); | ||
| const collatedData = configParseLimitParams(slice); | ||
| const importedMsgQueueTag = slice.loadUint(8); | ||
| if (importedMsgQueueTag !== 0xd3) { | ||
| throw Error('Invalid importedMsgQueue'); | ||
| } | ||
| const maxBytes = slice.loadUint(32); | ||
| const maxMsgs = slice.loadUint(32); | ||
| return { | ||
| bytes, | ||
| gas, | ||
| ltDelta, | ||
| collatedData, | ||
| importedMsgQueue: { | ||
| maxBytes, | ||
| maxMsgs | ||
| } | ||
| }; | ||
| } | ||
| throw Error('Invalid block limits'); | ||
| } | ||
| function configParseMsgPrices(slice) { | ||
| if (!slice) { | ||
| throw new Error('Invalid config'); | ||
| throw new Error('No msg prices slice'); | ||
| } | ||
@@ -469,10 +659,5 @@ const magic = slice.loadUint(8); | ||
| } | ||
| // catchain_config#c1 mc_catchain_lifetime:uint32 shard_catchain_lifetime:uint32 | ||
| // shard_validators_lifetime:uint32 shard_validators_num:uint32 = CatchainConfig; | ||
| // catchain_config_new#c2 flags:(## 7) { flags = 0 } shuffle_mc_validators:Bool | ||
| // mc_catchain_lifetime:uint32 shard_catchain_lifetime:uint32 | ||
| // shard_validators_lifetime:uint32 shard_validators_num:uint32 = CatchainConfig; | ||
| function configParse28(slice) { | ||
| if (!slice) { | ||
| throw new Error('Invalid config'); | ||
| throw new Error('No config28 slice'); | ||
| } | ||
@@ -508,3 +693,3 @@ const magic = slice.loadUint(8); | ||
| } | ||
| throw new Error('Invalid config'); | ||
| throw new Error('Invalid config28'); | ||
| } | ||
@@ -528,3 +713,3 @@ // consensus_config#d6 round_candidates:# { round_candidates >= 1 } | ||
| if (!slice) { | ||
| throw new Error('Invalid config'); | ||
| throw new Error('No config29 slice'); | ||
| } | ||
@@ -630,4 +815,60 @@ const magic = slice.loadUint(8); | ||
| } | ||
| throw new Error('Invalid config'); | ||
| throw new Error('Invalid config29'); | ||
| } | ||
| // _ fundamental_smc_addr:(HashmapE 256 True) = ConfigParam 31; | ||
| function configParse31(slice) { | ||
| if (!slice) { | ||
| throw Error('No config31 slice'); | ||
| } | ||
| const rawAddrsDict = slice.loadDict(core_1.Dictionary.Keys.Buffer(32), core_1.Dictionary.Values.Uint(0)); | ||
| // only masterchain addrs here - https://docs.ton.org/v3/documentation/network/config-params/overview#param-31 | ||
| return [...rawAddrsDict].map(e => new core_1.Address(-1, e[0])); | ||
| } | ||
| // suspended_address_list#00 addresses:(HashmapE 288 Unit) suspended_until:uint32 = SuspendedAddressList; | ||
| // _ SuspendedAddressList = ConfigParam 44; | ||
| function configParse44(slice) { | ||
| if (!slice) { | ||
| throw Error('No config44 slice'); | ||
| } | ||
| const magic = slice.loadUint(8); | ||
| if (magic !== 0x00) { | ||
| throw new Error('Invalid config44'); | ||
| } | ||
| // buffer36 = uint288 | ||
| const rawAddrsDict = slice.loadDict(core_1.Dictionary.Keys.Buffer(36), core_1.Dictionary.Values.Uint(0)); | ||
| const suspendedUntil = slice.loadUint(32); | ||
| // uint288 = [wc:int32 addr:uint256] | ||
| const constructedAddrs = [...rawAddrsDict].map(e => new core_1.Address(e[0].readInt32BE(), e[0].subarray(4))); | ||
| return { | ||
| addresses: constructedAddrs, | ||
| suspendedUntil | ||
| }; | ||
| } | ||
| const PrecompiledContractsDictValue = { | ||
| serialize: () => { throw Error('not implemented'); }, | ||
| parse: (src) => { | ||
| const tag = src.loadUint(8); | ||
| if (tag !== 0xb0) { | ||
| throw new Error('Invalid precompiled contracts dict'); | ||
| } | ||
| return src.loadUintBig(64); | ||
| }, | ||
| }; | ||
| // precompiled_smc#b0 gas_usage:uint64 = PrecompiledSmc; | ||
| // precompiled_contracts_config#c0 list:(HashmapE 256 PrecompiledSmc) = PrecompiledContractsConfig; | ||
| // _ PrecompiledContractsConfig = ConfigParam 45; | ||
| function configParse45(slice) { | ||
| if (!slice) { | ||
| throw Error('No config45 slice'); | ||
| } | ||
| const magic = slice.loadUint(8); | ||
| if (magic !== 0xc0) { | ||
| throw new Error('Invalid config45'); | ||
| } | ||
| const precompiledContracts = slice.loadDict(core_1.Dictionary.Keys.Buffer(32), PrecompiledContractsDictValue); | ||
| return [...precompiledContracts].map((e) => ({ | ||
| hash: e[0], | ||
| gasUsed: e[1] | ||
| })); | ||
| } | ||
| // cfg_vote_cfg#36 min_tot_rounds:uint8 max_tot_rounds:uint8 min_wins:uint8 max_losses:uint8 min_store_sec:uint32 max_store_sec:uint32 bit_price:uint32 cell_price:uint32 = ConfigProposalSetup; | ||
@@ -637,3 +878,3 @@ function parseProposalSetup(slice) { | ||
| if (magic !== 0x36) { | ||
| throw new Error('Invalid config'); | ||
| throw new Error('Invalid proposal setup'); | ||
| } | ||
@@ -653,7 +894,7 @@ const minTotalRounds = slice.loadUint(8); | ||
| if (!slice) { | ||
| throw new Error('Invalid config'); | ||
| throw new Error('No voting setup'); | ||
| } | ||
| const magic = slice.loadUint(8); | ||
| if (magic !== 0x91) { | ||
| throw new Error('Invalid config'); | ||
| throw new Error('Invalid voting setup'); | ||
| } | ||
@@ -720,8 +961,64 @@ const normalParams = parseProposalSetup(slice.loadRef().beginParse()); | ||
| consensus: configParse29(configs.get(29)) | ||
| // TODO: mint_new_price:Grams mint_add_price:Grams = ConfigParam 6; | ||
| // TODO: to_mint:ExtraCurrencyCollection = ConfigParam 7 | ||
| // TODO: mandatory_params:(Hashmap 32 True) = ConfigParam 9 | ||
| // TODO: critical_params:(Hashmap 32 True) = ConfigParam 10 | ||
| // TODO: BlockCreateFees = ConfigParam 14 | ||
| }; | ||
| } | ||
| function parseFullerConfig(configs) { | ||
| return { | ||
| configAddress: configParseMasterAddressRequired(configs.get(0)), | ||
| electorAddress: configParseMasterAddressRequired(configs.get(1)), | ||
| minterAddress: configParseMasterAddress(configs.get(2)), | ||
| feeCollectorAddress: configParseMasterAddress(configs.get(3)), | ||
| dnsRootAddress: configParseMasterAddress(configs.get(4)), | ||
| burningConfig: configParse5(configs.get(5)), | ||
| extraCurrenciesMintPrices: configParse6(configs.get(6)), | ||
| extraCurrencies: configParse7(configs.get(7)), | ||
| globalVersion: configParse8(configs.get(8)), | ||
| configMandatoryParams: configParse9(configs.get(9)), | ||
| configCriticalParams: configParse10(configs.get(10)), | ||
| voting: parseVotingSetup(configs.get(11)), | ||
| workchains: configParse12(configs.get(12)), | ||
| complaintCost: configParse13(configs.get(13)), | ||
| blockCreationRewards: configParse14(configs.get(14)), | ||
| validators: { | ||
| ...configParse15(configs.get(15)), | ||
| ...configParse16(configs.get(16)), | ||
| ...configParse17(configs.get(17)) | ||
| }, | ||
| storagePrices: configParse18(configs.get(18)), | ||
| gasPrices: { | ||
| masterchain: configParseGasLimitsPrices(configs.get(20)), | ||
| workchain: configParseGasLimitsPrices(configs.get(21)), | ||
| }, | ||
| blockLimits: { | ||
| masterchain: configParseBlockLimits(configs.get(22)), | ||
| workchain: configParseBlockLimits(configs.get(23)), | ||
| }, | ||
| msgPrices: { | ||
| masterchain: configParseMsgPrices(configs.get(24)), | ||
| workchain: configParseMsgPrices(configs.get(25)), | ||
| }, | ||
| catchain: configParse28(configs.get(28)), | ||
| consensus: configParse29(configs.get(29)), | ||
| fundamentalSmcAddr: configParse31(configs.get(31)), | ||
| validatorSets: { | ||
| prevValidators: configParseValidatorSet(configs.get(32)), | ||
| prevTempValidators: configParseValidatorSet(configs.get(33)), | ||
| currentValidators: configParseValidatorSet(configs.get(34)), | ||
| currentTempValidators: configParseValidatorSet(configs.get(35)), | ||
| nextValidators: configParseValidatorSet(configs.get(36)), | ||
| nextTempValidators: configParseValidatorSet(configs.get(37)) | ||
| }, | ||
| validatorsPunish: configParse40(configs.get(40)), | ||
| suspended: configParse44(configs.get(44)), | ||
| precompiledContracts: configParse45(configs.get(45)), | ||
| bridges: { | ||
| ethereum: configParseBridge(configs.get(71)), | ||
| binance: configParseBridge(configs.get(72)), | ||
| polygon: configParseBridge(configs.get(73)) | ||
| }, | ||
| tokenBridges: { | ||
| ethereum: loadJettonBridgeParams(configs.get(79)), | ||
| binance: loadJettonBridgeParams(configs.get(81)), | ||
| polygon: loadJettonBridgeParams(configs.get(82)), | ||
| } | ||
| }; | ||
| } |
@@ -15,11 +15,15 @@ "use strict"; | ||
| const KNOWN_BLOCK = 31091335; | ||
| const BLOCK_AT_31_10_25 = 53519168; | ||
| const TESTNET_BLOCK = 32762926; | ||
| const testnetClient = (0, createTestClient4_1.createTestClient4)("testnet"); | ||
| describe('ConfigContract', () => { | ||
| // for some reason api returns 500 for this reques | ||
| // it('should return correct burning config', async () => { | ||
| // const serializedConfigsCell = (await client.getConfig(KNOWN_BLOCK, [13])).config.cell; | ||
| // const config13 = configParse13(loadConfigParamById(serializedConfigsCell, 13).beginParse()); | ||
| // console.log(config13); | ||
| // }); | ||
| it('should return correct burning config', async () => { | ||
| const serializedConfigsCell = (await client.getConfig(BLOCK_AT_31_10_25, [13])).config.cell; | ||
| const config13 = (0, ConfigParser_1.configParse13)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 13).beginParse()); | ||
| expect(config13).toEqual({ | ||
| deposit: 1000000000n, | ||
| bitPrice: 1n, | ||
| cellPrice: 500n | ||
| }); | ||
| }); | ||
| it('should return correct complaint pricing', async () => { | ||
@@ -54,2 +58,108 @@ const serializedConfigsCell = (await client.getConfig(KNOWN_BLOCK, [5])).config.cell; | ||
| }); | ||
| it('should parse config7', async () => { | ||
| const serializedConfigsCell = (await client.getConfig(BLOCK_AT_31_10_25, [7])).config.cell; | ||
| const config7 = (0, ConfigParser_1.configParse7)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 7).beginParse()); | ||
| expect(config7).toEqual({ | ||
| toMint: { | ||
| '239': 666666666666n, | ||
| '4294967279': 1000000000000n | ||
| } | ||
| }); | ||
| }); | ||
| it('should parse config9', async () => { | ||
| const serializedConfigsCell = (await client.getConfig(BLOCK_AT_31_10_25, [9])).config.cell; | ||
| const config9 = (0, ConfigParser_1.configParse9)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 9).beginParse()); | ||
| expect(config9).toEqual(new Set([0, 1, 9, 10, 12, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 28, 34])); | ||
| }); | ||
| it('should parse config10', async () => { | ||
| const serializedConfigsCell = (await client.getConfig(BLOCK_AT_31_10_25, [10])).config.cell; | ||
| const config10 = (0, ConfigParser_1.configParse10)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 10).beginParse()); | ||
| expect(config10).toEqual(new Set([0, 1, 9, 10, 12, 14, 15, 16, 17, 32, 34, 36, -1001, -1000])); | ||
| }); | ||
| it('should parse config14', async () => { | ||
| const serializedConfigsCell = (await client.getConfig(BLOCK_AT_31_10_25, [14])).config.cell; | ||
| const config14 = (0, ConfigParser_1.configParse14)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 14).beginParse()); | ||
| expect(config14).toEqual({ | ||
| masterchainBlockFee: 1700000000n, | ||
| workchainBlockFee: 1000000000n | ||
| }); | ||
| }); | ||
| it('should parse config22', async () => { | ||
| const serializedConfigsCell = (await client.getConfig(BLOCK_AT_31_10_25, [22])).config.cell; | ||
| const config22 = (0, ConfigParser_1.configParseBlockLimits)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 22).beginParse()); | ||
| expect(config22).toEqual({ | ||
| bytes: { | ||
| underload: 131072, | ||
| softLimit: 524288, | ||
| hardLimit: 1048576 | ||
| }, | ||
| gas: { | ||
| underload: 200000, | ||
| softLimit: 1000000, | ||
| hardLimit: 2500000 | ||
| }, | ||
| ltDelta: { | ||
| underload: 1000, | ||
| softLimit: 5000, | ||
| hardLimit: 10000 | ||
| } | ||
| }); | ||
| }); | ||
| it('should parse config23', async () => { | ||
| const serializedConfigsCell = (await client.getConfig(BLOCK_AT_31_10_25, [23])).config.cell; | ||
| const config23 = (0, ConfigParser_1.configParseBlockLimits)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 23).beginParse()); | ||
| expect(config23).toEqual({ | ||
| bytes: { | ||
| underload: 262144, | ||
| softLimit: 1048576, | ||
| hardLimit: 2097152 | ||
| }, | ||
| gas: { | ||
| underload: 2000000, | ||
| softLimit: 10000000, | ||
| hardLimit: 20000000 | ||
| }, | ||
| ltDelta: { | ||
| underload: 1000, | ||
| softLimit: 5000, | ||
| hardLimit: 10000 | ||
| } | ||
| }); | ||
| }); | ||
| it('should parse config31', async () => { | ||
| const serializedConfigsCell = (await client.getConfig(BLOCK_AT_31_10_25, [31])).config.cell; | ||
| const config31 = (0, ConfigParser_1.configParse31)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 31).beginParse()); | ||
| expect(config31.map((e) => e.toString())).toEqual([ | ||
| core_1.Address.parse('-1:0000000000000000000000000000000000000000000000000000000000000000').toString(), | ||
| core_1.Address.parse('-1:0ebd7ff9ca70e06e9e22a8922f5ae75211a9d6a34a8094e8e1587b606bdbb662').toString(), | ||
| core_1.Address.parse('-1:3333333333333333333333333333333333333333333333333333333333333333').toString(), | ||
| core_1.Address.parse('-1:3b9bbfd0ad5338b9700f0833380ee17d463e51c1ae671ee6f08901bde899b202').toString(), | ||
| core_1.Address.parse('-1:4d5c0210b35daddaa219fac459dba0fdefb1fae4e97a0d0797739fe050d694ca').toString(), | ||
| core_1.Address.parse('-1:dd24c4a1f2b88f8b7053513b5cc6c5a31bc44b2a72dcb4d8c0338af0f0d37ec5').toString(), | ||
| core_1.Address.parse('-1:ead7da389bde317c5fb285807ce507baad31c35fe5534b3c418785e901f64c68').toString() | ||
| ]); | ||
| }); | ||
| it('should parse config44', async () => { | ||
| const serializedConfigsCell = (await client.getConfig(BLOCK_AT_31_10_25, [44])).config.cell; | ||
| const config44 = (0, ConfigParser_1.configParse44)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 44).beginParse()); | ||
| expect(config44.suspendedUntil).toEqual(1803189600); | ||
| expect(config44.addresses.length).toEqual(180); | ||
| expect(config44.addresses[4].toString()).toEqual(core_1.Address.parse('0:0927afd84711fea63794c619ded2288c7479b3ec16c927f0360ed76603f6df06').toString()); | ||
| }); | ||
| it('should parse config45', async () => { | ||
| const serializedConfigsCell = (await client.getConfig(BLOCK_AT_31_10_25, [45])).config.cell; | ||
| const config45 = (0, ConfigParser_1.configParse45)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 45).beginParse()); | ||
| expect(config45.map((e) => ({ hash: e.hash.toString('hex'), gasUsed: e.gasUsed }))).toEqual([{ | ||
| hash: '89468f02c78e570802e39979c8516fc38df07ea76a48357e0536f2ba7b3ee37b', | ||
| gasUsed: 1000n | ||
| }]); | ||
| }); | ||
| it('should parse jettonBridgeParams', async () => { | ||
| const serializedConfigsCell = (await client.getConfig(BLOCK_AT_31_10_25, [79])).config.cell; | ||
| const config79 = (0, ConfigParser_1.loadJettonBridgeParams)((0, ConfigParser_1.loadConfigParamById)(serializedConfigsCell, 79).beginParse()); | ||
| expect(config79?.bridgeAddress.toString()).toEqual(core_1.Address.parse('Ef-1JetbPF9ubc1ga-57oHoOyDA1IShJt-BVlJnA9rrVTfrB').toString()); | ||
| expect(config79?.jettonBridgePrices?.bridgeBurnFee).toEqual(1000000000n); | ||
| expect(config79?.oracles.length).toEqual(9); | ||
| expect(config79?.oracles[3].addr.toString()).toEqual(core_1.Address.parse('Uf8ceN7cTemTe4ZV6AIbg5f8LsHZsYV1UaiGntvkME0KtKP8').toString()); | ||
| }); | ||
| it('should return correct workchain_v2 description', async () => { | ||
@@ -131,4 +241,4 @@ const serializedConfigsCell = (await testnetClient.getConfig(TESTNET_BLOCK, [12])).config.cell; | ||
| }); | ||
| it('should not reise error when loading full config', async () => { | ||
| const serializedConfigsCell = (await client.getConfig(KNOWN_BLOCK)).config.cell; | ||
| it('should not raise error when loading full config', async () => { | ||
| const serializedConfigsCell = (await client.getConfig(BLOCK_AT_31_10_25)).config.cell; | ||
| (0, ConfigParser_1.parseFullConfig)((0, ConfigParser_1.loadConfigParamsAsSlice)(serializedConfigsCell)); | ||
@@ -135,0 +245,0 @@ }); |
+1
-1
@@ -28,3 +28,3 @@ /** | ||
| export { ElectorContract } from './elector/ElectorContract'; | ||
| export { GasLimitsPrices, StoragePrices, MsgPrices, WorkchainDescriptor, configParse5, configParse8, configParse12, configParse13, configParse15, configParse16, configParse17, configParse18, configParse28, configParse29, configParse40, configParseBridge, configParseGasLimitsPrices, configParseMasterAddress, configParseMasterAddressRequired, configParseMsgPrices, configParseValidatorSet, configParseWorkchainDescriptor, parseBridge, parseProposalSetup, parseValidatorSet, parseVotingSetup, parseFullConfig, loadConfigParamById, loadConfigParamsAsSlice } from './config/ConfigParser'; | ||
| export { GasLimitsPrices, StoragePrices, MsgPrices, WorkchainDescriptor, configParse5, configParse8, configParse12, configParse13, configParse15, configParse16, configParse17, configParse18, configParse28, configParse29, configParse40, configParseBridge, configParseGasLimitsPrices, configParseMasterAddress, configParseMasterAddressRequired, configParseMsgPrices, configParseValidatorSet, configParseWorkchainDescriptor, parseBridge, parseProposalSetup, parseValidatorSet, parseVotingSetup, parseFullConfig, parseFullerConfig, loadConfigParamById, loadConfigParamsAsSlice } from './config/ConfigParser'; | ||
| export { computeExternalMessageFees, computeFwdFees, computeGasPrices, computeMessageForwardFees, computeStorageFees } from './utils/fees'; |
+2
-1
@@ -24,3 +24,3 @@ "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.computeStorageFees = exports.computeMessageForwardFees = exports.computeGasPrices = exports.computeFwdFees = exports.computeExternalMessageFees = exports.loadConfigParamsAsSlice = exports.loadConfigParamById = exports.parseFullConfig = exports.parseVotingSetup = exports.parseValidatorSet = exports.parseProposalSetup = exports.parseBridge = exports.configParseWorkchainDescriptor = exports.configParseValidatorSet = exports.configParseMsgPrices = exports.configParseMasterAddressRequired = exports.configParseMasterAddress = exports.configParseGasLimitsPrices = exports.configParseBridge = exports.configParse40 = exports.configParse29 = exports.configParse28 = exports.configParse18 = exports.configParse17 = exports.configParse16 = exports.configParse15 = exports.configParse13 = exports.configParse12 = exports.configParse8 = exports.configParse5 = exports.ElectorContract = exports.MultisigWallet = exports.MultisigOrderBuilder = exports.MultisigOrder = exports.JettonWallet = exports.JettonMaster = exports.WalletContractV5R1 = exports.WalletContractV5Beta = exports.WalletContractV4 = exports.WalletContractV3R2 = exports.WalletContractV3R1 = exports.WalletContractV2R2 = exports.WalletContractV2R1 = exports.WalletContractV1R3 = exports.WalletContractV1R2 = exports.WalletContractV1R1 = exports.TonClient4 = exports.TonClient = exports.HttpApi = void 0; | ||
| exports.computeStorageFees = exports.computeMessageForwardFees = exports.computeGasPrices = exports.computeFwdFees = exports.computeExternalMessageFees = exports.loadConfigParamsAsSlice = exports.loadConfigParamById = exports.parseFullerConfig = exports.parseFullConfig = exports.parseVotingSetup = exports.parseValidatorSet = exports.parseProposalSetup = exports.parseBridge = exports.configParseWorkchainDescriptor = exports.configParseValidatorSet = exports.configParseMsgPrices = exports.configParseMasterAddressRequired = exports.configParseMasterAddress = exports.configParseGasLimitsPrices = exports.configParseBridge = exports.configParse40 = exports.configParse29 = exports.configParse28 = exports.configParse18 = exports.configParse17 = exports.configParse16 = exports.configParse15 = exports.configParse13 = exports.configParse12 = exports.configParse8 = exports.configParse5 = exports.ElectorContract = exports.MultisigWallet = exports.MultisigOrderBuilder = exports.MultisigOrder = exports.JettonWallet = exports.JettonMaster = exports.WalletContractV5R1 = exports.WalletContractV5Beta = exports.WalletContractV4 = exports.WalletContractV3R2 = exports.WalletContractV3R1 = exports.WalletContractV2R2 = exports.WalletContractV2R1 = exports.WalletContractV1R3 = exports.WalletContractV1R2 = exports.WalletContractV1R1 = exports.TonClient4 = exports.TonClient = exports.HttpApi = void 0; | ||
| __exportStar(require("@ton/core"), exports); | ||
@@ -110,2 +110,3 @@ // | ||
| Object.defineProperty(exports, "parseFullConfig", { enumerable: true, get: function () { return ConfigParser_1.parseFullConfig; } }); | ||
| Object.defineProperty(exports, "parseFullerConfig", { enumerable: true, get: function () { return ConfigParser_1.parseFullerConfig; } }); | ||
| Object.defineProperty(exports, "loadConfigParamById", { enumerable: true, get: function () { return ConfigParser_1.loadConfigParamById; } }); | ||
@@ -112,0 +113,0 @@ Object.defineProperty(exports, "loadConfigParamsAsSlice", { enumerable: true, get: function () { return ConfigParser_1.loadConfigParamsAsSlice; } }); |
@@ -34,3 +34,3 @@ /** | ||
| }; | ||
| private constructor(); | ||
| constructor(workchain: number, publicKey: Buffer, walletId?: Maybe<number>); | ||
| /** | ||
@@ -37,0 +37,0 @@ * Get Wallet Balance |
@@ -49,3 +49,3 @@ /** | ||
| }; | ||
| private constructor(); | ||
| constructor(walletId: WalletIdV5Beta, publicKey: Buffer); | ||
| /** | ||
@@ -52,0 +52,0 @@ * Get Wallet Balance |
@@ -50,3 +50,3 @@ /** | ||
| }; | ||
| private constructor(); | ||
| constructor(workchain: number, publicKey: Buffer, walletId: WalletIdV5R1<WalletIdV5R1ClientContext | WalletIdV5R1CustomContext>); | ||
| /** | ||
@@ -53,0 +53,0 @@ * Get Wallet Balance |
@@ -22,3 +22,3 @@ /** | ||
| }; | ||
| private constructor(); | ||
| constructor(workchain: number, publicKey: Buffer); | ||
| /** | ||
@@ -25,0 +25,0 @@ * Get Wallet Balance |
@@ -22,3 +22,3 @@ /** | ||
| }; | ||
| private constructor(); | ||
| constructor(workchain: number, publicKey: Buffer); | ||
| /** | ||
@@ -25,0 +25,0 @@ * Get Wallet Balance |
@@ -22,3 +22,3 @@ /** | ||
| }; | ||
| private constructor(); | ||
| constructor(workchain: number, publicKey: Buffer); | ||
| /** | ||
@@ -25,0 +25,0 @@ * Get Wallet Balance |
@@ -22,3 +22,3 @@ /** | ||
| }; | ||
| private constructor(); | ||
| constructor(workchain: number, publicKey: Buffer); | ||
| /** | ||
@@ -25,0 +25,0 @@ * Get Wallet Balance |
@@ -22,3 +22,3 @@ /** | ||
| }; | ||
| private constructor(); | ||
| constructor(workchain: number, publicKey: Buffer); | ||
| /** | ||
@@ -25,0 +25,0 @@ * Get Wallet Balance |
@@ -25,3 +25,3 @@ /** | ||
| }; | ||
| private constructor(); | ||
| constructor(workchain: number, publicKey: Buffer, walletId?: Maybe<number>); | ||
| /** | ||
@@ -28,0 +28,0 @@ * Get wallet balance |
@@ -25,3 +25,3 @@ /** | ||
| }; | ||
| private constructor(); | ||
| constructor(workchain: number, publicKey: Buffer, walletId?: Maybe<number>); | ||
| /** | ||
@@ -28,0 +28,0 @@ * Get wallet balance |
+1
-1
| { | ||
| "name": "@ton/ton", | ||
| "version": "16.0.0", | ||
| "version": "16.1.0", | ||
| "repository": "https://github.com/ton-org/ton.git", | ||
@@ -5,0 +5,0 @@ "author": "Whales Corp. <developers@whalescorp.com>", |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
481446
2.89%12331
1.82%