Convert all specs to type bundles (#4646)

* Convert all specs to type bundles

* Additional

* s.specVersioned/spec/

* Fix paraApi typesSpec import

* Update

* small update

* comment on mapping
This commit is contained in:
Jaco Greeff 2021-02-11 11:54:27 +01:00 committed by GitHub
parent 4478fd3087
commit f84a55089b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
57 changed files with 3497 additions and 3018 deletions

View File

@ -1,20 +1,20 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { OverrideBundleType } from '@polkadot/types/types';
import typesChain from './chain';
import typesSpec from './spec';
import specVersioned from './specVersioned';
import spec from './spec';
export * from './constants';
export * from './params';
export function getChainTypes (specName: string, chainName: string): Record<string, string | Record<string, unknown>> {
export function getChainTypes (_specName: string, chainName: string): Record<string, string | Record<string, unknown>> {
return {
...(typesSpec[specName as keyof typeof typesSpec] || {}),
...(typesChain[chainName as keyof typeof typesChain] || {})
};
}
export const typesBundle = { spec: specVersioned };
export const typesBundle: OverrideBundleType = { spec };
export { typesChain, typesSpec };
export { typesChain };

View File

@ -1,10 +1,22 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId'
}
}
]
};
export default definitions;

View File

@ -1,151 +1,165 @@
// Copyright 2017-2021 @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 */
export default {
Token: { symbol: 'Vec<u8>', precision: 'u16', totalSupply: 'u128' },
VersionId: 'u32',
Action: {
account: 'AccountName',
name: 'ActionName',
authorization: 'Vec<PermissionLevel>',
data: 'Vec<u8>'
},
IostAction: { contract: 'Vec<u8>', action_name: 'Vec<u8>', data: 'Vec<u8>' },
PermissionLevel: { actor: 'AccountName', permission: 'PermissionName' },
PermissionName: 'u64',
ActionReceipt: {
receiver: 'AccountName',
act_digest: 'Checksum256',
global_sequence: 'u64',
recv_sequence: 'u64',
auth_sequence: 'FlatMap<AccountName, u64>',
code_sequence: 'UnsignedInt',
abi_sequence: 'UnsignedInt'
},
Checksum256: '([u8;32])',
BlockchainType: { _enum: ['BIFROST', 'EOS', 'IOST'] },
Precision: 'u32',
BridgeAssetSymbol: {
blockchain: 'BlockchainType',
symbol: 'Vec<u8>',
precision: 'Precision'
},
ProducerSchedule: { version: 'u32', producers: 'Vec<ProducerKey>' },
ProducerKey: { producer_name: 'AccountName', block_signing_key: 'PublicKey' },
AccountName: 'u64',
ActionName: 'u64',
PublicKey: { type_: 'UnsignedInt', data: '[u8;33]' },
UnsignedInt: 'u32',
Signature: { type_: 'UnsignedInt', data: '[u8;65]' },
SignedBlockHeader: { block_header: 'BlockHeader', producer_signature: 'Signature' },
BlockHeader: {
timestamp: 'BlockTimestamp',
producer: 'AccountName',
confirmed: 'u16',
previous: 'Checksum256',
transaction_mroot: 'Checksum256',
action_mroot: 'Checksum256',
schedule_version: 'u32',
new_producers: 'Option<ProducerSchedule>',
header_extensions: 'Vec<Extension>'
},
BlockTimestamp: '(u32)',
Extension: '(u16, Vec<u8>)',
IncrementalMerkle: { _node_count: 'u64', _active_nodes: 'Checksum256Array' },
Checksum256Array: 'Vec<Checksum256>',
FlatMap: { map: 'Vec<(ActionName, u64)>' },
TxSig: { signature: 'Vec<u8>', author: 'AccountId' },
MultiSig: { signatures: 'Vec<TxSig>', threshold: 'u8' },
MultiSigTx: {
chain_id: 'Vec<u8>',
raw_tx: 'Vec<u8>',
multi_sig: 'MultiSig',
action: 'Action',
from: 'AccountId',
token_symbol: 'TokenSymbol'
},
Sent: { tx_id: 'Vec<u8>', from: 'AccountId', token_symbol: 'TokenSymbol' },
Succeeded: { tx_id: 'Vec<u8>' },
Failed: { tx_id: 'Vec<u8>', reason: 'Vec<u8>' },
TxOut: {
_enum: {
Initialized: 'MultiSigTx',
Created: 'MultiSigTx',
SignComplete: 'MultiSigTx',
Sent: 'Sent',
Succeeded: 'Succeeded',
Failed: 'Failed'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Token: { symbol: 'Vec<u8>', precision: 'u16', totalSupply: 'u128' },
VersionId: 'u32',
Action: {
account: 'AccountName',
name: 'ActionName',
authorization: 'Vec<PermissionLevel>',
data: 'Vec<u8>'
},
IostAction: { contract: 'Vec<u8>', action_name: 'Vec<u8>', data: 'Vec<u8>' },
PermissionLevel: { actor: 'AccountName', permission: 'PermissionName' },
PermissionName: 'u64',
ActionReceipt: {
receiver: 'AccountName',
act_digest: 'Checksum256',
global_sequence: 'u64',
recv_sequence: 'u64',
auth_sequence: 'FlatMap<AccountName, u64>',
code_sequence: 'UnsignedInt',
abi_sequence: 'UnsignedInt'
},
Checksum256: '([u8;32])',
BlockchainType: { _enum: ['BIFROST', 'EOS', 'IOST'] },
Precision: 'u32',
BridgeAssetSymbol: {
blockchain: 'BlockchainType',
symbol: 'Vec<u8>',
precision: 'Precision'
},
ProducerSchedule: { version: 'u32', producers: 'Vec<ProducerKey>' },
ProducerKey: { producer_name: 'AccountName', block_signing_key: 'PublicKey' },
AccountName: 'u64',
ActionName: 'u64',
PublicKey: { type_: 'UnsignedInt', data: '[u8;33]' },
UnsignedInt: 'u32',
Signature: { type_: 'UnsignedInt', data: '[u8;65]' },
SignedBlockHeader: { block_header: 'BlockHeader', producer_signature: 'Signature' },
BlockHeader: {
timestamp: 'BlockTimestamp',
producer: 'AccountName',
confirmed: 'u16',
previous: 'Checksum256',
transaction_mroot: 'Checksum256',
action_mroot: 'Checksum256',
schedule_version: 'u32',
new_producers: 'Option<ProducerSchedule>',
header_extensions: 'Vec<Extension>'
},
BlockTimestamp: '(u32)',
Extension: '(u16, Vec<u8>)',
IncrementalMerkle: { _node_count: 'u64', _active_nodes: 'Checksum256Array' },
Checksum256Array: 'Vec<Checksum256>',
FlatMap: { map: 'Vec<(ActionName, u64)>' },
TxSig: { signature: 'Vec<u8>', author: 'AccountId' },
MultiSig: { signatures: 'Vec<TxSig>', threshold: 'u8' },
MultiSigTx: {
chain_id: 'Vec<u8>',
raw_tx: 'Vec<u8>',
multi_sig: 'MultiSig',
action: 'Action',
from: 'AccountId',
token_symbol: 'TokenSymbol'
},
Sent: { tx_id: 'Vec<u8>', from: 'AccountId', token_symbol: 'TokenSymbol' },
Succeeded: { tx_id: 'Vec<u8>' },
Failed: { tx_id: 'Vec<u8>', reason: 'Vec<u8>' },
TxOut: {
_enum: {
Initialized: 'MultiSigTx',
Created: 'MultiSigTx',
SignComplete: 'MultiSigTx',
Sent: 'Sent',
Succeeded: 'Succeeded',
Failed: 'Failed'
}
},
RewardRecord: { account_id: 'AccountId', record_amount: 'Balance' },
ConvertPrice: 'u128',
RatePerBlock: 'u64',
Fee: 'u64',
PoolId: 'u32',
Nonce: 'u32',
PoolDetails: { owner: 'AccountId', swap_fee_rate: 'Fee', active: 'bool' },
PoolCreateTokenDetails: {
token_id: 'TokenSymbol',
token_balance: 'Balance',
token_weight: 'PoolWeight'
},
TokenPool: 'Balance',
VTokenPool: 'Balance',
InVariantPool: 'Balance',
TokenSymbol: {
_enum: [
'aUSD', 'DOT',
'vDOT', 'KSM',
'vKSM', 'EOS',
'vEOS', 'IOST',
'vIOST'
]
},
TransactionStatus: {
_enum: [
'Initialized',
'Created',
'SignComplete',
'Sent',
'Succeeded',
'Failed'
]
},
Cost: 'u128',
Income: 'u128',
Price: 'u64',
AccountAsset: {
balance: 'Balance',
locked: 'Balance',
available: 'Balance',
cost: 'Cost',
income: 'Income'
},
SpecIndex: 'u32',
RequestIdentifier: 'u64',
DataVersion: 'u64',
ConvertPool: {
token_pool: 'Balance',
vtoken_pool: 'Balance',
current_reward: 'Balance',
pending_reward: 'Balance'
},
ProducerAuthoritySchedule: { version: 'u32', producers: 'Vec<ProducerAuthority>' },
ProducerAuthority: { producer_name: 'ActionName', authority: 'BlockSigningAuthority' },
BlockSigningAuthority: '(UnsignedInt, BlockSigningAuthorityV0)',
BlockSigningAuthorityV0: { threshold: 'u32', keys: 'Vec<KeyWeight>' },
KeyWeight: { key: 'PublicKey', weight: 'u16' },
InvariantValue: 'Balance',
PoolWeight: 'Balance',
AssetConfig: { redeem_duration: 'BlockNumber', min_reward_per_block: 'Balance' },
ProxyValidatorRegister: {
last_block: 'BlockNumber',
deposit: 'Balance',
need: 'Balance',
staking: 'Balance',
reward_per_block: 'Balance',
validator_address: 'Vec<u8>'
},
BlockNumber: 'u32'
}
}
},
RewardRecord: { account_id: 'AccountId', record_amount: 'Balance' },
ConvertPrice: 'u128',
RatePerBlock: 'u64',
Fee: 'u64',
PoolId: 'u32',
Nonce: 'u32',
PoolDetails: { owner: 'AccountId', swap_fee_rate: 'Fee', active: 'bool' },
PoolCreateTokenDetails: {
token_id: 'TokenSymbol',
token_balance: 'Balance',
token_weight: 'PoolWeight'
},
TokenPool: 'Balance',
VTokenPool: 'Balance',
InVariantPool: 'Balance',
TokenSymbol: {
_enum: [
'aUSD', 'DOT',
'vDOT', 'KSM',
'vKSM', 'EOS',
'vEOS', 'IOST',
'vIOST'
]
},
TransactionStatus: {
_enum: [
'Initialized',
'Created',
'SignComplete',
'Sent',
'Succeeded',
'Failed'
]
},
Cost: 'u128',
Income: 'u128',
Price: 'u64',
AccountAsset: {
balance: 'Balance',
locked: 'Balance',
available: 'Balance',
cost: 'Cost',
income: 'Income'
},
SpecIndex: 'u32',
RequestIdentifier: 'u64',
DataVersion: 'u64',
ConvertPool: {
token_pool: 'Balance',
vtoken_pool: 'Balance',
current_reward: 'Balance',
pending_reward: 'Balance'
},
ProducerAuthoritySchedule: { version: 'u32', producers: 'Vec<ProducerAuthority>' },
ProducerAuthority: { producer_name: 'ActionName', authority: 'BlockSigningAuthority' },
BlockSigningAuthority: '(UnsignedInt, BlockSigningAuthorityV0)',
BlockSigningAuthorityV0: { threshold: 'u32', keys: 'Vec<KeyWeight>' },
KeyWeight: { key: 'PublicKey', weight: 'u16' },
InvariantValue: 'Balance',
PoolWeight: 'Balance',
AssetConfig: { redeem_duration: 'BlockNumber', min_reward_per_block: 'Balance' },
ProxyValidatorRegister: {
last_block: 'BlockNumber',
deposit: 'Balance',
need: 'Balance',
staking: 'Balance',
reward_per_block: 'Balance',
validator_address: 'Vec<u8>'
},
BlockNumber: 'u32'
]
};
export default definitions;

View File

@ -1,48 +1,62 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'MultiAddress',
LookupSource: 'MultiAddress',
Balance: 'u128',
AssetId: 'u64',
BlockNumber: 'u32',
AssetInfo: {
owner: 'AccountId',
data: 'AssetData'
},
AssetData: {
name: 'Vec<u8>',
description: 'Vec<u8>',
properties: 'Vec<u8>',
supporters: 'Vec<AccountId>'
},
AuctionId: 'u64',
AuctionItem: {
asset_id: 'AssetId',
recipient: 'AccountId',
initial_amount: 'Balance',
amount: 'Balance',
start_time: 'u32',
ed_time: 'u32'
},
AuctionInfo: {
bid: 'Option<(AccountId,Balance)>',
start: 'BlockNumber',
end: 'Option<BlockNumber>'
},
RentId: 'u64 ',
RentalInfo: {
owner: 'AccountId',
start: 'BlockNumber',
end: 'Option<BlockNumber>',
price_per_block: 'Balance'
},
CountryId: 'u64',
CollectionId: 'u64',
CurrencyId: 'u32',
TokenId: 'u64',
CurrencyIdOf: 'CurrencyId',
BalanceIdOf: 'Balance'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'MultiAddress',
LookupSource: 'MultiAddress',
Balance: 'u128',
AssetId: 'u64',
BlockNumber: 'u32',
AssetInfo: {
owner: 'AccountId',
data: 'AssetData'
},
AssetData: {
name: 'Vec<u8>',
description: 'Vec<u8>',
properties: 'Vec<u8>',
supporters: 'Vec<AccountId>'
},
AuctionId: 'u64',
AuctionItem: {
asset_id: 'AssetId',
recipient: 'AccountId',
initial_amount: 'Balance',
amount: 'Balance',
start_time: 'u32',
ed_time: 'u32'
},
AuctionInfo: {
bid: 'Option<(AccountId,Balance)>',
start: 'BlockNumber',
end: 'Option<BlockNumber>'
},
RentId: 'u64 ',
RentalInfo: {
owner: 'AccountId',
start: 'BlockNumber',
end: 'Option<BlockNumber>',
price_per_block: 'Balance'
},
CountryId: 'u64',
CollectionId: 'u64',
CurrencyId: 'u32',
TokenId: 'u64',
CurrencyIdOf: 'CurrencyId',
BalanceIdOf: 'Balance'
}
}
]
};
export default definitions;

View File

@ -1,11 +1,23 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId',
Schedule: 'ScheduleTo258'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId',
Schedule: 'ScheduleTo258'
}
}
]
};
export default definitions;

View File

@ -1,64 +1,75 @@
// Copyright 2017-2021 @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 */
export default {
// chain-specific
AnchorData: {
id: 'H256',
docRoot: 'H256',
anchoredBlock: 'u64'
},
Fee: {
key: 'Hash',
price: 'Balance'
},
PreCommitData: {
signingRoot: 'H256',
identity: 'H256',
expirationBlock: 'u64'
},
Proof: {
leafHash: 'H256',
sortedHashes: 'H256'
},
// MultiAccount
MultiAccountData: {
threshold: 'u16',
signatories: 'Vec<AccountId>',
deposit: 'Balance',
depositor: 'AccountId'
},
// Bridge constants
ChainId: 'u8',
ResourceId: '[u8; 32]',
'chainbridge::ChainId': 'u8',
DepositNonce: 'u64',
// NFT
RegistryId: 'H160',
TokenId: 'U256',
AssetId: {
registryId: 'RegistryId',
tokenId: 'TokenId'
},
RegistryInfo: {
ownerCanBurn: 'bool',
fields: 'Vec<Bytes>'
},
AssetInfo: {
metadata: 'Bytes'
},
ProofMint: {
value: 'Bytes',
property: 'Bytes',
salt: '[u8; 32]',
hashes: 'Vec<Hash>'
},
MintInfo: {
anchorId: 'Hash',
staticHashes: '[Hash; 3]',
proofs: 'Vec<ProofMint>'
}
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
AnchorData: {
id: 'H256',
docRoot: 'H256',
anchoredBlock: 'u64'
},
Fee: {
key: 'Hash',
price: 'Balance'
},
PreCommitData: {
signingRoot: 'H256',
identity: 'H256',
expirationBlock: 'u64'
},
Proof: {
leafHash: 'H256',
sortedHashes: 'H256'
},
// MultiAccount
MultiAccountData: {
threshold: 'u16',
signatories: 'Vec<AccountId>',
deposit: 'Balance',
depositor: 'AccountId'
},
// Bridge constants
ChainId: 'u8',
ResourceId: '[u8; 32]',
'chainbridge::ChainId': 'u8',
DepositNonce: 'u64',
// NFT
RegistryId: 'H160',
TokenId: 'U256',
AssetId: {
registryId: 'RegistryId',
tokenId: 'TokenId'
},
RegistryInfo: {
ownerCanBurn: 'bool',
fields: 'Vec<Bytes>'
},
AssetInfo: {
metadata: 'Bytes'
},
ProofMint: {
value: 'Bytes',
property: 'Bytes',
salt: '[u8; 32]',
hashes: 'Vec<Hash>'
},
MintInfo: {
anchorId: 'Hash',
staticHashes: '[Hash; 3]',
proofs: 'Vec<ProofMint>'
}
}
}
]
};
export default definitions;

View File

