@qubic.org/contracts 0.2.6 → 1.0.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.
Files changed (163) hide show
  1. package/LICENSE +41 -0
  2. package/README.md +15 -18
  3. package/dist/__generated__/computorcontrolledfund.d.ts +1 -1
  4. package/dist/__generated__/computorcontrolledfund.d.ts.map +1 -1
  5. package/dist/__generated__/computorcontrolledfund.js +8 -8
  6. package/dist/__generated__/computorcontrolledfund.js.map +1 -1
  7. package/dist/__generated__/escrow.d.ts +1 -1
  8. package/dist/__generated__/escrow.d.ts.map +1 -1
  9. package/dist/__generated__/escrow.js +3 -3
  10. package/dist/__generated__/escrow.js.map +1 -1
  11. package/dist/__generated__/generalquorumproposal.d.ts +1 -1
  12. package/dist/__generated__/generalquorumproposal.d.ts.map +1 -1
  13. package/dist/__generated__/generalquorumproposal.js +6 -6
  14. package/dist/__generated__/generalquorumproposal.js.map +1 -1
  15. package/dist/__generated__/ggwp.d.ts +265 -0
  16. package/dist/__generated__/ggwp.d.ts.map +1 -0
  17. package/dist/__generated__/ggwp.js +825 -0
  18. package/dist/__generated__/ggwp.js.map +1 -0
  19. package/dist/__generated__/index.d.ts +1 -0
  20. package/dist/__generated__/index.d.ts.map +1 -1
  21. package/dist/__generated__/index.js +1 -0
  22. package/dist/__generated__/index.js.map +1 -1
  23. package/dist/__generated__/msvault.d.ts +1 -1
  24. package/dist/__generated__/msvault.d.ts.map +1 -1
  25. package/dist/__generated__/msvault.js +19 -19
  26. package/dist/__generated__/msvault.js.map +1 -1
  27. package/dist/__generated__/multisignvault.d.ts +25 -25
  28. package/dist/__generated__/multisignvault.d.ts.map +1 -1
  29. package/dist/__generated__/multisignvault.js +25 -25
  30. package/dist/__generated__/multisignvault.js.map +1 -1
  31. package/dist/__generated__/nostromo.d.ts +1 -1
  32. package/dist/__generated__/nostromo.d.ts.map +1 -1
  33. package/dist/__generated__/nostromo.js +15 -15
  34. package/dist/__generated__/nostromo.js.map +1 -1
  35. package/dist/__generated__/pulse.d.ts +1 -1
  36. package/dist/__generated__/pulse.d.ts.map +1 -1
  37. package/dist/__generated__/pulse.js +26 -26
  38. package/dist/__generated__/pulse.js.map +1 -1
  39. package/dist/__generated__/qbay.d.ts +1 -1
  40. package/dist/__generated__/qbay.d.ts.map +1 -1
  41. package/dist/__generated__/qbay.js +23 -23
  42. package/dist/__generated__/qbay.js.map +1 -1
  43. package/dist/__generated__/qbond.d.ts +1 -1
  44. package/dist/__generated__/qbond.d.ts.map +1 -1
  45. package/dist/__generated__/qbond.js +14 -14
  46. package/dist/__generated__/qbond.js.map +1 -1
  47. package/dist/__generated__/qdraw.d.ts +1 -1
  48. package/dist/__generated__/qdraw.d.ts.map +1 -1
  49. package/dist/__generated__/qdraw.js.map +1 -1
  50. package/dist/__generated__/qduel.d.ts +1 -1
  51. package/dist/__generated__/qduel.d.ts.map +1 -1
  52. package/dist/__generated__/qduel.js +11 -11
  53. package/dist/__generated__/qduel.js.map +1 -1
  54. package/dist/__generated__/qearn.d.ts +1 -1
  55. package/dist/__generated__/qearn.d.ts.map +1 -1
  56. package/dist/__generated__/qearn.js +10 -10
  57. package/dist/__generated__/qearn.js.map +1 -1
  58. package/dist/__generated__/qip.d.ts +18 -1
  59. package/dist/__generated__/qip.d.ts.map +1 -1
  60. package/dist/__generated__/qip.js +64 -3
  61. package/dist/__generated__/qip.js.map +1 -1
  62. package/dist/__generated__/qraffle.d.ts +1 -1
  63. package/dist/__generated__/qraffle.d.ts.map +1 -1
  64. package/dist/__generated__/qraffle.js +12 -12
  65. package/dist/__generated__/qraffle.js.map +1 -1
  66. package/dist/__generated__/qreservepool.d.ts +1 -1
  67. package/dist/__generated__/qreservepool.d.ts.map +1 -1
  68. package/dist/__generated__/qreservepool.js +5 -5
  69. package/dist/__generated__/qreservepool.js.map +1 -1
  70. package/dist/__generated__/qrwa.d.ts +1 -1
  71. package/dist/__generated__/qrwa.d.ts.map +1 -1
  72. package/dist/__generated__/qrwa.js +18 -18
  73. package/dist/__generated__/qrwa.js.map +1 -1
  74. package/dist/__generated__/qswap.d.ts +3 -1
  75. package/dist/__generated__/qswap.d.ts.map +1 -1
  76. package/dist/__generated__/qswap.js +30 -18
  77. package/dist/__generated__/qswap.js.map +1 -1
  78. package/dist/__generated__/qthirtyfour.d.ts +1 -1
  79. package/dist/__generated__/qthirtyfour.d.ts.map +1 -1
  80. package/dist/__generated__/qthirtyfour.js +19 -19
  81. package/dist/__generated__/qthirtyfour.js.map +1 -1
  82. package/dist/__generated__/qubicicoportal.d.ts +4 -4
  83. package/dist/__generated__/qubicicoportal.d.ts.map +1 -1
  84. package/dist/__generated__/qubicicoportal.js +4 -4
  85. package/dist/__generated__/qubicicoportal.js.map +1 -1
  86. package/dist/__generated__/quottery.d.ts +1 -1
  87. package/dist/__generated__/quottery.d.ts.map +1 -1
  88. package/dist/__generated__/quottery.js +14 -14
  89. package/dist/__generated__/quottery.js.map +1 -1
  90. package/dist/__generated__/qusino.d.ts +1 -1
  91. package/dist/__generated__/qusino.d.ts.map +1 -1
  92. package/dist/__generated__/qusino.js +13 -13
  93. package/dist/__generated__/qusino.js.map +1 -1
  94. package/dist/__generated__/qutil.d.ts +1 -1
  95. package/dist/__generated__/qutil.d.ts.map +1 -1
  96. package/dist/__generated__/qutil.js +22 -22
  97. package/dist/__generated__/qutil.js.map +1 -1
  98. package/dist/__generated__/qvault.d.ts +14 -2
  99. package/dist/__generated__/qvault.d.ts.map +1 -1
  100. package/dist/__generated__/qvault.js +70 -32
  101. package/dist/__generated__/qvault.js.map +1 -1
  102. package/dist/__generated__/qx.d.ts +1 -1
  103. package/dist/__generated__/qx.d.ts.map +1 -1
  104. package/dist/__generated__/qx.js +12 -12
  105. package/dist/__generated__/qx.js.map +1 -1
  106. package/dist/__generated__/random.d.ts +24 -1
  107. package/dist/__generated__/random.d.ts.map +1 -1
  108. package/dist/__generated__/random.js +68 -0
  109. package/dist/__generated__/random.js.map +1 -1
  110. package/dist/__generated__/randomlottery.d.ts +1 -1
  111. package/dist/__generated__/randomlottery.d.ts.map +1 -1
  112. package/dist/__generated__/randomlottery.js +12 -12
  113. package/dist/__generated__/randomlottery.js.map +1 -1
  114. package/dist/__generated__/vottunbridge.d.ts +1 -1
  115. package/dist/__generated__/vottunbridge.d.ts.map +1 -1
  116. package/dist/__generated__/vottunbridge.js +13 -13
  117. package/dist/__generated__/vottunbridge.js.map +1 -1
  118. package/dist/call-contract.d.ts.map +1 -1
  119. package/dist/call-contract.js +6 -1
  120. package/dist/call-contract.js.map +1 -1
  121. package/dist/index.d.ts +2 -2
  122. package/dist/index.d.ts.map +1 -1
  123. package/dist/index.js +1 -1
  124. package/dist/index.js.map +1 -1
  125. package/package.json +7 -6
  126. package/src/__generated__/computorcontrolledfund.ts +1066 -0
  127. package/src/__generated__/escrow.ts +529 -0
  128. package/src/__generated__/generalquorumproposal.ts +691 -0
  129. package/src/__generated__/ggwp.ts +1241 -0
  130. package/src/__generated__/index.ts +28 -0
  131. package/src/__generated__/msvault.ts +1716 -0
  132. package/src/__generated__/multisignvault.ts +1511 -0
  133. package/src/__generated__/mylastmatch.ts +12 -0
  134. package/src/__generated__/nostromo.ts +1551 -0
  135. package/src/__generated__/pulse.ts +1512 -0
  136. package/src/__generated__/qbay.ts +2097 -0
  137. package/src/__generated__/qbond.ts +1016 -0
  138. package/src/__generated__/qdraw.ts +188 -0
  139. package/src/__generated__/qduel.ts +827 -0
  140. package/src/__generated__/qearn.ts +696 -0
  141. package/src/__generated__/qip.ts +501 -0
  142. package/src/__generated__/qraffle.ts +1162 -0
  143. package/src/__generated__/qreservepool.ts +281 -0
  144. package/src/__generated__/qrwa.ts +1491 -0
  145. package/src/__generated__/qswap.ts +1336 -0
  146. package/src/__generated__/qthirtyfour.ts +1131 -0
  147. package/src/__generated__/qubicicoportal.ts +386 -0
  148. package/src/__generated__/quottery.ts +1519 -0
  149. package/src/__generated__/qusino.ts +799 -0
  150. package/src/__generated__/qutil.ts +1506 -0
  151. package/src/__generated__/qvault.ts +2911 -0
  152. package/src/__generated__/qx.ts +861 -0
  153. package/src/__generated__/random.ts +145 -0
  154. package/src/__generated__/randomlottery.ts +653 -0
  155. package/src/__generated__/supplywatcher.ts +12 -0
  156. package/src/__generated__/vottunbridge.ts +1162 -0
  157. package/src/__tests__/contracts.test.ts +933 -0
  158. package/src/call-contract.ts +87 -0
  159. package/src/index.ts +9 -0
  160. package/dist/result.d.ts +0 -12
  161. package/dist/result.d.ts.map +0 -1
  162. package/dist/result.js +0 -7
  163. package/dist/result.js.map +0 -1
