Skip to content

Update jamton definitions #11538

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/apps-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@fragnova/api-augment": "0.1.0-spec-1.0.4-mainnet",
"@frequency-chain/api-augment": "1.11.1",
"@interlay/interbtc-types": "1.13.0",
"@jamton/parachain-ts-interfaces": "1.10.4",
"@kiltprotocol/type-definitions": "^1.11401.0",
"@laminar/type-definitions": "0.3.1",
"@logion/node-api": "0.27.0-4",
Expand Down
49 changes: 6 additions & 43 deletions packages/apps-config/src/api/spec/jamton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,20 @@

import type { OverrideBundleDefinition } from '@polkadot/types/types';

import { rpc, runtime, signedExtensions, types } from '@jamton/parachain-ts-interfaces/bundle';

/* eslint-disable sort-keys */
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
StakingRates: {
collatorStakingRate: 'Perquintill',
collatorRewardRate: 'Perquintill',
delegatorStakingRate: 'Perquintill',
delegatorRewardRate: 'Perquintill'
},
AssetId: 'u32',
Balance: 'u128'
}
types
}
],
runtime: {
ParachainStaking: [
{
methods: {
get_staking_rates: {
description: 'Calculate the current staking and reward rates for collators and delegators',
params: [],
type: 'StakingRates'
},
get_unclaimed_staking_rewards: {
description: 'Calculate the claimable staking rewards for a given account address',
params: [
{
name: 'account',
type: 'AccountId32'
}
],
type: 'Balance'
}
},
version: 1
}
]
},
signedExtensions: {
ChargeAssetTxPayment: {
extrinsic: {
tip: 'Compact<Balance>',
assetId: 'Option<AssetId>'
},
payload: {}
}
}
runtime,
rpc,
signedExtensions
};

export default definitions;
149 changes: 137 additions & 12 deletions packages/apps-config/src/api/typesBundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30142,18 +30142,113 @@ export const typesBundle = {
null
],
"types": {
"Amount": "i128",
"Balance": "u128",
"BlockNumber": "u64",
"CurrencyId": {
"_enum": {
"Native": "u32",
"DexShare": "(DexShare, DexShare)",
"ForeignAsset": "u32"
}
},
"DexShare": {
"_enum": {
"Native": "u32",
"ForeignAsset": "u32"
}
},
"TradingPair": "(CurrencyId, CurrencyId)",
"ProvisionParameters": {
"minContribution": "(Balance, Balance)",
"targetProvision": "(Balance, Balance)",
"accumulatedProvision": "(Balance, Balance)",
"notBefore": "u32"
},
"TradingPairStatus": {
"_enum": {
"Disabled": "Null",
"Provisioning": "ProvisionParameters",
"Enabled": "Null"
}
},
"StakingRates": {
"collatorStakingRate": "Perquintill",
"collatorRewardRate": "Perquintill",
"delegatorStakingRate": "Perquintill",
"delegatorRewardRate": "Perquintill"
},
"AssetId": "u32",
"Balance": "u128"
}
}
}
],
"runtime": {
"Doton": [
{
"methods": {
"doton_mint_amount_with_dot": {
"description": "Amount of DOTON that expected to be minted from passed DOT amount.",
"params": [
{
"name": "amount",
"type": "Balance"
}
],
"type": "Result<Balance, DispatchError>"
},
"dot_redeem_amount_with_doton": {
"description": "Amount of DOT that expected to be redeemed with passed amount of DOTON.",
"params": [
{
"name": "amount",
"type": "Balance"
}
],
"type": "Result<Balance, DispatchError>"
},
"min_mint_from_dot_amount": {
"description": "Minimal amount of DOT to stake through DOTON module.",
"params": [],
"type": "Result<Balance, DispatchError>"
},
"min_redeem_to_dot_amount": {
"description": "Minimal amount of DOTON to redeem DOT.",
"params": [],
"type": "Result<Balance, DispatchError>"
},
"doton_mint_amount_with_jamton": {
"description": "Amount of DOTON that expected to be minted from passed jamTON amount.",
"params": [
{
"name": "amount",
"type": "Balance"
}
],
"type": "Result<Balance, DispatchError>"
},
"jamton_redeem_amount_with_doton": {
"description": "Amount of jamTON that expected to be redeemed with passed amount of DOTON.",
"params": [
{
"name": "amount",
"type": "Balance"
}
],
"type": "Result<Balance, DispatchError>"
},
"max_doton_amount_to_redeem_into_dot": {
"description": "Maximum amount of DOTON to request redeem to DOT due to the vault state.",
"params": [],
"type": "Result<Balance, DispatchError>"
},
"max_doton_amount_to_redeem_into_jamton": {
"description": "Maximum amount of DOTON to redeem to jamTON due to the vault state.",
"params": [],
"type": "Result<Balance, DispatchError>"
}
},
"version": 1
}
],
"ParachainStaking": [
{
"methods": {
Expand All @@ -30171,21 +30266,51 @@ export const typesBundle = {
}
],
"type": "Balance"
},
"get_sorted_proposed_candidates": {
"description": "Provides a sorted list of collators most suited for given delegator's stake amount determined with some heuristic algorithm.",
"params": [
{
"name": "balance",
"type": "Balance"
}
],
"type": "Vec<AccountId>"
}
},
"version": 1
}
],
"Limits": [
{
"methods": {
"maybe_remaining_dot_stake_limit": {
"description": "Remaining DOT amount that account allowed to stake. Returns None if no limit.",
"params": [
{
"name": "account",
"type": "AccountId"
}
],
"type": "Option<Balance>"
},
"maybe_remaining_issue_allowance": {
"description": "Remaining amount of currency that could be minted. Returns None if no limit.",
"params": [
{
"name": "currency_id",
"type": "CurrencyId"
}
],
"type": "Option<Balance>"
}
},
"version": 1
}
]
},
"signedExtensions": {
"ChargeAssetTxPayment": {
"extrinsic": {
"tip": "Compact<Balance>",
"assetId": "Option<AssetId>"
},
"payload": {}
}
}
"rpc": {},
"signedExtensions": {}
},
"jupiter-prep": {
"types": [
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,15 @@ __metadata:
languageName: node
linkType: hard

"@jamton/parachain-ts-interfaces@npm:1.10.4":
version: 1.10.4
resolution: "@jamton/parachain-ts-interfaces@npm:1.10.4"
dependencies:
"@polkadot/api": "npm:^15.0.0"
checksum: 10/4b94986dfc5ed2b829e5b904994b7ce98007bcb235f35fde6de74fb0e7a466deb943b4c7c487a53b873630dbe8274b03d1cd3071d2e5b702aa8da932a796558a
languageName: node
linkType: hard

"@jest/expect-utils@npm:^29.6.2":
version: 29.6.2
resolution: "@jest/expect-utils@npm:29.6.2"
Expand Down Expand Up @@ -2162,6 +2171,7 @@ __metadata:
"@fragnova/api-augment": "npm:0.1.0-spec-1.0.4-mainnet"
"@frequency-chain/api-augment": "npm:1.11.1"
"@interlay/interbtc-types": "npm:1.13.0"
"@jamton/parachain-ts-interfaces": "npm:1.10.4"
"@kiltprotocol/type-definitions": "npm:^1.11401.0"
"@laminar/type-definitions": "npm:0.3.1"
"@logion/node-api": "npm:0.27.0-4"
Expand Down