@ -1,450 +1,462 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId',
Chain: {
_enum: [
'ChainX',
'Bitcoin',
'Ethereum',
'Polkadot'
]
},
NetworkType: {
_enum: [
'Mainnet',
'Testnet'
]
},
AssetType: {
_enum: [
'Usable',
'Locked',
'Reserved',
'ReservedWithdrawal',
'ReservedDexSpot'
]
},
OrderType: {
_enum: [
'Limit',
'Market'
]
},
Side: {
_enum: [
'Buy',
'Sell'
]
},
LockedType: {
_enum: [
'Bonded',
'BondedWithdrawal'
]
},
Memo: 'Text',
AssetInfo: {
token: 'String',
tokenName: 'String',
chain: 'Chain',
decimals: 'Decimals',
desc: 'String'
},
TradingPairProfile: {
id: 'TradingPairId',
currencyPair: 'CurrencyPair',
pipDecimals: 'u32',
tickDecimals: 'u32',
tradable: 'bool'
},
Order: {
props: 'OrderProperty',
status: 'OrderStatus',
remaining: 'Balance',
executedIndices: 'Vec<TradingHistoryIndex>',
alreadyFilled: 'Balance',
lastUpdateAt: 'BlockNumber'
},
TradingPairInfo: {
latestPrice: 'Price',
lastUpdated: 'BlockNumber'
},
OrderExecutedInfo: {
tradingHistoryIdx: 'TradingHistoryIndex',
pairId: 'TradingPairId',
price: 'Price',
maker: 'AccountId',
taker: 'AccountId',
makerOrderId: 'OrderId',
takerOrderId: 'OrderId',
turnover: 'Balance',
executedAt: 'BlockNumber'
},
BtcHeaderInfo: {
header: 'BtcHeader',
height: 'u32'
},
BtcParams: {
maxBits: 'u32',
blockMaxFuture: 'u32',
targetTimespanSeconds: 'u32',
targetSpacingSeconds: 'u32',
retargetingFactor: 'u32',
retargetingInterval: 'u32',
minTimespan: 'u32',
maxTimespan: 'u32'
},
MiningAssetInfo: {
assetId: 'AssetId',
miningPower: 'FixedAssetPower',
rewardPot: 'AccountId',
rewardPotBalance: 'RpcBalance',
lastTotalMiningWeight: 'RpcMiningWeight',
lastTotalMiningWeightUpdate: 'BlockNumber'
},
MiningDividendInfo: {
own: 'Balance',
other: 'Balance',
insufficientStake: 'Balance'
},
AssetLedger: {
lastTotalMiningWeight: 'MiningWeight',
lastTotalMiningWeightUpdate: 'BlockNumber'
},
MinerLedger: {
lastMiningWeight: 'MiningWeight',
lastMiningWeightUpdate: 'BlockNumber',
lastClaim: 'Option<BlockNumber>'
},
ClaimRestriction: {
stakingRequirement: 'StakingRequirement',
frequencyLimit: 'BlockNumber'
},
NominatorInfo: {
lastRebond: 'Option<BlockNumber>'
},
BondRequirement: {
selfBonded: 'Balance',
total: 'Balance'
},
Unbonded: {
value: 'Balance',
lockedUntil: 'BlockNumber'
},
ValidatorLedger: {
totalNomination: 'Balance',
lastTotalVoteWeight: 'VoteWeight',
lastTotalVoteWeightUpdate: 'BlockNumber'
},
NominatorLedger: {
nomination: 'Balance',
lastVoteWeight: 'VoteWeight',
lastVoteWeightUpdate: 'BlockNumber',
unbondedChunks: 'Vec<Unbonded>'
},
ValidatorProfile: {
registeredAt: 'BlockNumber',
isChilled: 'bool',
lastChilled: 'Option<BlockNumber>',
referralId: 'ReferralId'
},
GlobalDistribution: {
treasury: 'u32',
mining: 'u32'
},
MiningDistribution: {
asset: 'u32',
staking: 'u32'
},
InclusionFee: {
baseFee: 'Balance',
lenFee: 'Balance',
adjustedWeightFee: 'Balance'
},
FeeDetails: {
inclusionFee: 'Option<InclusionFee<Balance>>',
extraFee: 'Balance',
tip: 'Balance',
finalFee: 'Balance'
},
UnbondedIndex: 'u32',
Token: 'Text',
Desc: 'Text',
AddrStr: 'Text',
HandicapInfo: 'Handicap',
Price: 'u128',
OrderId: 'u64',
TradingPairId: 'u32',
TradingHistoryIndex: 'u64',
PriceFluctuation: 'u32',
BtcAddress: 'Text',
FixedAssetPower: 'u32',
StakingRequirement: 'u32',
Decimals: 'u8',
CurrencyPair: {
base: 'AssetId',
quote: 'AssetId'
},
OrderStatus: {
_enum: [
'Created',
'PartialFill',
'Filled',
'PartialFillAndCanceled',
'Canceled'
]
},
AssetId: 'u32',
MiningWeight: 'u128',
VoteWeight: 'u128',
ReferralId: 'Text',
AssetRestriction: {
_enum: [
'Move',
'Transfer',
'Deposit',
'Withdraw',
'DestroyWithdrawal',
'DestroyFree'
]
},
AssetRestrictions: {
bits: 'u32'
},
BtcHeader: 'Vec<u8>',
BtcNetwork: {
_enum: [
'Mainnet',
'Testnet'
]
},
OrderInfo: 'Order',
Amount: 'i128',
AmountOf: 'Amount',
CurrencyIdOf: 'AssetId',
CurrencyId: 'AssetId',
Handicap: {
highestBid: 'Price',
lowestAsk: 'Price'
},
OrderProperty: {
id: 'OrderId',
side: 'Side',
price: 'Price',
amount: 'Amount',
pairId: 'TradingPairId',
submitter: 'AccountId',
orderType: 'OrderType',
createdAt: 'BlockNumber'
},
TotalAssetInfo: {
info: 'AssetInfo',
balance: 'BTreeMap<AssetType, Balance>',
isOnline: 'bool',
restrictions: 'AssetRestrictions'
},
WithdrawalRecordId: 'u32',
WithdrawalState: {
_enum: [
'Applying',
'Processing',
'NormalFinish',
'RootFinish',
'NormalCancel',
'RootCancel'
]
},
WithdrawalRecord: {
assetId: 'AssetId',
applicant: 'AccountId',
balance: 'Balance',
addr: 'AddrStr',
ext: 'Memo',
height: 'BlockNumber'
},
WithdrawalLimit: {
minimalWithdrawal: 'Balance',
fee: 'Balance'
},
TrusteeInfoConfig: {
minTrusteeCount: 'u32',
maxTrusteeCount: 'u32'
},
GenericTrusteeIntentionProps: {
about: 'Text',
hotEntity: 'Vec<u8>',
coldEntity: 'Vec<u8>'
},
GenericTrusteeSessionInfo: {
trusteeList: 'Vec<AccountId>',
threshold: 'u16',
hotAddress: 'Vec<u8>',
coldAddress: 'Vec<u8>'
},
ChainAddress: 'Vec<u8>',
BtcTrusteeType: 'Vec<u8>',
BtcTrusteeAddrInfo: {
addr: 'BtcAddress',
redeemScript: 'Vec<u8>'
},
BtcTrusteeIntentionProps: {
about: 'Text',
hotEntity: 'BtcTrusteeType',
coldEntity: 'BtcTrusteeType'
},
BtcTrusteeSessionInfo: {
trusteeList: 'Vec<AccountId>',
threshold: 'u16',
hotAddress: 'BtcTrusteeAddrInfo',
coldAddress: 'BtcTrusteeAddrInfo'
},
BtcTransaction: 'Vec<u8>',
BtcPartialMerkleTree: 'Vec<u8>',
BtcRelayedTxInfo: {
blockHash: 'H256',
merkleProof: 'BtcPartialMerkleTree'
},
BtcHeaderIndex: {
hash: 'H256',
height: 'u32'
},
BtcTxResult: {
_enum: [
'Success',
'Failure'
]
},
BtcTxState: {
txType: 'BtcTxType',
result: 'BtcTxResult'
},
BtcTxType: {
_enum: [
'Withdrawal',
'Deposit',
'HotAndCold',
'TrusteeTransition',
'Irrelevance'
]
},
BtcDepositCache: {
txid: 'H256',
balance: 'u64'
},
BtcVoteResult: {
_enum: [
'Unfinish',
'Finish'
]
},
BtcWithdrawalProposal: {
sigState: 'BtcVoteResult',
withdrawalIdList: 'Vec<u32>',
tx: 'BtcTransaction',
trusteeList: 'Vec<(AccountId, bool)>'
},
BtcTxVerifier: {
_enum: [
'Recover',
'RuntimeInterface'
]
},
RpcTotalAssetInfo: {
info: 'AssetInfo',
balance: 'BTreeMap<AssetType, RpcBalance>',
isOnline: 'bool',
restrictions: 'AssetRestrictions'
},
RpcOrder: {
id: 'OrderId',
side: 'Side',
price: 'RpcPrice',
amount: 'RpcBalance',
pairId: 'TradingPairId',
submitter: 'AccountId',
orderType: 'OrderType',
createdAt: 'BlockNumber',
status: 'OrderStatus',
remaining: 'RpcBalance',
executedIndices: 'Vec<TradingHistoryIndex>',
alreadyFilled: 'RpcBalance',
reservedBalance: 'RpcBalance',
lastUpdateAt: 'BlockNumber'
},
RpcWithdrawalRecord: {
assetId: 'AssetId',
applicant: 'AccountId',
balance: 'RpcBalance',
addr: 'String',
ext: 'String',
height: 'BlockNumber',
state: 'WithdrawalState'
},
RpcMiningDividendInfo: {
own: 'RpcBalance',
other: 'RpcBalance',
insufficientStake: 'RpcBalance'
},
RpcInclusionFee: {
baseFee: 'RpcBalance',
lenFee: 'RpcBalance',
adjustedWeightFee: 'RpcBalance'
},
RpcFeeDetails: {
inclusionFee: 'Option<RpcInclusionFee>',
tip: 'RpcBalance',
extraFee: 'RpcBalance',
finalFee: 'RpcBalance'
},
ValidatorInfo: {
account: 'AccountId',
registeredAt: 'BlockNumber',
isChilled: 'bool',
lastChilled: 'Option<BlockNumber>',
totalNomination: 'RpcBalance',
lastTotalVoteWeight: 'RpcVoteWeight',
lastTotalVoteWeightUpdate: 'BlockNumber',
isValidating: 'bool',
selfBonded: 'RpcBalance',
referralId: 'String',
rewardPotAccount: 'AccountId',
rewardPotBalance: 'RpcBalance'
},
FullPairInfo: {
baseCurrency: 'AssetId',
highestBid: 'RpcPrice',
id: 'TradingPairId',
latestPrice: 'RpcPrice',
latestPriceUpdatedAt: 'BlockNumber',
lowestAsk: 'RpcPrice',
maxValidBid: 'RpcPrice',
minValidAsk: 'RpcPrice',
pipDecimals: 'u32',
quoteCurrency: 'AssetId',
tickDecimals: 'u32',
tradable: 'bool'
},
Depth: {
asks: 'Vec<(RpcPrice, RpcBalance)>',
bids: 'Vec<(RpcPrice, RpcBalance)>'
},
Page: {
pageIndex: 'u32',
pageSize: 'u32',
data: 'Vec<RpcOrder>'
},
String: 'Text',
Balance: 'u128',
RpcPrice: 'String',
RpcBalance: 'String',
RpcMiningWeight: 'String',
RpcVoteWeight: 'String',
FullIdentification: 'ValidatorId',
WithdrawalRecordOf: 'WithdrawalRecord'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId',
Chain: {
_enum: [
'ChainX',
'Bitcoin',
'Ethereum',
'Polkadot'
]
},
NetworkType: {
_enum: [
'Mainnet',
'Testnet'
]
},
AssetType: {
_enum: [
'Usable',
'Locked',
'Reserved',
'ReservedWithdrawal',
'ReservedDexSpot'
]
},
OrderType: {
_enum: [
'Limit',
'Market'
]
},
Side: {
_enum: [
'Buy',
'Sell'
]
},
LockedType: {
_enum: [
'Bonded',
'BondedWithdrawal'
]
},
Memo: 'Text',
AssetInfo: {
token: 'String',
tokenName: 'String',
chain: 'Chain',
decimals: 'Decimals',
desc: 'String'
},
TradingPairProfile: {
id: 'TradingPairId',
currencyPair: 'CurrencyPair',
pipDecimals: 'u32',
tickDecimals: 'u32',
tradable: 'bool'
},
Order: {
props: 'OrderProperty',
status: 'OrderStatus',
remaining: 'Balance',
executedIndices: 'Vec<TradingHistoryIndex>',
alreadyFilled: 'Balance',
lastUpdateAt: 'BlockNumber'
},
TradingPairInfo: {
latestPrice: 'Price',
lastUpdated: 'BlockNumber'
},
OrderExecutedInfo: {
tradingHistoryIdx: 'TradingHistoryIndex',
pairId: 'TradingPairId',
price: 'Price',
maker: 'AccountId',
taker: 'AccountId',
makerOrderId: 'OrderId',
takerOrderId: 'OrderId',
turnover: 'Balance',
executedAt: 'BlockNumber'
},
BtcHeaderInfo: {
header: 'BtcHeader',
height: 'u32'
},
BtcParams: {
maxBits: 'u32',
blockMaxFuture: 'u32',
targetTimespanSeconds: 'u32',
targetSpacingSeconds: 'u32',
retargetingFactor: 'u32',
retargetingInterval: 'u32',
minTimespan: 'u32',
maxTimespan: 'u32'
},
MiningAssetInfo: {
assetId: 'AssetId',
miningPower: 'FixedAssetPower',
rewardPot: 'AccountId',
rewardPotBalance: 'RpcBalance',
lastTotalMiningWeight: 'RpcMiningWeight',
lastTotalMiningWeightUpdate: 'BlockNumber'
},
MiningDividendInfo: {
own: 'Balance',
other: 'Balance',
insufficientStake: 'Balance'
},
AssetLedger: {
lastTotalMiningWeight: 'MiningWeight',
lastTotalMiningWeightUpdate: 'BlockNumber'
},
MinerLedger: {
lastMiningWeight: 'MiningWeight',
lastMiningWeightUpdate: 'BlockNumber',
lastClaim: 'Option<BlockNumber>'
},
ClaimRestriction: {
stakingRequirement: 'StakingRequirement',
frequencyLimit: 'BlockNumber'
},
NominatorInfo: {
lastRebond: 'Option<BlockNumber>'
},
BondRequirement: {
selfBonded: 'Balance',
total: 'Balance'
},
Unbonded: {
value: 'Balance',
lockedUntil: 'BlockNumber'
},
ValidatorLedger: {
totalNomination: 'Balance',
lastTotalVoteWeight: 'VoteWeight',
lastTotalVoteWeightUpdate: 'BlockNumber'
},
NominatorLedger: {
nomination: 'Balance',
lastVoteWeight: 'VoteWeight',
lastVoteWeightUpdate: 'BlockNumber',
unbondedChunks: 'Vec<Unbonded>'
},
ValidatorProfile: {
registeredAt: 'BlockNumber',
isChilled: 'bool',
lastChilled: 'Option<BlockNumber>',
referralId: 'ReferralId'
},
GlobalDistribution: {
treasury: 'u32',
mining: 'u32'
},
MiningDistribution: {
asset: 'u32',
staking: 'u32'
},
InclusionFee: {
baseFee: 'Balance',
lenFee: 'Balance',
adjustedWeightFee: 'Balance'
},
FeeDetails: {
inclusionFee: 'Option<InclusionFee<Balance>>',
extraFee: 'Balance',
tip: 'Balance',
finalFee: 'Balance'
},
UnbondedIndex: 'u32',
Token: 'Text',
Desc: 'Text',
AddrStr: 'Text',
HandicapInfo: 'Handicap',
Price: 'u128',
OrderId: 'u64',
TradingPairId: 'u32',
TradingHistoryIndex: 'u64',
PriceFluctuation: 'u32',
BtcAddress: 'Text',
FixedAssetPower: 'u32',
StakingRequirement: 'u32',
Decimals: 'u8',
CurrencyPair: {
base: 'AssetId',
quote: 'AssetId'
},
OrderStatus: {
_enum: [
'Created',
'PartialFill',
'Filled',
'PartialFillAndCanceled',
'Canceled'
]
},
AssetId: 'u32',
MiningWeight: 'u128',
VoteWeight: 'u128',
ReferralId: 'Text',
AssetRestriction: {
_enum: [
'Move',
'Transfer',
'Deposit',
'Withdraw',
'DestroyWithdrawal',
'DestroyFree'
]
},
AssetRestrictions: {
bits: 'u32'
},
BtcHeader: 'Vec<u8>',
BtcNetwork: {
_enum: [
'Mainnet',
'Testnet'
]
},
OrderInfo: 'Order',
Amount: 'i128',
AmountOf: 'Amount',
CurrencyIdOf: 'AssetId',
CurrencyId: 'AssetId',
Handicap: {
highestBid: 'Price',
lowestAsk: 'Price'
},
OrderProperty: {
id: 'OrderId',
side: 'Side',
price: 'Price',
amount: 'Amount',
pairId: 'TradingPairId',
submitter: 'AccountId',
orderType: 'OrderType',
createdAt: 'BlockNumber'
},
TotalAssetInfo: {
info: 'AssetInfo',
balance: 'BTreeMap<AssetType, Balance>',
isOnline: 'bool',
restrictions: 'AssetRestrictions'
},
WithdrawalRecordId: 'u32',
WithdrawalState: {
_enum: [
'Applying',
'Processing',
'NormalFinish',
'RootFinish',
'NormalCancel',
'RootCancel'
]
},
WithdrawalRecord: {
assetId: 'AssetId',
applicant: 'AccountId',
balance: 'Balance',
addr: 'AddrStr',
ext: 'Memo',
height: 'BlockNumber'
},
WithdrawalLimit: {
minimalWithdrawal: 'Balance',
fee: 'Balance'
},
TrusteeInfoConfig: {
minTrusteeCount: 'u32',
maxTrusteeCount: 'u32'
},
GenericTrusteeIntentionProps: {
about: 'Text',
hotEntity: 'Vec<u8>',
coldEntity: 'Vec<u8>'
},
GenericTrusteeSessionInfo: {
trusteeList: 'Vec<AccountId>',
threshold: 'u16',
hotAddress: 'Vec<u8>',
coldAddress: 'Vec<u8>'
},
ChainAddress: 'Vec<u8>',
BtcTrusteeType: 'Vec<u8>',
BtcTrusteeAddrInfo: {
addr: 'BtcAddress',
redeemScript: 'Vec<u8>'
},
BtcTrusteeIntentionProps: {
about: 'Text',
hotEntity: 'BtcTrusteeType',
coldEntity: 'BtcTrusteeType'
},
BtcTrusteeSessionInfo: {
trusteeList: 'Vec<AccountId>',
threshold: 'u16',
hotAddress: 'BtcTrusteeAddrInfo',
coldAddress: 'BtcTrusteeAddrInfo'
},
BtcTransaction: 'Vec<u8>',
BtcPartialMerkleTree: 'Vec<u8>',
BtcRelayedTxInfo: {
blockHash: 'H256',
merkleProof: 'BtcPartialMerkleTree'
},
BtcHeaderIndex: {
hash: 'H256',
height: 'u32'
},
BtcTxResult: {
_enum: [
'Success',
'Failure'
]
},
BtcTxState: {
txType: 'BtcTxType',
result: 'BtcTxResult'
},
BtcTxType: {
_enum: [
'Withdrawal',
'Deposit',
'HotAndCold',
'TrusteeTransition',
'Irrelevance'
]
},
BtcDepositCache: {
txid: 'H256',
balance: 'u64'
},
BtcVoteResult: {
_enum: [
'Unfinish',
'Finish'
]
},
BtcWithdrawalProposal: {
sigState: 'BtcVoteResult',
withdrawalIdList: 'Vec<u32>',
tx: 'BtcTransaction',
trusteeList: 'Vec<(AccountId, bool)>'
},
BtcTxVerifier: {
_enum: [
'Recover',
'RuntimeInterface'
]
},
RpcTotalAssetInfo: {
info: 'AssetInfo',
balance: 'BTreeMap<AssetType, RpcBalance>',
isOnline: 'bool',
restrictions: 'AssetRestrictions'
},
RpcOrder: {
id: 'OrderId',
side: 'Side',
price: 'RpcPrice',
amount: 'RpcBalance',
pairId: 'TradingPairId',
submitter: 'AccountId',
orderType: 'OrderType',
createdAt: 'BlockNumber',
status: 'OrderStatus',
remaining: 'RpcBalance',
executedIndices: 'Vec<TradingHistoryIndex>',
alreadyFilled: 'RpcBalance',
reservedBalance: 'RpcBalance',
lastUpdateAt: 'BlockNumber'
},
RpcWithdrawalRecord: {
assetId: 'AssetId',
applicant: 'AccountId',
balance: 'RpcBalance',
addr: 'String',
ext: 'String',
height: 'BlockNumber',
state: 'WithdrawalState'
},
RpcMiningDividendInfo: {
own: 'RpcBalance',
other: 'RpcBalance',
insufficientStake: 'RpcBalance'
},
RpcInclusionFee: {
baseFee: 'RpcBalance',
lenFee: 'RpcBalance',
adjustedWeightFee: 'RpcBalance'
},
RpcFeeDetails: {
inclusionFee: 'Option<RpcInclusionFee>',
tip: 'RpcBalance',
extraFee: 'RpcBalance',
finalFee: 'RpcBalance'
},
ValidatorInfo: {
account: 'AccountId',
registeredAt: 'BlockNumber',
isChilled: 'bool',
lastChilled: 'Option<BlockNumber>',
totalNomination: 'RpcBalance',
lastTotalVoteWeight: 'RpcVoteWeight',
lastTotalVoteWeightUpdate: 'BlockNumber',
isValidating: 'bool',
selfBonded: 'RpcBalance',
referralId: 'String',
rewardPotAccount: 'AccountId',
rewardPotBalance: 'RpcBalance'
},
FullPairInfo: {
baseCurrency: 'AssetId',
highestBid: 'RpcPrice',
id: 'TradingPairId',
latestPrice: 'RpcPrice',
latestPriceUpdatedAt: 'BlockNumber',
lowestAsk: 'RpcPrice',
maxValidBid: 'RpcPrice',
minValidAsk: 'RpcPrice',
pipDecimals: 'u32',
quoteCurrency: 'AssetId',
tickDecimals: 'u32',
tradable: 'bool'
},
Depth: {
asks: 'Vec<(RpcPrice, RpcBalance)>',
bids: 'Vec<(RpcPrice, RpcBalance)>'
},
Page: {
pageIndex: 'u32',
pageSize: 'u32',
data: 'Vec<RpcOrder>'
},
String: 'Text',
Balance: 'u128',
RpcPrice: 'String',
RpcBalance: 'String',
RpcMiningWeight: 'String',
RpcVoteWeight: 'String',
FullIdentification: 'ValidatorId',
WithdrawalRecordOf: 'WithdrawalRecord'
}
}
]
};
export default definitions;

View File

