use interfaces package for jamton (#11538)

This commit is contained in:
Alex 2025-05-20 06:36:44 +03:00 committed by GitHub
parent 791b3512a6
commit 89da93bef2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 154 additions and 55 deletions

View File

@ -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",

View File

@ -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;

View File

@ -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": {
@ -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": [

View File

@ -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"
@ -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"