@broxus/js-core
Version:
MobX-based JavaScript Core library
677 lines (676 loc) • 22.2 kB
JavaScript
/**
* @see [DexRoot](https://github.com/broxus/flatqube-contracts/blob/master/build/DexRoot.abi.json)
*/
export const DexRootAbi = {
'ABI version': 2,
version: '2.2',
header: ['pubkey', 'time', 'expire'],
functions: [
{
name: 'constructor',
inputs: [
{ name: 'initial_owner', type: 'address' },
{ name: 'initial_vault', type: 'address' },
],
outputs: [],
},
{
name: 'getAccountVersion',
inputs: [{ name: 'answerId', type: 'uint32' }],
outputs: [{ name: 'value0', type: 'uint32' }],
},
{
name: 'getAccountCode',
inputs: [{ name: 'answerId', type: 'uint32' }],
outputs: [{ name: 'value0', type: 'cell' }],
},
{
name: 'getPairVersion',
inputs: [
{ name: 'answerId', type: 'uint32' },
{ name: 'pool_type', type: 'uint8' },
],
outputs: [{ name: 'value0', type: 'uint32' }],
},
{
name: 'getPoolVersion',
inputs: [
{ name: 'answerId', type: 'uint32' },
{ name: 'pool_type', type: 'uint8' },
],
outputs: [{ name: 'value0', type: 'uint32' }],
},
{
name: 'getPairCode',
inputs: [
{ name: 'answerId', type: 'uint32' },
{ name: 'pool_type', type: 'uint8' },
],
outputs: [{ name: 'value0', type: 'cell' }],
},
{
name: 'getPoolCode',
inputs: [
{ name: 'answerId', type: 'uint32' },
{ name: 'pool_type', type: 'uint8' },
],
outputs: [{ name: 'value0', type: 'cell' }],
},
{
name: 'getVault',
inputs: [{ name: 'answerId', type: 'uint32' }],
outputs: [{ name: 'value0', type: 'address' }],
},
{
name: 'getTokenVaultCode',
inputs: [{ name: 'answerId', type: 'uint32' }],
outputs: [{ name: 'value0', type: 'cell' }],
},
{
name: 'getTokenVaultVersion',
inputs: [{ name: 'answerId', type: 'uint32' }],
outputs: [{ name: 'value0', type: 'uint32' }],
},
{
name: 'getLpTokenPendingCode',
inputs: [{ name: 'answerId', type: 'uint32' }],
outputs: [{ name: 'value0', type: 'cell' }],
},
{
name: 'getLpTokenPendingVersion',
inputs: [{ name: 'answerId', type: 'uint32' }],
outputs: [{ name: 'value0', type: 'uint32' }],
},
{
name: 'getTokenFactory',
inputs: [{ name: 'answerId', type: 'uint32' }],
outputs: [{ name: 'value0', type: 'address' }],
},
{
name: 'isActive',
inputs: [{ name: 'answerId', type: 'uint32' }],
outputs: [{ name: 'value0', type: 'bool' }],
},
{
name: 'getOwner',
inputs: [{ name: 'answerId', type: 'uint32' }],
outputs: [{ name: 'dex_owner', type: 'address' }],
},
{
name: 'getPendingOwner',
inputs: [{ name: 'answerId', type: 'uint32' }],
outputs: [{ name: 'dex_pending_owner', type: 'address' }],
},
{
name: 'getWeverVaultTokenRoot',
inputs: [{ name: 'answerId', type: 'uint32' }],
outputs: [{ name: 'value0', type: 'address' }],
},
{
name: 'getExpectedAccountAddress',
inputs: [
{ name: 'answerId', type: 'uint32' },
{ name: 'account_owner', type: 'address' },
],
outputs: [{ name: 'value0', type: 'address' }],
},
{
name: 'getExpectedPairAddress',
inputs: [
{ name: 'answerId', type: 'uint32' },
{ name: 'left_root', type: 'address' },
{ name: 'right_root', type: 'address' },
],
outputs: [{ name: 'value0', type: 'address' }],
},
{
name: 'getExpectedPoolAddress',
inputs: [
{ name: 'answerId', type: 'uint32' },
{ name: '_roots', type: 'address[]' },
],
outputs: [{ name: 'value0', type: 'address' }],
},
{
name: 'getExpectedTokenVaultAddress',
inputs: [
{ name: 'answerId', type: 'uint32' },
{ name: '_tokenRoot', type: 'address' },
],
outputs: [{ name: 'value0', type: 'address' }],
},
{
name: 'getManager',
inputs: [{ name: 'answerId', type: 'uint32' }],
outputs: [{ name: 'value0', type: 'address' }],
},
{
name: 'setVaultOnce',
inputs: [{ name: 'new_vault', type: 'address' }],
outputs: [],
},
{
name: 'setActive',
inputs: [{ name: 'new_active', type: 'bool' }],
outputs: [],
},
{
name: 'setManager',
inputs: [{ name: '_newManager', type: 'address' }],
outputs: [],
},
{
name: 'revokeManager',
inputs: [],
outputs: [],
},
{
name: 'transferOwner',
inputs: [{ name: 'new_owner', type: 'address' }],
outputs: [],
},
{
name: 'acceptOwner',
inputs: [],
outputs: [],
},
{
name: 'setTokenFactory',
inputs: [
{ name: '_newTokenFactory', type: 'address' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'setWeverVaultTokenRoot',
inputs: [
{ name: '_newWeverVaultTokenRoot', type: 'address' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'installPlatformOnce',
inputs: [{ name: 'code', type: 'cell' }],
outputs: [],
},
{
name: 'installOrUpdateAccountCode',
inputs: [{ name: 'code', type: 'cell' }],
outputs: [],
},
{
name: 'installOrUpdatePairCode',
inputs: [
{ name: 'code', type: 'cell' },
{ name: 'pool_type', type: 'uint8' },
],
outputs: [],
},
{
name: 'installOrUpdatePoolCode',
inputs: [
{ name: 'code', type: 'cell' },
{ name: 'pool_type', type: 'uint8' },
],
outputs: [],
},
{
name: 'installOrUpdateTokenVaultCode',
inputs: [
{ name: '_newCode', type: 'cell' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'installOrUpdateLpTokenPendingCode',
inputs: [
{ name: '_newCode', type: 'cell' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'upgrade',
inputs: [{ name: 'code', type: 'cell' }],
outputs: [],
},
{
name: 'resetGas',
inputs: [{ name: 'receiver', type: 'address' }],
outputs: [],
},
{
name: 'deployTokenVault',
inputs: [
{ name: '_tokenRoot', type: 'address' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'onTokenVaultDeployed',
inputs: [
{ name: '_version', type: 'uint32' },
{ name: '_tokenRoot', type: 'address' },
{ name: '_tokenWallet', type: 'address' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'deployLpToken',
inputs: [
{ name: '_tokenRoots', type: 'address[]' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'onLiquidityTokenDeployed',
inputs: [
{ name: '_lpPendingNonce', type: 'uint32' },
{ name: '_pool', type: 'address' },
{ name: '_roots', type: 'address[]' },
{ name: '_lpRoot', type: 'address' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'onLiquidityTokenNotDeployed',
inputs: [
{ name: '_lpPendingNonce', type: 'uint32' },
{ name: '_pool', type: 'address' },
{ name: '_roots', type: 'address[]' },
{ name: '_lpRoot', type: 'address' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'upgradeTokenVault',
inputs: [
{ name: '_tokenRoot', type: 'address' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'upgradeTokenVaults',
inputs: [
{ name: '_tokenRoots', type: 'address[]' },
{ name: '_offset', type: 'uint32' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'deployAccount',
inputs: [
{ name: 'account_owner', type: 'address' },
{ name: 'send_gas_to', type: 'address' },
],
outputs: [],
},
{
name: 'requestUpgradeAccount',
inputs: [
{ name: 'current_version', type: 'uint32' },
{ name: 'send_gas_to', type: 'address' },
{ name: 'account_owner', type: 'address' },
],
outputs: [],
},
{
name: 'forceUpgradeAccount',
inputs: [
{ name: 'account_owner', type: 'address' },
{ name: 'send_gas_to', type: 'address' },
],
outputs: [],
},
{
name: 'upgradeAccounts',
inputs: [
{ name: '_accountsOwners', type: 'address[]' },
{ name: '_offset', type: 'uint32' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'upgradePair',
inputs: [
{ name: 'left_root', type: 'address' },
{ name: 'right_root', type: 'address' },
{ name: 'pool_type', type: 'uint8' },
{ name: 'send_gas_to', type: 'address' },
],
outputs: [],
},
{
name: 'upgradePool',
inputs: [
{ name: 'roots', type: 'address[]' },
{ name: 'pool_type', type: 'uint8' },
{ name: 'send_gas_to', type: 'address' },
],
outputs: [],
},
{
name: 'upgradePools',
inputs: [
{
components: [
{ name: 'tokenRoots', type: 'address[]' },
{ name: 'poolType', type: 'uint8' },
],
name: '_params',
type: 'tuple[]',
},
{ name: '_offset', type: 'uint32' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'setPoolActive',
inputs: [
{
components: [
{ name: 'tokenRoots', type: 'address[]' },
{ name: 'newActive', type: 'bool' },
],
name: '_param',
type: 'tuple',
},
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'setPoolsActive',
inputs: [
{
components: [
{ name: 'tokenRoots', type: 'address[]' },
{ name: 'newActive', type: 'bool' },
],
name: '_params',
type: 'tuple[]',
},
{ name: '_offset', type: 'uint32' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'deployPair',
inputs: [
{ name: 'left_root', type: 'address' },
{ name: 'right_root', type: 'address' },
{ name: 'send_gas_to', type: 'address' },
],
outputs: [],
},
{
name: 'deployStablePool',
inputs: [
{ name: 'roots', type: 'address[]' },
{ name: 'send_gas_to', type: 'address' },
],
outputs: [],
},
{
name: 'setPairFeeParams',
inputs: [
{ name: '_roots', type: 'address[]' },
{
components: [
{ name: 'denominator', type: 'uint128' },
{ name: 'pool_numerator', type: 'uint128' },
{ name: 'beneficiary_numerator', type: 'uint128' },
{ name: 'referrer_numerator', type: 'uint128' },
{ name: 'beneficiary', type: 'address' },
{ name: 'threshold', type: 'map(address,uint128)' },
{ name: 'referrer_threshold', type: 'map(address,uint128)' },
],
name: '_params',
type: 'tuple',
},
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'setPairAmplificationCoefficient',
inputs: [
{ name: '_roots', type: 'address[]' },
{
components: [
{ name: 'value', type: 'uint128' },
{ name: 'precision', type: 'uint128' },
],
name: '_A',
type: 'tuple',
},
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'resetTargetGas',
inputs: [
{ name: 'target', type: 'address' },
{ name: 'receiver', type: 'address' },
],
outputs: [],
},
{
name: 'onPoolCreated',
inputs: [
{ name: '_roots', type: 'address[]' },
{ name: '_poolType', type: 'uint8' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'setOracleOptions',
inputs: [
{ name: '_leftRoot', type: 'address' },
{ name: '_rightRoot', type: 'address' },
{
components: [
{ name: 'minInterval', type: 'uint8' },
{ name: 'minRateDeltaNumerator', type: 'uint128' },
{ name: 'minRateDeltaDenominator', type: 'uint128' },
{ name: 'cardinality', type: 'uint16' },
],
name: '_options',
type: 'tuple',
},
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'removeLastNPoints',
inputs: [
{ name: '_leftRoot', type: 'address' },
{ name: '_rightRoot', type: 'address' },
{ name: '_count', type: 'uint16' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'setWeverInDexTokenVault',
inputs: [
{ name: '_dexTokenVault', type: 'address' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'setWeverInDexPool',
inputs: [
{ name: '_dexPool', type: 'address' },
{ name: '_remainingGasTo', type: 'address' },
],
outputs: [],
},
{
name: 'platform_code',
inputs: [],
outputs: [{ name: 'platform_code', type: 'cell' }],
},
],
data: [{ key: 1, name: '_nonce', type: 'uint32' }],
events: [
{
name: 'AccountCodeUpgraded',
inputs: [{ name: 'version', type: 'uint32' }],
outputs: [],
},
{
name: 'PairCodeUpgraded',
inputs: [
{ name: 'version', type: 'uint32' },
{ name: 'poolType', type: 'uint8' },
],
outputs: [],
},
{
name: 'PoolCodeUpgraded',
inputs: [
{ name: 'version', type: 'uint32' },
{ name: 'poolType', type: 'uint8' },
],
outputs: [],
},
{
name: 'TokenVaultCodeUpgraded',
inputs: [
{ name: 'version', type: 'uint32' },
{ name: 'codeHash', type: 'uint256' },
],
outputs: [],
},
{
name: 'LpTokenPendingCodeUpgraded',
inputs: [
{ name: 'version', type: 'uint32' },
{ name: 'codeHash', type: 'uint256' },
],
outputs: [],
},
{
name: 'TokenFactoryUpdated',
inputs: [
{ name: 'current', type: 'address' },
{ name: 'previous', type: 'address' },
],
outputs: [],
},
{
name: 'WeverVaultTokenRootUpdated',
inputs: [
{ name: 'current', type: 'address' },
{ name: 'previous', type: 'address' },
],
outputs: [],
},
{
name: 'RootCodeUpgraded',
inputs: [],
outputs: [],
},
{
name: 'ActiveUpdated',
inputs: [{ name: 'newActive', type: 'bool' }],
outputs: [],
},
{
name: 'RequestedPoolUpgrade',
inputs: [{ name: 'roots', type: 'address[]' }],
outputs: [],
},
{
name: 'RequestedForceAccountUpgrade',
inputs: [{ name: 'accountOwner', type: 'address' }],
outputs: [],
},
{
name: 'RequestedOwnerTransfer',
inputs: [
{ name: 'oldOwner', type: 'address' },
{ name: 'newOwner', type: 'address' },
],
outputs: [],
},
{
name: 'OwnerTransferAccepted',
inputs: [
{ name: 'oldOwner', type: 'address' },
{ name: 'newOwner', type: 'address' },
],
outputs: [],
},
{
name: 'NewPoolCreated',
inputs: [
{ name: 'roots', type: 'address[]' },
{ name: 'poolType', type: 'uint8' },
],
outputs: [],
},
{
name: 'NewTokenVaultCreated',
inputs: [
{ name: 'vault', type: 'address' },
{ name: 'tokenRoot', type: 'address' },
{ name: 'tokenWallet', type: 'address' },
{ name: 'version', type: 'uint32' },
],
outputs: [],
},
{
name: 'NewLpTokenRootCreated',
inputs: [
{ name: 'pool', type: 'address' },
{ name: 'poolTokenRoots', type: 'address[]' },
{ name: 'lpTokenRoot', type: 'address' },
{ name: 'lpPendingNonce', type: 'uint32' },
],
outputs: [],
},
],
fields: [
{ name: '_pubkey', type: 'uint256' },
{ name: '_timestamp', type: 'uint64' },
{ name: '_constructorFlag', type: 'bool' },
{ name: 'platform_code', type: 'cell' },
{ name: '_nonce', type: 'uint32' },
{ name: '_accountCode', type: 'cell' },
{ name: '_accountVersion', type: 'uint32' },
{ name: '_pairCodes', type: 'map(uint8,cell)' },
{ name: '_pairVersions', type: 'map(uint8,uint32)' },
{ name: '_poolCodes', type: 'map(uint8,cell)' },
{ name: '_poolVersions', type: 'map(uint8,uint32)' },
{ name: '_vaultCode', type: 'cell' },
{ name: '_vaultVersion', type: 'uint32' },
{ name: '_lpTokenPendingCode', type: 'cell' },
{ name: '_lpTokenPendingVersion', type: 'uint32' },
{ name: '_tokenFactory', type: 'address' },
{ name: '_active', type: 'bool' },
{ name: '_owner', type: 'address' },
{ name: '_vault', type: 'address' },
{ name: '_pendingOwner', type: 'address' },
{ name: '_manager', type: 'address' },
{ name: '_weverVaultTokenRoot', type: 'address' },
],
};