@ -1,64 +1,74 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
// types for clover
import type { OverrideBundleDefinition } from '@polkadot/types/types';
// structs need to be in order
/* eslint-disable sort-keys */
const cloverRococoTypes = {
Amount: 'i128',
AmountOf: 'Amount',
Balance: 'u128',
CurrencyId: {
_enum: ['CLV', 'CUSDT', 'DOT', 'CETH']
},
CurrencyIdOf: 'CurrencyId',
CurrencyTypeEnum: {
_enum: ['CLV', 'CUSDT', 'DOT', 'CETH']
},
PairKey: 'u64',
Rate: 'FixedU128',
Ratio: 'FixedU128',
Price: 'FixedU128',
Share: 'u128',
OracleKey: 'CurrencyId',
CurrencyInfo: {
id: 'CurrencyId',
name: 'CurrencyTypeEnum'
},
ExchangeInfo: {
balance: 'Balance',
routes: 'Vec<CurrencyTypeEnum>'
},
PoolId: {
_enum: {
Swap: 'u64'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Amount: 'i128',
AmountOf: 'Amount',
Balance: 'u128',
CurrencyId: {
_enum: ['CLV', 'CUSDT', 'DOT', 'CETH']
},
CurrencyIdOf: 'CurrencyId',
CurrencyTypeEnum: {
_enum: ['CLV', 'CUSDT', 'DOT', 'CETH']
},
PairKey: 'u64',
Rate: 'FixedU128',
Ratio: 'FixedU128',
Price: 'FixedU128',
Share: 'u128',
OracleKey: 'CurrencyId',
CurrencyInfo: {
id: 'CurrencyId',
name: 'CurrencyTypeEnum'
},
ExchangeInfo: {
balance: 'Balance',
routes: 'Vec<CurrencyTypeEnum>'
},
PoolId: {
_enum: {
Swap: 'u64'
}
},
EcdsaSignature: '[u8; 65]',
EvmAddress: 'H160',
ExitSucceed: {
_enum: ['Stopped', 'Returned', 'Suicided']
},
ExitRevert: {
_enum: ['Reverted']
},
ExitError: {
_enum: [
'StackUnderflow', 'StackOverflow', 'InvalidJump', 'InvalidRange', 'DesignatedInvalid', 'CallTooDeep',
'CreateCollision', 'CreateContractLimit', 'OutOfOffset', 'OutOfGas', 'OutOfFund', 'PCUnderflow', 'CreateEmpty',
'Other<String>'
]
},
ExitFatal: {
_enum: ['NotSupported', 'UnhandledInterrupt', 'CallErrorAsFatal', 'Other<String>']
},
ExitReason: {
_enum: ['Succeed<ExitSucceed>',
'Error<ExitError>',
'Revert<ExitRevert>',
'Fatal<ExitFatal>'
]
}
}
}
},
EcdsaSignature: '[u8; 65]',
EvmAddress: 'H160',
ExitSucceed: {
_enum: ['Stopped', 'Returned', 'Suicided']
},
ExitRevert: {
_enum: ['Reverted']
},
ExitError: {
_enum: [
'StackUnderflow', 'StackOverflow', 'InvalidJump', 'InvalidRange', 'DesignatedInvalid', 'CallTooDeep',
'CreateCollision', 'CreateContractLimit', 'OutOfOffset', 'OutOfGas', 'OutOfFund', 'PCUnderflow', 'CreateEmpty',
'Other<String>'
]
},
ExitFatal: {
_enum: ['NotSupported', 'UnhandledInterrupt', 'CallErrorAsFatal', 'Other<String>']
},
ExitReason: {
_enum: ['Succeed<ExitSucceed>',
'Error<ExitError>',
'Revert<ExitRevert>',
'Fatal<ExitFatal>'
]
}
]
};
export default cloverRococoTypes;
export default definitions;

View File

@ -1,65 +1,75 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
// types for clover
import type { OverrideBundleDefinition } from '@polkadot/types/types';
// structs need to be in order
/* eslint-disable sort-keys */
const cloverTypes = {
Amount: 'i128',
Keys: 'SessionKeys3',
AmountOf: 'Amount',
Balance: 'u128',
CurrencyId: {
_enum: ['CLV', 'CUSDT', 'DOT', 'CETH']
},
CurrencyIdOf: 'CurrencyId',
CurrencyTypeEnum: {
_enum: ['CLV', 'CUSDT', 'DOT', 'CETH']
},
PairKey: 'u64',
Rate: 'FixedU128',
Ratio: 'FixedU128',
Price: 'FixedU128',
Share: 'u128',
OracleKey: 'CurrencyId',
CurrencyInfo: {
id: 'CurrencyId',
name: 'CurrencyTypeEnum'
},
ExchangeInfo: {
balance: 'Balance',
routes: 'Vec<CurrencyTypeEnum>'
},
PoolId: {
_enum: {
Swap: 'u64'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Amount: 'i128',
Keys: 'SessionKeys3',
AmountOf: 'Amount',
Balance: 'u128',
CurrencyId: {
_enum: ['CLV', 'CUSDT', 'DOT', 'CETH']
},
CurrencyIdOf: 'CurrencyId',
CurrencyTypeEnum: {
_enum: ['CLV', 'CUSDT', 'DOT', 'CETH']
},
PairKey: 'u64',
Rate: 'FixedU128',
Ratio: 'FixedU128',
Price: 'FixedU128',
Share: 'u128',
OracleKey: 'CurrencyId',
CurrencyInfo: {
id: 'CurrencyId',
name: 'CurrencyTypeEnum'
},
ExchangeInfo: {
balance: 'Balance',
routes: 'Vec<CurrencyTypeEnum>'
},
PoolId: {
_enum: {
Swap: 'u64'
}
},
EcdsaSignature: '[u8; 65]',
EvmAddress: 'H160',
ExitSucceed: {
_enum: ['Stopped', 'Returned', 'Suicided']
},
ExitRevert: {
_enum: ['Reverted']
},
ExitError: {
_enum: [
'StackUnderflow', 'StackOverflow', 'InvalidJump', 'InvalidRange', 'DesignatedInvalid', 'CallTooDeep',
'CreateCollision', 'CreateContractLimit', 'OutOfOffset', 'OutOfGas', 'OutOfFund', 'PCUnderflow', 'CreateEmpty',
'Other<String>'
]
},
ExitFatal: {
_enum: ['NotSupported', 'UnhandledInterrupt', 'CallErrorAsFatal', 'Other<String>']
},
ExitReason: {
_enum: ['Succeed<ExitSucceed>',
'Error<ExitError>',
'Revert<ExitRevert>',
'Fatal<ExitFatal>'
]
}
}
}
},
EcdsaSignature: '[u8; 65]',
EvmAddress: 'H160',
ExitSucceed: {
_enum: ['Stopped', 'Returned', 'Suicided']
},
ExitRevert: {
_enum: ['Reverted']
},
ExitError: {
_enum: [
'StackUnderflow', 'StackOverflow', 'InvalidJump', 'InvalidRange', 'DesignatedInvalid', 'CallTooDeep',
'CreateCollision', 'CreateContractLimit', 'OutOfOffset', 'OutOfGas', 'OutOfFund', 'PCUnderflow', 'CreateEmpty',
'Other<String>'
]
},
ExitFatal: {
_enum: ['NotSupported', 'UnhandledInterrupt', 'CallErrorAsFatal', 'Other<String>']
},
ExitReason: {
_enum: ['Succeed<ExitSucceed>',
'Error<ExitError>',
'Revert<ExitRevert>',
'Fatal<ExitFatal>'
]
}
]
};
export default cloverTypes;
export default definitions;

View File

@ -1,273 +1,285 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId',
BalanceInfo: 'Null',
BalanceLock: {
id: 'LockIdentifier',
lockFor: 'LockFor',
LockReasons: 'Reasons',
amount: 'Balance',
reasons: 'Reasons'
},
LockFor: {
_enum: {
Common: 'Common',
Staking: 'StakingLock'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId',
BalanceInfo: 'Null',
BalanceLock: {
id: 'LockIdentifier',
lockFor: 'LockFor',
LockReasons: 'Reasons',
amount: 'Balance',
reasons: 'Reasons'
},
LockFor: {
_enum: {
Common: 'Common',
Staking: 'StakingLock'
}
},
Common: {
amount: 'Balance'
},
StakingLock: {
stakingAmount: 'Balance',
unbondings: 'Vec<Unbonding>'
},
Reasons: {
_enum: ['Fee', 'Misc', 'All']
},
Unbonding: {
amount: 'Balance',
moment: 'BlockNumber'
},
AccountData: {
free: 'Balance',
reserved: 'Balance',
freeKton: 'Balance',
reservedKton: 'Balance',
miscFrozen: 'Balance',
feeFrozen: 'Balance'
},
RingBalance: 'Balance',
KtonBalance: 'Balance',
TsInMs: 'u64',
Power: 'u32',
DepositId: 'U256',
StakingBalanceT: {
_enum: {
RingBalance: 'Balance',
KtonBalance: 'Balance'
}
},
StakingLedgerT: {
stash: 'AccountId',
activeRing: 'Compact<Balance>',
activeDepositRing: 'Compact<Balance>',
activeKton: 'Compact<Balance>',
depositItems: 'Vec<TimeDepositItem>',
ringStakingLock: 'StakingLock',
ktonStakingLock: 'StakingLock',
claimedRewards: 'Vec<EraIndex>',
total: 'Compact<Balance>',
active: 'Compact<Balance>',
unlocking: 'Vec<UnlockChunk>'
},
TimeDepositItem: {
value: 'Compact<Balance>',
startTime: 'Compact<TsInMs>',
expireTime: 'Compact<TsInMs>'
},
ExposureT: {
ownRingBalance: 'Compact<Balance>',
ownKtonBalance: 'Compact<Balance>',
ownPower: 'Power',
totalPower: 'Power',
others: 'Vec<IndividualExposure>'
},
Exposure: 'ExposureT',
IndividualExposure: {
who: 'AccountId',
ringBalance: 'Compact<Balance>',
ktonBalance: 'Compact<Balance>',
power: 'Power'
},
ElectionResultT: {
electedStashes: 'Vec<AccountId>',
exposures: 'Vec<(AccountId, ExposureT)>',
compute: 'ElectionCompute'
},
RKT: {
r: 'Balance',
k: 'Balance'
},
SpanRecord: {
slashed: 'RKT',
paidOut: 'RKT'
},
UnappliedSlash: {
validator: 'AccountId',
own: 'RKT',
others: 'Vec<(AccountId, RKT)>',
reporters: 'Vec<AccountId>',
payout: 'RKT'
},
TreasuryProposal: {
proposer: 'AccountId',
beneficiary: 'AccountId',
ringValue: 'Balance',
ktonValue: 'Balance',
ringBond: 'Balance',
ktonBond: 'Balance'
},
MappedRing: 'u128',
EthereumTransactionIndex: '(H256, u64)',
EthereumBlockNumber: 'u64',
EthereumHeader: {
parent_hash: 'H256',
timestamp: 'u64',
number: 'EthereumBlockNumber',
author: 'EthereumAddress',
transactions_root: 'H256',
uncles_hash: 'H256',
extra_data: 'Bytes',
state_root: 'H256',
receipts_root: 'H256',
log_bloom: 'Bloom',
gas_used: 'U256',
gas_limit: 'U256',
difficulty: 'U256',
seal: 'Vec<Bytes>',
hash: 'Option<H256>'
},
EthereumAddress: 'H160',
Bloom: '[u8; 256; Bloom]',
H128: '[u8; 16; H128]',
EthashProof: {
dagNodes: '(H512, H512)',
proof: 'Vec<H128>'
},
EthereumReceipt: {
gasUsed: 'U256',
logBloom: 'Bloom',
logs: 'Vec<LogEntry>',
outcome: 'TransactionOutcome'
},
LogEntry: {},
TransactionOutcome: {},
EthereumNetworkType: {
_enum: {
Mainnet: null,
Ropsten: null
}
},
RedeemFor: {
_enum: {
Token: null,
Deposit: null
}
},
EthereumReceiptProof: {
index: 'u64',
proof: 'Bytes',
headerHash: 'H256'
},
EthereumReceiptProofThing: '(EthereumHeader, EthereumReceiptProof, MMRProof)',
MMRProof: {
memberLeafIndex: 'u64',
lastLeafIndex: 'u64',
proof: 'Vec<H256>'
},
EthereumRelayHeaderParcel: {
header: 'EthereumHeader',
mmrRoot: 'H256'
},
EthereumRelayProofs: {
ethashProof: 'Vec<EthashProof>',
mmrProof: 'Vec<H256>'
},
OtherSignature: {
_enum: {
Eth: 'EcdsaSignature',
Tron: 'EcdsaSignature'
}
},
EcdsaSignature: '[u8; 65; EcdsaSignature]',
TronAddress: 'EthereumAddress',
OtherAddress: {
_enum: {
Eth: 'EthereumAddress',
Tron: 'TronAddress'
}
},
AddressT: '[u8; 20; AddressT]',
MerkleMountainRangeRootLog: {
prefix: '[u8; 4; Prefix]',
ParentMmrRoot: 'Hash'
},
AccountInfo: {
nonce: 'Index',
refcount: 'RefCount',
data: 'AccountData'
},
ProxyDefinition: {
delegate: 'AccountId',
proxyType: 'ProxyType',
delay: 'BlockNumber'
},
ProxyType: {
_enum: {
Any: null,
NonTransfer: null,
Governance: null,
Staking: null,
IdentityJudgement: null,
EthereumBridge: null
}
},
ProxyAnnouncement: {
real: 'AccountId',
callHash: 'Hash',
height: 'BlockNumber'
},
Announcement: 'ProxyAnnouncement',
RelayHeaderId: 'EthereumBlockNumber',
RelayHeaderParcel: 'EthereumRelayHeaderParcel',
RelayProofs: 'EthereumRelayProofs',
RelayAffirmationId: {
relayHeaderId: 'EthereumBlockNumber',
round: 'u32',
index: 'u32'
},
RelayAffirmationT: {
relayer: 'AccountId',
relayHeaderParcels: 'EthereumRelayHeaderParcel',
bond: 'Balance',
maybeExtendedRelayAffirmationId: 'Option<RelayAffirmationId>',
verified: 'bool'
},
RelayVotingState: {
ayes: 'Vec<AccountId>',
nays: 'Vec<AccountId>'
},
PowerOf: {
power: 'Power'
},
Signer: 'EthereumAddress',
RelayAuthorityT: {
accountId: 'AccountId',
signer: 'Signer',
stake: 'Balance',
term: 'BlockNumber'
},
MMRRoot: 'Hash',
EcdsaAddress: 'EthereumAddress',
EcdsaMessage: 'H256',
RelayAuthoritySigner: 'EcdsaAddress',
RelayAuthorityMessage: 'EcdsaMessage',
RelayAuthoritySignature: 'EcdsaSignature',
Term: 'u32'
}
}
},
Common: {
amount: 'Balance'
},
StakingLock: {
stakingAmount: 'Balance',
unbondings: 'Vec<Unbonding>'
},
Reasons: {
_enum: ['Fee', 'Misc', 'All']
},
Unbonding: {
amount: 'Balance',
moment: 'BlockNumber'
},
AccountData: {
free: 'Balance',
reserved: 'Balance',
freeKton: 'Balance',
reservedKton: 'Balance',
miscFrozen: 'Balance',
feeFrozen: 'Balance'
},
RingBalance: 'Balance',
KtonBalance: 'Balance',
TsInMs: 'u64',
Power: 'u32',
DepositId: 'U256',
StakingBalanceT: {
_enum: {
RingBalance: 'Balance',
KtonBalance: 'Balance'
}
},
StakingLedgerT: {
stash: 'AccountId',
activeRing: 'Compact<Balance>',
activeDepositRing: 'Compact<Balance>',
activeKton: 'Compact<Balance>',
depositItems: 'Vec<TimeDepositItem>',
ringStakingLock: 'StakingLock',
ktonStakingLock: 'StakingLock',
claimedRewards: 'Vec<EraIndex>',
total: 'Compact<Balance>',
active: 'Compact<Balance>',
unlocking: 'Vec<UnlockChunk>'
},
TimeDepositItem: {
value: 'Compact<Balance>',
startTime: 'Compact<TsInMs>',
expireTime: 'Compact<TsInMs>'
},
ExposureT: {
ownRingBalance: 'Compact<Balance>',
ownKtonBalance: 'Compact<Balance>',
ownPower: 'Power',
totalPower: 'Power',
others: 'Vec<IndividualExposure>'
},
Exposure: 'ExposureT',
IndividualExposure: {
who: 'AccountId',
ringBalance: 'Compact<Balance>',
ktonBalance: 'Compact<Balance>',
power: 'Power'
},
ElectionResultT: {
electedStashes: 'Vec<AccountId>',
exposures: 'Vec<(AccountId, ExposureT)>',
compute: 'ElectionCompute'
},
RKT: {
r: 'Balance',
k: 'Balance'
},
SpanRecord: {
slashed: 'RKT',
paidOut: 'RKT'
},
UnappliedSlash: {
validator: 'AccountId',
own: 'RKT',
others: 'Vec<(AccountId, RKT)>',
reporters: 'Vec<AccountId>',
payout: 'RKT'
},
TreasuryProposal: {
proposer: 'AccountId',
beneficiary: 'AccountId',
ringValue: 'Balance',
ktonValue: 'Balance',
ringBond: 'Balance',
ktonBond: 'Balance'
},
MappedRing: 'u128',
EthereumTransactionIndex: '(H256, u64)',
EthereumBlockNumber: 'u64',
EthereumHeader: {
parent_hash: 'H256',
timestamp: 'u64',
number: 'EthereumBlockNumber',
author: 'EthereumAddress',
transactions_root: 'H256',
uncles_hash: 'H256',
extra_data: 'Bytes',
state_root: 'H256',
receipts_root: 'H256',
log_bloom: 'Bloom',
gas_used: 'U256',
gas_limit: 'U256',
difficulty: 'U256',
seal: 'Vec<Bytes>',
hash: 'Option<H256>'
},
EthereumAddress: 'H160',
Bloom: '[u8; 256; Bloom]',
H128: '[u8; 16; H128]',
EthashProof: {
dagNodes: '(H512, H512)',
proof: 'Vec<H128>'
},
EthereumReceipt: {
gasUsed: 'U256',
logBloom: 'Bloom',
logs: 'Vec<LogEntry>',
outcome: 'TransactionOutcome'
},
LogEntry: {},
TransactionOutcome: {},
EthereumNetworkType: {
_enum: {
Mainnet: null,
Ropsten: null
}
},
RedeemFor: {
_enum: {
Token: null,
Deposit: null
}
},
EthereumReceiptProof: {
index: 'u64',
proof: 'Bytes',
headerHash: 'H256'
},
EthereumReceiptProofThing: '(EthereumHeader, EthereumReceiptProof, MMRProof)',
MMRProof: {
memberLeafIndex: 'u64',
lastLeafIndex: 'u64',
proof: 'Vec<H256>'
},
EthereumRelayHeaderParcel: {
header: 'EthereumHeader',
mmrRoot: 'H256'
},
EthereumRelayProofs: {
ethashProof: 'Vec<EthashProof>',
mmrProof: 'Vec<H256>'
},
OtherSignature: {
_enum: {
Eth: 'EcdsaSignature',
Tron: 'EcdsaSignature'
}
},
EcdsaSignature: '[u8; 65; EcdsaSignature]',
TronAddress: 'EthereumAddress',
OtherAddress: {
_enum: {
Eth: 'EthereumAddress',
Tron: 'TronAddress'
}
},
AddressT: '[u8; 20; AddressT]',
MerkleMountainRangeRootLog: {
prefix: '[u8; 4; Prefix]',
ParentMmrRoot: 'Hash'
},
AccountInfo: {
nonce: 'Index',
refcount: 'RefCount',
data: 'AccountData'
},
ProxyDefinition: {
delegate: 'AccountId',
proxyType: 'ProxyType',
delay: 'BlockNumber'
},
ProxyType: {
_enum: {
Any: null,
NonTransfer: null,
Governance: null,
Staking: null,
IdentityJudgement: null,
EthereumBridge: null
}
},
ProxyAnnouncement: {
real: 'AccountId',
callHash: 'Hash',
height: 'BlockNumber'
},
Announcement: 'ProxyAnnouncement',
RelayHeaderId: 'EthereumBlockNumber',
RelayHeaderParcel: 'EthereumRelayHeaderParcel',
RelayProofs: 'EthereumRelayProofs',
RelayAffirmationId: {
relayHeaderId: 'EthereumBlockNumber',
round: 'u32',
index: 'u32'
},
RelayAffirmationT: {
relayer: 'AccountId',
relayHeaderParcels: 'EthereumRelayHeaderParcel',
bond: 'Balance',
maybeExtendedRelayAffirmationId: 'Option<RelayAffirmationId>',
verified: 'bool'
},
RelayVotingState: {
ayes: 'Vec<AccountId>',
nays: 'Vec<AccountId>'
},
PowerOf: {
power: 'Power'
},
Signer: 'EthereumAddress',
RelayAuthorityT: {
accountId: 'AccountId',
signer: 'Signer',
stake: 'Balance',
term: 'BlockNumber'
},
MMRRoot: 'Hash',
EcdsaAddress: 'EthereumAddress',
EcdsaMessage: 'H256',
RelayAuthoritySigner: 'EcdsaAddress',
RelayAuthorityMessage: 'EcdsaMessage',
RelayAuthoritySignature: 'EcdsaSignature',
Term: 'u32'
]
};
export default definitions;

