@qubic.org/contracts 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +285 -0
- package/dist/__generated__/computorcontrolledfund.d.ts +185 -0
- package/dist/__generated__/computorcontrolledfund.d.ts.map +1 -0
- package/dist/__generated__/computorcontrolledfund.js +805 -0
- package/dist/__generated__/computorcontrolledfund.js.map +1 -0
- package/dist/__generated__/escrow.d.ts +103 -0
- package/dist/__generated__/escrow.d.ts.map +1 -0
- package/dist/__generated__/escrow.js +383 -0
- package/dist/__generated__/escrow.js.map +1 -0
- package/dist/__generated__/generalquorumproposal.d.ts +130 -0
- package/dist/__generated__/generalquorumproposal.d.ts.map +1 -0
- package/dist/__generated__/generalquorumproposal.js +499 -0
- package/dist/__generated__/generalquorumproposal.js.map +1 -0
- package/dist/__generated__/index.d.ts +28 -0
- package/dist/__generated__/index.d.ts.map +1 -0
- package/dist/__generated__/index.js +28 -0
- package/dist/__generated__/index.js.map +1 -0
- package/dist/__generated__/msvault.d.ts +336 -0
- package/dist/__generated__/msvault.d.ts.map +1 -0
- package/dist/__generated__/msvault.js +1187 -0
- package/dist/__generated__/msvault.js.map +1 -0
- package/dist/__generated__/multisignvault.d.ts +348 -0
- package/dist/__generated__/multisignvault.d.ts.map +1 -0
- package/dist/__generated__/multisignvault.js +913 -0
- package/dist/__generated__/multisignvault.js.map +1 -0
- package/dist/__generated__/mylastmatch.d.ts +5 -0
- package/dist/__generated__/mylastmatch.d.ts.map +1 -0
- package/dist/__generated__/mylastmatch.js +7 -0
- package/dist/__generated__/mylastmatch.js.map +1 -0
- package/dist/__generated__/nostromo.d.ts +295 -0
- package/dist/__generated__/nostromo.d.ts.map +1 -0
- package/dist/__generated__/nostromo.js +1113 -0
- package/dist/__generated__/nostromo.js.map +1 -0
- package/dist/__generated__/pulse.d.ts +320 -0
- package/dist/__generated__/pulse.d.ts.map +1 -0
- package/dist/__generated__/pulse.js +1024 -0
- package/dist/__generated__/pulse.js.map +1 -0
- package/dist/__generated__/qbay.d.ts +415 -0
- package/dist/__generated__/qbay.d.ts.map +1 -0
- package/dist/__generated__/qbay.js +1486 -0
- package/dist/__generated__/qbay.js.map +1 -0
- package/dist/__generated__/qbond.d.ts +210 -0
- package/dist/__generated__/qbond.d.ts.map +1 -0
- package/dist/__generated__/qbond.js +694 -0
- package/dist/__generated__/qbond.js.map +1 -0
- package/dist/__generated__/qdraw.d.ts +39 -0
- package/dist/__generated__/qdraw.d.ts.map +1 -0
- package/dist/__generated__/qdraw.js +135 -0
- package/dist/__generated__/qdraw.js.map +1 -0
- package/dist/__generated__/qduel.d.ts +171 -0
- package/dist/__generated__/qduel.d.ts.map +1 -0
- package/dist/__generated__/qduel.js +573 -0
- package/dist/__generated__/qduel.js.map +1 -0
- package/dist/__generated__/qearn.d.ts +139 -0
- package/dist/__generated__/qearn.d.ts.map +1 -0
- package/dist/__generated__/qearn.js +471 -0
- package/dist/__generated__/qearn.js.map +1 -0
- package/dist/__generated__/qip.d.ts +84 -0
- package/dist/__generated__/qip.d.ts.map +1 -0
- package/dist/__generated__/qip.js +303 -0
- package/dist/__generated__/qip.js.map +1 -0
- package/dist/__generated__/qraffle.d.ts +235 -0
- package/dist/__generated__/qraffle.d.ts.map +1 -0
- package/dist/__generated__/qraffle.js +798 -0
- package/dist/__generated__/qraffle.js.map +1 -0
- package/dist/__generated__/qreservepool.d.ts +70 -0
- package/dist/__generated__/qreservepool.d.ts.map +1 -0
- package/dist/__generated__/qreservepool.js +177 -0
- package/dist/__generated__/qreservepool.js.map +1 -0
- package/dist/__generated__/qrwa.d.ts +285 -0
- package/dist/__generated__/qrwa.d.ts.map +1 -0
- package/dist/__generated__/qrwa.js +1063 -0
- package/dist/__generated__/qrwa.js.map +1 -0
- package/dist/__generated__/qswap.d.ts +273 -0
- package/dist/__generated__/qswap.d.ts.map +1 -0
- package/dist/__generated__/qswap.js +897 -0
- package/dist/__generated__/qswap.js.map +1 -0
- package/dist/__generated__/qthirtyfour.d.ts +231 -0
- package/dist/__generated__/qthirtyfour.d.ts.map +1 -0
- package/dist/__generated__/qthirtyfour.js +790 -0
- package/dist/__generated__/qthirtyfour.js.map +1 -0
- package/dist/__generated__/qubicicoportal.d.ts +81 -0
- package/dist/__generated__/qubicicoportal.d.ts.map +1 -0
- package/dist/__generated__/qubicicoportal.js +260 -0
- package/dist/__generated__/qubicicoportal.js.map +1 -0
- package/dist/__generated__/quottery.d.ts +308 -0
- package/dist/__generated__/quottery.d.ts.map +1 -0
- package/dist/__generated__/quottery.js +1062 -0
- package/dist/__generated__/quottery.js.map +1 -0
- package/dist/__generated__/qusino.d.ts +172 -0
- package/dist/__generated__/qusino.d.ts.map +1 -0
- package/dist/__generated__/qusino.js +533 -0
- package/dist/__generated__/qusino.js.map +1 -0
- package/dist/__generated__/qutil.d.ts +310 -0
- package/dist/__generated__/qutil.d.ts.map +1 -0
- package/dist/__generated__/qutil.js +1033 -0
- package/dist/__generated__/qutil.js.map +1 -0
- package/dist/__generated__/qvault.d.ts +535 -0
- package/dist/__generated__/qvault.d.ts.map +1 -0
- package/dist/__generated__/qvault.js +2047 -0
- package/dist/__generated__/qvault.js.map +1 -0
- package/dist/__generated__/qx.d.ts +178 -0
- package/dist/__generated__/qx.d.ts.map +1 -0
- package/dist/__generated__/qx.js +586 -0
- package/dist/__generated__/qx.js.map +1 -0
- package/dist/__generated__/random.d.ts +12 -0
- package/dist/__generated__/random.d.ts.map +1 -0
- package/dist/__generated__/random.js +26 -0
- package/dist/__generated__/random.js.map +1 -0
- package/dist/__generated__/randomlottery.d.ts +135 -0
- package/dist/__generated__/randomlottery.d.ts.map +1 -0
- package/dist/__generated__/randomlottery.js +451 -0
- package/dist/__generated__/randomlottery.js.map +1 -0
- package/dist/__generated__/supplywatcher.d.ts +5 -0
- package/dist/__generated__/supplywatcher.d.ts.map +1 -0
- package/dist/__generated__/supplywatcher.js +7 -0
- package/dist/__generated__/supplywatcher.js.map +1 -0
- package/dist/__generated__/vottunbridge.d.ts +226 -0
- package/dist/__generated__/vottunbridge.d.ts.map +1 -0
- package/dist/__generated__/vottunbridge.js +835 -0
- package/dist/__generated__/vottunbridge.js.map +1 -0
- package/dist/call-contract.d.ts +25 -0
- package/dist/call-contract.d.ts.map +1 -0
- package/dist/call-contract.js +41 -0
- package/dist/call-contract.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/result.d.ts +12 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +7 -0
- package/dist/result.js.map +1 -0
- package/package.json +32 -0
|
@@ -0,0 +1,835 @@
|
|
|
1
|
+
import { buildPayload, decodePayload } from '@qubic.org/registry';
|
|
2
|
+
import { callContractFunction } from '../call-contract.js';
|
|
3
|
+
export const VOTTUN_BRIDGE_CONTRACT_INDEX = 25;
|
|
4
|
+
const STRUCTS = {
|
|
5
|
+
'OrderResponse': {
|
|
6
|
+
name: 'OrderResponse',
|
|
7
|
+
byteLength: 213,
|
|
8
|
+
fields: [
|
|
9
|
+
{
|
|
10
|
+
name: 'originAccount',
|
|
11
|
+
type: 'id',
|
|
12
|
+
offset: 0,
|
|
13
|
+
byteLength: 32,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'destinationAccount',
|
|
17
|
+
type: 'array',
|
|
18
|
+
offset: 32,
|
|
19
|
+
byteLength: 64,
|
|
20
|
+
arrayLength: 64,
|
|
21
|
+
arrayItemType: 'uint8',
|
|
22
|
+
arrayItemByteLength: 1,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'orderId',
|
|
26
|
+
type: 'uint64',
|
|
27
|
+
offset: 96,
|
|
28
|
+
byteLength: 8,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'amount',
|
|
32
|
+
type: 'uint64',
|
|
33
|
+
offset: 104,
|
|
34
|
+
byteLength: 8,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'memo',
|
|
38
|
+
type: 'array',
|
|
39
|
+
offset: 112,
|
|
40
|
+
byteLength: 64,
|
|
41
|
+
arrayLength: 64,
|
|
42
|
+
arrayItemType: 'uint8',
|
|
43
|
+
arrayItemByteLength: 1,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'sourceChain',
|
|
47
|
+
type: 'uint32',
|
|
48
|
+
offset: 176,
|
|
49
|
+
byteLength: 4,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'qubicDestination',
|
|
53
|
+
type: 'id',
|
|
54
|
+
offset: 180,
|
|
55
|
+
byteLength: 32,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'status',
|
|
59
|
+
type: 'uint8',
|
|
60
|
+
offset: 212,
|
|
61
|
+
byteLength: 1,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
'AdminProposal': {
|
|
66
|
+
name: 'AdminProposal',
|
|
67
|
+
byteLength: 596,
|
|
68
|
+
fields: [
|
|
69
|
+
{
|
|
70
|
+
name: 'proposalId',
|
|
71
|
+
type: 'uint64',
|
|
72
|
+
offset: 0,
|
|
73
|
+
byteLength: 8,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'proposalType',
|
|
77
|
+
type: 'uint8',
|
|
78
|
+
offset: 8,
|
|
79
|
+
byteLength: 1,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'targetAddress',
|
|
83
|
+
type: 'id',
|
|
84
|
+
offset: 9,
|
|
85
|
+
byteLength: 32,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'oldAddress',
|
|
89
|
+
type: 'id',
|
|
90
|
+
offset: 41,
|
|
91
|
+
byteLength: 32,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'amount',
|
|
95
|
+
type: 'uint64',
|
|
96
|
+
offset: 73,
|
|
97
|
+
byteLength: 8,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'approvals',
|
|
101
|
+
type: 'array',
|
|
102
|
+
offset: 81,
|
|
103
|
+
byteLength: 512,
|
|
104
|
+
arrayLength: 16,
|
|
105
|
+
arrayItemType: 'id',
|
|
106
|
+
arrayItemByteLength: 32,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'approvalsCount',
|
|
110
|
+
type: 'uint8',
|
|
111
|
+
offset: 593,
|
|
112
|
+
byteLength: 1,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'executed',
|
|
116
|
+
type: 'uint8',
|
|
117
|
+
offset: 594,
|
|
118
|
+
byteLength: 1,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'active',
|
|
122
|
+
type: 'uint8',
|
|
123
|
+
offset: 595,
|
|
124
|
+
byteLength: 1,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
'BridgeOrder': {
|
|
129
|
+
name: 'BridgeOrder',
|
|
130
|
+
byteLength: 149,
|
|
131
|
+
fields: [
|
|
132
|
+
{
|
|
133
|
+
name: 'qubicSender',
|
|
134
|
+
type: 'id',
|
|
135
|
+
offset: 0,
|
|
136
|
+
byteLength: 32,
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'qubicDestination',
|
|
140
|
+
type: 'id',
|
|
141
|
+
offset: 32,
|
|
142
|
+
byteLength: 32,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'ethAddress',
|
|
146
|
+
type: 'array',
|
|
147
|
+
offset: 64,
|
|
148
|
+
byteLength: 64,
|
|
149
|
+
arrayLength: 64,
|
|
150
|
+
arrayItemType: 'uint8',
|
|
151
|
+
arrayItemByteLength: 1,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'orderId',
|
|
155
|
+
type: 'uint64',
|
|
156
|
+
offset: 128,
|
|
157
|
+
byteLength: 8,
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'amount',
|
|
161
|
+
type: 'uint64',
|
|
162
|
+
offset: 136,
|
|
163
|
+
byteLength: 8,
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'orderType',
|
|
167
|
+
type: 'uint8',
|
|
168
|
+
offset: 144,
|
|
169
|
+
byteLength: 1,
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'status',
|
|
173
|
+
type: 'uint8',
|
|
174
|
+
offset: 145,
|
|
175
|
+
byteLength: 1,
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: 'fromQubicToEthereum',
|
|
179
|
+
type: 'uint8',
|
|
180
|
+
offset: 146,
|
|
181
|
+
byteLength: 1,
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: 'tokensReceived',
|
|
185
|
+
type: 'uint8',
|
|
186
|
+
offset: 147,
|
|
187
|
+
byteLength: 1,
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'tokensLocked',
|
|
191
|
+
type: 'uint8',
|
|
192
|
+
offset: 148,
|
|
193
|
+
byteLength: 1,
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
export const VOTTUN_BRIDGE_CREATE_ORDER_INPUT_TYPE = 1;
|
|
199
|
+
const VOTTUN_BRIDGE_CREATE_ORDER_INPUT_FIELDS = [
|
|
200
|
+
{
|
|
201
|
+
name: 'qubicDestination',
|
|
202
|
+
type: 'id',
|
|
203
|
+
offset: 0,
|
|
204
|
+
byteLength: 32,
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: 'amount',
|
|
208
|
+
type: 'uint64',
|
|
209
|
+
offset: 32,
|
|
210
|
+
byteLength: 8,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: 'ethAddress',
|
|
214
|
+
type: 'array',
|
|
215
|
+
offset: 40,
|
|
216
|
+
byteLength: 64,
|
|
217
|
+
arrayLength: 64,
|
|
218
|
+
arrayItemType: 'uint8',
|
|
219
|
+
arrayItemByteLength: 1,
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: 'fromQubicToEthereum',
|
|
223
|
+
type: 'uint8',
|
|
224
|
+
offset: 104,
|
|
225
|
+
byteLength: 1,
|
|
226
|
+
},
|
|
227
|
+
];
|
|
228
|
+
export function buildVottunBridgeCreateOrderInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
|
|
229
|
+
return buildPayload(VOTTUN_BRIDGE_CREATE_ORDER_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
|
|
230
|
+
}
|
|
231
|
+
const VOTTUN_BRIDGE_CREATE_ORDER_OUTPUT_FIELDS = [
|
|
232
|
+
{
|
|
233
|
+
name: 'status',
|
|
234
|
+
type: 'uint8',
|
|
235
|
+
offset: 0,
|
|
236
|
+
byteLength: 1,
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: 'orderId',
|
|
240
|
+
type: 'uint64',
|
|
241
|
+
offset: 1,
|
|
242
|
+
byteLength: 8,
|
|
243
|
+
},
|
|
244
|
+
];
|
|
245
|
+
export function decodeVottunBridgeCreateOrderOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
246
|
+
return decodePayload(data, VOTTUN_BRIDGE_CREATE_ORDER_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
247
|
+
}
|
|
248
|
+
export const VOTTUN_BRIDGE_COMPLETE_ORDER_INPUT_TYPE = 3;
|
|
249
|
+
const VOTTUN_BRIDGE_COMPLETE_ORDER_INPUT_FIELDS = [
|
|
250
|
+
{
|
|
251
|
+
name: 'orderId',
|
|
252
|
+
type: 'uint64',
|
|
253
|
+
offset: 0,
|
|
254
|
+
byteLength: 8,
|
|
255
|
+
},
|
|
256
|
+
];
|
|
257
|
+
export function buildVottunBridgeCompleteOrderInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
|
|
258
|
+
return buildPayload(VOTTUN_BRIDGE_COMPLETE_ORDER_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
|
|
259
|
+
}
|
|
260
|
+
const VOTTUN_BRIDGE_COMPLETE_ORDER_OUTPUT_FIELDS = [
|
|
261
|
+
{
|
|
262
|
+
name: 'status',
|
|
263
|
+
type: 'uint8',
|
|
264
|
+
offset: 0,
|
|
265
|
+
byteLength: 1,
|
|
266
|
+
},
|
|
267
|
+
];
|
|
268
|
+
export function decodeVottunBridgeCompleteOrderOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
269
|
+
return decodePayload(data, VOTTUN_BRIDGE_COMPLETE_ORDER_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
270
|
+
}
|
|
271
|
+
export const VOTTUN_BRIDGE_REFUND_ORDER_INPUT_TYPE = 4;
|
|
272
|
+
const VOTTUN_BRIDGE_REFUND_ORDER_INPUT_FIELDS = [
|
|
273
|
+
{
|
|
274
|
+
name: 'orderId',
|
|
275
|
+
type: 'uint64',
|
|
276
|
+
offset: 0,
|
|
277
|
+
byteLength: 8,
|
|
278
|
+
},
|
|
279
|
+
];
|
|
280
|
+
export function buildVottunBridgeRefundOrderInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
|
|
281
|
+
return buildPayload(VOTTUN_BRIDGE_REFUND_ORDER_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
|
|
282
|
+
}
|
|
283
|
+
const VOTTUN_BRIDGE_REFUND_ORDER_OUTPUT_FIELDS = [
|
|
284
|
+
{
|
|
285
|
+
name: 'status',
|
|
286
|
+
type: 'uint8',
|
|
287
|
+
offset: 0,
|
|
288
|
+
byteLength: 1,
|
|
289
|
+
},
|
|
290
|
+
];
|
|
291
|
+
export function decodeVottunBridgeRefundOrderOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
292
|
+
return decodePayload(data, VOTTUN_BRIDGE_REFUND_ORDER_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
293
|
+
}
|
|
294
|
+
export const VOTTUN_BRIDGE_TRANSFER_TO_CONTRACT_INPUT_TYPE = 5;
|
|
295
|
+
const VOTTUN_BRIDGE_TRANSFER_TO_CONTRACT_INPUT_FIELDS = [
|
|
296
|
+
{
|
|
297
|
+
name: 'amount',
|
|
298
|
+
type: 'uint64',
|
|
299
|
+
offset: 0,
|
|
300
|
+
byteLength: 8,
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
name: 'orderId',
|
|
304
|
+
type: 'uint64',
|
|
305
|
+
offset: 8,
|
|
306
|
+
byteLength: 8,
|
|
307
|
+
},
|
|
308
|
+
];
|
|
309
|
+
export function buildVottunBridgeTransferToContractInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
|
|
310
|
+
return buildPayload(VOTTUN_BRIDGE_TRANSFER_TO_CONTRACT_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
|
|
311
|
+
}
|
|
312
|
+
const VOTTUN_BRIDGE_TRANSFER_TO_CONTRACT_OUTPUT_FIELDS = [
|
|
313
|
+
{
|
|
314
|
+
name: 'status',
|
|
315
|
+
type: 'uint8',
|
|
316
|
+
offset: 0,
|
|
317
|
+
byteLength: 1,
|
|
318
|
+
},
|
|
319
|
+
];
|
|
320
|
+
export function decodeVottunBridgeTransferToContractOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
321
|
+
return decodePayload(data, VOTTUN_BRIDGE_TRANSFER_TO_CONTRACT_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
322
|
+
}
|
|
323
|
+
export const VOTTUN_BRIDGE_CREATE_PROPOSAL_INPUT_TYPE = 12;
|
|
324
|
+
const VOTTUN_BRIDGE_CREATE_PROPOSAL_INPUT_FIELDS = [
|
|
325
|
+
{
|
|
326
|
+
name: 'proposalType',
|
|
327
|
+
type: 'uint8',
|
|
328
|
+
offset: 0,
|
|
329
|
+
byteLength: 1,
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
name: 'targetAddress',
|
|
333
|
+
type: 'id',
|
|
334
|
+
offset: 1,
|
|
335
|
+
byteLength: 32,
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
name: 'oldAddress',
|
|
339
|
+
type: 'id',
|
|
340
|
+
offset: 33,
|
|
341
|
+
byteLength: 32,
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: 'amount',
|
|
345
|
+
type: 'uint64',
|
|
346
|
+
offset: 65,
|
|
347
|
+
byteLength: 8,
|
|
348
|
+
},
|
|
349
|
+
];
|
|
350
|
+
export function buildVottunBridgeCreateProposalInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
|
|
351
|
+
return buildPayload(VOTTUN_BRIDGE_CREATE_PROPOSAL_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
|
|
352
|
+
}
|
|
353
|
+
const VOTTUN_BRIDGE_CREATE_PROPOSAL_OUTPUT_FIELDS = [
|
|
354
|
+
{
|
|
355
|
+
name: 'status',
|
|
356
|
+
type: 'uint8',
|
|
357
|
+
offset: 0,
|
|
358
|
+
byteLength: 1,
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: 'proposalId',
|
|
362
|
+
type: 'uint64',
|
|
363
|
+
offset: 1,
|
|
364
|
+
byteLength: 8,
|
|
365
|
+
},
|
|
366
|
+
];
|
|
367
|
+
export function decodeVottunBridgeCreateProposalOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
368
|
+
return decodePayload(data, VOTTUN_BRIDGE_CREATE_PROPOSAL_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
369
|
+
}
|
|
370
|
+
export const VOTTUN_BRIDGE_APPROVE_PROPOSAL_INPUT_TYPE = 13;
|
|
371
|
+
const VOTTUN_BRIDGE_APPROVE_PROPOSAL_INPUT_FIELDS = [
|
|
372
|
+
{
|
|
373
|
+
name: 'proposalId',
|
|
374
|
+
type: 'uint64',
|
|
375
|
+
offset: 0,
|
|
376
|
+
byteLength: 8,
|
|
377
|
+
},
|
|
378
|
+
];
|
|
379
|
+
export function buildVottunBridgeApproveProposalInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
|
|
380
|
+
return buildPayload(VOTTUN_BRIDGE_APPROVE_PROPOSAL_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
|
|
381
|
+
}
|
|
382
|
+
const VOTTUN_BRIDGE_APPROVE_PROPOSAL_OUTPUT_FIELDS = [
|
|
383
|
+
{
|
|
384
|
+
name: 'status',
|
|
385
|
+
type: 'uint8',
|
|
386
|
+
offset: 0,
|
|
387
|
+
byteLength: 1,
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
name: 'executed',
|
|
391
|
+
type: 'uint8',
|
|
392
|
+
offset: 1,
|
|
393
|
+
byteLength: 1,
|
|
394
|
+
},
|
|
395
|
+
];
|
|
396
|
+
export function decodeVottunBridgeApproveProposalOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
397
|
+
return decodePayload(data, VOTTUN_BRIDGE_APPROVE_PROPOSAL_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
398
|
+
}
|
|
399
|
+
export const VOTTUN_BRIDGE_CANCEL_PROPOSAL_INPUT_TYPE = 15;
|
|
400
|
+
const VOTTUN_BRIDGE_CANCEL_PROPOSAL_INPUT_FIELDS = [
|
|
401
|
+
{
|
|
402
|
+
name: 'proposalId',
|
|
403
|
+
type: 'uint64',
|
|
404
|
+
offset: 0,
|
|
405
|
+
byteLength: 8,
|
|
406
|
+
},
|
|
407
|
+
];
|
|
408
|
+
export function buildVottunBridgeCancelProposalInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
|
|
409
|
+
return buildPayload(VOTTUN_BRIDGE_CANCEL_PROPOSAL_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
|
|
410
|
+
}
|
|
411
|
+
const VOTTUN_BRIDGE_CANCEL_PROPOSAL_OUTPUT_FIELDS = [
|
|
412
|
+
{
|
|
413
|
+
name: 'status',
|
|
414
|
+
type: 'uint8',
|
|
415
|
+
offset: 0,
|
|
416
|
+
byteLength: 1,
|
|
417
|
+
},
|
|
418
|
+
];
|
|
419
|
+
export function decodeVottunBridgeCancelProposalOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
420
|
+
return decodePayload(data, VOTTUN_BRIDGE_CANCEL_PROPOSAL_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
421
|
+
}
|
|
422
|
+
export const VOTTUN_BRIDGE_ADD_LIQUIDITY_INPUT_TYPE = 17;
|
|
423
|
+
const VOTTUN_BRIDGE_ADD_LIQUIDITY_OUTPUT_FIELDS = [
|
|
424
|
+
{
|
|
425
|
+
name: 'status',
|
|
426
|
+
type: 'uint8',
|
|
427
|
+
offset: 0,
|
|
428
|
+
byteLength: 1,
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
name: 'addedAmount',
|
|
432
|
+
type: 'uint64',
|
|
433
|
+
offset: 1,
|
|
434
|
+
byteLength: 8,
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
name: 'totalLocked',
|
|
438
|
+
type: 'uint64',
|
|
439
|
+
offset: 9,
|
|
440
|
+
byteLength: 8,
|
|
441
|
+
},
|
|
442
|
+
];
|
|
443
|
+
export function decodeVottunBridgeAddLiquidityOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
444
|
+
return decodePayload(data, VOTTUN_BRIDGE_ADD_LIQUIDITY_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
445
|
+
}
|
|
446
|
+
export const VOTTUN_BRIDGE_GET_TOTAL_RECEIVED_TOKENS_INPUT_TYPE = 2;
|
|
447
|
+
export const VOTTUN_BRIDGE_GET_TOTAL_RECEIVED_TOKENS_INPUT_SIZE = 0;
|
|
448
|
+
const VOTTUN_BRIDGE_GET_TOTAL_RECEIVED_TOKENS_OUTPUT_FIELDS = [
|
|
449
|
+
{
|
|
450
|
+
name: 'totalTokens',
|
|
451
|
+
type: 'uint64',
|
|
452
|
+
offset: 0,
|
|
453
|
+
byteLength: 8,
|
|
454
|
+
},
|
|
455
|
+
];
|
|
456
|
+
export function decodeVottunBridgeGetTotalReceivedTokensOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
457
|
+
return decodePayload(data, VOTTUN_BRIDGE_GET_TOTAL_RECEIVED_TOKENS_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
458
|
+
}
|
|
459
|
+
export async function vottunBridgeGetTotalReceivedTokens(live, options) {
|
|
460
|
+
return callContractFunction({
|
|
461
|
+
live,
|
|
462
|
+
contractIndex: VOTTUN_BRIDGE_CONTRACT_INDEX,
|
|
463
|
+
inputType: VOTTUN_BRIDGE_GET_TOTAL_RECEIVED_TOKENS_INPUT_TYPE,
|
|
464
|
+
inputSize: VOTTUN_BRIDGE_GET_TOTAL_RECEIVED_TOKENS_INPUT_SIZE,
|
|
465
|
+
inputFields: [],
|
|
466
|
+
outputFields: VOTTUN_BRIDGE_GET_TOTAL_RECEIVED_TOKENS_OUTPUT_FIELDS,
|
|
467
|
+
structs: STRUCTS,
|
|
468
|
+
input: {},
|
|
469
|
+
...options,
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
export const VOTTUN_BRIDGE_GET_AVAILABLE_FEES_INPUT_TYPE = 6;
|
|
473
|
+
export const VOTTUN_BRIDGE_GET_AVAILABLE_FEES_INPUT_SIZE = 0;
|
|
474
|
+
const VOTTUN_BRIDGE_GET_AVAILABLE_FEES_OUTPUT_FIELDS = [
|
|
475
|
+
{
|
|
476
|
+
name: 'availableFees',
|
|
477
|
+
type: 'uint64',
|
|
478
|
+
offset: 0,
|
|
479
|
+
byteLength: 8,
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
name: 'totalEarnedFees',
|
|
483
|
+
type: 'uint64',
|
|
484
|
+
offset: 8,
|
|
485
|
+
byteLength: 8,
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
name: 'totalDistributedFees',
|
|
489
|
+
type: 'uint64',
|
|
490
|
+
offset: 16,
|
|
491
|
+
byteLength: 8,
|
|
492
|
+
},
|
|
493
|
+
];
|
|
494
|
+
export function decodeVottunBridgeGetAvailableFeesOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
495
|
+
return decodePayload(data, VOTTUN_BRIDGE_GET_AVAILABLE_FEES_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
496
|
+
}
|
|
497
|
+
export async function vottunBridgeGetAvailableFees(live, options) {
|
|
498
|
+
return callContractFunction({
|
|
499
|
+
live,
|
|
500
|
+
contractIndex: VOTTUN_BRIDGE_CONTRACT_INDEX,
|
|
501
|
+
inputType: VOTTUN_BRIDGE_GET_AVAILABLE_FEES_INPUT_TYPE,
|
|
502
|
+
inputSize: VOTTUN_BRIDGE_GET_AVAILABLE_FEES_INPUT_SIZE,
|
|
503
|
+
inputFields: [],
|
|
504
|
+
outputFields: VOTTUN_BRIDGE_GET_AVAILABLE_FEES_OUTPUT_FIELDS,
|
|
505
|
+
structs: STRUCTS,
|
|
506
|
+
input: {},
|
|
507
|
+
...options,
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
export const VOTTUN_BRIDGE_GET_ORDER_INPUT_TYPE = 7;
|
|
511
|
+
export const VOTTUN_BRIDGE_GET_ORDER_INPUT_SIZE = 8;
|
|
512
|
+
const VOTTUN_BRIDGE_GET_ORDER_INPUT_FIELDS = [
|
|
513
|
+
{
|
|
514
|
+
name: 'orderId',
|
|
515
|
+
type: 'uint64',
|
|
516
|
+
offset: 0,
|
|
517
|
+
byteLength: 8,
|
|
518
|
+
},
|
|
519
|
+
];
|
|
520
|
+
export function buildVottunBridgeGetOrderInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
|
|
521
|
+
return buildPayload(VOTTUN_BRIDGE_GET_ORDER_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
|
|
522
|
+
}
|
|
523
|
+
const VOTTUN_BRIDGE_GET_ORDER_OUTPUT_FIELDS = [
|
|
524
|
+
{
|
|
525
|
+
name: 'status',
|
|
526
|
+
type: 'uint8',
|
|
527
|
+
offset: 0,
|
|
528
|
+
byteLength: 1,
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
name: 'order',
|
|
532
|
+
type: 'struct',
|
|
533
|
+
offset: 1,
|
|
534
|
+
byteLength: 213,
|
|
535
|
+
structRef: 'OrderResponse',
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
name: 'message',
|
|
539
|
+
type: 'array',
|
|
540
|
+
offset: 214,
|
|
541
|
+
byteLength: 32,
|
|
542
|
+
arrayLength: 32,
|
|
543
|
+
arrayItemType: 'uint8',
|
|
544
|
+
arrayItemByteLength: 1,
|
|
545
|
+
},
|
|
546
|
+
];
|
|
547
|
+
export function decodeVottunBridgeGetOrderOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
548
|
+
return decodePayload(data, VOTTUN_BRIDGE_GET_ORDER_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
549
|
+
}
|
|
550
|
+
export async function vottunBridgeGetOrder(live, input, options) {
|
|
551
|
+
return callContractFunction({
|
|
552
|
+
live,
|
|
553
|
+
contractIndex: VOTTUN_BRIDGE_CONTRACT_INDEX,
|
|
554
|
+
inputType: VOTTUN_BRIDGE_GET_ORDER_INPUT_TYPE,
|
|
555
|
+
inputSize: VOTTUN_BRIDGE_GET_ORDER_INPUT_SIZE,
|
|
556
|
+
inputFields: VOTTUN_BRIDGE_GET_ORDER_INPUT_FIELDS,
|
|
557
|
+
outputFields: VOTTUN_BRIDGE_GET_ORDER_OUTPUT_FIELDS,
|
|
558
|
+
structs: STRUCTS,
|
|
559
|
+
input: input,
|
|
560
|
+
...options,
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
export const VOTTUN_BRIDGE_GET_CONTRACT_INFO_INPUT_TYPE = 8;
|
|
564
|
+
export const VOTTUN_BRIDGE_GET_CONTRACT_INFO_INPUT_SIZE = 0;
|
|
565
|
+
const VOTTUN_BRIDGE_GET_CONTRACT_INFO_OUTPUT_FIELDS = [
|
|
566
|
+
{
|
|
567
|
+
name: 'managers',
|
|
568
|
+
type: 'array',
|
|
569
|
+
offset: 0,
|
|
570
|
+
byteLength: 512,
|
|
571
|
+
arrayLength: 16,
|
|
572
|
+
arrayItemType: 'id',
|
|
573
|
+
arrayItemByteLength: 32,
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
name: 'nextOrderId',
|
|
577
|
+
type: 'uint64',
|
|
578
|
+
offset: 512,
|
|
579
|
+
byteLength: 8,
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
name: 'lockedTokens',
|
|
583
|
+
type: 'uint64',
|
|
584
|
+
offset: 520,
|
|
585
|
+
byteLength: 8,
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
name: 'totalReceivedTokens',
|
|
589
|
+
type: 'uint64',
|
|
590
|
+
offset: 528,
|
|
591
|
+
byteLength: 8,
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
name: 'earnedFees',
|
|
595
|
+
type: 'uint64',
|
|
596
|
+
offset: 536,
|
|
597
|
+
byteLength: 8,
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
name: 'tradeFeeBillionths',
|
|
601
|
+
type: 'uint32',
|
|
602
|
+
offset: 544,
|
|
603
|
+
byteLength: 4,
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
name: 'sourceChain',
|
|
607
|
+
type: 'uint32',
|
|
608
|
+
offset: 548,
|
|
609
|
+
byteLength: 4,
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
name: 'firstOrders',
|
|
613
|
+
type: 'array',
|
|
614
|
+
offset: 552,
|
|
615
|
+
byteLength: 2384,
|
|
616
|
+
arrayLength: 16,
|
|
617
|
+
arrayItemByteLength: 149,
|
|
618
|
+
arrayItemStructRef: 'BridgeOrder',
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
name: 'totalOrdersFound',
|
|
622
|
+
type: 'uint64',
|
|
623
|
+
offset: 2936,
|
|
624
|
+
byteLength: 8,
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
name: 'emptySlots',
|
|
628
|
+
type: 'uint64',
|
|
629
|
+
offset: 2944,
|
|
630
|
+
byteLength: 8,
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
name: 'multisigAdmins',
|
|
634
|
+
type: 'array',
|
|
635
|
+
offset: 2952,
|
|
636
|
+
byteLength: 512,
|
|
637
|
+
arrayLength: 16,
|
|
638
|
+
arrayItemType: 'id',
|
|
639
|
+
arrayItemByteLength: 32,
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
name: 'numberOfAdmins',
|
|
643
|
+
type: 'uint8',
|
|
644
|
+
offset: 3464,
|
|
645
|
+
byteLength: 1,
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
name: 'requiredApprovals',
|
|
649
|
+
type: 'uint8',
|
|
650
|
+
offset: 3465,
|
|
651
|
+
byteLength: 1,
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
name: 'totalProposals',
|
|
655
|
+
type: 'uint64',
|
|
656
|
+
offset: 3466,
|
|
657
|
+
byteLength: 8,
|
|
658
|
+
},
|
|
659
|
+
];
|
|
660
|
+
export function decodeVottunBridgeGetContractInfoOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
661
|
+
return decodePayload(data, VOTTUN_BRIDGE_GET_CONTRACT_INFO_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
662
|
+
}
|
|
663
|
+
export async function vottunBridgeGetContractInfo(live, options) {
|
|
664
|
+
return callContractFunction({
|
|
665
|
+
live,
|
|
666
|
+
contractIndex: VOTTUN_BRIDGE_CONTRACT_INDEX,
|
|
667
|
+
inputType: VOTTUN_BRIDGE_GET_CONTRACT_INFO_INPUT_TYPE,
|
|
668
|
+
inputSize: VOTTUN_BRIDGE_GET_CONTRACT_INFO_INPUT_SIZE,
|
|
669
|
+
inputFields: [],
|
|
670
|
+
outputFields: VOTTUN_BRIDGE_GET_CONTRACT_INFO_OUTPUT_FIELDS,
|
|
671
|
+
structs: STRUCTS,
|
|
672
|
+
input: {},
|
|
673
|
+
...options,
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
export const VOTTUN_BRIDGE_GET_TOTAL_LOCKED_TOKENS_INPUT_TYPE = 9;
|
|
677
|
+
export const VOTTUN_BRIDGE_GET_TOTAL_LOCKED_TOKENS_INPUT_SIZE = 0;
|
|
678
|
+
const VOTTUN_BRIDGE_GET_TOTAL_LOCKED_TOKENS_OUTPUT_FIELDS = [
|
|
679
|
+
{
|
|
680
|
+
name: 'totalLockedTokens',
|
|
681
|
+
type: 'uint64',
|
|
682
|
+
offset: 0,
|
|
683
|
+
byteLength: 8,
|
|
684
|
+
},
|
|
685
|
+
];
|
|
686
|
+
export function decodeVottunBridgeGetTotalLockedTokensOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
687
|
+
return decodePayload(data, VOTTUN_BRIDGE_GET_TOTAL_LOCKED_TOKENS_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
688
|
+
}
|
|
689
|
+
export async function vottunBridgeGetTotalLockedTokens(live, options) {
|
|
690
|
+
return callContractFunction({
|
|
691
|
+
live,
|
|
692
|
+
contractIndex: VOTTUN_BRIDGE_CONTRACT_INDEX,
|
|
693
|
+
inputType: VOTTUN_BRIDGE_GET_TOTAL_LOCKED_TOKENS_INPUT_TYPE,
|
|
694
|
+
inputSize: VOTTUN_BRIDGE_GET_TOTAL_LOCKED_TOKENS_INPUT_SIZE,
|
|
695
|
+
inputFields: [],
|
|
696
|
+
outputFields: VOTTUN_BRIDGE_GET_TOTAL_LOCKED_TOKENS_OUTPUT_FIELDS,
|
|
697
|
+
structs: STRUCTS,
|
|
698
|
+
input: {},
|
|
699
|
+
...options,
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
export const VOTTUN_BRIDGE_GET_PROPOSAL_INPUT_TYPE = 14;
|
|
703
|
+
export const VOTTUN_BRIDGE_GET_PROPOSAL_INPUT_SIZE = 8;
|
|
704
|
+
const VOTTUN_BRIDGE_GET_PROPOSAL_INPUT_FIELDS = [
|
|
705
|
+
{
|
|
706
|
+
name: 'proposalId',
|
|
707
|
+
type: 'uint64',
|
|
708
|
+
offset: 0,
|
|
709
|
+
byteLength: 8,
|
|
710
|
+
},
|
|
711
|
+
];
|
|
712
|
+
export function buildVottunBridgeGetProposalInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
|
|
713
|
+
return buildPayload(VOTTUN_BRIDGE_GET_PROPOSAL_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
|
|
714
|
+
}
|
|
715
|
+
const VOTTUN_BRIDGE_GET_PROPOSAL_OUTPUT_FIELDS = [
|
|
716
|
+
{
|
|
717
|
+
name: 'status',
|
|
718
|
+
type: 'uint8',
|
|
719
|
+
offset: 0,
|
|
720
|
+
byteLength: 1,
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
name: 'proposal',
|
|
724
|
+
type: 'struct',
|
|
725
|
+
offset: 1,
|
|
726
|
+
byteLength: 596,
|
|
727
|
+
structRef: 'AdminProposal',
|
|
728
|
+
},
|
|
729
|
+
];
|
|
730
|
+
export function decodeVottunBridgeGetProposalOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
731
|
+
return decodePayload(data, VOTTUN_BRIDGE_GET_PROPOSAL_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
732
|
+
}
|
|
733
|
+
export async function vottunBridgeGetProposal(live, input, options) {
|
|
734
|
+
return callContractFunction({
|
|
735
|
+
live,
|
|
736
|
+
contractIndex: VOTTUN_BRIDGE_CONTRACT_INDEX,
|
|
737
|
+
inputType: VOTTUN_BRIDGE_GET_PROPOSAL_INPUT_TYPE,
|
|
738
|
+
inputSize: VOTTUN_BRIDGE_GET_PROPOSAL_INPUT_SIZE,
|
|
739
|
+
inputFields: VOTTUN_BRIDGE_GET_PROPOSAL_INPUT_FIELDS,
|
|
740
|
+
outputFields: VOTTUN_BRIDGE_GET_PROPOSAL_OUTPUT_FIELDS,
|
|
741
|
+
structs: STRUCTS,
|
|
742
|
+
input: input,
|
|
743
|
+
...options,
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
export const VOTTUN_BRIDGE_GET_ORDER_BY_DETAILS_INPUT_TYPE = 16;
|
|
747
|
+
export const VOTTUN_BRIDGE_GET_ORDER_BY_DETAILS_INPUT_SIZE = 73;
|
|
748
|
+
const VOTTUN_BRIDGE_GET_ORDER_BY_DETAILS_INPUT_FIELDS = [
|
|
749
|
+
{
|
|
750
|
+
name: 'ethAddress',
|
|
751
|
+
type: 'array',
|
|
752
|
+
offset: 0,
|
|
753
|
+
byteLength: 64,
|
|
754
|
+
arrayLength: 64,
|
|
755
|
+
arrayItemType: 'uint8',
|
|
756
|
+
arrayItemByteLength: 1,
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
name: 'amount',
|
|
760
|
+
type: 'uint64',
|
|
761
|
+
offset: 64,
|
|
762
|
+
byteLength: 8,
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
name: 'status',
|
|
766
|
+
type: 'uint8',
|
|
767
|
+
offset: 72,
|
|
768
|
+
byteLength: 1,
|
|
769
|
+
},
|
|
770
|
+
];
|
|
771
|
+
export function buildVottunBridgeGetOrderByDetailsInput(input, identityToPublicKey = (_identity) => new Uint8Array(32)) {
|
|
772
|
+
return buildPayload(VOTTUN_BRIDGE_GET_ORDER_BY_DETAILS_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
|
|
773
|
+
}
|
|
774
|
+
const VOTTUN_BRIDGE_GET_ORDER_BY_DETAILS_OUTPUT_FIELDS = [
|
|
775
|
+
{
|
|
776
|
+
name: 'status',
|
|
777
|
+
type: 'uint8',
|
|
778
|
+
offset: 0,
|
|
779
|
+
byteLength: 1,
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
name: 'orderId',
|
|
783
|
+
type: 'uint64',
|
|
784
|
+
offset: 1,
|
|
785
|
+
byteLength: 8,
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
name: 'qubicDestination',
|
|
789
|
+
type: 'id',
|
|
790
|
+
offset: 9,
|
|
791
|
+
byteLength: 32,
|
|
792
|
+
},
|
|
793
|
+
];
|
|
794
|
+
export function decodeVottunBridgeGetOrderByDetailsOutput(data, publicKeyToIdentity = (_pk) => 'A'.repeat(60)) {
|
|
795
|
+
return decodePayload(data, VOTTUN_BRIDGE_GET_ORDER_BY_DETAILS_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
|
|
796
|
+
}
|
|
797
|
+
export async function vottunBridgeGetOrderByDetails(live, input, options) {
|
|
798
|
+
return callContractFunction({
|
|
799
|
+
live,
|
|
800
|
+
contractIndex: VOTTUN_BRIDGE_CONTRACT_INDEX,
|
|
801
|
+
inputType: VOTTUN_BRIDGE_GET_ORDER_BY_DETAILS_INPUT_TYPE,
|
|
802
|
+
inputSize: VOTTUN_BRIDGE_GET_ORDER_BY_DETAILS_INPUT_SIZE,
|
|
803
|
+
inputFields: VOTTUN_BRIDGE_GET_ORDER_BY_DETAILS_INPUT_FIELDS,
|
|
804
|
+
outputFields: VOTTUN_BRIDGE_GET_ORDER_BY_DETAILS_OUTPUT_FIELDS,
|
|
805
|
+
structs: STRUCTS,
|
|
806
|
+
input: input,
|
|
807
|
+
...options,
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
export const vottunBridge = {
|
|
811
|
+
contractIndex: VOTTUN_BRIDGE_CONTRACT_INDEX,
|
|
812
|
+
getTotalReceivedTokens: vottunBridgeGetTotalReceivedTokens,
|
|
813
|
+
getAvailableFees: vottunBridgeGetAvailableFees,
|
|
814
|
+
getOrder: vottunBridgeGetOrder,
|
|
815
|
+
getContractInfo: vottunBridgeGetContractInfo,
|
|
816
|
+
getTotalLockedTokens: vottunBridgeGetTotalLockedTokens,
|
|
817
|
+
getProposal: vottunBridgeGetProposal,
|
|
818
|
+
getOrderByDetails: vottunBridgeGetOrderByDetails,
|
|
819
|
+
buildCreateOrderInput: buildVottunBridgeCreateOrderInput,
|
|
820
|
+
decodeCreateOrderOutput: decodeVottunBridgeCreateOrderOutput,
|
|
821
|
+
buildCompleteOrderInput: buildVottunBridgeCompleteOrderInput,
|
|
822
|
+
decodeCompleteOrderOutput: decodeVottunBridgeCompleteOrderOutput,
|
|
823
|
+
buildRefundOrderInput: buildVottunBridgeRefundOrderInput,
|
|
824
|
+
decodeRefundOrderOutput: decodeVottunBridgeRefundOrderOutput,
|
|
825
|
+
buildTransferToContractInput: buildVottunBridgeTransferToContractInput,
|
|
826
|
+
decodeTransferToContractOutput: decodeVottunBridgeTransferToContractOutput,
|
|
827
|
+
buildCreateProposalInput: buildVottunBridgeCreateProposalInput,
|
|
828
|
+
decodeCreateProposalOutput: decodeVottunBridgeCreateProposalOutput,
|
|
829
|
+
buildApproveProposalInput: buildVottunBridgeApproveProposalInput,
|
|
830
|
+
decodeApproveProposalOutput: decodeVottunBridgeApproveProposalOutput,
|
|
831
|
+
buildCancelProposalInput: buildVottunBridgeCancelProposalInput,
|
|
832
|
+
decodeCancelProposalOutput: decodeVottunBridgeCancelProposalOutput,
|
|
833
|
+
decodeAddLiquidityOutput: decodeVottunBridgeAddLiquidityOutput,
|
|
834
|
+
};
|
|
835
|
+
//# sourceMappingURL=vottunbridge.js.map
|