@@ -0,0 +1,825 @@
1
+ import { buildPayload, decodePayload } from '@qubic.org/registry';
2
+ import { callContractFunction } from '../call-contract.js';
3
+ export const GGWP_CONTRACT_INDEX = 28;
4
+ const STRUCTS = {};
5
+ export const GGWP_DEPOSIT_REVENUE_INPUT_TYPE = 1;
6
+ const GGWP_DEPOSIT_REVENUE_OUTPUT_FIELDS = [
7
+ {
8
+ name: 'returnCode',
9
+ type: 'uint32',
10
+ offset: 0,
11
+ byteLength: 4,
12
+ },
13
+ ];
14
+ export function decodeGGWPDepositRevenueOutput(data) {
15
+ return decodePayload(data, GGWP_DEPOSIT_REVENUE_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
16
+ }
17
+ export const GGWP_ADD_CLAN_MEMBER_INPUT_TYPE = 2;
18
+ const GGWP_ADD_CLAN_MEMBER_INPUT_FIELDS = [
19
+ {
20
+ name: 'memberAddress',
21
+ type: 'id',
22
+ offset: 0,
23
+ byteLength: 32,
24
+ },
25
+ {
26
+ name: 'rank',
27
+ type: 'uint64',
28
+ offset: 32,
29
+ byteLength: 8,
30
+ },
31
+ ];
32
+ export function buildGGWPAddClanMemberInput(input, identityToPublicKey) {
33
+ return { contractIndex: GGWP_CONTRACT_INDEX, inputType: GGWP_ADD_CLAN_MEMBER_INPUT_TYPE, payload: buildPayload(GGWP_ADD_CLAN_MEMBER_INPUT_FIELDS, STRUCTS, input, identityToPublicKey) };
34
+ }
35
+ const GGWP_ADD_CLAN_MEMBER_OUTPUT_FIELDS = [
36
+ {
37
+ name: 'returnCode',
38
+ type: 'uint32',
39
+ offset: 0,
40
+ byteLength: 4,
41
+ },
42
+ ];
43
+ export function decodeGGWPAddClanMemberOutput(data) {
44
+ return decodePayload(data, GGWP_ADD_CLAN_MEMBER_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
45
+ }
46
+ export const GGWP_REMOVE_CLAN_MEMBER_INPUT_TYPE = 3;
47
+ const GGWP_REMOVE_CLAN_MEMBER_INPUT_FIELDS = [
48
+ {
49
+ name: 'memberAddress',
50
+ type: 'id',
51
+ offset: 0,
52
+ byteLength: 32,
53
+ },
54
+ ];
55
+ export function buildGGWPRemoveClanMemberInput(input, identityToPublicKey) {
56
+ return { contractIndex: GGWP_CONTRACT_INDEX, inputType: GGWP_REMOVE_CLAN_MEMBER_INPUT_TYPE, payload: buildPayload(GGWP_REMOVE_CLAN_MEMBER_INPUT_FIELDS, STRUCTS, input, identityToPublicKey) };
57
+ }
58
+ const GGWP_REMOVE_CLAN_MEMBER_OUTPUT_FIELDS = [
59
+ {
60
+ name: 'returnCode',
61
+ type: 'uint32',
62
+ offset: 0,
63
+ byteLength: 4,
64
+ },
65
+ ];
66
+ export function decodeGGWPRemoveClanMemberOutput(data) {
67
+ return decodePayload(data, GGWP_REMOVE_CLAN_MEMBER_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
68
+ }
69
+ export const GGWP_SET_CLAN_RANK_INPUT_TYPE = 4;
70
+ const GGWP_SET_CLAN_RANK_INPUT_FIELDS = [
71
+ {
72
+ name: 'memberAddress',
73
+ type: 'id',
74
+ offset: 0,
75
+ byteLength: 32,
76
+ },
77
+ {
78
+ name: 'rank',
79
+ type: 'uint64',
80
+ offset: 32,
81
+ byteLength: 8,
82
+ },
83
+ ];
84
+ export function buildGGWPSetClanRankInput(input, identityToPublicKey) {
85
+ return { contractIndex: GGWP_CONTRACT_INDEX, inputType: GGWP_SET_CLAN_RANK_INPUT_TYPE, payload: buildPayload(GGWP_SET_CLAN_RANK_INPUT_FIELDS, STRUCTS, input, identityToPublicKey) };
86
+ }
87
+ const GGWP_SET_CLAN_RANK_OUTPUT_FIELDS = [
88
+ {
89
+ name: 'returnCode',
90
+ type: 'uint32',
91
+ offset: 0,
92
+ byteLength: 4,
93
+ },
94
+ ];
95
+ export function decodeGGWPSetClanRankOutput(data) {
96
+ return decodePayload(data, GGWP_SET_CLAN_RANK_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
97
+ }
98
+ export const GGWP_SET_ADMIN_INPUT_TYPE = 5;
99
+ const GGWP_SET_ADMIN_INPUT_FIELDS = [
100
+ {
101
+ name: 'newAdmin',
102
+ type: 'id',
103
+ offset: 0,
104
+ byteLength: 32,
105
+ },
106
+ ];
107
+ export function buildGGWPSetAdminInput(input, identityToPublicKey) {
108
+ return { contractIndex: GGWP_CONTRACT_INDEX, inputType: GGWP_SET_ADMIN_INPUT_TYPE, payload: buildPayload(GGWP_SET_ADMIN_INPUT_FIELDS, STRUCTS, input, identityToPublicKey) };
109
+ }
110
+ const GGWP_SET_ADMIN_OUTPUT_FIELDS = [
111
+ {
112
+ name: 'returnCode',
113
+ type: 'uint32',
114
+ offset: 0,
115
+ byteLength: 4,
116
+ },
117
+ ];
118
+ export function decodeGGWPSetAdminOutput(data) {
119
+ return decodePayload(data, GGWP_SET_ADMIN_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
120
+ }
121
+ export const GGWP_SET_EXCLUDE_ADDRESS_INPUT_TYPE = 6;
122
+ const GGWP_SET_EXCLUDE_ADDRESS_INPUT_FIELDS = [
123
+ {
124
+ name: 'slot',
125
+ type: 'uint64',
126
+ offset: 0,
127
+ byteLength: 8,
128
+ },
129
+ {
130
+ name: 'address',
131
+ type: 'id',
132
+ offset: 8,
133
+ byteLength: 32,
134
+ },
135
+ ];
136
+ export function buildGGWPSetExcludeAddressInput(input, identityToPublicKey) {
137
+ return { contractIndex: GGWP_CONTRACT_INDEX, inputType: GGWP_SET_EXCLUDE_ADDRESS_INPUT_TYPE, payload: buildPayload(GGWP_SET_EXCLUDE_ADDRESS_INPUT_FIELDS, STRUCTS, input, identityToPublicKey) };
138
+ }
139
+ const GGWP_SET_EXCLUDE_ADDRESS_OUTPUT_FIELDS = [
140
+ {
141
+ name: 'returnCode',
142
+ type: 'uint32',
143
+ offset: 0,
144
+ byteLength: 4,
145
+ },
146
+ ];
147
+ export function decodeGGWPSetExcludeAddressOutput(data) {
148
+ return decodePayload(data, GGWP_SET_EXCLUDE_ADDRESS_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
149
+ }
150
+ export const GGWP_STAKE_INPUT_TYPE = 7;
151
+ const GGWP_STAKE_INPUT_FIELDS = [
152
+ {
153
+ name: 'numberOfShares',
154
+ type: 'uint64',
155
+ offset: 0,
156
+ byteLength: 8,
157
+ },
158
+ ];
159
+ export function buildGGWPStakeInput(input) {
160
+ return { contractIndex: GGWP_CONTRACT_INDEX, inputType: GGWP_STAKE_INPUT_TYPE, payload: buildPayload(GGWP_STAKE_INPUT_FIELDS, STRUCTS, input, (_) => new Uint8Array(32)) };
161
+ }
162
+ const GGWP_STAKE_OUTPUT_FIELDS = [
163
+ {
164
+ name: 'returnCode',
165
+ type: 'uint32',
166
+ offset: 0,
167
+ byteLength: 4,
168
+ },
169
+ ];
170
+ export function decodeGGWPStakeOutput(data) {
171
+ return decodePayload(data, GGWP_STAKE_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
172
+ }
173
+ export const GGWP_REQUEST_UNSTAKE_INPUT_TYPE = 8;
174
+ const GGWP_REQUEST_UNSTAKE_INPUT_FIELDS = [
175
+ {
176
+ name: 'numberOfShares',
177
+ type: 'uint64',
178
+ offset: 0,
179
+ byteLength: 8,
180
+ },
181
+ ];
182
+ export function buildGGWPRequestUnstakeInput(input) {
183
+ return { contractIndex: GGWP_CONTRACT_INDEX, inputType: GGWP_REQUEST_UNSTAKE_INPUT_TYPE, payload: buildPayload(GGWP_REQUEST_UNSTAKE_INPUT_FIELDS, STRUCTS, input, (_) => new Uint8Array(32)) };
184
+ }
185
+ const GGWP_REQUEST_UNSTAKE_OUTPUT_FIELDS = [
186
+ {
187
+ name: 'returnCode',
188
+ type: 'uint32',
189
+ offset: 0,
190
+ byteLength: 4,
191
+ },
192
+ ];
193
+ export function decodeGGWPRequestUnstakeOutput(data) {
194
+ return decodePayload(data, GGWP_REQUEST_UNSTAKE_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
195
+ }
196
+ export const GGWP_FINALIZE_UNSTAKE_INPUT_TYPE = 9;
197
+ const GGWP_FINALIZE_UNSTAKE_OUTPUT_FIELDS = [
198
+ {
199
+ name: 'returnCode',
200
+ type: 'uint32',
201
+ offset: 0,
202
+ byteLength: 4,
203
+ },
204
+ ];
205
+ export function decodeGGWPFinalizeUnstakeOutput(data) {
206
+ return decodePayload(data, GGWP_FINALIZE_UNSTAKE_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
207
+ }
208
+ export const GGWP_DEPOSIT_STAKING_REWARDS_INPUT_TYPE = 10;
209
+ const GGWP_DEPOSIT_STAKING_REWARDS_INPUT_FIELDS = [
210
+ {
211
+ name: 'numberOfShares',
212
+ type: 'uint64',
213
+ offset: 0,
214
+ byteLength: 8,
215
+ },
216
+ ];
217
+ export function buildGGWPDepositStakingRewardsInput(input) {
218
+ return { contractIndex: GGWP_CONTRACT_INDEX, inputType: GGWP_DEPOSIT_STAKING_REWARDS_INPUT_TYPE, payload: buildPayload(GGWP_DEPOSIT_STAKING_REWARDS_INPUT_FIELDS, STRUCTS, input, (_) => new Uint8Array(32)) };
219
+ }
220
+ const GGWP_DEPOSIT_STAKING_REWARDS_OUTPUT_FIELDS = [
221
+ {
222
+ name: 'returnCode',
223
+ type: 'uint32',
224
+ offset: 0,
225
+ byteLength: 4,
226
+ },
227
+ ];
228
+ export function decodeGGWPDepositStakingRewardsOutput(data) {
229
+ return decodePayload(data, GGWP_DEPOSIT_STAKING_REWARDS_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
230
+ }
231
+ export const GGWP_CLAIM_STAKING_REWARDS_INPUT_TYPE = 11;
232
+ const GGWP_CLAIM_STAKING_REWARDS_OUTPUT_FIELDS = [
233
+ {
234
+ name: 'returnCode',
235
+ type: 'uint32',
236
+ offset: 0,
237
+ byteLength: 4,
238
+ },
239
+ {
240
+ name: 'claimedAmount',
241
+ type: 'uint64',
242
+ offset: 4,
243
+ byteLength: 8,
244
+ },
245
+ ];
246
+ export function decodeGGWPClaimStakingRewardsOutput(data) {
247
+ return decodePayload(data, GGWP_CLAIM_STAKING_REWARDS_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
248
+ }
249
+ export const GGWP_PROPOSE_GOV_CHANGE_INPUT_TYPE = 12;
250
+ const GGWP_PROPOSE_GOV_CHANGE_INPUT_FIELDS = [
251
+ {
252
+ name: 'targetType',
253
+ type: 'uint8',
254
+ offset: 0,
255
+ byteLength: 1,
256
+ },
257
+ {
258
+ name: 'newAddress',
259
+ type: 'id',
260
+ offset: 1,
261
+ byteLength: 32,
262
+ },
263
+ ];
264
+ export function buildGGWPProposeGovChangeInput(input, identityToPublicKey) {
265
+ return { contractIndex: GGWP_CONTRACT_INDEX, inputType: GGWP_PROPOSE_GOV_CHANGE_INPUT_TYPE, payload: buildPayload(GGWP_PROPOSE_GOV_CHANGE_INPUT_FIELDS, STRUCTS, input, identityToPublicKey) };
266
+ }
267
+ const GGWP_PROPOSE_GOV_CHANGE_OUTPUT_FIELDS = [
268
+ {
269
+ name: 'returnCode',
270
+ type: 'uint32',
271
+ offset: 0,
272
+ byteLength: 4,
273
+ },
274
+ {
275
+ name: 'proposalIndex',
276
+ type: 'uint64',
277
+ offset: 4,
278
+ byteLength: 8,
279
+ },
280
+ {
281
+ name: 'passed',
282
+ type: 'uint8',
283
+ offset: 12,
284
+ byteLength: 1,
285
+ },
286
+ ];
287
+ export function decodeGGWPProposeGovChangeOutput(data) {
288
+ return decodePayload(data, GGWP_PROPOSE_GOV_CHANGE_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
289
+ }
290
+ export const GGWP_VOTE_GOV_CHANGE_INPUT_TYPE = 13;
291
+ const GGWP_VOTE_GOV_CHANGE_INPUT_FIELDS = [
292
+ {
293
+ name: 'proposalIndex',
294
+ type: 'uint64',
295
+ offset: 0,
296
+ byteLength: 8,
297
+ },
298
+ {
299
+ name: 'approve',
300
+ type: 'uint8',
301
+ offset: 8,
302
+ byteLength: 1,
303
+ },
304
+ ];
305
+ export function buildGGWPVoteGovChangeInput(input) {
306
+ return { contractIndex: GGWP_CONTRACT_INDEX, inputType: GGWP_VOTE_GOV_CHANGE_INPUT_TYPE, payload: buildPayload(GGWP_VOTE_GOV_CHANGE_INPUT_FIELDS, STRUCTS, input, (_) => new Uint8Array(32)) };
307
+ }
308
+ const GGWP_VOTE_GOV_CHANGE_OUTPUT_FIELDS = [
309
+ {
310
+ name: 'returnCode',
311
+ type: 'uint32',
312
+ offset: 0,
313
+ byteLength: 4,
314
+ },
315
+ {
316
+ name: 'passed',
317
+ type: 'uint8',
318
+ offset: 4,
319
+ byteLength: 1,
320
+ },
321
+ ];
322
+ export function decodeGGWPVoteGovChangeOutput(data) {
323
+ return decodePayload(data, GGWP_VOTE_GOV_CHANGE_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
324
+ }
325
+ export const GGWP_GET_STATUS_INPUT_TYPE = 1;
326
+ export const GGWP_GET_STATUS_INPUT_SIZE = 0;
327
+ const GGWP_GET_STATUS_OUTPUT_FIELDS = [
328
+ {
329
+ name: 'holderCount',
330
+ type: 'uint64',
331
+ offset: 0,
332
+ byteLength: 8,
333
+ },
334
+ {
335
+ name: 'totalTokensSnapshot',
336
+ type: 'uint64',
337
+ offset: 8,
338
+ byteLength: 8,
339
+ },
340
+ {
341
+ name: 'clanMemberCount',
342
+ type: 'uint64',
343
+ offset: 16,
344
+ byteLength: 8,
345
+ },
346
+ {
347
+ name: 'clanWeightedTotal',
348
+ type: 'uint64',
349
+ offset: 24,
350
+ byteLength: 8,
351
+ },
352
+ {
353
+ name: 'pendingRevenue',
354
+ type: 'uint64',
355
+ offset: 32,
356
+ byteLength: 8,
357
+ },
358
+ {
359
+ name: 'reinvestmentFund',
360
+ type: 'uint64',
361
+ offset: 40,
362
+ byteLength: 8,
363
+ },
364
+ {
365
+ name: 'execReserveFund',
366
+ type: 'uint64',
367
+ offset: 48,
368
+ byteLength: 8,
369
+ },
370
+ {
371
+ name: 'totalDistributed',
372
+ type: 'uint64',
373
+ offset: 56,
374
+ byteLength: 8,
375
+ },
376
+ {
377
+ name: 'totalDeposited',
378
+ type: 'uint64',
379
+ offset: 64,
380
+ byteLength: 8,
381
+ },
382
+ {
383
+ name: 'lastPayoutTick',
384
+ type: 'uint64',
385
+ offset: 72,
386
+ byteLength: 8,
387
+ },
388
+ {
389
+ name: 'lastDistributionEpoch',
390
+ type: 'uint64',
391
+ offset: 80,
392
+ byteLength: 8,
393
+ },
394
+ {
395
+ name: 'adminAddress',
396
+ type: 'id',
397
+ offset: 88,
398
+ byteLength: 32,
399
+ },
400
+ ];
401
+ export function decodeGGWPGetStatusOutput(data, publicKeyToIdentity) {
402
+ return decodePayload(data, GGWP_GET_STATUS_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
403
+ }
404
+ export async function gGWPGetStatus(live, options) {
405
+ return callContractFunction({
406
+ live,
407
+ contractIndex: GGWP_CONTRACT_INDEX,
408
+ inputType: GGWP_GET_STATUS_INPUT_TYPE,
409
+ inputSize: GGWP_GET_STATUS_INPUT_SIZE,
410
+ inputFields: [],
411
+ outputFields: GGWP_GET_STATUS_OUTPUT_FIELDS,
412
+ structs: STRUCTS,
413
+ input: {},
414
+ ...options,
415
+ });
416
+ }
417
+ export const GGWP_GET_HOLDER_INFO_INPUT_TYPE = 2;
418
+ export const GGWP_GET_HOLDER_INFO_INPUT_SIZE = 32;
419
+ const GGWP_GET_HOLDER_INFO_INPUT_FIELDS = [
420
+ {
421
+ name: 'holderAddress',
422
+ type: 'id',
423
+ offset: 0,
424
+ byteLength: 32,
425
+ },
426
+ ];
427
+ export function buildGGWPGetHolderInfoInput(input, identityToPublicKey) {
428
+ return buildPayload(GGWP_GET_HOLDER_INFO_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
429
+ }
430
+ const GGWP_GET_HOLDER_INFO_OUTPUT_FIELDS = [
431
+ {
432
+ name: 'tokenBalance',
433
+ type: 'uint64',
434
+ offset: 0,
435
+ byteLength: 8,
436
+ },
437
+ {
438
+ name: 'isHolder',
439
+ type: 'uint32',
440
+ offset: 8,
441
+ byteLength: 4,
442
+ },
443
+ ];
444
+ export function decodeGGWPGetHolderInfoOutput(data) {
445
+ return decodePayload(data, GGWP_GET_HOLDER_INFO_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
446
+ }
447
+ export async function gGWPGetHolderInfo(live, input, options) {
448
+ return callContractFunction({
449
+ live,
450
+ contractIndex: GGWP_CONTRACT_INDEX,
451
+ inputType: GGWP_GET_HOLDER_INFO_INPUT_TYPE,
452
+ inputSize: GGWP_GET_HOLDER_INFO_INPUT_SIZE,
453
+ inputFields: GGWP_GET_HOLDER_INFO_INPUT_FIELDS,
454
+ outputFields: GGWP_GET_HOLDER_INFO_OUTPUT_FIELDS,
455
+ structs: STRUCTS,
456
+ input: input,
457
+ ...options,
458
+ });
459
+ }
460
+ export const GGWP_GET_CLAN_MEMBER_INFO_INPUT_TYPE = 3;
461
+ export const GGWP_GET_CLAN_MEMBER_INFO_INPUT_SIZE = 32;
462
+ const GGWP_GET_CLAN_MEMBER_INFO_INPUT_FIELDS = [
463
+ {
464
+ name: 'memberAddress',
465
+ type: 'id',
466
+ offset: 0,
467
+ byteLength: 32,
468
+ },
469
+ ];
470
+ export function buildGGWPGetClanMemberInfoInput(input, identityToPublicKey) {
471
+ return buildPayload(GGWP_GET_CLAN_MEMBER_INFO_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
472
+ }
473
+ const GGWP_GET_CLAN_MEMBER_INFO_OUTPUT_FIELDS = [
474
+ {
475
+ name: 'rank',
476
+ type: 'uint64',
477
+ offset: 0,
478
+ byteLength: 8,
479
+ },
480
+ {
481
+ name: 'isMember',
482
+ type: 'uint32',
483
+ offset: 8,
484
+ byteLength: 4,
485
+ },
486
+ ];
487
+ export function decodeGGWPGetClanMemberInfoOutput(data) {
488
+ return decodePayload(data, GGWP_GET_CLAN_MEMBER_INFO_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
489
+ }
490
+ export async function gGWPGetClanMemberInfo(live, input, options) {
491
+ return callContractFunction({
492
+ live,
493
+ contractIndex: GGWP_CONTRACT_INDEX,
494
+ inputType: GGWP_GET_CLAN_MEMBER_INFO_INPUT_TYPE,
495
+ inputSize: GGWP_GET_CLAN_MEMBER_INFO_INPUT_SIZE,
496
+ inputFields: GGWP_GET_CLAN_MEMBER_INFO_INPUT_FIELDS,
497
+ outputFields: GGWP_GET_CLAN_MEMBER_INFO_OUTPUT_FIELDS,
498
+ structs: STRUCTS,
499
+ input: input,
500
+ ...options,
501
+ });
502
+ }
503
+ export const GGWP_GET_SHAREHOLDER_INFO_INPUT_TYPE = 4;
504
+ export const GGWP_GET_SHAREHOLDER_INFO_INPUT_SIZE = 32;
505
+ const GGWP_GET_SHAREHOLDER_INFO_INPUT_FIELDS = [
506
+ {
507
+ name: 'shareholderAddress',
508
+ type: 'id',
509
+ offset: 0,
510
+ byteLength: 32,
511
+ },
512
+ ];
513
+ export function buildGGWPGetShareholderInfoInput(input, identityToPublicKey) {
514
+ return buildPayload(GGWP_GET_SHAREHOLDER_INFO_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
515
+ }
516
+ const GGWP_GET_SHAREHOLDER_INFO_OUTPUT_FIELDS = [
517
+ {
518
+ name: 'shares',
519
+ type: 'uint64',
520
+ offset: 0,
521
+ byteLength: 8,
522
+ },
523
+ {
524
+ name: 'isShareholder',
525
+ type: 'uint32',
526
+ offset: 8,
527
+ byteLength: 4,
528
+ },
529
+ ];
530
+ export function decodeGGWPGetShareholderInfoOutput(data) {
531
+ return decodePayload(data, GGWP_GET_SHAREHOLDER_INFO_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
532
+ }
533
+ export async function gGWPGetShareholderInfo(live, input, options) {
534
+ return callContractFunction({
535
+ live,
536
+ contractIndex: GGWP_CONTRACT_INDEX,
537
+ inputType: GGWP_GET_SHAREHOLDER_INFO_INPUT_TYPE,
538
+ inputSize: GGWP_GET_SHAREHOLDER_INFO_INPUT_SIZE,
539
+ inputFields: GGWP_GET_SHAREHOLDER_INFO_INPUT_FIELDS,
540
+ outputFields: GGWP_GET_SHAREHOLDER_INFO_OUTPUT_FIELDS,
541
+ structs: STRUCTS,
542
+ input: input,
543
+ ...options,
544
+ });
545
+ }
546
+ export const GGWP_GET_STAKING_INFO_INPUT_TYPE = 5;
547
+ export const GGWP_GET_STAKING_INFO_INPUT_SIZE = 32;
548
+ const GGWP_GET_STAKING_INFO_INPUT_FIELDS = [
549
+ {
550
+ name: 'stakerAddress',
551
+ type: 'id',
552
+ offset: 0,
553
+ byteLength: 32,
554
+ },
555
+ ];
556
+ export function buildGGWPGetStakingInfoInput(input, identityToPublicKey) {
557
+ return buildPayload(GGWP_GET_STAKING_INFO_INPUT_FIELDS, STRUCTS, input, identityToPublicKey);
558
+ }
559
+ const GGWP_GET_STAKING_INFO_OUTPUT_FIELDS = [
560
+ {
561
+ name: 'stakedAmount',
562
+ type: 'uint64',
563
+ offset: 0,
564
+ byteLength: 8,
565
+ },
566
+ {
567
+ name: 'pendingRewards',
568
+ type: 'uint64',
569
+ offset: 8,
570
+ byteLength: 8,
571
+ },
572
+ {
573
+ name: 'unstakeAmount',
574
+ type: 'uint64',
575
+ offset: 16,
576
+ byteLength: 8,
577
+ },
578
+ {
579
+ name: 'unstakeEpoch',
580
+ type: 'uint64',
581
+ offset: 24,
582
+ byteLength: 8,
583
+ },
584
+ {
585
+ name: 'totalStaked',
586
+ type: 'uint64',
587
+ offset: 32,
588
+ byteLength: 8,
589
+ },
590
+ {
591
+ name: 'stakingRewardPool',
592
+ type: 'uint64',
593
+ offset: 40,
594
+ byteLength: 8,
595
+ },
596
+ {
597
+ name: 'isStaker',
598
+ type: 'uint32',
599
+ offset: 48,
600
+ byteLength: 4,
601
+ },
602
+ ];
603
+ export function decodeGGWPGetStakingInfoOutput(data) {
604
+ return decodePayload(data, GGWP_GET_STAKING_INFO_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
605
+ }
606
+ export async function gGWPGetStakingInfo(live, input, options) {
607
+ return callContractFunction({
608
+ live,
609
+ contractIndex: GGWP_CONTRACT_INDEX,
610
+ inputType: GGWP_GET_STAKING_INFO_INPUT_TYPE,
611
+ inputSize: GGWP_GET_STAKING_INFO_INPUT_SIZE,
612
+ inputFields: GGWP_GET_STAKING_INFO_INPUT_FIELDS,
613
+ outputFields: GGWP_GET_STAKING_INFO_OUTPUT_FIELDS,
614
+ structs: STRUCTS,
615
+ input: input,
616
+ ...options,
617
+ });
618
+ }
619
+ export const GGWP_GET_EXCLUDE_ADDRESSES_INPUT_TYPE = 6;
620
+ export const GGWP_GET_EXCLUDE_ADDRESSES_INPUT_SIZE = 0;
621
+ const GGWP_GET_EXCLUDE_ADDRESSES_OUTPUT_FIELDS = [
622
+ {
623
+ name: 'address1',
624
+ type: 'id',
625
+ offset: 0,
626
+ byteLength: 32,
627
+ },
628
+ {
629
+ name: 'address2',
630
+ type: 'id',
631
+ offset: 32,
632
+ byteLength: 32,
633
+ },
634
+ ];
635
+ export function decodeGGWPGetExcludeAddressesOutput(data, publicKeyToIdentity) {
636
+ return decodePayload(data, GGWP_GET_EXCLUDE_ADDRESSES_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
637
+ }
638
+ export async function gGWPGetExcludeAddresses(live, options) {
639
+ return callContractFunction({
640
+ live,
641
+ contractIndex: GGWP_CONTRACT_INDEX,
642
+ inputType: GGWP_GET_EXCLUDE_ADDRESSES_INPUT_TYPE,
643
+ inputSize: GGWP_GET_EXCLUDE_ADDRESSES_INPUT_SIZE,
644
+ inputFields: [],
645
+ outputFields: GGWP_GET_EXCLUDE_ADDRESSES_OUTPUT_FIELDS,
646
+ structs: STRUCTS,
647
+ input: {},
648
+ ...options,
649
+ });
650
+ }
651
+ export const GGWP_GET_DISTRIBUTION_PREVIEW_INPUT_TYPE = 7;
652
+ export const GGWP_GET_DISTRIBUTION_PREVIEW_INPUT_SIZE = 8;
653
+ const GGWP_GET_DISTRIBUTION_PREVIEW_INPUT_FIELDS = [
654
+ {
655
+ name: 'amount',
656
+ type: 'uint64',
657
+ offset: 0,
658
+ byteLength: 8,
659
+ },
660
+ ];
661
+ export function buildGGWPGetDistributionPreviewInput(input) {
662
+ return buildPayload(GGWP_GET_DISTRIBUTION_PREVIEW_INPUT_FIELDS, STRUCTS, input, (_) => new Uint8Array(32));
663
+ }
664
+ const GGWP_GET_DISTRIBUTION_PREVIEW_OUTPUT_FIELDS = [
665
+ {
666
+ name: 'holderShare',
667
+ type: 'uint64',
668
+ offset: 0,
669
+ byteLength: 8,
670
+ },
671
+ {
672
+ name: 'shareholderShare',
673
+ type: 'uint64',
674
+ offset: 8,
675
+ byteLength: 8,
676
+ },
677
+ {
678
+ name: 'clanShare',
679
+ type: 'uint64',
680
+ offset: 16,
681
+ byteLength: 8,
682
+ },
683
+ {
684
+ name: 'reinvestShare',
685
+ type: 'uint64',
686
+ offset: 24,
687
+ byteLength: 8,
688
+ },
689
+ {
690
+ name: 'execReserveShare',
691
+ type: 'uint64',
692
+ offset: 32,
693
+ byteLength: 8,
694
+ },
695
+ ];
696
+ export function decodeGGWPGetDistributionPreviewOutput(data) {
697
+ return decodePayload(data, GGWP_GET_DISTRIBUTION_PREVIEW_OUTPUT_FIELDS, STRUCTS, (_) => { throw new Error('unreachable'); });
698
+ }
699
+ export async function gGWPGetDistributionPreview(live, input, options) {
700
+ return callContractFunction({
701
+ live,
702
+ contractIndex: GGWP_CONTRACT_INDEX,
703
+ inputType: GGWP_GET_DISTRIBUTION_PREVIEW_INPUT_TYPE,
704
+ inputSize: GGWP_GET_DISTRIBUTION_PREVIEW_INPUT_SIZE,
705
+ inputFields: GGWP_GET_DISTRIBUTION_PREVIEW_INPUT_FIELDS,
706
+ outputFields: GGWP_GET_DISTRIBUTION_PREVIEW_OUTPUT_FIELDS,
707
+ structs: STRUCTS,
708
+ input: input,
709
+ ...options,
710
+ });
711
+ }
712
+ export const GGWP_GET_GOV_PROPOSAL_INPUT_TYPE = 8;
713
+ export const GGWP_GET_GOV_PROPOSAL_INPUT_SIZE = 8;
714
+ const GGWP_GET_GOV_PROPOSAL_INPUT_FIELDS = [
715
+ {
716
+ name: 'proposalIndex',
717
+ type: 'uint64',
718
+ offset: 0,
719
+ byteLength: 8,
720
+ },
721
+ ];
722
+ export function buildGGWPGetGovProposalInput(input) {
723
+ return buildPayload(GGWP_GET_GOV_PROPOSAL_INPUT_FIELDS, STRUCTS, input, (_) => new Uint8Array(32));
724
+ }
725
+ const GGWP_GET_GOV_PROPOSAL_OUTPUT_FIELDS = [
726
+ {
727
+ name: 'status',
728
+ type: 'uint8',
729
+ offset: 0,
730
+ byteLength: 1,
731
+ },
732
+ {
733
+ name: 'targetType',
734
+ type: 'uint8',
735
+ offset: 1,
736
+ byteLength: 1,
737
+ },
738
+ {
739
+ name: 'proposedAddress',
740
+ type: 'id',
741
+ offset: 2,
742
+ byteLength: 32,
743
+ },
744
+ {
745
+ name: 'proposalId',
746
+ type: 'uint64',
747
+ offset: 34,
748
+ byteLength: 8,
749
+ },
750
+ {
751
+ name: 'proposalEpoch',
752
+ type: 'uint64',
753
+ offset: 42,
754
+ byteLength: 8,
755
+ },
756
+ {
757
+ name: 'yesShares',
758
+ type: 'uint64',
759
+ offset: 50,
760
+ byteLength: 8,
761
+ },
762
+ {
763
+ name: 'totalShares',
764
+ type: 'uint64',
765
+ offset: 58,
766
+ byteLength: 8,
767
+ },
768
+ {
769
+ name: 'requiredShares',
770
+ type: 'uint64',
771
+ offset: 66,
772
+ byteLength: 8,
773
+ },
774
+ ];
775
+ export function decodeGGWPGetGovProposalOutput(data, publicKeyToIdentity) {
776
+ return decodePayload(data, GGWP_GET_GOV_PROPOSAL_OUTPUT_FIELDS, STRUCTS, publicKeyToIdentity);
777
+ }
778
+ export async function gGWPGetGovProposal(live, input, options) {
779
+ return callContractFunction({
780
+ live,
781
+ contractIndex: GGWP_CONTRACT_INDEX,
782
+ inputType: GGWP_GET_GOV_PROPOSAL_INPUT_TYPE,
783
+ inputSize: GGWP_GET_GOV_PROPOSAL_INPUT_SIZE,
784
+ inputFields: GGWP_GET_GOV_PROPOSAL_INPUT_FIELDS,
785
+ outputFields: GGWP_GET_GOV_PROPOSAL_OUTPUT_FIELDS,
786
+ structs: STRUCTS,
787
+ input: input,
788
+ ...options,
789
+ });
790
+ }
791
+ export const gGWP = {
792
+ contractIndex: GGWP_CONTRACT_INDEX,
793
+ GetStatus: gGWPGetStatus,
794
+ GetHolderInfo: gGWPGetHolderInfo,
795
+ GetClanMemberInfo: gGWPGetClanMemberInfo,
796
+ GetShareholderInfo: gGWPGetShareholderInfo,
797
+ GetStakingInfo: gGWPGetStakingInfo,
798
+ GetExcludeAddresses: gGWPGetExcludeAddresses,
799
+ GetDistributionPreview: gGWPGetDistributionPreview,
800
+ GetGovProposal: gGWPGetGovProposal,
801
+ decodeDepositRevenueOutput: decodeGGWPDepositRevenueOutput,
802
+ buildAddClanMemberInput: buildGGWPAddClanMemberInput,
803
+ decodeAddClanMemberOutput: decodeGGWPAddClanMemberOutput,
804
+ buildRemoveClanMemberInput: buildGGWPRemoveClanMemberInput,
805
+ decodeRemoveClanMemberOutput: decodeGGWPRemoveClanMemberOutput,
806
+ buildSetClanRankInput: buildGGWPSetClanRankInput,
807
+ decodeSetClanRankOutput: decodeGGWPSetClanRankOutput,
808
+ buildSetAdminInput: buildGGWPSetAdminInput,
809
+ decodeSetAdminOutput: decodeGGWPSetAdminOutput,
810
+ buildSetExcludeAddressInput: buildGGWPSetExcludeAddressInput,
811
+ decodeSetExcludeAddressOutput: decodeGGWPSetExcludeAddressOutput,
812
+ buildStakeInput: buildGGWPStakeInput,
813
+ decodeStakeOutput: decodeGGWPStakeOutput,
814
+ buildRequestUnstakeInput: buildGGWPRequestUnstakeInput,
815
+ decodeRequestUnstakeOutput: decodeGGWPRequestUnstakeOutput,
816
+ decodeFinalizeUnstakeOutput: decodeGGWPFinalizeUnstakeOutput,
817
+ buildDepositStakingRewardsInput: buildGGWPDepositStakingRewardsInput,
818
+ decodeDepositStakingRewardsOutput: decodeGGWPDepositStakingRewardsOutput,
819
+ decodeClaimStakingRewardsOutput: decodeGGWPClaimStakingRewardsOutput,
820
+ buildProposeGovChangeInput: buildGGWPProposeGovChangeInput,
821
+ decodeProposeGovChangeOutput: decodeGGWPProposeGovChangeOutput,
822
+ buildVoteGovChangeInput: buildGGWPVoteGovChangeInput,
823
+ decodeVoteGovChangeOutput: decodeGGWPVoteGovChangeOutput,
824
+ };
825
+ //# sourceMappingURL=ggwp.js.map