View File

@ -1,76 +1,88 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
AddressInfo: 'Vec<u8>',
FileAlias: 'Vec<u8>',
Guarantee: {
targets: 'Vec<IndividualExposure<AccountId, Balance>>',
total: 'Compact<Balance>',
submitted_in: 'EraIndex',
suppressed: 'bool'
},
IASSig: 'Vec<u8>',
Identity: {
pub_key: 'Vec<u8>',
code: 'Vec<u8>'
},
ISVBody: 'Vec<u8>',
LookupSource: 'AccountId',
MerchantInfo: {
address: 'Vec<u8>',
storage_price: 'Balance',
file_map: 'Vec<(Vec<u8>, Vec<Hash>)>'
},
MerchantPunishment: {
success: 'EraIndex',
failed: 'EraIndex',
value: 'Balance'
},
MerkleRoot: 'Vec<u8>',
OrderStatus: {
_enum: ['Success', 'Failed', 'Pending']
},
PaymentLedger: {
total: 'Balance',
paid: 'Balance',
unreserved: 'Balance'
},
Pledge: {
total: 'Balance',
used: 'Balance'
},
ReportSlot: 'u64',
Releases: {
_enum: ['V1_0_0', 'V2_0_0']
},
Status: {
_enum: ['Free', 'Reserved']
},
StorageOrder: {
file_identifier: 'Vec<u8>',
file_size: 'u64',
created_on: 'BlockNumber',
completed_on: 'BlockNumber',
expired_on: 'BlockNumber',
provider: 'AccountId',
client: 'AccountId',
amount: 'Balance',
order_status: 'OrderStatus'
},
SworkerCert: 'Vec<u8>',
SworkerCode: 'Vec<u8>',
SworkerPubKey: 'Vec<u8>',
SworkerSignature: 'Vec<u8>',
WorkReport: {
block_number: 'u64',
used: 'u64',
reserved: 'u64',
cached_reserved: 'u64',
files: 'Vec<(Vec<u8>, u64)>'
}
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
AddressInfo: 'Vec<u8>',
FileAlias: 'Vec<u8>',
Guarantee: {
targets: 'Vec<IndividualExposure<AccountId, Balance>>',
total: 'Compact<Balance>',
submitted_in: 'EraIndex',
suppressed: 'bool'
},
IASSig: 'Vec<u8>',
Identity: {
pub_key: 'Vec<u8>',
code: 'Vec<u8>'
},
ISVBody: 'Vec<u8>',
LookupSource: 'AccountId',
MerchantInfo: {
address: 'Vec<u8>',
storage_price: 'Balance',
file_map: 'Vec<(Vec<u8>, Vec<Hash>)>'
},
MerchantPunishment: {
success: 'EraIndex',
failed: 'EraIndex',
value: 'Balance'
},
MerkleRoot: 'Vec<u8>',
OrderStatus: {
_enum: ['Success', 'Failed', 'Pending']
},
PaymentLedger: {
total: 'Balance',
paid: 'Balance',
unreserved: 'Balance'
},
Pledge: {
total: 'Balance',
used: 'Balance'
},
ReportSlot: 'u64',
Releases: {
_enum: ['V1_0_0', 'V2_0_0']
},
Status: {
_enum: ['Free', 'Reserved']
},
StorageOrder: {
file_identifier: 'Vec<u8>',
file_size: 'u64',
created_on: 'BlockNumber',
completed_on: 'BlockNumber',
expired_on: 'BlockNumber',
provider: 'AccountId',
client: 'AccountId',
amount: 'Balance',
order_status: 'OrderStatus'
},
SworkerCert: 'Vec<u8>',
SworkerCode: 'Vec<u8>',
SworkerPubKey: 'Vec<u8>',
SworkerSignature: 'Vec<u8>',
WorkReport: {
block_number: 'u64',
used: 'u64',
reserved: 'u64',
cached_reserved: 'u64',
files: 'Vec<(Vec<u8>, u64)>'
}
}
}
]
};
export default definitions;

View File

@ -1,73 +1,85 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
AddressInfo: 'Vec<u8>',
ETHAddress: 'Vec<u8>',
EthereumTxHash: 'H256',
FileAlias: 'Vec<u8>',
FileInfo: {
file_size: 'u64',
expired_on: 'BlockNumber',
claimed_at: 'BlockNumber',
amount: 'Balance',
expected_replica_count: 'u32',
reported_replica_count: 'u32',
replicas: 'Vec<Replica<AccountId>>'
},
Guarantee: {
targets: 'Vec<IndividualExposure<AccountId, Balance>>',
total: 'Compact<Balance>',
submitted_in: 'EraIndex',
suppressed: 'bool'
},
IASSig: 'Vec<u8>',
Identity: {
anchor: 'SworkerAnchor',
punishment_deadline: 'u64',
group: 'Option<AccountId>'
},
ISVBody: 'Vec<u8>',
LookupSource: 'AccountId',
MerchantLedger: {
reward: 'Balance',
pledge: 'Balance'
},
MerkleRoot: 'Vec<u8>',
ReportSlot: 'u64',
Replica: {
who: 'AccountId',
valid_at: 'BlockNumber',
anchor: 'SworkerAnchor',
is_reported: 'bool'
},
PKInfo: {
code: 'SworkerCode',
anchor: 'Option<SworkerAnchor>'
},
Status: {
_enum: ['Free', 'Reserved']
},
SworkerAnchor: 'Vec<u8>',
SworkerCert: 'Vec<u8>',
SworkerCode: 'Vec<u8>',
SworkerPubKey: 'Vec<u8>',
SworkerSignature: 'Vec<u8>',
UsedInfo: {
used_size: 'u64',
reported_group_count: 'u32',
groups: 'BTreeMap<SworkerAnchor, bool>'
},
WorkReport: {
report_slot: 'u64',
used: 'u64',
free: 'u64',
reported_files_size: 'u64',
reported_srd_root: 'MerkleRoot',
reported_files_root: 'MerkleRoot'
}
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
AddressInfo: 'Vec<u8>',
ETHAddress: 'Vec<u8>',
EthereumTxHash: 'H256',
FileAlias: 'Vec<u8>',
FileInfo: {
file_size: 'u64',
expired_on: 'BlockNumber',
claimed_at: 'BlockNumber',
amount: 'Balance',
expected_replica_count: 'u32',
reported_replica_count: 'u32',
replicas: 'Vec<Replica<AccountId>>'
},
Guarantee: {
targets: 'Vec<IndividualExposure<AccountId, Balance>>',
total: 'Compact<Balance>',
submitted_in: 'EraIndex',
suppressed: 'bool'
},
IASSig: 'Vec<u8>',
Identity: {
anchor: 'SworkerAnchor',
punishment_deadline: 'u64',
group: 'Option<AccountId>'
},
ISVBody: 'Vec<u8>',
LookupSource: 'AccountId',
MerchantLedger: {
reward: 'Balance',
pledge: 'Balance'
},
MerkleRoot: 'Vec<u8>',
ReportSlot: 'u64',
Replica: {
who: 'AccountId',
valid_at: 'BlockNumber',
anchor: 'SworkerAnchor',
is_reported: 'bool'
},
PKInfo: {
code: 'SworkerCode',
anchor: 'Option<SworkerAnchor>'
},
Status: {
_enum: ['Free', 'Reserved']
},
SworkerAnchor: 'Vec<u8>',
SworkerCert: 'Vec<u8>',
SworkerCode: 'Vec<u8>',
SworkerPubKey: 'Vec<u8>',
SworkerSignature: 'Vec<u8>',
UsedInfo: {
used_size: 'u64',
reported_group_count: 'u32',
groups: 'BTreeMap<SworkerAnchor, bool>'
},
WorkReport: {
report_slot: 'u64',
used: 'u64',
free: 'u64',
reported_files_size: 'u64',
reported_srd_root: 'MerkleRoot',
reported_files_root: 'MerkleRoot'
}
}
}
]
};
export default definitions;

View File

@ -1,11 +1,23 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId',
RefCount: 'u8'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId',
RefCount: 'u8'
}
}
]
};
export default definitions;

View File

@ -1,229 +1,241 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId',
RefCount: 'u8',
BalanceLock: {
id: 'LockIdentifier',
lock_for: 'LockFor',
lock_reasons: 'LockReasons',
amount: 'Balance',
reasons: 'Reasons'
},
LockFor: {
_enum: {
Common: 'Common',
Staking: 'StakingLock'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId',
RefCount: 'u8',
BalanceLock: {
id: 'LockIdentifier',
lock_for: 'LockFor',
lock_reasons: 'LockReasons',
amount: 'Balance',
reasons: 'Reasons'
},
LockFor: {
_enum: {
Common: 'Common',
Staking: 'StakingLock'
}
},
Common: {
amount: 'Balance'
},
StakingLock: {
staking_amount: 'Balance',
unbondings: 'Vec<Unbonding>'
},
LockReasons: {
_enum: {
Fee: null,
Misc: null,
All: null
}
},
Unbonding: {
amount: 'Balance',
until: 'BlockNumber'
},
AccountData: {
free: 'Balance',
reserved: 'Balance',
free_kton: 'Balance',
reserved_kton: 'Balance',
misc_frozen: 'Balance',
fee_frozen: 'Balance'
},
RingBalance: 'Balance',
KtonBalance: 'Balance',
TsInMs: 'u64',
Power: 'u32',
DepositId: 'U256',
StakingBalanceT: {
_enum: {
RingBalance: 'Balance',
KtonBalance: 'Balance'
}
},
StakingLedgerT: {
stash: 'AccountId',
active_ring: 'Compact<Balance>',
active_deposit_ring: 'Compact<Balance>',
active_kton: 'Compact<Balance>',
deposit_items: 'Vec<TimeDepositItem>',
ring_staking_lock: 'StakingLock',
kton_staking_lock: 'StakingLock',
claimed_rewards: 'Vec<EraIndex>',
total: 'Compact<Balance>',
active: 'Compact<Balance>',
unlocking: 'Vec<UnlockChunk>'
},
TimeDepositItem: {
value: 'Compact<Balance>',
start_time: 'Compact<TsInMs>',
expire_time: 'Compact<TsInMs>'
},
RewardDestination: {
_enum: {
Staked: 'Staked',
Stash: null,
Controller: null
}
},
Staked: {
promise_month: 'u8'
},
ExposureT: {
own_ring_balance: 'Compact<Balance>',
own_kton_balance: 'Compact<Balance>',
own_power: 'Power',
total_power: 'Power',
others: 'Vec<IndividualExposure>',
total: 'Compact<Balance>',
own: 'Compact<Balance>'
},
IndividualExposure: {
who: 'AccountId',
ring_balance: 'Compact<Balance>',
kton_balance: 'Compact<Balance>',
power: 'Power',
value: 'Compact<Balance>'
},
ElectionResultT: {
elected_stashes: 'Vec<AccountId>',
exposures: 'Vec<(AccountId, ExposureT)>',
compute: 'ElectionCompute'
},
RKT: {
r: 'Balance',
k: 'Balance'
},
SpanRecord: {
slashed: 'RKT',
paid_out: 'RKT'
},
UnappliedSlash: {
validator: 'AccountId',
own: 'RKT',
others: 'Vec<(AccountId, RKT)>',
reporters: 'Vec<AccountId>',
payout: 'RKT'
},
TreasuryProposal: {
proposer: 'AccountId',
beneficiary: 'AccountId',
ring_value: 'Balance',
kton_value: 'Balance',
ring_bond: 'Balance',
kton_bond: 'Balance',
value: 'Balance',
bond: 'Balance'
},
EthTransactionIndex: '(H256, u64)',
EthHeaderBrief: {
total_difficulty: 'U256',
parent_hash: 'H256',
number: 'EthBlockNumber',
relayer: 'AccountId'
},
EthBlockNumber: 'u64',
EthHeaderThing: {
eth_header: 'EthHeader',
ethash_proof: 'Vec<EthashProof>',
mmr_root: 'MMRHash',
mmr_proof: 'Vec<MMRHash>'
},
EthHeader: {
parent_hash: 'H256',
timestamp: 'u64',
number: 'EthBlockNumber',
author: 'EthAddress',
transactions_root: 'H256',
uncles_hash: 'H256',
extra_data: 'Bytes',
state_root: 'H256',
receipts_root: 'H256',
log_bloom: 'Bloom',
gas_used: 'U256',
gas_limit: 'U256',
difficulty: 'U256',
seal: 'Vec<Bytes>',
hash: 'Option<H256>'
},
EthAddress: 'H160',
Bloom: '[u8; 256; Bloom]',
H128: '[u8; 16; H128]',
EthashProof: {
dag_nodes: '(H512, H512)',
proof: 'Vec<H128>'
},
Receipt: {
gas_used: 'U256',
log_bloom: 'Bloom',
logs: 'Vec<LogEntry>',
outcome: 'TransactionOutcome'
},
EthereumNetworkType: {
_enum: {
Mainnet: null,
Ropsten: null
}
},
RedeemFor: {
_enum: {
Ring: null,
Kton: null,
Deposit: null
}
},
EthereumReceiptProof: {
index: 'u64',
proof: 'Bytes',
header_hash: 'H256'
},
MMRProof: 'Vec<H256>',
OtherSignature: {
_enum: {
Eth: 'EcdsaSignature',
Tron: 'EcdsaSignature'
}
},
EcdsaSignature: '[u8; 65; EcdsaSignature]',
OtherAddress: {
_enum: {
Eth: '[u8; 20; EthereumAddress]',
Tron: '[u8; 20; TronAddress]'
}
},
AddressT: '[u8; 20; AddressT]',
MerkleMountainRangeRootLog: {
prefix: '[u8; 4; Prefix]',
mmr_root: 'Hash'
},
Round: 'u64',
TcBlockNumber: 'Vec<u8>',
TcHeaderHash: 'Vec<u8>',
TcHeaderMMR: 'Vec<u8>',
MMRHash: 'Vec<u8>',
GameId: 'TcBlockNumber',
RawHeaderThing: 'Vec<u8>',
BalancesRuntimeDispatchInfo: {
usable_balance: 'Balance'
},
StakingRuntimeDispatchInfo: {
power: 'Power'
}
}
}
},
Common: {
amount: 'Balance'
},
StakingLock: {
staking_amount: 'Balance',
unbondings: 'Vec<Unbonding>'
},
LockReasons: {
_enum: {
Fee: null,
Misc: null,
All: null
}
},
Unbonding: {
amount: 'Balance',
until: 'BlockNumber'
},
AccountData: {
free: 'Balance',
reserved: 'Balance',
free_kton: 'Balance',
reserved_kton: 'Balance',
misc_frozen: 'Balance',
fee_frozen: 'Balance'
},
RingBalance: 'Balance',
KtonBalance: 'Balance',
TsInMs: 'u64',
Power: 'u32',
DepositId: 'U256',
StakingBalanceT: {
_enum: {
RingBalance: 'Balance',
KtonBalance: 'Balance'
}
},
StakingLedgerT: {
stash: 'AccountId',
active_ring: 'Compact<Balance>',
active_deposit_ring: 'Compact<Balance>',
active_kton: 'Compact<Balance>',
deposit_items: 'Vec<TimeDepositItem>',
ring_staking_lock: 'StakingLock',
kton_staking_lock: 'StakingLock',
claimed_rewards: 'Vec<EraIndex>',
total: 'Compact<Balance>',
active: 'Compact<Balance>',
unlocking: 'Vec<UnlockChunk>'
},
TimeDepositItem: {
value: 'Compact<Balance>',
start_time: 'Compact<TsInMs>',
expire_time: 'Compact<TsInMs>'
},
RewardDestination: {
_enum: {
Staked: 'Staked',
Stash: null,
Controller: null
}
},
Staked: {
promise_month: 'u8'
},
ExposureT: {
own_ring_balance: 'Compact<Balance>',
own_kton_balance: 'Compact<Balance>',
own_power: 'Power',
total_power: 'Power',
others: 'Vec<IndividualExposure>',
total: 'Compact<Balance>',
own: 'Compact<Balance>'
},
IndividualExposure: {
who: 'AccountId',
ring_balance: 'Compact<Balance>',
kton_balance: 'Compact<Balance>',
power: 'Power',
value: 'Compact<Balance>'
},
ElectionResultT: {
elected_stashes: 'Vec<AccountId>',
exposures: 'Vec<(AccountId, ExposureT)>',
compute: 'ElectionCompute'
},
RKT: {
r: 'Balance',
k: 'Balance'
},
SpanRecord: {
slashed: 'RKT',
paid_out: 'RKT'
},
UnappliedSlash: {
validator: 'AccountId',
own: 'RKT',
others: 'Vec<(AccountId, RKT)>',
reporters: 'Vec<AccountId>',
payout: 'RKT'
},
TreasuryProposal: {
proposer: 'AccountId',
beneficiary: 'AccountId',
ring_value: 'Balance',
kton_value: 'Balance',
ring_bond: 'Balance',
kton_bond: 'Balance',
value: 'Balance',
bond: 'Balance'
},
EthTransactionIndex: '(H256, u64)',
EthHeaderBrief: {
total_difficulty: 'U256',
parent_hash: 'H256',
number: 'EthBlockNumber',
relayer: 'AccountId'
},
EthBlockNumber: 'u64',
EthHeaderThing: {
eth_header: 'EthHeader',
ethash_proof: 'Vec<EthashProof>',
mmr_root: 'MMRHash',
mmr_proof: 'Vec<MMRHash>'
},
EthHeader: {
parent_hash: 'H256',
timestamp: 'u64',
number: 'EthBlockNumber',
author: 'EthAddress',
transactions_root: 'H256',
uncles_hash: 'H256',
extra_data: 'Bytes',
state_root: 'H256',
receipts_root: 'H256',
log_bloom: 'Bloom',
gas_used: 'U256',
gas_limit: 'U256',
difficulty: 'U256',
seal: 'Vec<Bytes>',
hash: 'Option<H256>'
},
EthAddress: 'H160',
Bloom: '[u8; 256; Bloom]',
H128: '[u8; 16; H128]',
EthashProof: {
dag_nodes: '(H512, H512)',
proof: 'Vec<H128>'
},
Receipt: {
gas_used: 'U256',
log_bloom: 'Bloom',
logs: 'Vec<LogEntry>',
outcome: 'TransactionOutcome'
},
EthereumNetworkType: {
_enum: {
Mainnet: null,
Ropsten: null
}
},
RedeemFor: {
_enum: {
Ring: null,
Kton: null,
Deposit: null
}
},
EthereumReceiptProof: {
index: 'u64',
proof: 'Bytes',
header_hash: 'H256'
},
MMRProof: 'Vec<H256>',
OtherSignature: {
_enum: {
Eth: 'EcdsaSignature',
Tron: 'EcdsaSignature'
}
},
EcdsaSignature: '[u8; 65; EcdsaSignature]',
OtherAddress: {
_enum: {
Eth: '[u8; 20; EthereumAddress]',
Tron: '[u8; 20; TronAddress]'
}
},
AddressT: '[u8; 20; AddressT]',
MerkleMountainRangeRootLog: {
prefix: '[u8; 4; Prefix]',
mmr_root: 'Hash'
},
Round: 'u64',
TcBlockNumber: 'Vec<u8>',
TcHeaderHash: 'Vec<u8>',
TcHeaderMMR: 'Vec<u8>',
MMRHash: 'Vec<u8>',
GameId: 'TcBlockNumber',
RawHeaderThing: 'Vec<u8>',
BalancesRuntimeDispatchInfo: {
usable_balance: 'Balance'
},
StakingRuntimeDispatchInfo: {
power: 'Power'
}
]
};
export default definitions;

View File

