-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathorigintrail.ts
164 lines (157 loc) · 4.54 KB
/
origintrail.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
// Copyright 2017-2021 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { DefinitionRpc, DefinitionRpcSub, OverrideBundleDefinition, OverrideBundleType } from '@polkadot/types/types';
// structs need to be in order
/* eslint-disable sort-keys */
export const rpcDefinitions: Record<string, Record<string, DefinitionRpc | DefinitionRpcSub>> = {
txpool: {
content: {
aliasSection: 'txpool',
description:
'The detailed information regarding Ethereum transactions that are currently in the ' +
'Substrate transaction pool.',
params: [],
type: 'TxPoolResultContent'
},
inspect: {
aliasSection: 'txpool',
description:
'Summarized information of the Ethereum transactions that are currently in the Substrate' +
' transaction pool.',
params: [],
type: 'TxPoolResultInspect'
},
status: {
aliasSection: 'txpool',
description:
'The number of Ethereum transaction that are currently in the Substrate transaction pool.',
params: [],
type: 'TxPoolResultStatus'
}
}
};
// structs need to be in order
/* eslint-disable sort-keys */
const origintrailDefinitions = {
rpc: rpcDefinitions,
types: [
{
minmax: [0, undefined],
types: {
AccountId: 'EthereumAccountId',
AccountId32: 'H256',
AccountInfo: 'AccountInfoWithTripleRefCount',
Address: 'AccountId',
AuthorId: 'AccountId32',
Balance: 'u128',
LookupSource: 'AccountId',
Account: {
nonce: 'U256',
balance: 'u128'
},
ExtrinsicSignature: 'EthereumSignature',
RoundIndex: 'u32',
Candidate: {
id: 'AccountId',
fee: 'Perbill',
bond: 'Balance',
nominators: 'Vec<Bond>',
total: 'Balance',
state: 'CollatorStatus'
},
Nominator: {
nominations: 'Vec<Bond>',
total: 'Balance'
},
Bond: {
owner: 'AccountId',
amount: 'Balance'
},
CollatorStatus: {
_enum: ['Active', 'Idle', { Leaving: 'RoundIndex' }]
},
TxPoolResultContent: {
pending: 'HashMap<H160, HashMap<U256, PoolTransaction>>',
queued: 'HashMap<H160, HashMap<U256, PoolTransaction>>'
},
TxPoolResultInspect: {
pending: 'HashMap<H160, HashMap<U256, Summary>>',
queued: 'HashMap<H160, HashMap<U256, Summary>>'
},
TxPoolResultStatus: {
pending: 'U256',
queued: 'U256'
},
Summary: 'Bytes',
PoolTransaction: {
hash: 'H256',
nonce: 'U256',
block_hash: 'Option<H256>',
block_number: 'Option<U256>',
from: 'H160',
to: 'Option<H160>',
value: 'U256',
gas_price: 'U256',
gas: 'U256',
input: 'Bytes'
},
// Staking inflation
Range: 'RangeBalance',
RangeBalance: {
min: 'Balance',
ideal: 'Balance',
max: 'Balance'
},
RangePerbill: {
min: 'Perbill',
ideal: 'Perbill',
max: 'Perbill'
},
InflationInfo: {
expect: 'RangeBalance',
annual: 'RangePerbill',
round: 'RangePerbill'
},
OrderedSet: 'Vec<Bond>',
Collator: {
id: 'AccountId',
bond: 'Balance',
nominators: 'Vec<Bond>',
total: 'Balance',
state: 'CollatorStatus'
},
CollatorSnapshot: {
bond: 'Balance',
nominators: 'Vec<Bond>',
total: 'Balance'
},
SystemInherentData: {
validation_data: 'PersistedValidationData',
relay_chain_state: 'StorageProof',
downward_messages: 'Vec<InboundDownwardMessage>',
horizontal_messages: 'BTreeMap<ParaId, Vec<InboundHrmpMessage>>'
},
RelayChainAccountId: 'AccountId32',
RoundInfo: {
current: 'RoundIndex',
first: 'BlockNumber',
length: 'u32'
},
RewardInfo: {
total_reward: 'Balance',
claimed_reward: 'Balance'
},
RegistrationInfo: {
account: 'AccountId',
deposit: 'Balance'
}
}
}
]
} as OverrideBundleDefinition;
export default origintrailDefinitions;
export const typesBundle = {
spec: {
'origintrail-parachain': origintrailDefinitions
}
} as OverrideBundleType;