From c0392667e2424f8f44b5a3e7f90da3752c341b10 Mon Sep 17 00:00:00 2001 From: James Bayly Date: Tue, 5 Mar 2024 11:11:01 +0800 Subject: [PATCH] Chaintypes --- Reef/reef-starter/package.json | 2 +- Reef/reef-starter/src/chaintypes.json | 232 ++++++++++++++++++++++++++ Reef/reef-starter/src/chaintypes.ts | 22 --- 3 files changed, 233 insertions(+), 23 deletions(-) create mode 100644 Reef/reef-starter/src/chaintypes.json delete mode 100644 Reef/reef-starter/src/chaintypes.ts diff --git a/Reef/reef-starter/package.json b/Reef/reef-starter/package.json index d03d1f7..e466be7 100644 --- a/Reef/reef-starter/package.json +++ b/Reef/reef-starter/package.json @@ -29,6 +29,6 @@ "@subql/node": "latest" }, "exports": { - "chaintypes": "src/chaintypes.ts" + "chaintypes": "src/chaintypes.json" } } diff --git a/Reef/reef-starter/src/chaintypes.json b/Reef/reef-starter/src/chaintypes.json new file mode 100644 index 0000000..64e0cb2 --- /dev/null +++ b/Reef/reef-starter/src/chaintypes.json @@ -0,0 +1,232 @@ +{ + "CallOf": "Call", + "DispatchTime": { + "_enum": { + "At": "BlockNumber", + "After": "BlockNumber" + } + }, + "ScheduleTaskIndex": "u32", + "DelayedOrigin": { + "delay": "BlockNumber", + "origin": "PalletsOrigin" + }, + "StorageValue": "Vec", + "GraduallyUpdate": { + "key": "StorageKey", + "targetValue": "StorageValue", + "perBlock": "StorageValue" + }, + "StorageKeyBytes": "Vec", + "StorageValueBytes": "Vec", + "RpcDataProviderId": "Text", + "OrderedSet": "Vec", + "OrmlAccountData": { + "free": "Balance", + "frozen": "Balance", + "reserved": "Balance" + }, + "OrmlBalanceLock": { + "amount": "Balance", + "id": "LockIdentifier" + }, + "DelayedDispatchTime": { + "_enum": { + "At": "BlockNumber", + "After": "BlockNumber" + } + }, + "DispatchId": "u32", + "Price": "FixedU128", + "OrmlVestingSchedule": { + "start": "BlockNumber", + "period": "BlockNumber", + "periodCount": "u32", + "perPeriod": "Compact" + }, + "VestingScheduleOf": "OrmlVestingSchedule", + "PalletBalanceOf": "Balance", + "ChangeBalance": { + "_enum": { + "NoChange": "Null", + "NewValue": "Balance" + } + }, + "BalanceWrapper": { + "amount": "Balance" + }, + "BalanceRequest": { + "amount": "Balance" + }, + "EvmAccountInfo": { + "nonce": "Index", + "contractInfo": "Option", + "developerDeposit": "Option" + }, + "CodeInfo": { + "codeSize": "u32", + "refCount": "u32" + }, + "EvmContractInfo": { + "codeHash": "H256", + "maintainer": "H160", + "deployed": "bool" + }, + "EvmAddress": "H160", + "CallRequest": { + "from": "Option", + "to": "Option", + "gasLimit": "Option", + "storageLimit": "Option", + "value": "Option", + "data": "Option" + }, + "CID": "Vec", + "ClassId": "u32", + "ClassIdOf": "ClassId", + "TokenId": "u64", + "TokenIdOf": "TokenId", + "TokenInfoOf": { + "metadata": "CID", + "owner": "AccountId", + "data": "TokenData" + }, + "TokenData": { + "deposit": "Balance" + }, + "Properties": { + "_set": { + "_bitLength": 8, + "Transferable": 1, + "Burnable": 2 + } + }, + "BondingLedger": { + "total": "Compact", + "active": "Compact", + "unlocking": "Vec" + }, + "Amount": "i128", + "AmountOf": "Amount", + "AuctionId": "u32", + "AuctionIdOf": "AuctionId", + "TokenSymbol": { + "_enum": { + "REEF": 0, + "RUSD": 1 + } + }, + "CurrencyId": { + "_enum": { + "Token": "TokenSymbol", + "DEXShare": "(TokenSymbol, TokenSymbol)", + "ERC20": "EvmAddress" + } + }, + "CurrencyIdOf": "CurrencyId", + "AuthoritysOriginId": { + "_enum": ["Root"] + }, + "TradingPair": "(CurrencyId, CurrencyId)", + "AsOriginId": "AuthoritysOriginId", + "SubAccountStatus": { + "bonded": "Balance", + "available": "Balance", + "unbonding": "Vec<(EraIndex,Balance)>", + "mockRewardRate": "Rate" + }, + "Params": { + "targetMaxFreeUnbondedRatio": "Ratio", + "targetMinFreeUnbondedRatio": "Ratio", + "targetUnbondingToFreeRatio": "Ratio", + "unbondingToFreeAdjustment": "Ratio", + "baseFeeRate": "Rate" + }, + "Ledger": { + "bonded": "Balance", + "unbondingToFree": "Balance", + "freePool": "Balance", + "toUnbondNextEra": "(Balance, Balance)" + }, + "ChangeRate": { + "_enum": { + "NoChange": "Null", + "NewValue": "Rate" + } + }, + "ChangeRatio": { + "_enum": { + "NoChange": "Null", + "NewValue": "Ratio" + } + }, + "BalanceInfo": { + "amount": "Balance" + }, + "Rate": "FixedU128", + "Ratio": "FixedU128", + "PublicKey": "[u8; 20]", + "DestAddress": "Vec", + "Keys": "SessionKeys2", + "PalletsOrigin": { + "_enum": { + "System": "SystemOrigin", + "Timestamp": "Null", + "RandomnessCollectiveFlip": "Null", + "Balances": "Null", + "Accounts": "Null", + "Currencies": "Null", + "Tokens": "Null", + "Vesting": "Null", + "Utility": "Null", + "Multisig": "Null", + "Recovery": "Null", + "Proxy": "Null", + "Scheduler": "Null", + "Indices": "Null", + "GraduallyUpdate": "Null", + "Authorship": "Null", + "Babe": "Null", + "Grandpa": "Null", + "Staking": "Null", + "Session": "Null", + "Historical": "Null", + "Authority": "DelayedOrigin", + "ElectionsPhragmen": "Null", + "Contracts": "Null", + "EVM": "Null", + "Sudo": "Null", + "TransactionPayment": "Null" + } + }, + "LockState": { + "_enum": { + "Committed": "None", + "Unbonding": "BlockNumber" + } + }, + "LockDuration": { + "_enum": ["OneMonth", "OneYear", "TenYears"] + }, + "EraIndex": "u32", + "Era": { + "index": "EraIndex", + "start": "BlockNumber" + }, + "Commitment": { + "state": "LockState", + "duration": "LockDuration", + "amount": "Balance", + "candidate": "AccountId" + }, + "Multisig": { + "when": "Timepoint", + "deposit": "Balance", + "depositor": "AccountId", + "approvals": "Vec" + }, + "Timepoint": { + "height": "BlockNumber", + "index": "u32" + } +} diff --git a/Reef/reef-starter/src/chaintypes.ts b/Reef/reef-starter/src/chaintypes.ts deleted file mode 100644 index 0c76c37..0000000 --- a/Reef/reef-starter/src/chaintypes.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2017-2024 @polkadot/apps-config authors & contributors -// SPDX-License-Identifier: Apache-2.0 - -import type { OverrideBundleDefinition } from "@polkadot/types/types"; - -// structs need to be in order -/* eslint-disable sort-keys */ - -const definitions: OverrideBundleDefinition = { - types: [ - { - // on all versions - minmax: [0, undefined], - types: { - Address: "AccountId", - LookupSource: "AccountId", - }, - }, - ], -}; - -export default definitions;