@ -1,259 +1,271 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId',
BalanceInfo: 'Null',
BalanceLock: {
id: 'LockIdentifier',
lockFor: 'LockFor',
LockReasons: 'Reasons',
amount: 'Balance',
reasons: 'Reasons'
},
LockFor: {
_enum: {
Common: 'Common',
Staking: 'StakingLock'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId',
BalanceInfo: 'Null',
BalanceLock: {
id: 'LockIdentifier',
lockFor: 'LockFor',
LockReasons: 'Reasons',
amount: 'Balance',
reasons: 'Reasons'
},
LockFor: {
_enum: {
Common: 'Common',
Staking: 'StakingLock'
}
},
Common: {
amount: 'Balance'
},
StakingLock: {
stakingAmount: 'Balance',
unbondings: 'Vec<Unbonding>'
},
Reasons: {
_enum: ['Fee', 'Misc', 'All']
},
Unbonding: {
amount: 'Balance',
moment: 'BlockNumber'
},
AccountData: {
free: 'Balance',
reserved: 'Balance',
freeKton: 'Balance',
reservedKton: 'Balance',
miscFrozen: 'Balance',
feeFrozen: 'Balance'
},
RingBalance: 'Balance',
KtonBalance: 'Balance',
TsInMs: 'u64',
Power: 'u32',
DepositId: 'U256',
StakingBalanceT: {
_enum: {
RingBalance: 'Balance',
KtonBalance: 'Balance'
}
},
StakingLedgerT: {
stash: 'AccountId',
activeRing: 'Compact<Balance>',
activeDepositRing: 'Compact<Balance>',
activeKton: 'Compact<Balance>',
depositItems: 'Vec<TimeDepositItem>',
ringStakingLock: 'StakingLock',
ktonStakingLock: 'StakingLock',
claimedRewards: 'Vec<EraIndex>',
total: 'Compact<Balance>',
active: 'Compact<Balance>',
unlocking: 'Vec<UnlockChunk>'
},
TimeDepositItem: {
value: 'Compact<Balance>',
startTime: 'Compact<TsInMs>',
expireTime: 'Compact<TsInMs>'
},
ExposureT: {
ownRingBalance: 'Compact<Balance>',
ownKtonBalance: 'Compact<Balance>',
ownPower: 'Power',
totalPower: 'Power',
others: 'Vec<IndividualExposure>'
},
Exposure: 'ExposureT',
IndividualExposure: {
who: 'AccountId',
ringBalance: 'Compact<Balance>',
ktonBalance: 'Compact<Balance>',
power: 'Power'
},
ElectionResultT: {
electedStashes: 'Vec<AccountId>',
exposures: 'Vec<(AccountId, ExposureT)>',
compute: 'ElectionCompute'
},
RKT: {
r: 'Balance',
k: 'Balance'
},
SpanRecord: {
slashed: 'RKT',
paidOut: 'RKT'
},
UnappliedSlash: {
validator: 'AccountId',
own: 'RKT',
others: 'Vec<(AccountId, RKT)>',
reporters: 'Vec<AccountId>',
payout: 'RKT'
},
TreasuryProposal: {
proposer: 'AccountId',
beneficiary: 'AccountId',
ringValue: 'Balance',
ktonValue: 'Balance',
ringBond: 'Balance',
ktonBond: 'Balance'
},
MappedRing: 'u128',
EthereumTransactionIndex: '(H256, u64)',
EthereumBlockNumber: 'u64',
EthereumHeader: {
parent_hash: 'H256',
timestamp: 'u64',
number: 'EthereumBlockNumber',
author: 'EthereumAddress',
transactions_root: 'H256',
uncles_hash: 'H256',
extra_data: 'Bytes',
state_root: 'H256',
receipts_root: 'H256',
log_bloom: 'Bloom',
gas_used: 'U256',
gas_limit: 'U256',
difficulty: 'U256',
seal: 'Vec<Bytes>',
hash: 'Option<H256>'
},
EthereumAddress: 'H160',
Bloom: '[u8; 256; Bloom]',
H128: '[u8; 16; H128]',
EthashProof: {
dagNodes: '(H512, H512)',
proof: 'Vec<H128>'
},
EthereumReceipt: {
gasUsed: 'U256',
logBloom: 'Bloom',
logs: 'Vec<LogEntry>',
outcome: 'TransactionOutcome'
},
LogEntry: {},
TransactionOutcome: {},
EthereumNetworkType: {
_enum: {
Mainnet: null,
Ropsten: null
}
},
RedeemFor: {
_enum: {
Token: null,
Deposit: null
}
},
EthereumReceiptProof: {
index: 'u64',
proof: 'Bytes',
headerHash: 'H256'
},
EthereumReceiptProofThing: '(EthereumHeader, EthereumReceiptProof, MMRProof)',
MMRProof: {
memberLeafIndex: 'u64',
lastLeafIndex: 'u64',
proof: 'Vec<H256>'
},
EthereumRelayHeaderParcel: {
header: 'EthereumHeader',
mmrRoot: 'H256'
},
EthereumRelayProofs: {
ethashProof: 'Vec<EthashProof>',
mmrProof: 'Vec<H256>'
},
OtherSignature: {
_enum: {
Eth: 'EcdsaSignature',
Tron: 'EcdsaSignature'
}
},
EcdsaSignature: '[u8; 65; EcdsaSignature]',
TronAddress: 'EthereumAddress',
OtherAddress: {
_enum: {
Eth: 'EthereumAddress',
Tron: 'TronAddress'
}
},
AddressT: '[u8; 20; AddressT]',
MerkleMountainRangeRootLog: {
prefix: '[u8; 4; Prefix]',
mmrRoot: 'Hash'
},
AccountInfo: {
nonce: 'Index',
refcount: 'RefCount',
data: 'AccountData'
},
ProxyDefinition: {
delegate: 'AccountId',
proxyType: 'ProxyType',
delay: 'BlockNumber'
},
ProxyType: {
_enum: {
Any: null,
NonTransfer: null,
Governance: null,
Staking: null,
IdentityJudgement: null,
EthereumBridge: null
}
},
ProxyAnnouncement: {
real: 'AccountId',
callHash: 'Hash',
height: 'BlockNumber'
},
Announcement: 'ProxyAnnouncement',
RelayHeaderId: 'EthereumBlockNumber',
RelayHeaderParcel: 'EthereumRelayHeaderParcel',
RelayProofs: 'EthereumRelayProofs',
RelayAffirmationId: {
relayHeaderId: 'EthereumBlockNumber',
round: 'u32',
index: 'u32'
},
RelayAffirmationT: {
relayer: 'AccountId',
relayHeaderParcels: 'EthereumRelayHeaderParcel',
bond: 'Balance',
maybeExtendedRelayAffirmationId: 'Option<RelayAffirmationId>',
verified: 'bool'
},
RelayVotingState: {
ayes: 'Vec<AccountId>',
nays: 'Vec<AccountId>'
},
PowerOf: {
power: 'Power'
}
}
}
},
Common: {
amount: 'Balance'
},
StakingLock: {
stakingAmount: 'Balance',
unbondings: 'Vec<Unbonding>'
},
Reasons: {
_enum: ['Fee', 'Misc', 'All']
},
Unbonding: {
amount: 'Balance',
moment: 'BlockNumber'
},
AccountData: {
free: 'Balance',
reserved: 'Balance',
freeKton: 'Balance',
reservedKton: 'Balance',
miscFrozen: 'Balance',
feeFrozen: 'Balance'
},
RingBalance: 'Balance',
KtonBalance: 'Balance',
TsInMs: 'u64',
Power: 'u32',
DepositId: 'U256',
StakingBalanceT: {
_enum: {
RingBalance: 'Balance',
KtonBalance: 'Balance'
}
},
StakingLedgerT: {
stash: 'AccountId',
activeRing: 'Compact<Balance>',
activeDepositRing: 'Compact<Balance>',
activeKton: 'Compact<Balance>',
depositItems: 'Vec<TimeDepositItem>',
ringStakingLock: 'StakingLock',
ktonStakingLock: 'StakingLock',
claimedRewards: 'Vec<EraIndex>',
total: 'Compact<Balance>',
active: 'Compact<Balance>',
unlocking: 'Vec<UnlockChunk>'
},
TimeDepositItem: {
value: 'Compact<Balance>',
startTime: 'Compact<TsInMs>',
expireTime: 'Compact<TsInMs>'
},
ExposureT: {
ownRingBalance: 'Compact<Balance>',
ownKtonBalance: 'Compact<Balance>',
ownPower: 'Power',
totalPower: 'Power',
others: 'Vec<IndividualExposure>'
},
Exposure: 'ExposureT',
IndividualExposure: {
who: 'AccountId',
ringBalance: 'Compact<Balance>',
ktonBalance: 'Compact<Balance>',
power: 'Power'
},
ElectionResultT: {
electedStashes: 'Vec<AccountId>',
exposures: 'Vec<(AccountId, ExposureT)>',
compute: 'ElectionCompute'
},
RKT: {
r: 'Balance',
k: 'Balance'
},
SpanRecord: {
slashed: 'RKT',
paidOut: 'RKT'
},
UnappliedSlash: {
validator: 'AccountId',
own: 'RKT',
others: 'Vec<(AccountId, RKT)>',
reporters: 'Vec<AccountId>',
payout: 'RKT'
},
TreasuryProposal: {
proposer: 'AccountId',
beneficiary: 'AccountId',
ringValue: 'Balance',
ktonValue: 'Balance',
ringBond: 'Balance',
ktonBond: 'Balance'
},
MappedRing: 'u128',
EthereumTransactionIndex: '(H256, u64)',
EthereumBlockNumber: 'u64',
EthereumHeader: {
parent_hash: 'H256',
timestamp: 'u64',
number: 'EthereumBlockNumber',
author: 'EthereumAddress',
transactions_root: 'H256',
uncles_hash: 'H256',
extra_data: 'Bytes',
state_root: 'H256',
receipts_root: 'H256',
log_bloom: 'Bloom',
gas_used: 'U256',
gas_limit: 'U256',
difficulty: 'U256',
seal: 'Vec<Bytes>',
hash: 'Option<H256>'
},
EthereumAddress: 'H160',
Bloom: '[u8; 256; Bloom]',
H128: '[u8; 16; H128]',
EthashProof: {
dagNodes: '(H512, H512)',
proof: 'Vec<H128>'
},
EthereumReceipt: {
gasUsed: 'U256',
logBloom: 'Bloom',
logs: 'Vec<LogEntry>',
outcome: 'TransactionOutcome'
},
LogEntry: {},
TransactionOutcome: {},
EthereumNetworkType: {
_enum: {
Mainnet: null,
Ropsten: null
}
},
RedeemFor: {
_enum: {
Token: null,
Deposit: null
}
},
EthereumReceiptProof: {
index: 'u64',
proof: 'Bytes',
headerHash: 'H256'
},
EthereumReceiptProofThing: '(EthereumHeader, EthereumReceiptProof, MMRProof)',
MMRProof: {
memberLeafIndex: 'u64',
lastLeafIndex: 'u64',
proof: 'Vec<H256>'
},
EthereumRelayHeaderParcel: {
header: 'EthereumHeader',
mmrRoot: 'H256'
},
EthereumRelayProofs: {
ethashProof: 'Vec<EthashProof>',
mmrProof: 'Vec<H256>'
},
OtherSignature: {
_enum: {
Eth: 'EcdsaSignature',
Tron: 'EcdsaSignature'
}
},
EcdsaSignature: '[u8; 65; EcdsaSignature]',
TronAddress: 'EthereumAddress',
OtherAddress: {
_enum: {
Eth: 'EthereumAddress',
Tron: 'TronAddress'
}
},
AddressT: '[u8; 20; AddressT]',
MerkleMountainRangeRootLog: {
prefix: '[u8; 4; Prefix]',
mmrRoot: 'Hash'
},
AccountInfo: {
nonce: 'Index',
refcount: 'RefCount',
data: 'AccountData'
},
ProxyDefinition: {
delegate: 'AccountId',
proxyType: 'ProxyType',
delay: 'BlockNumber'
},
ProxyType: {
_enum: {
Any: null,
NonTransfer: null,
Governance: null,
Staking: null,
IdentityJudgement: null,
EthereumBridge: null
}
},
ProxyAnnouncement: {
real: 'AccountId',
callHash: 'Hash',
height: 'BlockNumber'
},
Announcement: 'ProxyAnnouncement',
RelayHeaderId: 'EthereumBlockNumber',
RelayHeaderParcel: 'EthereumRelayHeaderParcel',
RelayProofs: 'EthereumRelayProofs',
RelayAffirmationId: {
relayHeaderId: 'EthereumBlockNumber',
round: 'u32',
index: 'u32'
},
RelayAffirmationT: {
relayer: 'AccountId',
relayHeaderParcels: 'EthereumRelayHeaderParcel',
bond: 'Balance',
maybeExtendedRelayAffirmationId: 'Option<RelayAffirmationId>',
verified: 'bool'
},
RelayVotingState: {
ayes: 'Vec<AccountId>',
nays: 'Vec<AccountId>'
},
PowerOf: {
power: 'Power'
}
]
};
export default definitions;

View File

@ -1,8 +1,22 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId'
}
}
]
};
export default definitions;

View File

@ -1,126 +1,138 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId',
Keys: 'SessionKeys2',
Did: '[u8;32]',
Bytes32: {
value: '[u8;32]'
},
Bytes33: {
value: '[u8;33]'
},
Bytes64: {
value: '[u8;64]'
},
Bytes65: {
value: '[u8;65]'
},
PublicKey: {
_enum: {
Sr25519: 'Bytes32',
Ed25519: 'Bytes32',
Secp256k1: 'Bytes33'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId',
Keys: 'SessionKeys2',
Did: '[u8;32]',
Bytes32: {
value: '[u8;32]'
},
Bytes33: {
value: '[u8;33]'
},
Bytes64: {
value: '[u8;64]'
},
Bytes65: {
value: '[u8;65]'
},
PublicKey: {
_enum: {
Sr25519: 'Bytes32',
Ed25519: 'Bytes32',
Secp256k1: 'Bytes33'
}
},
DidSignature: {
_enum: {
Sr25519: 'Bytes64',
Ed25519: 'Bytes64',
Secp256k1: 'Bytes65'
}
},
KeyDetail: {
controller: 'Did',
public_key: 'PublicKey'
},
KeyUpdate: {
did: 'Did',
public_key: 'PublicKey',
controller: 'Option<Did>',
last_modified_in_block: 'BlockNumber'
},
DidRemoval: {
did: 'Did',
last_modified_in_block: 'BlockNumber'
},
RegistryId: '[u8;32]',
RevokeId: '[u8;32]',
Registry: {
policy: 'Policy',
add_only: 'bool'
},
Revoke: {
registry_id: 'RegistryId',
revoke_ids: 'BTreeSet<RevokeId>',
last_modified: 'BlockNumber'
},
UnRevoke: {
registry_id: 'RegistryId',
revoke_ids: 'BTreeSet<RevokeId>',
last_modified: 'BlockNumber'
},
RemoveRegistry: {
registry_id: 'RegistryId',
last_modified: 'BlockNumber'
},
PAuth: 'BTreeMap<Did, DidSignature>',
Policy: {
_enum: {
OneOf: 'BTreeSet<Did>'
}
},
BlobId: '[u8;32]',
Blob: {
id: 'BlobId',
blob: 'Vec<u8>',
author: 'Did'
},
EpochNo: 'u32',
EpochLen: 'u32',
SlotNo: 'u64',
Balance: 'u64',
EpochDetail: {
validator_count: 'u8',
starting_slot: 'SlotNo',
expected_ending_slot: 'SlotNo',
ending_slot: 'Option<SlotNo>',
total_emission: 'Option<Balance>',
emission_for_treasury: 'Option<Balance>',
emission_for_validators: 'Option<Balance>'
},
ValidatorStatsPerEpoch: {
block_count: 'EpochLen',
locked_reward: 'Option<Balance>',
unlocked_reward: 'Option<Balance>'
},
Payload: {
proposal: 'Vec<u8>',
round_no: 'u64'
},
Membership: {
members: 'BTreeSet<Did>',
vote_requirement: 'u64'
},
PMAuth: 'BTreeMap<Did, DidSignature>',
Bonus: {
swap_bonuses: 'Vec<(Balance, BlockNumber)>',
vesting_bonuses: 'Vec<(Balance, Balance, BlockNumber)>'
},
StateChange: {
_enum: {
KeyUpdate: 'KeyUpdate',
DidRemoval: 'DidRemoval',
Revoke: 'Revoke',
UnRevoke: 'UnRevoke',
RemoveRegistry: 'RemoveRegistry',
Blob: 'Blob',
MasterVote: 'Payload'
}
}
}
}
},
DidSignature: {
_enum: {
Sr25519: 'Bytes64',
Ed25519: 'Bytes64',
Secp256k1: 'Bytes65'
}
},
KeyDetail: {
controller: 'Did',
public_key: 'PublicKey'
},
KeyUpdate: {
did: 'Did',
public_key: 'PublicKey',
controller: 'Option<Did>',
last_modified_in_block: 'BlockNumber'
},
DidRemoval: {
did: 'Did',
last_modified_in_block: 'BlockNumber'
},
RegistryId: '[u8;32]',
RevokeId: '[u8;32]',
Registry: {
policy: 'Policy',
add_only: 'bool'
},
Revoke: {
registry_id: 'RegistryId',
revoke_ids: 'BTreeSet<RevokeId>',
last_modified: 'BlockNumber'
},
UnRevoke: {
registry_id: 'RegistryId',
revoke_ids: 'BTreeSet<RevokeId>',
last_modified: 'BlockNumber'
},
RemoveRegistry: {
registry_id: 'RegistryId',
last_modified: 'BlockNumber'
},
PAuth: 'BTreeMap<Did, DidSignature>',
Policy: {
_enum: {
OneOf: 'BTreeSet<Did>'
}
},
BlobId: '[u8;32]',
Blob: {
id: 'BlobId',
blob: 'Vec<u8>',
author: 'Did'
},
EpochNo: 'u32',
EpochLen: 'u32',
SlotNo: 'u64',
Balance: 'u64',
EpochDetail: {
validator_count: 'u8',
starting_slot: 'SlotNo',
expected_ending_slot: 'SlotNo',
ending_slot: 'Option<SlotNo>',
total_emission: 'Option<Balance>',
emission_for_treasury: 'Option<Balance>',
emission_for_validators: 'Option<Balance>'
},
ValidatorStatsPerEpoch: {
block_count: 'EpochLen',
locked_reward: 'Option<Balance>',
unlocked_reward: 'Option<Balance>'
},
Payload: {
proposal: 'Vec<u8>',
round_no: 'u64'
},
Membership: {
members: 'BTreeSet<Did>',
vote_requirement: 'u64'
},
PMAuth: 'BTreeMap<Did, DidSignature>',
Bonus: {
swap_bonuses: 'Vec<(Balance, BlockNumber)>',
vesting_bonuses: 'Vec<(Balance, Balance, BlockNumber)>'
},
StateChange: {
_enum: {
KeyUpdate: 'KeyUpdate',
DidRemoval: 'DidRemoval',
Revoke: 'Revoke',
UnRevoke: 'UnRevoke',
RemoveRegistry: 'RemoveRegistry',
Blob: 'Blob',
MasterVote: 'Payload'
}
}
]
};
export default definitions;

View File

@ -1,40 +1,52 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'IndicesLookupSource',
LookupSource: 'IndicesLookupSource',
MogwaiStruct: {
id: 'Hash',
dna: 'Hash',
genesis: 'BlockNumber',
price: 'Balance',
gen: 'u64'
},
MogwaiBios: {
mogwai_id: 'Hash',
state: 'u32',
metaxy: 'Vec<[u8;16]>',
intrinsic: 'Balance',
level: 'u8',
phases: 'Vec<BlockNumber>',
adaptations: 'Vec<Hash>'
},
GameEvent: {
id: 'Hash',
begin: 'BlockNumber',
duration: 'u16',
event_type: 'GameEventType',
hashes: 'Vec<Hash>',
value: 'u64'
},
GameEventType: {
_enum: [
'Default',
'Hatch'
]
}
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'IndicesLookupSource',
LookupSource: 'IndicesLookupSource',
MogwaiStruct: {
id: 'Hash',
dna: 'Hash',
genesis: 'BlockNumber',
price: 'Balance',
gen: 'u64'
},
MogwaiBios: {
mogwai_id: 'Hash',
state: 'u32',
metaxy: 'Vec<[u8;16]>',
intrinsic: 'Balance',
level: 'u8',
phases: 'Vec<BlockNumber>',
adaptations: 'Vec<Hash>'
},
GameEvent: {
id: 'Hash',
begin: 'BlockNumber',
duration: 'u16',
event_type: 'GameEventType',
hashes: 'Vec<Hash>',
value: 'u64'
},
GameEventType: {
_enum: [
'Default',
'Hatch'
]
}
}
}
]
};
export default definitions;

View File

