diff --git a/packages/apps-config/src/api/spec/mangata.ts b/packages/apps-config/src/api/spec/mangata.ts index 6d6ee059be..ff68cc2db6 100644 --- a/packages/apps-config/src/api/spec/mangata.ts +++ b/packages/apps-config/src/api/spec/mangata.ts @@ -1,6 +1,9 @@ // Copyright 2017-2023 @polkadot/apps-config authors & contributors // SPDX-License-Identifier: Apache-2.0 +// structs need to be in order +/* eslint-disable sort-keys */ + import type { Observable } from 'rxjs'; import type { ApiInterfaceRx } from '@polkadot/api/types'; import type { OverrideBundleDefinition } from '@polkadot/types/types'; @@ -74,22 +77,202 @@ const definitions: OverrideBundleDefinition = { // on all versions minmax: [0, undefined], types: { - Header: { - count: 'BlockNumber', - digest: 'Digest', - extrinsicsRoot: 'Hash', - number: 'Compact', - parentHash: 'Hash', - seed: 'ShufflingSeed', - stateRoot: 'Hash' - }, ShufflingSeed: { - proof: 'H512', - seed: 'H256' + seed: 'H256', + proof: 'H512' + }, + Header: { + parentHash: 'Hash', + number: 'Compact', + stateRoot: 'Hash', + extrinsicsRoot: 'Hash', + digest: 'Digest', + seed: 'ShufflingSeed', + count: 'BlockNumber' + }, + XYKRpcResult: { + price: 'Balance' + }, + RPCAmountsResult: { + firstAssetAmount: 'Balance', + secondAssetAmount: 'Balance' + }, + VestingInfo: { + locked: 'Balance', + perBlock: 'Balance', + startingBlock: 'BlockNumber' + }, + TokenId: 'u32', + VestingInfosWithLockedAt: { + vestingInfosWithLockedAt: 'Vec<(VestingInfo, Balance)>' } } } - ] + ], + rpc: { + xyk: { + calculate_buy_price: { + description: '', + params: [ + { + name: 'input_reserve', + type: 'Balance' + }, + { + name: 'output_reserve', + type: 'Balance' + }, + { + name: 'sell_amount', + type: 'Balance' + } + ], + type: 'XYKRpcResult' + }, + calculate_sell_price: { + description: '', + params: [ + { + name: 'input_reserve', + type: 'Balance' + }, + { + name: 'output_reserve', + type: 'Balance' + }, + { + name: 'sell_amount', + type: 'Balance' + } + ], + type: 'XYKRpcResult' + }, + get_burn_amount: { + description: '', + params: [ + { + name: 'first_asset_id', + type: 'TokenId' + }, + { + name: 'second_asset_id', + type: 'TokenId' + }, + { + name: 'liquidity_asset_amount', + type: 'Balance' + } + ], + type: 'RPCAmountsResult' + }, + calculate_sell_price_id: { + description: '', + params: [ + { + name: 'sold_token_id', + type: 'TokenId' + }, + { + name: 'bought_token_id', + type: 'TokenId' + }, + { + name: 'sell_amount', + type: 'Balance' + } + ], + type: 'XYKRpcResult' + }, + calculate_buy_price_id: { + description: '', + params: [ + { + name: 'sold_token_id', + type: 'TokenId' + }, + { + name: 'bought_token_id', + type: 'TokenId' + }, + { + name: 'buy_amount', + type: 'Balance' + } + ], + type: 'XYKRpcResult' + }, + calculate_rewards_amount: { + description: '', + params: [ + { + name: 'user', + type: 'AccountId' + }, + { + name: 'liquidity_asset_id', + type: 'TokenId' + } + ], + type: 'XYKRpcResult' + }, + calculate_balanced_sell_amount: { + description: '', + params: [ + { + name: 'total_amount', + type: 'Balance' + }, + { + name: 'reserve_amount', + type: 'Balance' + } + ], + type: 'XYKRpcResult' + }, + get_max_instant_unreserve_amount: { + description: '', + params: [ + { + name: 'user', + type: 'AccountId' + }, + { + name: 'liquidity_asset_id', + type: 'TokenId' + } + ], + type: 'Balance' + }, + get_max_instant_burn_amount: { + description: '', + params: [ + { + name: 'user', + type: 'AccountId' + }, + { + name: 'liquidity_asset_id', + type: 'TokenId' + } + ], + type: 'Balance' + }, + get_vesting_locked_at: { + description: '', + params: [ + { + name: 'who', + type: 'AccountId' + }, + { + name: 'token_id', + type: 'TokenId' + } + ], + type: 'VestingInfosWithLockedAt' + } + } + } }; export default definitions; diff --git a/packages/apps-config/src/api/typesBundle.ts b/packages/apps-config/src/api/typesBundle.ts index dd22dcad92..85817db093 100644 --- a/packages/apps-config/src/api/typesBundle.ts +++ b/packages/apps-config/src/api/typesBundle.ts @@ -59823,22 +59823,202 @@ export const typesBundle = { null ], "types": { - "Header": { - "count": "BlockNumber", - "digest": "Digest", - "extrinsicsRoot": "Hash", - "number": "Compact", - "parentHash": "Hash", - "seed": "ShufflingSeed", - "stateRoot": "Hash" - }, "ShufflingSeed": { - "proof": "H512", - "seed": "H256" + "seed": "H256", + "proof": "H512" + }, + "Header": { + "parentHash": "Hash", + "number": "Compact", + "stateRoot": "Hash", + "extrinsicsRoot": "Hash", + "digest": "Digest", + "seed": "ShufflingSeed", + "count": "BlockNumber" + }, + "XYKRpcResult": { + "price": "Balance" + }, + "RPCAmountsResult": { + "firstAssetAmount": "Balance", + "secondAssetAmount": "Balance" + }, + "VestingInfo": { + "locked": "Balance", + "perBlock": "Balance", + "startingBlock": "BlockNumber" + }, + "TokenId": "u32", + "VestingInfosWithLockedAt": { + "vestingInfosWithLockedAt": "Vec<(VestingInfo, Balance)>" } } } - ] + ], + "rpc": { + "xyk": { + "calculate_buy_price": { + "description": "", + "params": [ + { + "name": "input_reserve", + "type": "Balance" + }, + { + "name": "output_reserve", + "type": "Balance" + }, + { + "name": "sell_amount", + "type": "Balance" + } + ], + "type": "XYKRpcResult" + }, + "calculate_sell_price": { + "description": "", + "params": [ + { + "name": "input_reserve", + "type": "Balance" + }, + { + "name": "output_reserve", + "type": "Balance" + }, + { + "name": "sell_amount", + "type": "Balance" + } + ], + "type": "XYKRpcResult" + }, + "get_burn_amount": { + "description": "", + "params": [ + { + "name": "first_asset_id", + "type": "TokenId" + }, + { + "name": "second_asset_id", + "type": "TokenId" + }, + { + "name": "liquidity_asset_amount", + "type": "Balance" + } + ], + "type": "RPCAmountsResult" + }, + "calculate_sell_price_id": { + "description": "", + "params": [ + { + "name": "sold_token_id", + "type": "TokenId" + }, + { + "name": "bought_token_id", + "type": "TokenId" + }, + { + "name": "sell_amount", + "type": "Balance" + } + ], + "type": "XYKRpcResult" + }, + "calculate_buy_price_id": { + "description": "", + "params": [ + { + "name": "sold_token_id", + "type": "TokenId" + }, + { + "name": "bought_token_id", + "type": "TokenId" + }, + { + "name": "buy_amount", + "type": "Balance" + } + ], + "type": "XYKRpcResult" + }, + "calculate_rewards_amount": { + "description": "", + "params": [ + { + "name": "user", + "type": "AccountId" + }, + { + "name": "liquidity_asset_id", + "type": "TokenId" + } + ], + "type": "XYKRpcResult" + }, + "calculate_balanced_sell_amount": { + "description": "", + "params": [ + { + "name": "total_amount", + "type": "Balance" + }, + { + "name": "reserve_amount", + "type": "Balance" + } + ], + "type": "XYKRpcResult" + }, + "get_max_instant_unreserve_amount": { + "description": "", + "params": [ + { + "name": "user", + "type": "AccountId" + }, + { + "name": "liquidity_asset_id", + "type": "TokenId" + } + ], + "type": "Balance" + }, + "get_max_instant_burn_amount": { + "description": "", + "params": [ + { + "name": "user", + "type": "AccountId" + }, + { + "name": "liquidity_asset_id", + "type": "TokenId" + } + ], + "type": "Balance" + }, + "get_vesting_locked_at": { + "description": "", + "params": [ + { + "name": "who", + "type": "AccountId" + }, + { + "name": "token_id", + "type": "TokenId" + } + ], + "type": "VestingInfosWithLockedAt" + } + } + } }, "mangata-parachain": { "types": [ @@ -59848,22 +60028,202 @@ export const typesBundle = { null ], "types": { - "Header": { - "count": "BlockNumber", - "digest": "Digest", - "extrinsicsRoot": "Hash", - "number": "Compact", - "parentHash": "Hash", - "seed": "ShufflingSeed", - "stateRoot": "Hash" - }, "ShufflingSeed": { - "proof": "H512", - "seed": "H256" + "seed": "H256", + "proof": "H512" + }, + "Header": { + "parentHash": "Hash", + "number": "Compact", + "stateRoot": "Hash", + "extrinsicsRoot": "Hash", + "digest": "Digest", + "seed": "ShufflingSeed", + "count": "BlockNumber" + }, + "XYKRpcResult": { + "price": "Balance" + }, + "RPCAmountsResult": { + "firstAssetAmount": "Balance", + "secondAssetAmount": "Balance" + }, + "VestingInfo": { + "locked": "Balance", + "perBlock": "Balance", + "startingBlock": "BlockNumber" + }, + "TokenId": "u32", + "VestingInfosWithLockedAt": { + "vestingInfosWithLockedAt": "Vec<(VestingInfo, Balance)>" } } } - ] + ], + "rpc": { + "xyk": { + "calculate_buy_price": { + "description": "", + "params": [ + { + "name": "input_reserve", + "type": "Balance" + }, + { + "name": "output_reserve", + "type": "Balance" + }, + { + "name": "sell_amount", + "type": "Balance" + } + ], + "type": "XYKRpcResult" + }, + "calculate_sell_price": { + "description": "", + "params": [ + { + "name": "input_reserve", + "type": "Balance" + }, + { + "name": "output_reserve", + "type": "Balance" + }, + { + "name": "sell_amount", + "type": "Balance" + } + ], + "type": "XYKRpcResult" + }, + "get_burn_amount": { + "description": "", + "params": [ + { + "name": "first_asset_id", + "type": "TokenId" + }, + { + "name": "second_asset_id", + "type": "TokenId" + }, + { + "name": "liquidity_asset_amount", + "type": "Balance" + } + ], + "type": "RPCAmountsResult" + }, + "calculate_sell_price_id": { + "description": "", + "params": [ + { + "name": "sold_token_id", + "type": "TokenId" + }, + { + "name": "bought_token_id", + "type": "TokenId" + }, + { + "name": "sell_amount", + "type": "Balance" + } + ], + "type": "XYKRpcResult" + }, + "calculate_buy_price_id": { + "description": "", + "params": [ + { + "name": "sold_token_id", + "type": "TokenId" + }, + { + "name": "bought_token_id", + "type": "TokenId" + }, + { + "name": "buy_amount", + "type": "Balance" + } + ], + "type": "XYKRpcResult" + }, + "calculate_rewards_amount": { + "description": "", + "params": [ + { + "name": "user", + "type": "AccountId" + }, + { + "name": "liquidity_asset_id", + "type": "TokenId" + } + ], + "type": "XYKRpcResult" + }, + "calculate_balanced_sell_amount": { + "description": "", + "params": [ + { + "name": "total_amount", + "type": "Balance" + }, + { + "name": "reserve_amount", + "type": "Balance" + } + ], + "type": "XYKRpcResult" + }, + "get_max_instant_unreserve_amount": { + "description": "", + "params": [ + { + "name": "user", + "type": "AccountId" + }, + { + "name": "liquidity_asset_id", + "type": "TokenId" + } + ], + "type": "Balance" + }, + "get_max_instant_burn_amount": { + "description": "", + "params": [ + { + "name": "user", + "type": "AccountId" + }, + { + "name": "liquidity_asset_id", + "type": "TokenId" + } + ], + "type": "Balance" + }, + "get_vesting_locked_at": { + "description": "", + "params": [ + { + "name": "who", + "type": "AccountId" + }, + { + "name": "token_id", + "type": "TokenId" + } + ], + "type": "VestingInfosWithLockedAt" + } + } + } }, "manta-node": { "types": [