forked from polkadot-js/apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
encointer-para.ts
258 lines (248 loc) · 8.25 KB
/
encointer-para.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
// Copyright 2017-2022 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { OverrideBundleDefinition } from '@polkadot/types/types';
// structs need to be in order
/* eslint-disable sort-keys */
const definitions: OverrideBundleDefinition = {
types: [
{
// metadata v14 was introduced here. Hence, we don't need type overrides anymore.
minmax: [3, undefined],
types: {
CommunityIdentifier: {
geohash: 'GeoHash',
digest: 'CidDigest'
},
GeoHash: '[u8; 5]',
// We need to call it `CidDigest` because plain `Digest` is already a substrate type.
CidDigest: '[u8; 4]'
}
},
{
// until metadata v14
minmax: [0, 2],
types: {
ShardIdentifier: 'Hash',
GetterArgs: '(AccountId, CommunityIdentifier)',
Enclave: {
pubkey: 'AccountId',
mrenclave: 'Hash',
timestamp: 'u64',
url: 'Text'
},
PublicGetter: {
_enum: {
total_issuance: 'CommunityIdentifier',
participant_count: 'CommunityIdentifier',
meetup_count: 'CommunityIdentifier',
ceremony_reward: 'CommunityIdentifier',
location_tolerance: 'CommunityIdentifier',
time_tolerance: 'CommunityIdentifier',
scheduler_state: 'CommunityIdentifier'
}
},
TrustedGetter: {
_enum: {
balance: '(AccountId, CommunityIdentifier)',
participant_index: '(AccountId, CommunityIdentifier)',
meetup_index: '(AccountId, CommunityIdentifier)',
attestations: '(AccountId, CommunityIdentifier)',
meetup_registry: '(AccountId, CommunityIdentifier)'
}
},
TrustedGetterSigned: {
getter: 'TrustedGetter',
signature: 'Signature'
},
Getter: {
_enum: {
public: 'PublicGetter',
trusted: 'TrustedGetterSigned'
}
},
ClientRequest: {
_enum: {
PubKeyWorker: null,
MuRaPortWorker: null,
StfState: '(Getter, ShardIdentifier)'
}
},
WorkerEncoded: 'Vec<u8>',
Request: {
shard: 'ShardIdentifier',
cyphertext: 'WorkerEncoded'
},
TrustedCallSigned: {
call: 'TrustedCall',
nonce: 'u32',
signature: 'Signature'
},
TrustedCall: {
_enum: {
balance_transfer: 'BalanceTransferArgs',
ceremonies_register_participant: 'RegisterParticipantArgs',
ceremonies_register_attestations: 'RegisterAttestationsArgs',
ceremonies_grant_reputation: 'GrantReputationArgs'
}
},
BalanceTransferArgs: '(AccountId, AccountId, CommunityIdentifier, BalanceType)',
RegisterParticipantArgs: '(AccountId, CommunityIdentifier, Option<ProofOfAttendance<MultiSignature, AccountId>>)',
RegisterAttestationsArgs: '(AccountId, Vec<Attestation<MultiSignature, AccountId, u64>>)',
GrantReputationArgs: '(AccountId, CommunityIdentifier, AccountId)',
BalanceType: 'i128',
BalanceEntry: {
principal: 'BalanceType',
lastUpdate: 'BlockNumber'
},
Demurrage: 'BalanceType',
BusinessIdentifier: {
communityIdentifier: 'CommunityIdentifier',
controller: 'AccountId'
},
OfferingIdentifier: 'u32',
BusinessData: {
url: 'PalletString',
last_oid: 'u32'
},
OfferingData: {
url: 'PalletString'
},
PalletString: 'Text',
IpfsCid: 'Text',
FixedI64F64: {
bits: 'i128'
},
CeremonyIndexType: 'u32',
CeremonyPhaseType: {
_enum: ['Registering', 'Assigning', 'Attesting']
},
ParticipantIndexType: 'u64',
MeetupIndexType: 'u64',
AttestationIndexType: 'u64',
MeetupAssignment: '(MeetupIndexType, Option<Location>)',
MeetupTimeOffsetType: 'i32',
Reputation: {
_enum: ['Unverified', 'UnverifiedReputable', 'VerifiedUnlinked', 'VerifiedLinked']
},
CommunityReputation: {
communityIdentifier: 'CommunityIdentifier',
reputation: 'Reputation'
},
ClaimOfAttendance: {
claimantPublic: 'AccountId',
ceremonyIndex: 'CeremonyIndexType',
communityIdentifier: 'CommunityIdentifier',
meetupIndex: 'MeetupIndexType',
location: 'Location',
timestamp: 'Moment',
numberOfParticipantsConfirmed: 'u32',
claimantSignature: 'Option<MultiSignature>'
},
ClaimOfAttendanceSigningPayload: {
claimantPublic: 'AccountId',
ceremonyIndex: 'CeremonyIndexType',
communityIdentifier: 'CommunityIdentifier',
meetupIndex: 'MeetupIndexType',
location: 'Location',
timestamp: 'Moment',
numberOfParticipantsConfirmed: 'u32'
},
AssignmentCount: {
bootstrappers: 'ParticipantIndexType',
reputables: 'ParticipantIndexType',
endorsees: 'ParticipantIndexType',
newbies: 'ParticipantIndexType'
},
Assignment: {
bootstrappersReputables: 'AssignmentParams',
endorsees: 'AssignmentParams',
newbies: 'AssignmentParams',
locations: 'AssignmentParams'
},
AssignmentParams: {
m: 'u64',
s1: 'u64',
s2: 'u64'
},
CommunityCeremonyStats: {
communityCeremony: '(CommunityIdentifier, CeremonyIndexType)',
assignment: 'Assignment',
assignmentCount: 'AssignmentCount',
meetupCount: 'MeetupIndexType',
meetups: 'Vec<Meetup>'
},
Meetup: {
index: 'MeetupIndexType',
location: 'LocationRpc',
time: 'Moment',
registrations: 'Vec<(AccountId, ParticipantRegistration)>'
},
ParticipantRegistration: {
index: 'ParticipantIndexType',
registrationType: 'RegistrationType'
},
RegistrationType: {
_enum: ['Bootstrapper', 'Reputable', 'Endorsee', 'Newbie']
},
// Todo: remove this type does no longer exist in ceremonies, but it still exists in the trusted stuff.
Attestation: {
claim: 'ClaimOfAttendance',
signature: 'MultiSignature',
public: 'AccountId'
},
ProofOfAttendance: {
proverPublic: 'AccountId',
ceremonyIndex: 'CeremonyIndexType',
communityIdentifier: 'CommunityIdentifier',
attendeePublic: 'AccountId',
attendeeSignature: 'MultiSignature'
},
CommunityIdentifier: {
geohash: 'GeoHash',
digest: 'CidDigest'
},
GeoHash: '[u8; 5]',
// We need to call it `CidDigest` because plain `Digest` is already a substrate type.
CidDigest: '[u8; 4]',
CommunityCeremony: '(CommunityIdentifier,CeremonyIndexType)',
NominalIncomeType: 'BalanceType',
// This is used when handling fixed-point numbers that have been serialized with `serialize_fixed` on rusts end,
// which is the case when we call any rpc-getters.
DegreeRpc: 'Text',
// This is used when we need to encode fixed-point numbers with scale-codec, e.g., when using it in an extrinsic.
DegreeFixed: 'i128',
Location: {
lat: 'DegreeFixed',
lon: 'DegreeFixed'
},
LocationRpc: {
lat: 'DegreeRpc',
lon: 'DegreeRpc'
},
CidName: {
cid: 'CommunityIdentifier',
name: 'Text'
},
CommunityMetadataType: {
name: 'Text',
symbol: 'Text',
assets: 'Text',
theme: 'Option<Text>',
url: 'Option<Text>'
},
SystemNumber: 'u32',
SchedulerState: '(CeremonyIndexType, CeremonyPhaseType, SystemNumber)'
}
}
],
signedExtensions: {
ChargeAssetTxPayment: {
extrinsic: {
tip: 'Compact<Balance>',
assetId: 'Option<CommunityIdentifier>'
},
payload: {}
}
}
};
export default definitions;