@ -1,83 +1,98 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
export default {
AuthorityId: 'AccountId',
AuthorityVote: 'u32',
ChallengeGameOf: {
challenges: 'Vec<Hash>',
createdBlock: 'BlockNumber',
decision: 'Decision',
propertyHash: 'Hash'
},
Claim: {
amount: 'u128',
approve: 'BTreeSet<AuthorityId>',
complete: 'bool',
decline: 'BTreeSet<AuthorityId>',
params: 'Lockdrop'
},
ClaimId: 'H256',
ClaimVote: {
approve: 'bool',
authority: 'u16',
claim_id: 'ClaimId'
},
Decision: {
_enum: ['Undecided', 'True', 'False']
},
DollarRate: 'u128',
EraIndex: 'u32',
EraStakingPoints: {
individual: 'BTreeMap<AccountId, Balance>',
total: 'Balance'
},
Keys: 'SessionKeys2',
Lockdrop: {
duration: 'u64',
public_key: '[u8; 33]',
transaction_hash: 'H256',
type: 'u8',
value: 'u128'
},
Parameters: {
canBeNominated: 'bool',
optionExpired: 'u128',
optionP: 'u32'
},
PredicateContractOf: {
inputs: 'Vec<u8>',
predicateHash: 'Hash'
},
PredicateHash: 'Hash',
PrefabOvmModule: {
code: 'Vec<u8>',
scheduleVersion: 'u32'
},
Property: {
inputs: 'Vec<Vec<u8>>',
predicateAddress: 'AccountId'
},
PropertyOf: {
inputs: 'Vec<Vec<u8>>',
predicateAddress: 'AccountId'
},
Schedule: {
putCodePerByteCost: 'Weight',
version: 'u32'
},
StakingParameters: {
canBeNominated: 'bool',
optionExpired: 'u128',
optionP: 'u32'
},
TickerRate: {
authority: 'u16',
btc: 'u128',
eth: 'u128'
},
VoteCounts: {
bad: 'u32',
good: 'u32'
}
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: {
AuthorityId: 'AccountId',
AuthorityVote: 'u32',
ChallengeGameOf: {
challenges: 'Vec<Hash>',
createdBlock: 'BlockNumber',
decision: 'Decision',
propertyHash: 'Hash'
},
Claim: {
amount: 'u128',
approve: 'BTreeSet<AuthorityId>',
complete: 'bool',
decline: 'BTreeSet<AuthorityId>',
params: 'Lockdrop'
},
ClaimId: 'H256',
ClaimVote: {
approve: 'bool',
authority: 'u16',
claim_id: 'ClaimId'
},
Decision: {
_enum: ['Undecided', 'True', 'False']
},
DollarRate: 'u128',
EraIndex: 'u32',
EraStakingPoints: {
individual: 'BTreeMap<AccountId, Balance>',
total: 'Balance'
},
Keys: 'SessionKeys2',
Lockdrop: {
duration: 'u64',
public_key: '[u8; 33]',
transaction_hash: 'H256',
type: 'u8',
value: 'u128'
},
Parameters: {
canBeNominated: 'bool',
optionExpired: 'u128',
optionP: 'u32'
},
PredicateContractOf: {
inputs: 'Vec<u8>',
predicateHash: 'Hash'
},
PredicateHash: 'Hash',
PrefabOvmModule: {
code: 'Vec<u8>',
scheduleVersion: 'u32'
},
Property: {
inputs: 'Vec<Vec<u8>>',
predicateAddress: 'AccountId'
},
PropertyOf: {
inputs: 'Vec<Vec<u8>>',
predicateAddress: 'AccountId'
},
Schedule: {
putCodePerByteCost: 'Weight',
version: 'u32'
},
StakingParameters: {
canBeNominated: 'bool',
optionExpired: 'u128',
optionP: 'u32'
},
TickerRate: {
authority: 'u16',
btc: 'u128',
eth: 'u128'
},
VoteCounts: {
bad: 'u32',
good: 'u32'
}
}
}
]
};
export default definitions;

View File

@ -1,71 +1,82 @@
// Copyright 2017-2021 @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 */
/* eslint-disable camelcase */
export default {
Address: 'MultiAddress',
LookupSource: 'MultiAddress',
CeremonyPhaseType: {
_enum: [
'Registering',
'Assigning',
'Attesting'
]
},
CeremonyIndexType: 'u32',
ParticipantIndexType: 'u64',
MeetupIndexType: 'u64',
AttestationIndexType: 'u64',
CurrencyIdentifier: 'Hash',
BalanceType: 'i128',
BalanceEntry: {
principal: 'i128',
last_update: 'BlockNumber'
},
CurrencyCeremony: {
cid: 'CurrencyIdentifier',
cindex: 'CeremonyIndexType'
},
Location: {
lat: 'i64',
lon: 'i64'
},
Reputation: {
_enum: [
'Unverified',
'UnverifiedReputable',
'VerifiedUnlinked',
'VerifiedLinked'
]
},
CurrencyPropertiesType: {
name_utf8: 'Text',
demurrage_per_block: 'i128'
},
ClaimOfAttendance: {
claimant_public: 'AccountId',
ceremony_index: 'CeremonyIndexType',
currency_identifier: 'CurrencyIdentifier',
meetup_index: 'MeetupIndexType',
location: 'Location',
timestamp: 'Moment',
number_of_participants_confirmed: 'u32'
},
Attestation: {
claim: 'ClaimOfAttendance',
signature: 'Signature',
public: 'AccountId'
},
ProofOfAttendance: {
prover_public: 'AccountId',
ceremony_index: 'CeremonyIndexType',
currency_identifier: 'CurrencyIdentifier',
attendee_public: 'AccountId',
attendee_signature: 'Signature'
},
ShopIdentifier: 'Text',
ArticleIdentifier: 'Text'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'MultiAddress',
LookupSource: 'MultiAddress',
CeremonyPhaseType: {
_enum: [
'Registering',
'Assigning',
'Attesting'
]
},
CeremonyIndexType: 'u32',
ParticipantIndexType: 'u64',
MeetupIndexType: 'u64',
AttestationIndexType: 'u64',
CurrencyIdentifier: 'Hash',
BalanceType: 'i128',
BalanceEntry: {
principal: 'i128',
last_update: 'BlockNumber'
},
CurrencyCeremony: {
cid: 'CurrencyIdentifier',
cindex: 'CeremonyIndexType'
},
Location: {
lat: 'i64',
lon: 'i64'
},
Reputation: {
_enum: [
'Unverified',
'UnverifiedReputable',
'VerifiedUnlinked',
'VerifiedLinked'
]
},
CurrencyPropertiesType: {
name_utf8: 'Text',
demurrage_per_block: 'i128'
},
ClaimOfAttendance: {
claimant_public: 'AccountId',
ceremony_index: 'CeremonyIndexType',
currency_identifier: 'CurrencyIdentifier',
meetup_index: 'MeetupIndexType',
location: 'Location',
timestamp: 'Moment',
number_of_participants_confirmed: 'u32'
},
Attestation: {
claim: 'ClaimOfAttendance',
signature: 'Signature',
public: 'AccountId'
},
ProofOfAttendance: {
prover_public: 'AccountId',
ceremony_index: 'CeremonyIndexType',
currency_identifier: 'CurrencyIdentifier',
attendee_public: 'AccountId',
attendee_signature: 'Signature'
},
ShopIdentifier: 'Text',
ArticleIdentifier: 'Text'
}
}
]
};
export default definitions;

View File

@ -1,43 +1,54 @@
// Copyright 2017-2021 @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 */
/* eslint-disable camelcase */
export default {
Address: 'MultiAddress',
LookupSource: 'MultiAddress',
CeremonyPhaseType: {
_enum: [
'Registering',
'Assigning',
'Attesting'
]
},
CeremonyIndexType: 'u32',
CurrencyIdentifier: 'Hash',
CurrencyCeremony: {
cid: 'CurrencyIdentifier',
cindex: 'CeremonyIndexType'
},
Location: {
lat: 'i64',
lon: 'i64'
},
CurrencyPropertiesType: {
name_utf8: 'Text',
demurrage_per_block: 'i128'
},
ShardIdentifier: 'Hash',
Request: {
shard: 'ShardIdentifier',
cyphertext: 'Vec<u8>'
},
Enclave: {
pubkey: 'AccountId',
mrenclave: 'Hash',
timestamp: 'u64',
url: 'Text'
}
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'MultiAddress',
LookupSource: 'MultiAddress',
CeremonyPhaseType: {
_enum: [
'Registering',
'Assigning',
'Attesting'
]
},
CeremonyIndexType: 'u32',
CurrencyIdentifier: 'Hash',
CurrencyCeremony: {
cid: 'CurrencyIdentifier',
cindex: 'CeremonyIndexType'
},
Location: {
lat: 'i64',
lon: 'i64'
},
CurrencyPropertiesType: {
name_utf8: 'Text',
demurrage_per_block: 'i128'
},
ShardIdentifier: 'Hash',
Request: {
shard: 'ShardIdentifier',
cyphertext: 'Vec<u8>'
},
Enclave: {
pubkey: 'AccountId',
mrenclave: 'Hash',
timestamp: 'u64',
url: 'Text'
}
}
}
]
};
export default definitions;

View File

@ -1,71 +1,82 @@
// Copyright 2017-2021 @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 */
/* eslint-disable camelcase */
export default {
Address: 'AccountId',
LookupSource: 'AccountId',
CeremonyPhaseType: {
_enum: [
'Registering',
'Assigning',
'Attesting'
]
},
CeremonyIndexType: 'u32',
ParticipantIndexType: 'u64',
MeetupIndexType: 'u64',
AttestationIndexType: 'u64',
CurrencyIdentifier: 'Hash',
BalanceType: 'i128',
BalanceEntry: {
principal: 'i128',
last_update: 'BlockNumber'
},
CurrencyCeremony: {
cid: 'CurrencyIdentifier',
cindex: 'CeremonyIndexType'
},
Location: {
lat: 'i64',
lon: 'i64'
},
Reputation: {
_enum: [
'Unverified',
'UnverifiedReputable',
'VerifiedUnlinked',
'VerifiedLinked'
]
},
CurrencyPropertiesType: {
name_utf8: 'Text',
demurrage_per_block: 'i128'
},
ClaimOfAttendance: {
claimant_public: 'AccountId',
ceremony_index: 'CeremonyIndexType',
currency_identifier: 'CurrencyIdentifier',
meetup_index: 'MeetupIndexType',
location: 'Location',
timestamp: 'Moment',
number_of_participants_confirmed: 'u32'
},
Attestation: {
claim: 'ClaimOfAttendance',
signature: 'Signature',
public: 'AccountId'
},
ProofOfAttendance: {
prover_public: 'AccountId',
ceremony_index: 'CeremonyIndexType',
currency_identifier: 'CurrencyIdentifier',
attendee_public: 'AccountId',
attendee_signature: 'Signature'
},
ShopIdentifier: 'Text',
ArticleIdentifier: 'Text'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId',
CeremonyPhaseType: {
_enum: [
'Registering',
'Assigning',
'Attesting'
]
},
CeremonyIndexType: 'u32',
ParticipantIndexType: 'u64',
MeetupIndexType: 'u64',
AttestationIndexType: 'u64',
CurrencyIdentifier: 'Hash',
BalanceType: 'i128',
BalanceEntry: {
principal: 'i128',
last_update: 'BlockNumber'
},
CurrencyCeremony: {
cid: 'CurrencyIdentifier',
cindex: 'CeremonyIndexType'
},
Location: {
lat: 'i64',
lon: 'i64'
},
Reputation: {
_enum: [
'Unverified',
'UnverifiedReputable',
'VerifiedUnlinked',
'VerifiedLinked'
]
},
CurrencyPropertiesType: {
name_utf8: 'Text',
demurrage_per_block: 'i128'
},
ClaimOfAttendance: {
claimant_public: 'AccountId',
ceremony_index: 'CeremonyIndexType',
currency_identifier: 'CurrencyIdentifier',
meetup_index: 'MeetupIndexType',
location: 'Location',
timestamp: 'Moment',
number_of_participants_confirmed: 'u32'
},
Attestation: {
claim: 'ClaimOfAttendance',
signature: 'Signature',
public: 'AccountId'
},
ProofOfAttendance: {
prover_public: 'AccountId',
ceremony_index: 'CeremonyIndexType',
currency_identifier: 'CurrencyIdentifier',
attendee_public: 'AccountId',
attendee_signature: 'Signature'
},
ShopIdentifier: 'Text',
ArticleIdentifier: 'Text'
}
}
]
};
export default definitions;

View File

@ -1,98 +1,292 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { Enum, Struct } from '@polkadot/types';
import type { Option } from '@polkadot/types/codec';
import type { AccountId, AccountIndex, AccountInfo, Address, Balance, BlockNumber, Index } from '@polkadot/types/interfaces';
import type { OverrideBundleDefinition } from '@polkadot/types/types';
import type { Observable } from '@polkadot/x-rxjs';
import { memo } from '@polkadot/api-derive/util/memo';
import { combineLatest, of } from '@polkadot/x-rxjs';
import { map, switchMap } from '@polkadot/x-rxjs/operators';
// structs need to be in order
/* eslint-disable sort-keys */
export default {
Address: 'AccountId',
Balance: 'u64',
BalanceOf: 'Balance',
BalancesAggregate: {
total_issuance: 'Balance',
total_debt: 'Balance'
},
BlockNumber: 'u64',
ChainId: 'u8',
Currency: {
_enum: ['Unknown', 'Usd', 'EQ', 'Eth', 'Btc', 'Eos', 'Dot']
},
DataPoint: {
price: 'u64',
account_id: 'AccountId',
block_number: 'BlockNumber',
timestamp: 'u64'
},
DepositNonce: 'u64',
FixedI64: 'i64',
Keys: 'SessionKeys3',
LookupSource: 'AccountId',
OperationRequest: {
account: 'AccountId',
authority_index: 'AuthIndex',
validators_len: 'u32',
block_num: 'BlockNumber'
},
PricePayload: 'Data',
PricePeriod: {
_enum: ['Min', 'TenMin', 'Hour', 'FourHour', 'Day']
},
PricePoint: {
block_number: 'BlockNumber',
timestamp: 'u64',
price: 'u64',
data_points: 'Vec<DataPoint>'
},
ProposalStatus: {
_enum: [
'Initiated',
'Approved',
'Rejected'
]
},
ProposalVotes: {
votes_for: 'Vec<AccountId>',
votes_against: 'Vec<AccountId>',
status: 'ProposalStatus',
expiry: 'BlockNumber'
},
ReinitRequest: {
account: 'AccountId',
authority_index: 'AuthIndex',
validators_len: 'u32',
block_num: 'BlockNumber'
},
ResourceId: '[u8; 32]',
SignedBalance: {
_enum: {
Positive: 'Balance',
Negative: 'Balance'
interface VestingInfo extends Struct {
readonly locked: Balance;
readonly perBlock: Balance;
readonly startingBlock: BlockNumber;
}
interface SignedBalance extends Enum {
readonly isPositive: boolean;
readonly asPositive: Balance;
readonly isNegative: boolean;
readonly asNegative: Balance;
}
export interface EQDeriveBalancesAll {
additional: []; // fix until vesting instances are supported in api-derive
freeBalance: Balance;
reservedBalance: Balance;
vestingLocked: Balance;
lockedBalance: Balance;
accountId: AccountId;
accountNonce: Index;
lockedBreakdown: unknown[];
}
type Result = [Balance, Balance, Balance, Index];
type RawResult = [
SignedBalance,
Option<Balance>,
Option<VestingInfo>,
AccountInfo
];
type EQDeriveBalancesAccountQuery = (
address: AccountIndex | AccountId | Address | string
) => Observable<{ accountNonce: Index; }>;
type EQDeriveBalancesAllQuery = (
address: AccountIndex | AccountId | Address | string
) => Observable<EQDeriveBalancesAll>;
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
Balance: 'u64',
BalanceOf: 'Balance',
BalancesAggregate: {
total_issuance: 'Balance',
total_debt: 'Balance'
},
BlockNumber: 'u64',
ChainId: 'u8',
Currency: {
_enum: ['Unknown', 'Usd', 'EQ', 'Eth', 'Btc', 'Eos', 'Dot']
},
DataPoint: {
price: 'u64',
account_id: 'AccountId',
block_number: 'BlockNumber',
timestamp: 'u64'
},
DepositNonce: 'u64',
FixedI64: 'i64',
Keys: 'SessionKeys3',
LookupSource: 'AccountId',
OperationRequest: {
account: 'AccountId',
authority_index: 'AuthIndex',
validators_len: 'u32',
block_num: 'BlockNumber'
},
PricePayload: 'Data',
PricePeriod: {
_enum: ['Min', 'TenMin', 'Hour', 'FourHour', 'Day']
},
PricePoint: {
block_number: 'BlockNumber',
timestamp: 'u64',
price: 'u64',
data_points: 'Vec<DataPoint>'
},
ProposalStatus: {
_enum: [
'Initiated',
'Approved',
'Rejected'
]
},
ProposalVotes: {
votes_for: 'Vec<AccountId>',
votes_against: 'Vec<AccountId>',
status: 'ProposalStatus',
expiry: 'BlockNumber'
},
ReinitRequest: {
account: 'AccountId',
authority_index: 'AuthIndex',
validators_len: 'u32',
block_num: 'BlockNumber'
},
ResourceId: '[u8; 32]',
SignedBalance: {
_enum: {
Positive: 'Balance',
Negative: 'Balance'
}
},
SubAccType: {
_enum: ['Bailsman', 'Borrower', 'Lender']
},
TotalAggregates: {
collateral: 'Balance',
debt: 'Balance'
},
TransferReason: {
_enum: [
'Common',
'InterestFee',
'MarginCall',
'BailsmenRedistribution',
'TreasuryEqBuyout',
'TreasuryBuyEq',
'Subaccount'
]
},
UserGroup: {
_enum: ['Unknown', 'Balances', 'Bailsmen', 'Borrowers', 'Lenders']
},
VestingInfo: {
locked: 'Balance',
perBlock: 'Balance',
startingBlock: 'BlockNumber'
}
}
}
],
derives: {
// TODO derive.democracy.locks
// TODO derice.staking.account
balances: {
account: (
// Compatibility with calc tx fee
instanceId: string,
api: ApiInterfaceRx
): EQDeriveBalancesAccountQuery =>
memo(
instanceId,
(address: AccountId | AccountIndex | Address | string) =>
api.derive.accounts.accountId(address).pipe(
switchMap(
(accountId): Observable<[AccountId, [Index]]> =>
accountId
? combineLatest([
of(accountId),
api
.queryMulti([
[api.query.system.account, accountId]
])
.pipe(
map((raw): [Index] => {
if (raw.length < 1) {
throw new Error('Data expected');
}
const data = raw as [AccountInfo];
return [data[0].nonce];
})
)
])
: of([
api.registry.createType('AccountId'),
[api.registry.createType('Index')]
])
),
map(([, [accountNonce]]) => ({ accountNonce }))
)
),
all: (
// Compatibility for account balance in explorer
instanceId: string,
api: ApiInterfaceRx
): EQDeriveBalancesAllQuery =>
memo(
instanceId,
(address: AccountIndex | AccountId | Address | string) =>
api.derive.accounts.accountId(address).pipe(
switchMap(
(accountId): Observable<[AccountId, Result]> =>
accountId
? combineLatest([
of(accountId),
api
.queryMulti([
[api.query.balances.account, [accountId, 'EQ']],
[api.query.eqVesting.vested, accountId],
[api.query.eqVesting.vesting, accountId],
[api.query.system.account, accountId]
])
.pipe(
map(
(raw): Result => {
if (raw.length < 4) {
throw new Error('4 members expected');
}
const res = raw as RawResult;
const freeBalance = res[0].asPositive;
let reservedBalance = api.registry.createType(
'Balance'
);
let vestingLocked = api.registry.createType(
'Balance'
);
if (res[1].isSome && res[2].isSome) {
const vested = res[1].unwrap();
const info = res[2].unwrap();
vestingLocked = info.locked;
reservedBalance = api.registry.createType(
'Balance',
vestingLocked.sub(vested)
);
}
return [
freeBalance,
reservedBalance,
vestingLocked,
res[3].nonce
];
}
)
)
])
: of([
api.registry.createType('AccountId'),
[
api.registry.createType('Balance'),
api.registry.createType('Balance'),
api.registry.createType('Balance'),
api.registry.createType('Index')
]
])
),
map(
([
accountId,
[freeBalance, reservedBalance, vestingLocked, accountNonce]
]): EQDeriveBalancesAll => ({
accountId,
accountNonce,
additional: [],
freeBalance,
lockedBalance: vestingLocked,
lockedBreakdown: [],
reservedBalance,
vestingLocked
})
)
)
)
}
},
SubAccType: {
_enum: ['Bailsman', 'Borrower', 'Lender']
},
TotalAggregates: {
collateral: 'Balance',
debt: 'Balance'
},
TransferReason: {
_enum: [
'Common',
'InterestFee',
'MarginCall',
'BailsmenRedistribution',
'TreasuryEqBuyout',
'TreasuryBuyEq',
'Subaccount'
]
},
UserGroup: {
_enum: ['Unknown', 'Balances', 'Bailsmen', 'Borrowers', 'Lenders']
},
VestingInfo: {
locked: 'Balance',
perBlock: 'Balance',
startingBlock: 'BlockNumber'
}
};
export default definitions;

View File

