Skip to content

Commit

Permalink
add rest of types and rpcs for mangata chain (polkadot-js#9269)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanderian authored Apr 2, 2023
1 parent 63580c4 commit 3ddb4ef
Show file tree
Hide file tree
Showing 2 changed files with 570 additions and 27 deletions.
201 changes: 192 additions & 9 deletions packages/apps-config/src/api/spec/mangata.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -74,22 +77,202 @@ const definitions: OverrideBundleDefinition = {
// on all versions
minmax: [0, undefined],
types: {
ShufflingSeed: {
seed: 'H256',
proof: 'H512'
},
Header: {
count: 'BlockNumber',
digest: 'Digest',
extrinsicsRoot: 'Hash',
number: 'Compact<BlockNumber>',
parentHash: 'Hash',
number: 'Compact<BlockNumber>',
stateRoot: 'Hash',
extrinsicsRoot: 'Hash',
digest: 'Digest',
seed: 'ShufflingSeed',
stateRoot: 'Hash'
count: 'BlockNumber'
},
ShufflingSeed: {
proof: 'H512',
seed: 'H256'
XYKRpcResult: {
price: 'Balance'
},
RPCAmountsResult: {
firstAssetAmount: 'Balance',
secondAssetAmount: 'Balance'
},
VestingInfo: {
locked: 'Balance',
perBlock: 'Balance',
startingBlock: 'BlockNumber'
},
TokenId: 'u32',
VestingInfosWithLockedAt: {
vestingInfosWithLockedAt: 'Vec<(VestingInfo<Balance, BlockNumber>, 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<Balance>'
},
calculate_sell_price: {
description: '',
params: [
{
name: 'input_reserve',
type: 'Balance'
},
{
name: 'output_reserve',
type: 'Balance'
},
{
name: 'sell_amount',
type: 'Balance'
}
],
type: 'XYKRpcResult<Balance>'
},
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<Balance>'
},
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<Balance>'
},
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<Balance>'
},
calculate_rewards_amount: {
description: '',
params: [
{
name: 'user',
type: 'AccountId'
},
{
name: 'liquidity_asset_id',
type: 'TokenId'
}
],
type: 'XYKRpcResult<Balance>'
},
calculate_balanced_sell_amount: {
description: '',
params: [
{
name: 'total_amount',
type: 'Balance'
},
{
name: 'reserve_amount',
type: 'Balance'
}
],
type: 'XYKRpcResult<Balance>'
},
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<Balance, BlockNumber>'
}
}
}
};

export default definitions;
Loading

0 comments on commit 3ddb4ef

Please sign in to comment.