From 1c3156d60992408964b3ace9056829258b97e7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Dan=C4=8Do?= Date: Mon, 23 Oct 2023 16:49:37 +0200 Subject: [PATCH] feat: update mangata type definitons to new major version (#9976) --- packages/apps-config/package.json | 2 +- packages/apps-config/src/api/typesBundle.ts | 126 ++++++++------------ yarn.lock | 12 +- 3 files changed, 55 insertions(+), 85 deletions(-) diff --git a/packages/apps-config/package.json b/packages/apps-config/package.json index 2fd8ea64e3..9735d85e4a 100644 --- a/packages/apps-config/package.json +++ b/packages/apps-config/package.json @@ -31,7 +31,7 @@ "@kiltprotocol/type-definitions": "0.33.1", "@laminar/type-definitions": "0.3.1", "@logion/node-api": "0.19.0-2", - "@mangata-finance/type-definitions": "^1.0.0", + "@mangata-finance/type-definitions": "^2.0.0", "@metaverse-network-sdk/type-definitions": "0.0.1-16", "@parallel-finance/type-definitions": "2.0.0", "@peaqnetwork/type-definitions": "0.0.4", diff --git a/packages/apps-config/src/api/typesBundle.ts b/packages/apps-config/src/api/typesBundle.ts index 04da9e9d8f..7158ac153c 100644 --- a/packages/apps-config/src/api/typesBundle.ts +++ b/packages/apps-config/src/api/typesBundle.ts @@ -58965,22 +58965,13 @@ export const typesBundle = { "seed": "ShufflingSeed", "count": "BlockNumber" }, - "XYKRpcResult": { - "price": "Balance" + "RpcAssetMetadata": { + "tokenId": "TokenId", + "decimals": "u32", + "name": "Vec", + "symbol": "Vec" }, - "RPCAmountsResult": { - "firstAssetAmount": "Balance", - "secondAssetAmount": "Balance" - }, - "VestingInfo": { - "locked": "Balance", - "perBlock": "Balance", - "startingBlock": "BlockNumber" - }, - "TokenId": "u32", - "VestingInfosWithLockedAt": { - "vestingInfosWithLockedAt": "Vec<(VestingInfo, Balance)>" - } + "TokenId": "u32" } } ], @@ -59002,7 +58993,7 @@ export const typesBundle = { "type": "Balance" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "calculate_sell_price": { "description": "Calculates and returns bought_token_amount while providing sold_token_amount and respective reserves", @@ -59020,7 +59011,7 @@ export const typesBundle = { "type": "Balance" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "get_burn_amount": { "description": "Returns amounts of tokens received by burning provided liquidity_token_amount in pool of provided token ids", @@ -59038,7 +59029,7 @@ export const typesBundle = { "type": "Balance" } ], - "type": "RPCAmountsResult" + "type": "(Balance,Balance)" }, "calculate_sell_price_id": { "description": "Same as calculate_sell_price, but providing token_id instead of reserves. Reserves are fetched by function.", @@ -59056,7 +59047,7 @@ export const typesBundle = { "type": "Balance" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "calculate_buy_price_id": { "description": "Same as calculate_buy_price, but providing token_id instead of reserves. Reserves are fetched by function.", @@ -59074,7 +59065,7 @@ export const typesBundle = { "type": "Balance" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "calculate_rewards_amount": { "description": "Calculate rewards amount of liquidity token id for the user", @@ -59088,7 +59079,7 @@ export const typesBundle = { "type": "TokenId" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "calculate_balanced_sell_amount": { "description": "Calculates how much amount x we need to swap from total_amount, so that after y = swap(x), the resulting balance equals (total_amount - x) / y = pool_x / pool_y - the resulting amounts can then be used to `mint_liquidity` with minimal leftover after operation", @@ -59102,7 +59093,7 @@ export const typesBundle = { "type": "Balance" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "get_max_instant_unreserve_amount": { "description": "Instant unreserve amount", @@ -59116,7 +59107,7 @@ export const typesBundle = { "type": "TokenId" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "get_max_instant_burn_amount": { "description": "", @@ -59130,7 +59121,7 @@ export const typesBundle = { "type": "TokenId" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "is_sell_asset_lock_free": { "description": "", @@ -59159,22 +59150,16 @@ export const typesBundle = { } ], "type": "Option" - } - }, - "vesting": { - "getVestingLockedAt": { + }, + "get_tradeable_tokens": { "description": "", - "params": [ - { - "name": "who", - "type": "AccountId" - }, - { - "name": "token_id", - "type": "TokenId" - } - ], - "type": "VestingInfosWithLockedAt" + "params": [], + "type": "Vec>" + }, + "get_liq_tokens_for_trading": { + "description": "", + "params": [], + "type": "Vec" } } } @@ -59200,22 +59185,13 @@ export const typesBundle = { "seed": "ShufflingSeed", "count": "BlockNumber" }, - "XYKRpcResult": { - "price": "Balance" + "RpcAssetMetadata": { + "tokenId": "TokenId", + "decimals": "u32", + "name": "Vec", + "symbol": "Vec" }, - "RPCAmountsResult": { - "firstAssetAmount": "Balance", - "secondAssetAmount": "Balance" - }, - "VestingInfo": { - "locked": "Balance", - "perBlock": "Balance", - "startingBlock": "BlockNumber" - }, - "TokenId": "u32", - "VestingInfosWithLockedAt": { - "vestingInfosWithLockedAt": "Vec<(VestingInfo, Balance)>" - } + "TokenId": "u32" } } ], @@ -59237,7 +59213,7 @@ export const typesBundle = { "type": "Balance" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "calculate_sell_price": { "description": "Calculates and returns bought_token_amount while providing sold_token_amount and respective reserves", @@ -59255,7 +59231,7 @@ export const typesBundle = { "type": "Balance" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "get_burn_amount": { "description": "Returns amounts of tokens received by burning provided liquidity_token_amount in pool of provided token ids", @@ -59273,7 +59249,7 @@ export const typesBundle = { "type": "Balance" } ], - "type": "RPCAmountsResult" + "type": "(Balance,Balance)" }, "calculate_sell_price_id": { "description": "Same as calculate_sell_price, but providing token_id instead of reserves. Reserves are fetched by function.", @@ -59291,7 +59267,7 @@ export const typesBundle = { "type": "Balance" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "calculate_buy_price_id": { "description": "Same as calculate_buy_price, but providing token_id instead of reserves. Reserves are fetched by function.", @@ -59309,7 +59285,7 @@ export const typesBundle = { "type": "Balance" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "calculate_rewards_amount": { "description": "Calculate rewards amount of liquidity token id for the user", @@ -59323,7 +59299,7 @@ export const typesBundle = { "type": "TokenId" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "calculate_balanced_sell_amount": { "description": "Calculates how much amount x we need to swap from total_amount, so that after y = swap(x), the resulting balance equals (total_amount - x) / y = pool_x / pool_y - the resulting amounts can then be used to `mint_liquidity` with minimal leftover after operation", @@ -59337,7 +59313,7 @@ export const typesBundle = { "type": "Balance" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "get_max_instant_unreserve_amount": { "description": "Instant unreserve amount", @@ -59351,7 +59327,7 @@ export const typesBundle = { "type": "TokenId" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "get_max_instant_burn_amount": { "description": "", @@ -59365,7 +59341,7 @@ export const typesBundle = { "type": "TokenId" } ], - "type": "XYKRpcResult" + "type": "Balance" }, "is_sell_asset_lock_free": { "description": "", @@ -59394,22 +59370,16 @@ export const typesBundle = { } ], "type": "Option" - } - }, - "vesting": { - "getVestingLockedAt": { + }, + "get_tradeable_tokens": { "description": "", - "params": [ - { - "name": "who", - "type": "AccountId" - }, - { - "name": "token_id", - "type": "TokenId" - } - ], - "type": "VestingInfosWithLockedAt" + "params": [], + "type": "Vec>" + }, + "get_liq_tokens_for_trading": { + "description": "", + "params": [], + "type": "Vec" } } } diff --git a/yarn.lock b/yarn.lock index f6bf227293..1e24d93556 100644 --- a/yarn.lock +++ b/yarn.lock @@ -883,12 +883,12 @@ __metadata: languageName: node linkType: hard -"@mangata-finance/type-definitions@npm:^1.0.0": - version: 1.0.0 - resolution: "@mangata-finance/type-definitions@npm:1.0.0" +"@mangata-finance/type-definitions@npm:^2.0.0": + version: 2.0.0 + resolution: "@mangata-finance/type-definitions@npm:2.0.0" peerDependencies: - "@polkadot/types": ^10.7.3 - checksum: 6b93fd4c4e53b7fa0b1c145929ecd170fcbd7921a49ec18b128b32dafab2a4e06d678cc8058ffc7b95f921481387062b3b32bf31c9929005827d87599392e389 + "@polkadot/types": 10.9.1 + checksum: 4f24764c56afc0cc2113e1517517c786330553e25131a87edbc2cbb5ce85204e273e7706a9aec9c61eea1013adba93b112c35d674890c729cdc4322b46e53d3b languageName: node linkType: hard @@ -1775,7 +1775,7 @@ __metadata: "@kiltprotocol/type-definitions": 0.33.1 "@laminar/type-definitions": 0.3.1 "@logion/node-api": 0.19.0-2 - "@mangata-finance/type-definitions": ^1.0.0 + "@mangata-finance/type-definitions": ^2.0.0 "@metaverse-network-sdk/type-definitions": 0.0.1-16 "@parallel-finance/type-definitions": 2.0.0 "@peaqnetwork/type-definitions": 0.0.4