@ -1,19 +1,31 @@
// Copyright 2017-2021 @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 */
export default {
Difficulty: 'U256',
DifficultyAndTimestamp: {
difficulty: 'Difficulty',
timestamp: 'Moment'
},
Era: {
genesisBlockHash: 'H256',
finalBlockHash: 'H256',
finalStateRoot: 'H256'
},
RefCount: 'u8'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Difficulty: 'U256',
DifficultyAndTimestamp: {
difficulty: 'Difficulty',
timestamp: 'Moment'
},
Era: {
genesisBlockHash: 'H256',
finalBlockHash: 'H256',
finalStateRoot: 'H256'
},
RefCount: 'u8'
}
}
]
};
export default definitions;

View File

@ -1,32 +1,46 @@
// Copyright 2017-2021 @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 */
export default {
Amount: 'i128',
AmountOf: 'Amount',
Address: 'AccountId',
BalanceInfo: {
amount: 'Balance',
assetId: 'AssetId'
},
CurrencyId: 'AssetId',
CurrencyIdOf: 'AssetId',
Intention: {
who: 'AccountId',
asset_sell: 'AssetId',
asset_buy: 'AssetId',
amount: 'Balance',
discount: 'bool',
sell_or_buy: 'IntentionType'
},
IntentionId: 'u128',
IntentionType: {
_enum: [
'SELL',
'BUY'
]
},
LookupSource: 'AccountId',
Price: 'Balance'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Amount: 'i128',
AmountOf: 'Amount',
Address: 'AccountId',
BalanceInfo: {
amount: 'Balance',
assetId: 'AssetId'
},
CurrencyId: 'AssetId',
CurrencyIdOf: 'AssetId',
Intention: {
who: 'AccountId',
asset_sell: 'AssetId',
asset_buy: 'AssetId',
amount: 'Balance',
discount: 'bool',
sell_or_buy: 'IntentionType'
},
IntentionId: 'u128',
IntentionType: {
_enum: [
'SELL',
'BUY'
]
},
LookupSource: 'AccountId',
Price: 'Balance'
}
}
]
};
export default definitions;

View File

@ -1,10 +1,22 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId'
}
}
]
};
export default definitions;

View File

@ -1,6 +1,9 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { OverrideBundleDefinition } from '@polkadot/types/types';
import acala from './acala';
import aresParachain from './ares-parachain';
import bifrost from './bifrost';
import bitcountry from './bitcountry';
@ -19,6 +22,7 @@ import datahighwayParachain from './datahighway';
import dock from './dock';
import dotmog from './dotmog';
import dusty from './dusty';
import edgeware from './edgeware';
import encointerNodeNotee from './encointer-node-notee';
import encointerNodeTeeproxy from './encointer-node-teeproxy';
import encointerPara from './encointer-para';
@ -29,14 +33,18 @@ import idavoll from './idavoll';
import integritee from './integritee';
import jupiter from './jupiter';
import kilt from './kilt';
import kulupu from './kulupu';
import laminar from './laminar';
import moonbeam from './moonbeam';
import nodle from './nodle';
import phala from './phala';
import phalaParachain from './phala-parachain';
import plasm from './plasm';
import plasmParachain from './plasm-parachain';
import polkabtc from './polkabtc';
import polkadex from './polkadex';
import robonomics from './robonomics';
import stablePoc from './stable-poc';
import soraSubstrate from './soraSubstrate';
import stafi from './stafi';
import subdao from './subdao';
import subsocial from './subsocial';
@ -46,17 +54,19 @@ import uniarts from './uniarts';
import zenlink from './zenlink';
import zero from './zero';
// mapping from specName in state.getRuntimeVersion
export default {
// NOTE: The mapping is done from specName in state.getRuntimeVersion
const spec: Record<string, OverrideBundleDefinition> = {
Crab: crab,
Darwinia: darwinia,
Equilibrium: equilibrium,
acala,
'ares-parachain': aresParachain,
bifrost: bifrost,
bifrost,
'bitcountry-node': bitcountry,
'btc-parachain': polkabtc,
canvas,
'centrifuge-chain': centrifugeChain,
chainx: chainx,
chainx,
clover,
'clover-rococo': cloverRococo,
crust,
@ -68,17 +78,25 @@ export default {
'dock-testnet': dock,
'dotmog-node': dotmog,
dusty3: dusty,
edgeware,
'encointer-node-notee': encointerNodeNotee,
'encointer-node-teeproxy': encointerNodeTeeproxy,
'encointer-parachain': encointerPara,
'hack-hydra-dx': hydrate,
hanonycash,
'hydra-dx': hydrate,
idavoll: idavoll,
idavoll,
'integritee-parachain': integritee,
jupiter,
'kilt-parachain': kilt,
kulupu,
laminar,
mandala: acala,
'mashnet-node': kilt,
'moonbase-alphanet': moonbeam,
moonbeam,
'moonbeam-standalone': moonbeam,
'node-moonbeam': moonbeam,
'node-polkadex': polkadex,
'nodle-chain': nodle,
'phala-collator': phalaParachain,
@ -86,14 +104,15 @@ export default {
plasm,
'plasm-parachain': plasmParachain,
robonomics,
'stable-poc': stablePoc,
stable_poc: stablePoc,
'sora-substrate': soraSubstrate,
stafi,
subdao,
subsocial,
subzero: zero,
ternoa: ternoa,
trustbase: trustbase,
uniarts: uniarts,
ternoa,
trustbase,
uniarts,
zenlink
};
export default spec;

View File

@ -1,21 +1,33 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'MultiAddress',
Enclave: {
mrenclave: 'Hash',
pubkey: 'AccountId',
timestamp: 'u64',
url: 'Text'
},
LookupSource: 'MultiAddress',
Request: {
cyphertext: 'Vec<u8>',
shard: 'ShardIdentifier'
},
ShardIdentifier: 'Hash'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'MultiAddress',
Enclave: {
mrenclave: 'Hash',
pubkey: 'AccountId',
timestamp: 'u64',
url: 'Text'
},
LookupSource: 'MultiAddress',
Request: {
cyphertext: 'Vec<u8>',
shard: 'ShardIdentifier'
},
ShardIdentifier: 'Hash'
}
}
]
};
export default definitions;

View File

@ -1,10 +1,22 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'MultiAddress',
LookupSource: 'MultiAddress'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'MultiAddress',
LookupSource: 'MultiAddress'
}
}
]
};
export default definitions;

View File

@ -1,16 +1,31 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
export default {
Address: 'AccountId',
BlockNumber: 'u64',
DelegationNodeId: 'Hash',
ErrorCode: 'u16',
Index: 'u64',
LookupSource: 'AccountId',
Permissions: 'u32',
PublicBoxKey: 'Hash',
PublicSigningKey: 'Hash',
RefCount: 'u8',
Signature: 'MultiSignature'
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',
BlockNumber: 'u64',
DelegationNodeId: 'Hash',
ErrorCode: 'u16',
Index: 'u64',
LookupSource: 'AccountId',
Permissions: 'u32',
PublicBoxKey: 'Hash',
PublicSigningKey: 'Hash',
RefCount: 'u8',
Signature: 'MultiSignature'
}
}
]
};
export default definitions;

View File

@ -1,30 +1,45 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
export default {
Amendment: 'Call',
Application: {
candidate: 'AccountId',
candidate_deposit: 'Balance',
challenged_block: 'BlockNumber',
challenger: 'Option<AccountId>',
challenger_deposit: 'Option<Balance>',
created_block: 'BlockNumber',
metadata: 'Vec<u8>',
voters_against: 'Vec<(AccountId, Balance)>',
voters_for: 'Vec<(AccountId, Balance)>',
votes_against: 'Option<Balance>',
votes_for: 'Option<Balance>'
},
CertificateId: 'AccountId',
RefCount: 'u8',
RootCertificate: {
child_revocations: 'Vec<CertificateId>',
created: 'BlockNumber',
key: 'CertificateId',
owner: 'AccountId',
renewed: 'BlockNumber',
revoked: 'bool',
validity: 'BlockNumber'
}
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: {
Amendment: 'Call',
Application: {
candidate: 'AccountId',
candidate_deposit: 'Balance',
challenged_block: 'BlockNumber',
challenger: 'Option<AccountId>',
challenger_deposit: 'Option<Balance>',
created_block: 'BlockNumber',
metadata: 'Vec<u8>',
voters_against: 'Vec<(AccountId, Balance)>',
voters_for: 'Vec<(AccountId, Balance)>',
votes_against: 'Option<Balance>',
votes_for: 'Option<Balance>'
},
CertificateId: 'AccountId',
RefCount: 'u8',
RootCertificate: {
child_revocations: 'Vec<CertificateId>',
created: 'BlockNumber',
key: 'CertificateId',
owner: 'AccountId',
renewed: 'BlockNumber',
revoked: 'bool',
validity: 'BlockNumber'
}
}
}
]
};
export default definitions;

View File

@ -1,62 +1,74 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'MultiAddress',
LookupSource: 'MultiAddress',
EthereumAddress: 'H160',
EcdsaSignature: '[u8; 65]',
EthereumTxHash: 'H256',
WorkerStateEnum: {
_enum: {
Empty: null,
Free: null,
Gatekeeper: null,
MiningPending: null,
Mining: 'BlockNumber',
MiningStopping: null
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'MultiAddress',
LookupSource: 'MultiAddress',
EthereumAddress: 'H160',
EcdsaSignature: '[u8; 65]',
EthereumTxHash: 'H256',
WorkerStateEnum: {
_enum: {
Empty: null,
Free: null,
Gatekeeper: null,
MiningPending: null,
Mining: 'BlockNumber',
MiningStopping: null
}
},
WorkerInfo: {
machineId: 'Vec<u8>',
pubkey: 'Vec<u8>',
lastUpdated: 'u64',
state: 'WorkerStateEnum',
score: 'Option<Score>'
},
Score: {
overallScore: 'u32',
features: 'Vec<u32>'
},
StashInfo: {
controller: 'AccountId',
payoutPrefs: 'PayoutPrefs'
},
PayoutPrefs: {
commission: 'u32',
target: 'AccountId'
},
BlockRewardInfo: {
seed: 'U256',
onlineTarget: 'U256',
computeTarget: 'U256'
},
RoundInfo: {
round: 'u32',
startBlock: 'BlockNumber'
},
RoundStats: {
round: 'u32',
onlineWorkers: 'u32',
computeWorkers: 'u32',
fracTargetOnlineReward: 'u32',
totalPower: 'u32'
},
MinerStatsDelta: {
numWorker: 'i32',
numPower: 'i32'
}
}
}
},
WorkerInfo: {
machineId: 'Vec<u8>',
pubkey: 'Vec<u8>',
lastUpdated: 'u64',
state: 'WorkerStateEnum',
score: 'Option<Score>'
},
Score: {
overallScore: 'u32',
features: 'Vec<u32>'
},
StashInfo: {
controller: 'AccountId',
payoutPrefs: 'PayoutPrefs'
},
PayoutPrefs: {
commission: 'u32',
target: 'AccountId'
},
BlockRewardInfo: {
seed: 'U256',
onlineTarget: 'U256',
computeTarget: 'U256'
},
RoundInfo: {
round: 'u32',
startBlock: 'BlockNumber'
},
RoundStats: {
round: 'u32',
onlineWorkers: 'u32',
computeWorkers: 'u32',
fracTargetOnlineReward: 'u32',
totalPower: 'u32'
},
MinerStatsDelta: {
numWorker: 'i32',
numPower: 'i32'
}
]
};
export default definitions;

View File

@ -1,34 +1,46 @@
// Copyright 2017-2021 @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 */
export default {
EcdsaSignature: '[u8; 65]',
EthereumAddress: 'H160',
EthereumTxHash: 'H256',
MiningInfo: {
isMining: 'bool',
startBlock: 'Option<BlockNumber>'
},
PayoutPrefs: {
commission: 'u32',
target: 'AccountId'
},
Score: {
features: 'Vec<u32>',
overallScore: 'u32'
},
StashInfo: {
controller: 'AccountId',
payoutPrefs: 'PayoutPrefs'
},
WorkerInfo: {
machineId: 'Vec<u8>',
pubkey: 'Vec<u8>',
lastUpdated: 'u64',
score: 'Option<Score>',
status: 'i32'
}
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
EcdsaSignature: '[u8; 65]',
EthereumAddress: 'H160',
EthereumTxHash: 'H256',
MiningInfo: {
isMining: 'bool',
startBlock: 'Option<BlockNumber>'
},
PayoutPrefs: {
commission: 'u32',
target: 'AccountId'
},
Score: {
features: 'Vec<u32>',
overallScore: 'u32'
},
StashInfo: {
controller: 'AccountId',
payoutPrefs: 'PayoutPrefs'
},
WorkerInfo: {
machineId: 'Vec<u8>',
pubkey: 'Vec<u8>',
lastUpdated: 'u64',
score: 'Option<Score>',
status: 'i32'
}
}
}
]
};
export default definitions;

View File

@ -1,31 +1,43 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId',
ChainId: {
_enum: {
RelayChain: null,
Parachain: 'ParaId'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId',
ChainId: {
_enum: {
RelayChain: null,
Parachain: 'ParaId'
}
},
XCurrencyId: {
chain_id: 'ChainId',
currency_id: 'Bytes'
},
CurrencyIdOf: 'CurrencyId',
CurrencyId: {
_enum: {
Token: 'TokenSymbol'
}
},
TokenSymbol: {
_enum: ['ACA', 'AUSD', 'DOT', 'XBTC', 'LDOT', 'RENBTC', 'SDN', 'PLM']
},
AmountOf: 'Amount',
Amount: 'i128'
}
}
},
XCurrencyId: {
chain_id: 'ChainId',
currency_id: 'Bytes'
},
CurrencyIdOf: 'CurrencyId',
CurrencyId: {
_enum: {
Token: 'TokenSymbol'
}
},
TokenSymbol: {
_enum: ['ACA', 'AUSD', 'DOT', 'XBTC', 'LDOT', 'RENBTC', 'SDN', 'PLM']
},
AmountOf: 'Amount',
Amount: 'i128'
]
};
export default definitions;

View File

@ -1,36 +1,51 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
export default {
AuthorityId: 'AccountId',
AuthorityVote: 'u32',
Claim: {
amount: 'u128',
approve: 'BTreeSet<AuthorityId>',
complete: 'bool',
decline: 'BTreeSet<AuthorityId>',
params: 'Lockdrop'
},
ClaimId: 'H256',
ClaimVote: {
approve: 'bool',
authority: 'u16',
claim_id: 'ClaimId'
},
DollarRate: 'u128',
Keys: 'SessionKeys2',
Lockdrop: {
duration: 'u64',
public_key: '[u8; 33]',
transaction_hash: 'H256',
type: 'u8',
value: 'u128'
},
PredicateHash: 'H256',
RefCount: 'u8',
TickerRate: {
authority: 'u16',
btc: 'u128',
eth: 'u128'
}
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: {
AuthorityId: 'AccountId',
AuthorityVote: 'u32',
Claim: {
amount: 'u128',
approve: 'BTreeSet<AuthorityId>',
complete: 'bool',
decline: 'BTreeSet<AuthorityId>',
params: 'Lockdrop'
},
ClaimId: 'H256',
ClaimVote: {
approve: 'bool',
authority: 'u16',
claim_id: 'ClaimId'
},
DollarRate: 'u128',
Keys: 'SessionKeys2',
Lockdrop: {
duration: 'u64',
public_key: '[u8; 33]',
transaction_hash: 'H256',
type: 'u8',
value: 'u128'
},
PredicateHash: 'H256',
RefCount: 'u8',
TickerRate: {
authority: 'u16',
btc: 'u128',
eth: 'u128'
}
}
}
]
};
export default definitions;

View File

@ -1,72 +1,86 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable sort-keys */
export default {
OrderType: {
_enum: [
'BidLimit',
'BidMarket',
'AskLimit',
'AskMarket'
]
},
Order: {
id: 'Hash',
trading_pair: 'Hash',
trader: 'AccountId',
price: 'FixedU128',
quantity: 'FixedU128',
order_type: 'OrderType'
},
Order4RPC: {
id: '[u8;32]',
trading_pair: '[u8;32]',
trader: '[u8;32]',
price: 'Vec<u8>',
quantity: 'Vec<u8>',
order_type: 'OrderType'
},
MarketData: {
low: 'FixedU128',
high: 'FixedU128',
volume: 'FixedU128',
open: 'FixedU128',
close: 'FixedU128'
import type { OverrideBundleDefinition } from '@polkadot/types/types';
},
LinkedPriceLevel: {
next: 'Option<FixedU128>',
prev: 'Option<FixedU128>',
orders: 'Vec<Order>'
},
LinkedPriceLevelRpc: {
next: 'Vec<u8>',
prev: 'Vec<u8>',
orders: 'Vec<Order4RPC>'
},
Orderbook: {
trading_pair: 'Hash',
base_asset_id: 'u32',
quote_asset_id: 'u32',
best_bid_price: 'FixedU128',
best_ask_price: 'FixedU128'
},
OrderbookRPC: {
trading_pair: '[u8;32]',
base_asset_id: 'u32',
quote_asset_id: 'u32',
best_bid_price: 'Vec<u8>',
best_ask_price: 'Vec<u8>'
},
FrontendPricelevel: {
price: 'FixedU128',
quantity: 'FixedU128'
},
OrderbookUpdates: {
bids: 'Vec<FrontendPricelevel>',
asks: 'Vec<FrontendPricelevel>'
},
LookupSource: 'AccountId',
Address: 'AccountId'
// structs need to be in order
/* eslint-disable sort-keys */
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
OrderType: {
_enum: [
'BidLimit',
'BidMarket',
'AskLimit',
'AskMarket'
]
},
Order: {
id: 'Hash',
trading_pair: 'Hash',
trader: 'AccountId',
price: 'FixedU128',
quantity: 'FixedU128',
order_type: 'OrderType'
},
Order4RPC: {
id: '[u8;32]',
trading_pair: '[u8;32]',
trader: '[u8;32]',
price: 'Vec<u8>',
quantity: 'Vec<u8>',
order_type: 'OrderType'
},
MarketData: {
low: 'FixedU128',
high: 'FixedU128',
volume: 'FixedU128',
open: 'FixedU128',
close: 'FixedU128'
},
LinkedPriceLevel: {
next: 'Option<FixedU128>',
prev: 'Option<FixedU128>',
orders: 'Vec<Order>'
},
LinkedPriceLevelRpc: {
next: 'Vec<u8>',
prev: 'Vec<u8>',
orders: 'Vec<Order4RPC>'
},
Orderbook: {
trading_pair: 'Hash',
base_asset_id: 'u32',
quote_asset_id: 'u32',
best_bid_price: 'FixedU128',
best_ask_price: 'FixedU128'
},
OrderbookRPC: {
trading_pair: '[u8;32]',
base_asset_id: 'u32',
quote_asset_id: 'u32',
best_bid_price: 'Vec<u8>',
best_ask_price: 'Vec<u8>'
},
FrontendPricelevel: {
price: 'FixedU128',
quantity: 'FixedU128'
},
OrderbookUpdates: {
bids: 'Vec<FrontendPricelevel>',
asks: 'Vec<FrontendPricelevel>'
},
LookupSource: 'AccountId',
Address: 'AccountId'
}
}
]
};
export default definitions;

View File

@ -1,18 +1,31 @@
// Copyright 2017-2021 @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 */
export default {
Record: 'Vec<u8>',
TechnicalParam: 'Vec<u8>',
TechnicalReport: 'Vec<u8>',
EconomicalParam: '{}',
ProofParam: 'MultiSignature',
LiabilityIndex: 'u64',
ValidationFunctionParams: {
max_code_size: 'u32',
relay_chain_height: 'u32',
code_upgrade_allowed: 'Option<u32>'
}
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Record: 'Vec<u8>',
TechnicalParam: 'Vec<u8>',
TechnicalReport: 'Vec<u8>',
EconomicalParam: '{}',
ProofParam: 'MultiSignature',
LiabilityIndex: 'u64',
ValidationFunctionParams: {
max_code_size: 'u32',
relay_chain_height: 'u32',
code_upgrade_allowed: 'Option<u32>'
}
}
}
]
};
export default definitions;

View File

@ -1,41 +0,0 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
// structs need to be in order
/* eslint-disable sort-keys */
export default {
Address: 'AccountId',
LookupSource: 'AccountId',
RefCount: 'u8',
AccountData: {
free: 'Balance',
reserved: 'Balance',
miscFrozen: 'Balance',
feeFrozen: 'Balance',
txCount: 'u32',
sessionIndex: 'u32'
},
TemplateAccountData: {
txCount: 'u32',
sessionIndex: 'u32'
},
TxCount: 'u32',
Value: 'u128',
UtxoHash: 'H256',
AccountHash: 'H256',
TxHash: 'H256',
TransactionOutput: {
value: 'Value',
pubkey: 'AccountId'
},
SignedPair: {
input: 'Vec<UtxoHash>',
output: 'Vec<TransactionOutput>'
},
ArchivedTransaction: 'Vec<ArchivedPair>',
ArchivedPair: {
inputs: 'Vec<TransactionOutput>',
outputs: 'Vec<UtxoHash>'
}
};

View File

@ -1,11 +1,23 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId',
RefCount: 'u8'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId',
RefCount: 'u8'
}
}
]
};
export default definitions;

View File

@ -1,6 +1,19 @@
// Copyright 2017-2021 @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 */
export default {};
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {}
}
]
};
export default definitions;

View File

@ -1,10 +1,23 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { OverrideBundleDefinition } from '@polkadot/types/types';
import * as subsocialDefinitions from '@subsocial/types/substrate/interfaces/definitions';
import { typesFromDefs } from '../util';
const subsocialTypes = typesFromDefs(subsocialDefinitions);
// structs need to be in order
/* eslint-disable sort-keys */
export default subsocialTypes;
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: typesFromDefs(subsocialDefinitions)
}
]
};
export default definitions;

View File

@ -1,18 +1,31 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
CapsuleID: 'u32',
CapsuleIDOf: 'CapsuleID',
CapsuleData: {
offchain_uri: 'Vec<u8>',
pk_hash: 'Hash',
creator: 'AccountId',
owner: 'AccountId',
locked: 'bool'
},
LookupSource: 'AccountId'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
CapsuleID: 'u32',
CapsuleIDOf: 'CapsuleID',
CapsuleData: {
offchain_uri: 'Vec<u8>',
pk_hash: 'Hash',
creator: 'AccountId',
owner: 'AccountId',
locked: 'bool'
},
LookupSource: 'AccountId'
}
}
]
};
export default definitions;

View File

@ -1,10 +1,22 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId'
}
}
]
};
export default definitions;

View File

@ -1,203 +1,214 @@
// Copyright 2017-2021 @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 */
/* eslint-disable camelcase */
export default {
Keys: 'SessionKeys2',
Address: 'AccountId',
LookupSource: 'AccountId',
WorkId: 'u32',
Id: 'u32',
Name: 'Vec<u8>',
Value: 'Vec<u8>',
ReasonIndex: 'u32',
LottoIndex: 'u32',
LotteryKind: {
_enum: {
Routine: 'Null',
TreasuryFunded: 'ReasonIndex'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Keys: 'SessionKeys2',
Address: 'AccountId',
LookupSource: 'AccountId',
WorkId: 'u32',
Id: 'u32',
Name: 'Vec<u8>',
Value: 'Vec<u8>',
ReasonIndex: 'u32',
LottoIndex: 'u32',
LotteryKind: {
_enum: {
Routine: 'Null',
TreasuryFunded: 'ReasonIndex'
}
},
LottoResult: {
_enum: {
Routine: '(AccountId, Balance)',
TreasuryFunded: 'Balance'
}
},
Lottery: {
round: 'LottoIndex',
kind: 'LotteryKind',
jackpot: 'Balance',
next_ticket_id: 'u32',
players: 'BTreeMap<AccountId, bool>',
tickets: 'BTreeMap<u32, AccountId>',
result: 'Option<LottoResult>'
},
NameData: {
value: 'Value',
owner: 'AccountId',
expiration: 'Option<u32>'
},
Token: {
hash: 'H256',
symbol: 'Vec<u8>',
total_supply: 'Balance'
},
OrderType: {
_enum: ['Buy', 'Sell']
},
OrderStatus: {
_enum: ['Created', 'PartialFilled', 'Filled', 'Canceled']
},
TradePair: {
hash: 'H256',
base: 'H256',
quote: 'H256',
buy_one_price: 'Option<Price>',
sell_one_price: 'Option<Price>',
latest_matched_price: 'Option<Price>',
one_day_trade_volume: 'Option<Price>',
one_day_highest_price: 'Option<Price>',
one_day_lowest_price: 'Option<Price>'
},
Price: 'u128',
LimitOrder: {
hash: 'H256',
base: 'H256',
quote: 'H256',
owner: 'AccountId',
price: 'Price',
sell_amount: 'Balance',
buy_amount: 'Balance',
remained_sell_amount: 'Balance',
remained_buy_amount: 'Balance',
otype: 'OrderType',
status: 'OrderStatus'
},
Trade: {
hash: 'H256',
base: 'H256',
quote: 'H256',
buyer: 'AccountId',
seller: 'AccountId',
maker: 'AccountId',
taker: 'AccountId',
otype: 'OrderType',
price: 'Price',
base_amount: 'Balance',
quote_amount: 'Balance'
},
OrderLinkedItem: {
prev: 'Option<Price>',
next: 'Option<Price>',
price: 'Option<Price>',
orders: 'Vec<H256>'
},
CollectionMode: {
_enum: {
Invalid: null,
NFT: 'u32',
Fungible: 'u32',
ReFungible: '(u32, u32)'
}
},
NftItemType: {
Collection: 'u64',
Owner: 'AccountId',
Data: 'Vec<u8>',
item_hash: 'H160'
},
FungibleItemType: {
Collection: 'u64',
Owner: 'AccountId',
value: 'u128'
},
ApprovePermissions: {
approved: 'AccountId',
amount: 'u64'
},
AccessMode: {
_enum: ['Normal', 'WhiteList']
},
SaleOrder: {
collection_id: 'u64',
item_id: 'u64',
value: 'u64',
owner: 'AccountId',
price: 'u64'
},
SaleOrderHistory: {
collection_id: 'u64',
item_id: 'u64',
value: 'u64',
seller: 'AccountId',
buyer: 'AccountId',
price: 'u64',
buy_time: 'BlockNumber'
},
SignatureAuthentication: {
collection: 'u64',
item: 'u64',
names: 'Name',
names_owner: 'AccountId',
sign_time: 'BlockNumber',
memo: 'Vec<u8>',
expiration: 'Option<BlockNumber>'
},
Ownership: {
owner: 'AccountId',
fraction: 'u128'
},
ReFungibleItemType: {
Collection: 'u64',
Owner: 'Vec<Ownership>',
Data: 'Vec<u8>'
},
CollectionType: {
Owner: 'AccountId',
Mode: 'CollectionMode',
Access: 'u8',
DecimalPoints: 'u32',
Name: 'Vec<u16>',
Description: 'Vec<u16>',
TokenPrefix: 'Vec<u8>',
CustomDataSize: 'u32',
OffchainSchema: 'Vec<u8>',
Sponsor: 'AccountId',
UnconfirmedSponsor: 'AccountId'
},
Auction: {
id: 'u64',
collection_id: 'u64',
item_id: 'u64',
value: 'u64',
owner: 'AccountId',
start_price: 'u64',
increment: 'u64',
current_price: 'u64',
start_time: 'BlockNumber',
end_time: 'BlockNumber'
},
BidHistory: {
auction_id: 'u64',
bidder: 'AccountId',
bid_price: 'u64',
bid_time: 'BlockNumber'
},
Pool: {
id: 'Id',
account: 'AccountId',
acc_rewards_per_share: 'Balance',
last_reward_block: 'BlockNumber',
asset_id: 'Id',
total_balance: 'Balance'
},
Staker: {
amount: 'Balance',
reward: 'Balance',
debt: 'Balance'
}
}
}
},
LottoResult: {
_enum: {
Routine: '(AccountId, Balance)',
TreasuryFunded: 'Balance'
}
},
Lottery: {
round: 'LottoIndex',
kind: 'LotteryKind',
jackpot: 'Balance',
next_ticket_id: 'u32',
players: 'BTreeMap<AccountId, bool>',
tickets: 'BTreeMap<u32, AccountId>',
result: 'Option<LottoResult>'
},
NameData: {
value: 'Value',
owner: 'AccountId',
expiration: 'Option<u32>'
},
Token: {
hash: 'H256',
symbol: 'Vec<u8>',
total_supply: 'Balance'
},
OrderType: {
_enum: ['Buy', 'Sell']
},
OrderStatus: {
_enum: ['Created', 'PartialFilled', 'Filled', 'Canceled']
},
TradePair: {
hash: 'H256',
base: 'H256',
quote: 'H256',
buy_one_price: 'Option<Price>',
sell_one_price: 'Option<Price>',
latest_matched_price: 'Option<Price>',
one_day_trade_volume: 'Option<Price>',
one_day_highest_price: 'Option<Price>',
one_day_lowest_price: 'Option<Price>'
},
Price: 'u128',
LimitOrder: {
hash: 'H256',
base: 'H256',
quote: 'H256',
owner: 'AccountId',
price: 'Price',
sell_amount: 'Balance',
buy_amount: 'Balance',
remained_sell_amount: 'Balance',
remained_buy_amount: 'Balance',
otype: 'OrderType',
status: 'OrderStatus'
},
Trade: {
hash: 'H256',
base: 'H256',
quote: 'H256',
buyer: 'AccountId',
seller: 'AccountId',
maker: 'AccountId',
taker: 'AccountId',
otype: 'OrderType',
price: 'Price',
base_amount: 'Balance',
quote_amount: 'Balance'
},
OrderLinkedItem: {
prev: 'Option<Price>',
next: 'Option<Price>',
price: 'Option<Price>',
orders: 'Vec<H256>'
},
CollectionMode: {
_enum: {
Invalid: null,
NFT: 'u32',
Fungible: 'u32',
ReFungible: '(u32, u32)'
}
},
NftItemType: {
Collection: 'u64',
Owner: 'AccountId',
Data: 'Vec<u8>',
item_hash: 'H160'
},
FungibleItemType: {
Collection: 'u64',
Owner: 'AccountId',
value: 'u128'
},
ApprovePermissions: {
approved: 'AccountId',
amount: 'u64'
},
AccessMode: {
_enum: ['Normal', 'WhiteList']
},
SaleOrder: {
collection_id: 'u64',
item_id: 'u64',
value: 'u64',
owner: 'AccountId',
price: 'u64'
},
SaleOrderHistory: {
collection_id: 'u64',
item_id: 'u64',
value: 'u64',
seller: 'AccountId',
buyer: 'AccountId',
price: 'u64',
buy_time: 'BlockNumber'
},
SignatureAuthentication: {
collection: 'u64',
item: 'u64',
names: 'Name',
names_owner: 'AccountId',
sign_time: 'BlockNumber',
memo: 'Vec<u8>',
expiration: 'Option<BlockNumber>'
},
Ownership: {
owner: 'AccountId',
fraction: 'u128'
},
ReFungibleItemType: {
Collection: 'u64',
Owner: 'Vec<Ownership>',
Data: 'Vec<u8>'
},
CollectionType: {
Owner: 'AccountId',
Mode: 'CollectionMode',
Access: 'u8',
DecimalPoints: 'u32',
Name: 'Vec<u16>',
Description: 'Vec<u16>',
TokenPrefix: 'Vec<u8>',
CustomDataSize: 'u32',
OffchainSchema: 'Vec<u8>',
Sponsor: 'AccountId',
UnconfirmedSponsor: 'AccountId'
},
Auction: {
id: 'u64',
collection_id: 'u64',
item_id: 'u64',
value: 'u64',
owner: 'AccountId',
start_price: 'u64',
increment: 'u64',
current_price: 'u64',
start_time: 'BlockNumber',
end_time: 'BlockNumber'
},
BidHistory: {
auction_id: 'u64',
bidder: 'AccountId',
bid_price: 'u64',
bid_time: 'BlockNumber'
},
Pool: {
id: 'Id',
account: 'AccountId',
acc_rewards_per_share: 'Balance',
last_reward_block: 'BlockNumber',
asset_id: 'Id',
total_balance: 'Balance'
},
Staker: {
amount: 'Balance',
reward: 'Balance',
debt: 'Balance'
}
]
};
export default definitions;

View File

@ -1,34 +1,47 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
AccountInfo: 'AccountInfoWithRefCount',
AssetId: {
_enum: {
NativeCurrency: null,
ParaCurrency: 'u32'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
AccountInfo: 'AccountInfoWithRefCount',
AssetId: {
_enum: {
NativeCurrency: null,
ParaCurrency: 'u32'
}
},
LookupSource: 'AccountId',
Pair: {
token_0: 'AssetId',
token_1: 'AssetId',
account: 'AccountId',
total_liquidity: 'TokenBalance'
},
PairId: 'u32',
PairInfo: {
token_0: 'AssetId',
token_1: 'AssetId',
account: 'AccountId',
total_liquidity: 'TokenBalance',
holding_liquidity: 'TokenBalance',
reserve_0: 'TokenBalance',
reserve_1: 'TokenBalance'
},
RefCount: 'u32',
TokenBalance: 'u128'
}
}
},
LookupSource: 'AccountId',
Pair: {
token_0: 'AssetId',
token_1: 'AssetId',
account: 'AccountId',
total_liquidity: 'TokenBalance'
},
PairId: 'u32',
PairInfo: {
token_0: 'AssetId',
token_1: 'AssetId',
account: 'AccountId',
total_liquidity: 'TokenBalance',
holding_liquidity: 'TokenBalance',
reserve_0: 'TokenBalance',
reserve_1: 'TokenBalance'
},
RefCount: 'u32',
TokenBalance: 'u128'
]
};
export default definitions;

View File

@ -1,22 +1,34 @@
// Copyright 2017-2021 @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 */
export default {
Address: 'AccountId',
LookupSource: 'AccountId',
Campaign: {
id: 'Hash',
manager: 'AccountId',
deposit: 'Balance',
expiry: 'BlockNumber',
cap: 'Balance',
name: 'Vec<u8>',
protocol: 'u8',
status: 'u8'
},
EventMessage: 'Vec<u8>',
Nonce: 'u64'
const definitions: OverrideBundleDefinition = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Address: 'AccountId',
LookupSource: 'AccountId',
Campaign: {
id: 'Hash',
manager: 'AccountId',
deposit: 'Balance',
expiry: 'BlockNumber',
cap: 'Balance',
name: 'Vec<u8>',
protocol: 'u8',
status: 'u8'
},
EventMessage: 'Vec<u8>',
Nonce: 'u64'
}
}
]
};
export default definitions;

View File

@ -1,188 +0,0 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiInterfaceRx } from '@polkadot/api/types';
import type { Enum, Struct } from '@polkadot/types';
import type { Option } from '@polkadot/types/codec';
import type { AccountId, AccountIndex, AccountInfo, Address, Balance, BlockNumber, Index } from '@polkadot/types/interfaces';
import type { Observable } from '@polkadot/x-rxjs';
import { memo } from '@polkadot/api-derive/util/memo';
import { combineLatest, of } from '@polkadot/x-rxjs';
import { map, switchMap } from '@polkadot/x-rxjs/operators';
interface VestingInfo extends Struct {
readonly locked: Balance;
readonly perBlock: Balance;
readonly startingBlock: BlockNumber;
}
interface SignedBalance extends Enum {
readonly isPositive: boolean;
readonly asPositive: Balance;
readonly isNegative: boolean;
readonly asNegative: Balance;
}
export interface EQDeriveBalancesAll {
additional: []; // fix until vesting instances are supported in api-derive
freeBalance: Balance;
reservedBalance: Balance;
vestingLocked: Balance;
lockedBalance: Balance;
accountId: AccountId;
accountNonce: Index;
lockedBreakdown: unknown[];
}
type Result = [Balance, Balance, Balance, Index];
type RawResult = [
SignedBalance,
Option<Balance>,
Option<VestingInfo>,
AccountInfo
];
type EQDeriveBalancesAccountQuery = (
address: AccountIndex | AccountId | Address | string
) => Observable<{ accountNonce: Index; }>;
type EQDeriveBalancesAllQuery = (
address: AccountIndex | AccountId | Address | string
) => Observable<EQDeriveBalancesAll>;
export default {
derives: {
// TODO derive.democracy.locks
// TODO derice.staking.account
balances: {
account: (
// Compatibility with calc tx fee
instanceId: string,
api: ApiInterfaceRx
): EQDeriveBalancesAccountQuery =>
memo(
instanceId,
(address: AccountId | AccountIndex | Address | string) =>
api.derive.accounts.accountId(address).pipe(
switchMap(
(accountId): Observable<[AccountId, [Index]]> =>
accountId
? combineLatest([
of(accountId),
api
.queryMulti([
[api.query.system.account, accountId]
])
.pipe(
map((raw): [Index] => {
if (raw.length < 1) {
throw new Error('Data expected');
}
const data = raw as [AccountInfo];
return [data[0].nonce];
})
)
])
: of([
api.registry.createType('AccountId'),
[api.registry.createType('Index')]
])
),
map(([, [accountNonce]]) => ({ accountNonce }))
)
),
all: (
// Compatibility for account balance in explorer
instanceId: string,
api: ApiInterfaceRx
): EQDeriveBalancesAllQuery =>
memo(
instanceId,
(address: AccountIndex | AccountId | Address | string) =>
api.derive.accounts.accountId(address).pipe(
switchMap(
(accountId): Observable<[AccountId, Result]> =>
accountId
? combineLatest([
of(accountId),
api
.queryMulti([
[api.query.balances.account, [accountId, 'EQ']],
[api.query.eqVesting.vested, accountId],
[api.query.eqVesting.vesting, accountId],
[api.query.system.account, accountId]
])
.pipe(
map(
(raw): Result => {
if (raw.length < 4) {
throw new Error('4 members expected');
}
const res = raw as RawResult;
const freeBalance = res[0].asPositive;
let reservedBalance = api.registry.createType(
'Balance'
);
let vestingLocked = api.registry.createType(
'Balance'
);
if (res[1].isSome && res[2].isSome) {
const vested = res[1].unwrap();
const info = res[2].unwrap();
vestingLocked = info.locked;
reservedBalance = api.registry.createType(
'Balance',
vestingLocked.sub(vested)
);
}
return [
freeBalance,
reservedBalance,
vestingLocked,
res[3].nonce
];
}
)
)
])
: of([
api.registry.createType('AccountId'),
[
api.registry.createType('Balance'),
api.registry.createType('Balance'),
api.registry.createType('Balance'),
api.registry.createType('Index')
]
])
),
map(
([
accountId,
[freeBalance, reservedBalance, vestingLocked, accountNonce]
]): EQDeriveBalancesAll => ({
accountId,
accountNonce,
additional: [],
freeBalance,
lockedBalance: vestingLocked,
lockedBreakdown: [],
reservedBalance,
vestingLocked
})
)
)
)
}
}
};

View File

@ -1,26 +0,0 @@
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import acala from './acala';
import edgeware from './edgeware';
import equilibrium from './equilibrium';
import kulupu from './kulupu';
import laminar from './laminar';
import moonbeam from './moonbeam';
import polkabtc from './polkabtc';
import soraSubstrate from './soraSubstrate';
export default {
Equilibrium: equilibrium,
acala,
'btc-parachain': polkabtc,
edgeware,
kulupu,
laminar,
mandala: acala,
'moonbase-alphanet': moonbeam,
moonbeam,
'moonbeam-standalone': moonbeam,
'node-moonbeam': moonbeam,
'sora-substrate': soraSubstrate
};

View File

@ -12,7 +12,7 @@ import store from 'store';
import { ApiPromise } from '@polkadot/api/promise';
import { deriveMapCache, setDeriveCache } from '@polkadot/api-derive/util';
import { ethereumChains, typesBundle, typesChain, typesSpec } from '@polkadot/apps-config';
import { ethereumChains, typesBundle, typesChain } from '@polkadot/apps-config';
import { web3Accounts, web3Enable } from '@polkadot/extension-dapp';
import { TokenUnit } from '@polkadot/react-components/InputNumber';
import { StatusContext } from '@polkadot/react-components/Status';
@ -198,7 +198,7 @@ function Api ({ children, store, url }: Props): React.ReactElement<Props> | null
const signer = new ApiSigner(registry, queuePayload, queueSetTxStatus);
const types = getDevTypes();
api = new ApiPromise({ provider, registry, signer, types, typesBundle, typesChain, typesSpec });
api = new ApiPromise({ provider, registry, signer, types, typesBundle, typesChain });
api.on('connected', () => setIsApiConnected(true));
api.on('disconnected', () => setIsApiConnected(false));

View File

@ -7,7 +7,7 @@ import type { LinkOption } from '@polkadot/apps-config/settings/types';
import { useCallback, useEffect, useRef, useState } from 'react';
import { ApiPromise, WsProvider } from '@polkadot/api';
import { typesBundle, typesChain, typesSpec } from '@polkadot/apps-config';
import { typesBundle, typesChain } from '@polkadot/apps-config';
import { useIsMountedRef } from './useIsMountedRef';
import { useParaEndpoints } from './useParaEndpoints';
@ -52,8 +52,7 @@ export function useParaApi (paraId: BN | number): Result {
.create({
provider: new WsProvider(endpoints[endpoints.length - 1].value as string),
typesBundle,
typesChain,
typesSpec
typesChain
})
.then(_setApi)
.catch(console.error);