@alephium/powfi-sdk 0.0.1-rc.1

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 (146) hide show
  1. package/README.md +4 -0
  2. package/clmm/artifacts/BitmapWord.ral.json +125 -0
  3. package/clmm/artifacts/BitmapWordDeployer.ral.json +31 -0
  4. package/clmm/artifacts/CreateConfig.ral.json +37 -0
  5. package/clmm/artifacts/CreateLiquidPool.ral.json +55 -0
  6. package/clmm/artifacts/DexAccount.ral.json +110 -0
  7. package/clmm/artifacts/LiquidityAmountsTest.ral.json +161 -0
  8. package/clmm/artifacts/LiquidityManagmentTest.ral.json +384 -0
  9. package/clmm/artifacts/Pool.ral.json +1530 -0
  10. package/clmm/artifacts/PoolConfig.ral.json +31 -0
  11. package/clmm/artifacts/PoolFactory.ral.json +300 -0
  12. package/clmm/artifacts/PoolRouterDemo.ral.json +49 -0
  13. package/clmm/artifacts/PoolUser.ral.json +89 -0
  14. package/clmm/artifacts/Position.ral.json +183 -0
  15. package/clmm/artifacts/PositionManager.ral.json +416 -0
  16. package/clmm/artifacts/SwapWithoutAccount.ral.json +46 -0
  17. package/clmm/artifacts/TestToken.ral.json +68 -0
  18. package/clmm/artifacts/Tick.ral.json +161 -0
  19. package/clmm/artifacts/TickBitmapTest.ral.json +220 -0
  20. package/clmm/artifacts/constants.ral.json +81 -0
  21. package/clmm/artifacts/structs.ral.json +335 -0
  22. package/clmm/artifacts/ts/BitmapWord.ts +337 -0
  23. package/clmm/artifacts/ts/BitmapWordDeployer.ts +164 -0
  24. package/clmm/artifacts/ts/DexAccount.ts +330 -0
  25. package/clmm/artifacts/ts/LiquidityAmountsTest.ts +464 -0
  26. package/clmm/artifacts/ts/LiquidityManagmentTest.ts +859 -0
  27. package/clmm/artifacts/ts/Pool.ts +2535 -0
  28. package/clmm/artifacts/ts/PoolConfig.ts +179 -0
  29. package/clmm/artifacts/ts/PoolFactory.ts +640 -0
  30. package/clmm/artifacts/ts/PoolUser.ts +237 -0
  31. package/clmm/artifacts/ts/Position.ts +440 -0
  32. package/clmm/artifacts/ts/PositionManager.ts +929 -0
  33. package/clmm/artifacts/ts/TestToken.ts +277 -0
  34. package/clmm/artifacts/ts/Tick.ts +351 -0
  35. package/clmm/artifacts/ts/TickBitmapTest.ts +512 -0
  36. package/clmm/artifacts/ts/constants.ts +17 -0
  37. package/clmm/artifacts/ts/contracts.ts +26 -0
  38. package/clmm/artifacts/ts/deployments.ts +160 -0
  39. package/clmm/artifacts/ts/index.ts +20 -0
  40. package/clmm/artifacts/ts/scripts.ts +76 -0
  41. package/clmm/artifacts/ts/types.ts +105 -0
  42. package/clmm/deployments/.deployments.devnet.json +350 -0
  43. package/clmm/deployments/.deployments.testnet.json +350 -0
  44. package/cpmm/artifacts/dex/DexAccount.ral.json +110 -0
  45. package/cpmm/artifacts/dex/Router.ral.json +361 -0
  46. package/cpmm/artifacts/dex/TokenPair.ral.json +512 -0
  47. package/cpmm/artifacts/dex/TokenPairFactory.ral.json +297 -0
  48. package/cpmm/artifacts/examples/ExampleOracleSimple.ral.json +192 -0
  49. package/cpmm/artifacts/examples/FeeCollectorFactoryImpl.ral.json +185 -0
  50. package/cpmm/artifacts/examples/FeeCollectorPerTokenPairImpl.ral.json +216 -0
  51. package/cpmm/artifacts/examples/FullMathTest.ral.json +123 -0
  52. package/cpmm/artifacts/scripts/AddLiquidity.ral.json +46 -0
  53. package/cpmm/artifacts/scripts/Burn.ral.json +31 -0
  54. package/cpmm/artifacts/scripts/CollectFee.ral.json +25 -0
  55. package/cpmm/artifacts/scripts/CreatePair.ral.json +37 -0
  56. package/cpmm/artifacts/scripts/CreatePairAndAddLiquidity.ral.json +43 -0
  57. package/cpmm/artifacts/scripts/EnableFeeCollector.ral.json +28 -0
  58. package/cpmm/artifacts/scripts/Mint.ral.json +34 -0
  59. package/cpmm/artifacts/scripts/RemoveLiquidity.ral.json +43 -0
  60. package/cpmm/artifacts/scripts/SetFeeCollectorFactory.ral.json +28 -0
  61. package/cpmm/artifacts/scripts/Swap.ral.json +46 -0
  62. package/cpmm/artifacts/scripts/SwapMaxIn.ral.json +46 -0
  63. package/cpmm/artifacts/scripts/SwapMinOut.ral.json +46 -0
  64. package/cpmm/artifacts/test/GetToken.ral.json +31 -0
  65. package/cpmm/artifacts/test/MathTest.ral.json +49 -0
  66. package/cpmm/artifacts/test/TestToken.ral.json +87 -0
  67. package/cpmm/artifacts/ts/DexAccount.ts +329 -0
  68. package/cpmm/artifacts/ts/ExampleOracleSimple.ts +383 -0
  69. package/cpmm/artifacts/ts/FeeCollectorFactoryImpl.ts +227 -0
  70. package/cpmm/artifacts/ts/FeeCollectorPerTokenPairImpl.ts +327 -0
  71. package/cpmm/artifacts/ts/FullMathTest.ts +251 -0
  72. package/cpmm/artifacts/ts/MathTest.ts +183 -0
  73. package/cpmm/artifacts/ts/Router.ts +554 -0
  74. package/cpmm/artifacts/ts/TestToken.ts +312 -0
  75. package/cpmm/artifacts/ts/TokenPair.ts +947 -0
  76. package/cpmm/artifacts/ts/TokenPairFactory.ts +501 -0
  77. package/cpmm/artifacts/ts/contracts.ts +26 -0
  78. package/cpmm/artifacts/ts/deployments.ts +109 -0
  79. package/cpmm/artifacts/ts/index.ts +16 -0
  80. package/cpmm/artifacts/ts/scripts.ts +142 -0
  81. package/cpmm/deployments/.deployments.devnet.json +77 -0
  82. package/cpmm/deployments/.deployments.testnet.json +79 -0
  83. package/lib/index.d.mts +8800 -0
  84. package/lib/index.d.ts +8800 -0
  85. package/lib/index.js +21769 -0
  86. package/lib/index.js.map +1 -0
  87. package/lib/index.mjs +22118 -0
  88. package/lib/index.mjs.map +1 -0
  89. package/package.json +80 -0
  90. package/src/clmm/clmm.ts +607 -0
  91. package/src/clmm/constants.ts +7 -0
  92. package/src/clmm/index.ts +6 -0
  93. package/src/clmm/liquidity.ts +163 -0
  94. package/src/clmm/pool.ts +154 -0
  95. package/src/clmm/tick.ts +335 -0
  96. package/src/clmm/types.ts +155 -0
  97. package/src/common/constants.ts +1 -0
  98. package/src/common/error.ts +46 -0
  99. package/src/common/index.ts +7 -0
  100. package/src/common/logger.ts +82 -0
  101. package/src/common/math.ts +88 -0
  102. package/src/common/numeric.ts +64 -0
  103. package/src/common/types.ts +49 -0
  104. package/src/common/utils.ts +3 -0
  105. package/src/cpmm/constants.ts +2 -0
  106. package/src/cpmm/cpmm.ts +631 -0
  107. package/src/cpmm/index.ts +3 -0
  108. package/src/cpmm/types.ts +113 -0
  109. package/src/index.ts +25 -0
  110. package/src/moduleBase.ts +64 -0
  111. package/src/staking/index.ts +4 -0
  112. package/src/staking/settings.ts +38 -0
  113. package/src/staking/staking.ts +277 -0
  114. package/src/staking/types.ts +15 -0
  115. package/src/staking/utils.ts +25 -0
  116. package/src/token/index.ts +1 -0
  117. package/src/token/token.ts +163 -0
  118. package/src/zeta.ts +105 -0
  119. package/staking/artifacts/AlphStakeAndLock.ral.json +31 -0
  120. package/staking/artifacts/AlphUnstakeVault.ral.json +151 -0
  121. package/staking/artifacts/XAlphStakeVault.ral.json +559 -0
  122. package/staking/artifacts/XAlphToken.ral.json +404 -0
  123. package/staking/artifacts/XAlphUnlockAndStartUnstake.ral.json +31 -0
  124. package/staking/artifacts/examples/GovernanceDemo.ral.json +282 -0
  125. package/staking/artifacts/examples/RewardSharingVault.ral.json +253 -0
  126. package/staking/artifacts/structs.ral.json +47 -0
  127. package/staking/artifacts/ts/AlphUnstakeVault.ts +354 -0
  128. package/staking/artifacts/ts/FullMathTest.ts +175 -0
  129. package/staking/artifacts/ts/GovernanceDemo.ts +726 -0
  130. package/staking/artifacts/ts/RewardSharingVault.ts +559 -0
  131. package/staking/artifacts/ts/TestDynamicArrayByteVec32.ts +431 -0
  132. package/staking/artifacts/ts/TestDynamicSortedArrayForU256.ts +516 -0
  133. package/staking/artifacts/ts/TestMerkleProof.ts +343 -0
  134. package/staking/artifacts/ts/XAlphStakeVault.ts +1120 -0
  135. package/staking/artifacts/ts/XAlphToken.ts +835 -0
  136. package/staking/artifacts/ts/contracts.ts +26 -0
  137. package/staking/artifacts/ts/deployments.ts +109 -0
  138. package/staking/artifacts/ts/index.ts +15 -0
  139. package/staking/artifacts/ts/scripts.ts +35 -0
  140. package/staking/artifacts/ts/types.ts +19 -0
  141. package/staking/artifacts/utils/FullMathTest.ral.json +57 -0
  142. package/staking/artifacts/utils/TestDynamicArrayByteVec32.ral.json +165 -0
  143. package/staking/artifacts/utils/TestDynamicSortedArrayForU256.ral.json +189 -0
  144. package/staking/artifacts/utils/TestMerkleProof.ral.json +134 -0
  145. package/staking/deployments/.deployments.devnet.json +77 -0
  146. package/staking/deployments/.deployments.testnet.json +78 -0
@@ -0,0 +1,1120 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import {
6
+ Address,
7
+ Contract,
8
+ ContractState,
9
+ TestContractResult,
10
+ HexString,
11
+ ContractFactory,
12
+ EventSubscribeOptions,
13
+ EventSubscription,
14
+ CallContractParams,
15
+ CallContractResult,
16
+ TestContractParams,
17
+ ContractEvent,
18
+ subscribeContractEvent,
19
+ subscribeContractEvents,
20
+ testMethod,
21
+ callMethod,
22
+ multicallMethods,
23
+ fetchContractState,
24
+ Asset,
25
+ ContractInstance,
26
+ getContractEventsCurrentCount,
27
+ TestContractParamsWithoutMaps,
28
+ TestContractResultWithoutMaps,
29
+ SignExecuteContractMethodParams,
30
+ SignExecuteScriptTxResult,
31
+ signExecuteMethod,
32
+ addStdIdToFields,
33
+ encodeContractFields,
34
+ Narrow,
35
+ } from "@alephium/web3";
36
+ import { default as XAlphStakeVaultContractJson } from "../XAlphStakeVault.ral.json";
37
+ import { getContractByCodeHash, registerContract } from "./contracts";
38
+ import * as types from "./types";
39
+ import { RalphMap } from "@alephium/web3";
40
+
41
+ // Custom types for the contract
42
+ export namespace XAlphStakeVaultTypes {
43
+ export type Fields = {
44
+ stakeTokenId: HexString;
45
+ maxConnectedDapps: bigint;
46
+ merkleRoot: HexString;
47
+ totalStakedAmount: bigint;
48
+ owner: Address;
49
+ };
50
+
51
+ export type State = ContractState<Fields>;
52
+
53
+ export type UpdateRootEvent = ContractEvent<{
54
+ newMerkleRoot: HexString;
55
+ updatedBy: Address;
56
+ }>;
57
+ export type StakedEvent = ContractEvent<{ staker: Address; amount: bigint }>;
58
+ export type UnstakedEvent = ContractEvent<{
59
+ staker: Address;
60
+ amount: bigint;
61
+ }>;
62
+
63
+ export interface CallMethodTable {
64
+ get: {
65
+ params: CallContractParams<{ array: HexString; index: bigint }>;
66
+ result: CallContractResult<HexString>;
67
+ };
68
+ find: {
69
+ params: CallContractParams<{ array: HexString; value: HexString }>;
70
+ result: CallContractResult<bigint>;
71
+ };
72
+ remove: {
73
+ params: CallContractParams<{ array: HexString; value: HexString }>;
74
+ result: CallContractResult<HexString>;
75
+ };
76
+ push: {
77
+ params: CallContractParams<{ array: HexString; value: HexString }>;
78
+ result: CallContractResult<HexString>;
79
+ };
80
+ removeAt: {
81
+ params: CallContractParams<{ array: HexString; index: bigint }>;
82
+ result: CallContractResult<HexString>;
83
+ };
84
+ size: {
85
+ params: CallContractParams<{ array: HexString }>;
86
+ result: CallContractResult<bigint>;
87
+ };
88
+ empty: {
89
+ params: Omit<CallContractParams<{}>, "args">;
90
+ result: CallContractResult<HexString>;
91
+ };
92
+ getMerkleRoot: {
93
+ params: Omit<CallContractParams<{}>, "args">;
94
+ result: CallContractResult<HexString>;
95
+ };
96
+ updateRoot: {
97
+ params: CallContractParams<{ newMerkleRoot: HexString }>;
98
+ result: CallContractResult<null>;
99
+ };
100
+ verify: {
101
+ params: CallContractParams<{ proof: HexString; dataHash: HexString }>;
102
+ result: CallContractResult<boolean>;
103
+ };
104
+ hashPair: {
105
+ params: CallContractParams<{ a: HexString; b: HexString }>;
106
+ result: CallContractResult<HexString>;
107
+ };
108
+ hash: {
109
+ params: CallContractParams<{ dataToHash: HexString }>;
110
+ result: CallContractResult<HexString>;
111
+ };
112
+ getStakeTokenId: {
113
+ params: Omit<CallContractParams<{}>, "args">;
114
+ result: CallContractResult<HexString>;
115
+ };
116
+ getUserStakingInfo: {
117
+ params: CallContractParams<{ user: Address }>;
118
+ result: CallContractResult<types.UserStakingInfo>;
119
+ };
120
+ isStaking: {
121
+ params: CallContractParams<{ user: Address }>;
122
+ result: CallContractResult<boolean>;
123
+ };
124
+ stake: {
125
+ params: CallContractParams<{ amount: bigint }>;
126
+ result: CallContractResult<null>;
127
+ };
128
+ unstake: {
129
+ params: CallContractParams<{ amount: bigint }>;
130
+ result: CallContractResult<null>;
131
+ };
132
+ connectToDapp: {
133
+ params: CallContractParams<{
134
+ contractId: HexString;
135
+ merkleProof: HexString;
136
+ }>;
137
+ result: CallContractResult<null>;
138
+ };
139
+ disconnectFromDapp: {
140
+ params: CallContractParams<{ contractId: HexString }>;
141
+ result: CallContractResult<null>;
142
+ };
143
+ getWeight: {
144
+ params: CallContractParams<{ user: Address }>;
145
+ result: CallContractResult<bigint>;
146
+ };
147
+ updateDappTemplatesWhitelistMerkleRoot: {
148
+ params: CallContractParams<{ newMerkleRoot: HexString }>;
149
+ result: CallContractResult<null>;
150
+ };
151
+ updateOwner: {
152
+ params: CallContractParams<{ newOwner: Address }>;
153
+ result: CallContractResult<null>;
154
+ };
155
+ verifyDappTemplatesWhiteListed: {
156
+ params: CallContractParams<{ proof: HexString; contractId: HexString }>;
157
+ result: CallContractResult<boolean>;
158
+ };
159
+ }
160
+ export type CallMethodParams<T extends keyof CallMethodTable> =
161
+ CallMethodTable[T]["params"];
162
+ export type CallMethodResult<T extends keyof CallMethodTable> =
163
+ CallMethodTable[T]["result"];
164
+ export type MultiCallParams = Partial<{
165
+ [Name in keyof CallMethodTable]: CallMethodTable[Name]["params"];
166
+ }>;
167
+ export type MultiCallResults<T extends MultiCallParams> = {
168
+ [MaybeName in keyof T]: MaybeName extends keyof CallMethodTable
169
+ ? CallMethodTable[MaybeName]["result"]
170
+ : undefined;
171
+ };
172
+ export type MulticallReturnType<Callss extends MultiCallParams[]> = {
173
+ [index in keyof Callss]: MultiCallResults<Callss[index]>;
174
+ };
175
+
176
+ export interface SignExecuteMethodTable {
177
+ get: {
178
+ params: SignExecuteContractMethodParams<{
179
+ array: HexString;
180
+ index: bigint;
181
+ }>;
182
+ result: SignExecuteScriptTxResult;
183
+ };
184
+ find: {
185
+ params: SignExecuteContractMethodParams<{
186
+ array: HexString;
187
+ value: HexString;
188
+ }>;
189
+ result: SignExecuteScriptTxResult;
190
+ };
191
+ remove: {
192
+ params: SignExecuteContractMethodParams<{
193
+ array: HexString;
194
+ value: HexString;
195
+ }>;
196
+ result: SignExecuteScriptTxResult;
197
+ };
198
+ push: {
199
+ params: SignExecuteContractMethodParams<{
200
+ array: HexString;
201
+ value: HexString;
202
+ }>;
203
+ result: SignExecuteScriptTxResult;
204
+ };
205
+ removeAt: {
206
+ params: SignExecuteContractMethodParams<{
207
+ array: HexString;
208
+ index: bigint;
209
+ }>;
210
+ result: SignExecuteScriptTxResult;
211
+ };
212
+ size: {
213
+ params: SignExecuteContractMethodParams<{ array: HexString }>;
214
+ result: SignExecuteScriptTxResult;
215
+ };
216
+ empty: {
217
+ params: Omit<SignExecuteContractMethodParams<{}>, "args">;
218
+ result: SignExecuteScriptTxResult;
219
+ };
220
+ getMerkleRoot: {
221
+ params: Omit<SignExecuteContractMethodParams<{}>, "args">;
222
+ result: SignExecuteScriptTxResult;
223
+ };
224
+ updateRoot: {
225
+ params: SignExecuteContractMethodParams<{ newMerkleRoot: HexString }>;
226
+ result: SignExecuteScriptTxResult;
227
+ };
228
+ verify: {
229
+ params: SignExecuteContractMethodParams<{
230
+ proof: HexString;
231
+ dataHash: HexString;
232
+ }>;
233
+ result: SignExecuteScriptTxResult;
234
+ };
235
+ hashPair: {
236
+ params: SignExecuteContractMethodParams<{ a: HexString; b: HexString }>;
237
+ result: SignExecuteScriptTxResult;
238
+ };
239
+ hash: {
240
+ params: SignExecuteContractMethodParams<{ dataToHash: HexString }>;
241
+ result: SignExecuteScriptTxResult;
242
+ };
243
+ getStakeTokenId: {
244
+ params: Omit<SignExecuteContractMethodParams<{}>, "args">;
245
+ result: SignExecuteScriptTxResult;
246
+ };
247
+ getUserStakingInfo: {
248
+ params: SignExecuteContractMethodParams<{ user: Address }>;
249
+ result: SignExecuteScriptTxResult;
250
+ };
251
+ isStaking: {
252
+ params: SignExecuteContractMethodParams<{ user: Address }>;
253
+ result: SignExecuteScriptTxResult;
254
+ };
255
+ stake: {
256
+ params: SignExecuteContractMethodParams<{ amount: bigint }>;
257
+ result: SignExecuteScriptTxResult;
258
+ };
259
+ unstake: {
260
+ params: SignExecuteContractMethodParams<{ amount: bigint }>;
261
+ result: SignExecuteScriptTxResult;
262
+ };
263
+ connectToDapp: {
264
+ params: SignExecuteContractMethodParams<{
265
+ contractId: HexString;
266
+ merkleProof: HexString;
267
+ }>;
268
+ result: SignExecuteScriptTxResult;
269
+ };
270
+ disconnectFromDapp: {
271
+ params: SignExecuteContractMethodParams<{ contractId: HexString }>;
272
+ result: SignExecuteScriptTxResult;
273
+ };
274
+ getWeight: {
275
+ params: SignExecuteContractMethodParams<{ user: Address }>;
276
+ result: SignExecuteScriptTxResult;
277
+ };
278
+ updateDappTemplatesWhitelistMerkleRoot: {
279
+ params: SignExecuteContractMethodParams<{ newMerkleRoot: HexString }>;
280
+ result: SignExecuteScriptTxResult;
281
+ };
282
+ updateOwner: {
283
+ params: SignExecuteContractMethodParams<{ newOwner: Address }>;
284
+ result: SignExecuteScriptTxResult;
285
+ };
286
+ verifyDappTemplatesWhiteListed: {
287
+ params: SignExecuteContractMethodParams<{
288
+ proof: HexString;
289
+ contractId: HexString;
290
+ }>;
291
+ result: SignExecuteScriptTxResult;
292
+ };
293
+ }
294
+ export type SignExecuteMethodParams<T extends keyof SignExecuteMethodTable> =
295
+ SignExecuteMethodTable[T]["params"];
296
+ export type SignExecuteMethodResult<T extends keyof SignExecuteMethodTable> =
297
+ SignExecuteMethodTable[T]["result"];
298
+
299
+ export type Maps = { userStakingInfo?: Map<Address, types.UserStakingInfo> };
300
+ }
301
+
302
+ class Factory extends ContractFactory<
303
+ XAlphStakeVaultInstance,
304
+ XAlphStakeVaultTypes.Fields
305
+ > {
306
+ encodeFields(fields: XAlphStakeVaultTypes.Fields) {
307
+ return encodeContractFields(
308
+ addStdIdToFields(this.contract, fields),
309
+ this.contract.fieldsSig,
310
+ types.AllStructs
311
+ );
312
+ }
313
+
314
+ eventIndex = { UpdateRoot: 0, Staked: 1, Unstaked: 2 };
315
+ consts = {
316
+ IntByteLength: BigInt("32"),
317
+ WEIGHT_SCALING_FACTOR: BigInt("1000000000000000000"),
318
+ ErrorCode: {
319
+ InvalidArrayLength: BigInt("550"),
320
+ IndexOutOfBound: BigInt("551"),
321
+ InvalidByteVecLength: BigInt("552"),
322
+ },
323
+ MerkleProofErrorCodes: {
324
+ InvalidProofSize: BigInt("11001"),
325
+ InvalidDataHash: BigInt("11002"),
326
+ InvalidMerkleRoot: BigInt("11003"),
327
+ },
328
+ ErrorCodes: {
329
+ NotOwner: BigInt("300"),
330
+ AssetAddressCallerOnly: BigInt("301"),
331
+ NoStakingInfo: BigInt("302"),
332
+ InsufficientStakedAmount: BigInt("303"),
333
+ InvalidStakedAmount: BigInt("304"),
334
+ InvalidUnstakedAmount: BigInt("305"),
335
+ MaxConnectedDappsReached: BigInt("306"),
336
+ DappAlreadyConnected: BigInt("307"),
337
+ DappNotConnected: BigInt("308"),
338
+ DappNotAllowed: BigInt("309"),
339
+ },
340
+ };
341
+
342
+ at(address: string): XAlphStakeVaultInstance {
343
+ return new XAlphStakeVaultInstance(address);
344
+ }
345
+
346
+ tests = {
347
+ get: async (
348
+ params: TestContractParams<
349
+ XAlphStakeVaultTypes.Fields,
350
+ { array: HexString; index: bigint },
351
+ XAlphStakeVaultTypes.Maps
352
+ >
353
+ ): Promise<TestContractResult<HexString, XAlphStakeVaultTypes.Maps>> => {
354
+ return testMethod(this, "get", params, getContractByCodeHash);
355
+ },
356
+ find: async (
357
+ params: TestContractParams<
358
+ XAlphStakeVaultTypes.Fields,
359
+ { array: HexString; value: HexString },
360
+ XAlphStakeVaultTypes.Maps
361
+ >
362
+ ): Promise<TestContractResult<bigint, XAlphStakeVaultTypes.Maps>> => {
363
+ return testMethod(this, "find", params, getContractByCodeHash);
364
+ },
365
+ remove: async (
366
+ params: TestContractParams<
367
+ XAlphStakeVaultTypes.Fields,
368
+ { array: HexString; value: HexString },
369
+ XAlphStakeVaultTypes.Maps
370
+ >
371
+ ): Promise<TestContractResult<HexString, XAlphStakeVaultTypes.Maps>> => {
372
+ return testMethod(this, "remove", params, getContractByCodeHash);
373
+ },
374
+ push: async (
375
+ params: TestContractParams<
376
+ XAlphStakeVaultTypes.Fields,
377
+ { array: HexString; value: HexString },
378
+ XAlphStakeVaultTypes.Maps
379
+ >
380
+ ): Promise<TestContractResult<HexString, XAlphStakeVaultTypes.Maps>> => {
381
+ return testMethod(this, "push", params, getContractByCodeHash);
382
+ },
383
+ removeAt: async (
384
+ params: TestContractParams<
385
+ XAlphStakeVaultTypes.Fields,
386
+ { array: HexString; index: bigint },
387
+ XAlphStakeVaultTypes.Maps
388
+ >
389
+ ): Promise<TestContractResult<HexString, XAlphStakeVaultTypes.Maps>> => {
390
+ return testMethod(this, "removeAt", params, getContractByCodeHash);
391
+ },
392
+ size: async (
393
+ params: TestContractParams<
394
+ XAlphStakeVaultTypes.Fields,
395
+ { array: HexString },
396
+ XAlphStakeVaultTypes.Maps
397
+ >
398
+ ): Promise<TestContractResult<bigint, XAlphStakeVaultTypes.Maps>> => {
399
+ return testMethod(this, "size", params, getContractByCodeHash);
400
+ },
401
+ empty: async (
402
+ params: Omit<
403
+ TestContractParams<
404
+ XAlphStakeVaultTypes.Fields,
405
+ never,
406
+ XAlphStakeVaultTypes.Maps
407
+ >,
408
+ "args"
409
+ >
410
+ ): Promise<TestContractResult<HexString, XAlphStakeVaultTypes.Maps>> => {
411
+ return testMethod(this, "empty", params, getContractByCodeHash);
412
+ },
413
+ getMerkleRoot: async (
414
+ params: Omit<
415
+ TestContractParams<
416
+ XAlphStakeVaultTypes.Fields,
417
+ never,
418
+ XAlphStakeVaultTypes.Maps
419
+ >,
420
+ "args"
421
+ >
422
+ ): Promise<TestContractResult<HexString, XAlphStakeVaultTypes.Maps>> => {
423
+ return testMethod(this, "getMerkleRoot", params, getContractByCodeHash);
424
+ },
425
+ updateRoot: async (
426
+ params: TestContractParams<
427
+ XAlphStakeVaultTypes.Fields,
428
+ { newMerkleRoot: HexString },
429
+ XAlphStakeVaultTypes.Maps
430
+ >
431
+ ): Promise<TestContractResult<null, XAlphStakeVaultTypes.Maps>> => {
432
+ return testMethod(this, "updateRoot", params, getContractByCodeHash);
433
+ },
434
+ verify: async (
435
+ params: TestContractParams<
436
+ XAlphStakeVaultTypes.Fields,
437
+ { proof: HexString; dataHash: HexString },
438
+ XAlphStakeVaultTypes.Maps
439
+ >
440
+ ): Promise<TestContractResult<boolean, XAlphStakeVaultTypes.Maps>> => {
441
+ return testMethod(this, "verify", params, getContractByCodeHash);
442
+ },
443
+ hashPair: async (
444
+ params: TestContractParams<
445
+ XAlphStakeVaultTypes.Fields,
446
+ { a: HexString; b: HexString },
447
+ XAlphStakeVaultTypes.Maps
448
+ >
449
+ ): Promise<TestContractResult<HexString, XAlphStakeVaultTypes.Maps>> => {
450
+ return testMethod(this, "hashPair", params, getContractByCodeHash);
451
+ },
452
+ hash: async (
453
+ params: TestContractParams<
454
+ XAlphStakeVaultTypes.Fields,
455
+ { dataToHash: HexString },
456
+ XAlphStakeVaultTypes.Maps
457
+ >
458
+ ): Promise<TestContractResult<HexString, XAlphStakeVaultTypes.Maps>> => {
459
+ return testMethod(this, "hash", params, getContractByCodeHash);
460
+ },
461
+ getStakeTokenId: async (
462
+ params: Omit<
463
+ TestContractParams<
464
+ XAlphStakeVaultTypes.Fields,
465
+ never,
466
+ XAlphStakeVaultTypes.Maps
467
+ >,
468
+ "args"
469
+ >
470
+ ): Promise<TestContractResult<HexString, XAlphStakeVaultTypes.Maps>> => {
471
+ return testMethod(this, "getStakeTokenId", params, getContractByCodeHash);
472
+ },
473
+ getUserStakingInfo: async (
474
+ params: TestContractParams<
475
+ XAlphStakeVaultTypes.Fields,
476
+ { user: Address },
477
+ XAlphStakeVaultTypes.Maps
478
+ >
479
+ ): Promise<
480
+ TestContractResult<types.UserStakingInfo, XAlphStakeVaultTypes.Maps>
481
+ > => {
482
+ return testMethod(
483
+ this,
484
+ "getUserStakingInfo",
485
+ params,
486
+ getContractByCodeHash
487
+ );
488
+ },
489
+ isStaking: async (
490
+ params: TestContractParams<
491
+ XAlphStakeVaultTypes.Fields,
492
+ { user: Address },
493
+ XAlphStakeVaultTypes.Maps
494
+ >
495
+ ): Promise<TestContractResult<boolean, XAlphStakeVaultTypes.Maps>> => {
496
+ return testMethod(this, "isStaking", params, getContractByCodeHash);
497
+ },
498
+ stake: async (
499
+ params: TestContractParams<
500
+ XAlphStakeVaultTypes.Fields,
501
+ { amount: bigint },
502
+ XAlphStakeVaultTypes.Maps
503
+ >
504
+ ): Promise<TestContractResult<null, XAlphStakeVaultTypes.Maps>> => {
505
+ return testMethod(this, "stake", params, getContractByCodeHash);
506
+ },
507
+ unstake: async (
508
+ params: TestContractParams<
509
+ XAlphStakeVaultTypes.Fields,
510
+ { amount: bigint },
511
+ XAlphStakeVaultTypes.Maps
512
+ >
513
+ ): Promise<TestContractResult<null, XAlphStakeVaultTypes.Maps>> => {
514
+ return testMethod(this, "unstake", params, getContractByCodeHash);
515
+ },
516
+ connectToDapp: async (
517
+ params: TestContractParams<
518
+ XAlphStakeVaultTypes.Fields,
519
+ { contractId: HexString; merkleProof: HexString },
520
+ XAlphStakeVaultTypes.Maps
521
+ >
522
+ ): Promise<TestContractResult<null, XAlphStakeVaultTypes.Maps>> => {
523
+ return testMethod(this, "connectToDapp", params, getContractByCodeHash);
524
+ },
525
+ disconnectFromDapp: async (
526
+ params: TestContractParams<
527
+ XAlphStakeVaultTypes.Fields,
528
+ { contractId: HexString },
529
+ XAlphStakeVaultTypes.Maps
530
+ >
531
+ ): Promise<TestContractResult<null, XAlphStakeVaultTypes.Maps>> => {
532
+ return testMethod(
533
+ this,
534
+ "disconnectFromDapp",
535
+ params,
536
+ getContractByCodeHash
537
+ );
538
+ },
539
+ getWeight: async (
540
+ params: TestContractParams<
541
+ XAlphStakeVaultTypes.Fields,
542
+ { user: Address },
543
+ XAlphStakeVaultTypes.Maps
544
+ >
545
+ ): Promise<TestContractResult<bigint, XAlphStakeVaultTypes.Maps>> => {
546
+ return testMethod(this, "getWeight", params, getContractByCodeHash);
547
+ },
548
+ updateDappTemplatesWhitelistMerkleRoot: async (
549
+ params: TestContractParams<
550
+ XAlphStakeVaultTypes.Fields,
551
+ { newMerkleRoot: HexString },
552
+ XAlphStakeVaultTypes.Maps
553
+ >
554
+ ): Promise<TestContractResult<null, XAlphStakeVaultTypes.Maps>> => {
555
+ return testMethod(
556
+ this,
557
+ "updateDappTemplatesWhitelistMerkleRoot",
558
+ params,
559
+ getContractByCodeHash
560
+ );
561
+ },
562
+ updateOwner: async (
563
+ params: TestContractParams<
564
+ XAlphStakeVaultTypes.Fields,
565
+ { newOwner: Address },
566
+ XAlphStakeVaultTypes.Maps
567
+ >
568
+ ): Promise<TestContractResult<null, XAlphStakeVaultTypes.Maps>> => {
569
+ return testMethod(this, "updateOwner", params, getContractByCodeHash);
570
+ },
571
+ verifyDappTemplatesWhiteListed: async (
572
+ params: TestContractParams<
573
+ XAlphStakeVaultTypes.Fields,
574
+ { proof: HexString; contractId: HexString },
575
+ XAlphStakeVaultTypes.Maps
576
+ >
577
+ ): Promise<TestContractResult<boolean, XAlphStakeVaultTypes.Maps>> => {
578
+ return testMethod(
579
+ this,
580
+ "verifyDappTemplatesWhiteListed",
581
+ params,
582
+ getContractByCodeHash
583
+ );
584
+ },
585
+ };
586
+
587
+ stateForTest(
588
+ initFields: XAlphStakeVaultTypes.Fields,
589
+ asset?: Asset,
590
+ address?: string,
591
+ maps?: XAlphStakeVaultTypes.Maps
592
+ ) {
593
+ return this.stateForTest_(initFields, asset, address, maps);
594
+ }
595
+ }
596
+
597
+ // Use this object to test and deploy the contract
598
+ export const XAlphStakeVault = new Factory(
599
+ Contract.fromJson(
600
+ XAlphStakeVaultContractJson,
601
+ "=66-2+29=1-3=1+22=1-1+4=1+d=2-2+43=2-2+92=2-2+a9=2-2+c0=2-2+d9=1166-2+61=323-1+b=34+7a7e0214696e73657274206174206d617020706174683a2000=55-1+d=297-1+c=38+7a7e021472656d6f7665206174206d617020706174683a2000=976",
602
+ "5a98904451536bfc5851ac53658d832b096d820da66892272b361692d7a31790",
603
+ types.AllStructs
604
+ )
605
+ );
606
+ registerContract(XAlphStakeVault);
607
+
608
+ // Use this class to interact with the blockchain
609
+ export class XAlphStakeVaultInstance extends ContractInstance {
610
+ constructor(address: Address) {
611
+ super(address);
612
+ }
613
+
614
+ maps = {
615
+ userStakingInfo: new RalphMap<Address, types.UserStakingInfo>(
616
+ XAlphStakeVault.contract,
617
+ this.contractId,
618
+ "userStakingInfo"
619
+ ),
620
+ };
621
+
622
+ async fetchState(): Promise<XAlphStakeVaultTypes.State> {
623
+ return fetchContractState(XAlphStakeVault, this);
624
+ }
625
+
626
+ async getContractEventsCurrentCount(): Promise<number> {
627
+ return getContractEventsCurrentCount(this.address);
628
+ }
629
+
630
+ subscribeUpdateRootEvent(
631
+ options: EventSubscribeOptions<XAlphStakeVaultTypes.UpdateRootEvent>,
632
+ fromCount?: number
633
+ ): EventSubscription {
634
+ return subscribeContractEvent(
635
+ XAlphStakeVault.contract,
636
+ this,
637
+ options,
638
+ "UpdateRoot",
639
+ fromCount
640
+ );
641
+ }
642
+
643
+ subscribeStakedEvent(
644
+ options: EventSubscribeOptions<XAlphStakeVaultTypes.StakedEvent>,
645
+ fromCount?: number
646
+ ): EventSubscription {
647
+ return subscribeContractEvent(
648
+ XAlphStakeVault.contract,
649
+ this,
650
+ options,
651
+ "Staked",
652
+ fromCount
653
+ );
654
+ }
655
+
656
+ subscribeUnstakedEvent(
657
+ options: EventSubscribeOptions<XAlphStakeVaultTypes.UnstakedEvent>,
658
+ fromCount?: number
659
+ ): EventSubscription {
660
+ return subscribeContractEvent(
661
+ XAlphStakeVault.contract,
662
+ this,
663
+ options,
664
+ "Unstaked",
665
+ fromCount
666
+ );
667
+ }
668
+
669
+ subscribeAllEvents(
670
+ options: EventSubscribeOptions<
671
+ | XAlphStakeVaultTypes.UpdateRootEvent
672
+ | XAlphStakeVaultTypes.StakedEvent
673
+ | XAlphStakeVaultTypes.UnstakedEvent
674
+ >,
675
+ fromCount?: number
676
+ ): EventSubscription {
677
+ return subscribeContractEvents(
678
+ XAlphStakeVault.contract,
679
+ this,
680
+ options,
681
+ fromCount
682
+ );
683
+ }
684
+
685
+ view = {
686
+ get: async (
687
+ params: XAlphStakeVaultTypes.CallMethodParams<"get">
688
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"get">> => {
689
+ return callMethod(
690
+ XAlphStakeVault,
691
+ this,
692
+ "get",
693
+ params,
694
+ getContractByCodeHash
695
+ );
696
+ },
697
+ find: async (
698
+ params: XAlphStakeVaultTypes.CallMethodParams<"find">
699
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"find">> => {
700
+ return callMethod(
701
+ XAlphStakeVault,
702
+ this,
703
+ "find",
704
+ params,
705
+ getContractByCodeHash
706
+ );
707
+ },
708
+ remove: async (
709
+ params: XAlphStakeVaultTypes.CallMethodParams<"remove">
710
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"remove">> => {
711
+ return callMethod(
712
+ XAlphStakeVault,
713
+ this,
714
+ "remove",
715
+ params,
716
+ getContractByCodeHash
717
+ );
718
+ },
719
+ push: async (
720
+ params: XAlphStakeVaultTypes.CallMethodParams<"push">
721
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"push">> => {
722
+ return callMethod(
723
+ XAlphStakeVault,
724
+ this,
725
+ "push",
726
+ params,
727
+ getContractByCodeHash
728
+ );
729
+ },
730
+ removeAt: async (
731
+ params: XAlphStakeVaultTypes.CallMethodParams<"removeAt">
732
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"removeAt">> => {
733
+ return callMethod(
734
+ XAlphStakeVault,
735
+ this,
736
+ "removeAt",
737
+ params,
738
+ getContractByCodeHash
739
+ );
740
+ },
741
+ size: async (
742
+ params: XAlphStakeVaultTypes.CallMethodParams<"size">
743
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"size">> => {
744
+ return callMethod(
745
+ XAlphStakeVault,
746
+ this,
747
+ "size",
748
+ params,
749
+ getContractByCodeHash
750
+ );
751
+ },
752
+ empty: async (
753
+ params?: XAlphStakeVaultTypes.CallMethodParams<"empty">
754
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"empty">> => {
755
+ return callMethod(
756
+ XAlphStakeVault,
757
+ this,
758
+ "empty",
759
+ params === undefined ? {} : params,
760
+ getContractByCodeHash
761
+ );
762
+ },
763
+ getMerkleRoot: async (
764
+ params?: XAlphStakeVaultTypes.CallMethodParams<"getMerkleRoot">
765
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"getMerkleRoot">> => {
766
+ return callMethod(
767
+ XAlphStakeVault,
768
+ this,
769
+ "getMerkleRoot",
770
+ params === undefined ? {} : params,
771
+ getContractByCodeHash
772
+ );
773
+ },
774
+ updateRoot: async (
775
+ params: XAlphStakeVaultTypes.CallMethodParams<"updateRoot">
776
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"updateRoot">> => {
777
+ return callMethod(
778
+ XAlphStakeVault,
779
+ this,
780
+ "updateRoot",
781
+ params,
782
+ getContractByCodeHash
783
+ );
784
+ },
785
+ verify: async (
786
+ params: XAlphStakeVaultTypes.CallMethodParams<"verify">
787
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"verify">> => {
788
+ return callMethod(
789
+ XAlphStakeVault,
790
+ this,
791
+ "verify",
792
+ params,
793
+ getContractByCodeHash
794
+ );
795
+ },
796
+ hashPair: async (
797
+ params: XAlphStakeVaultTypes.CallMethodParams<"hashPair">
798
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"hashPair">> => {
799
+ return callMethod(
800
+ XAlphStakeVault,
801
+ this,
802
+ "hashPair",
803
+ params,
804
+ getContractByCodeHash
805
+ );
806
+ },
807
+ hash: async (
808
+ params: XAlphStakeVaultTypes.CallMethodParams<"hash">
809
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"hash">> => {
810
+ return callMethod(
811
+ XAlphStakeVault,
812
+ this,
813
+ "hash",
814
+ params,
815
+ getContractByCodeHash
816
+ );
817
+ },
818
+ getStakeTokenId: async (
819
+ params?: XAlphStakeVaultTypes.CallMethodParams<"getStakeTokenId">
820
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"getStakeTokenId">> => {
821
+ return callMethod(
822
+ XAlphStakeVault,
823
+ this,
824
+ "getStakeTokenId",
825
+ params === undefined ? {} : params,
826
+ getContractByCodeHash
827
+ );
828
+ },
829
+ getUserStakingInfo: async (
830
+ params: XAlphStakeVaultTypes.CallMethodParams<"getUserStakingInfo">
831
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"getUserStakingInfo">> => {
832
+ return callMethod(
833
+ XAlphStakeVault,
834
+ this,
835
+ "getUserStakingInfo",
836
+ params,
837
+ getContractByCodeHash
838
+ );
839
+ },
840
+ isStaking: async (
841
+ params: XAlphStakeVaultTypes.CallMethodParams<"isStaking">
842
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"isStaking">> => {
843
+ return callMethod(
844
+ XAlphStakeVault,
845
+ this,
846
+ "isStaking",
847
+ params,
848
+ getContractByCodeHash
849
+ );
850
+ },
851
+ stake: async (
852
+ params: XAlphStakeVaultTypes.CallMethodParams<"stake">
853
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"stake">> => {
854
+ return callMethod(
855
+ XAlphStakeVault,
856
+ this,
857
+ "stake",
858
+ params,
859
+ getContractByCodeHash
860
+ );
861
+ },
862
+ unstake: async (
863
+ params: XAlphStakeVaultTypes.CallMethodParams<"unstake">
864
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"unstake">> => {
865
+ return callMethod(
866
+ XAlphStakeVault,
867
+ this,
868
+ "unstake",
869
+ params,
870
+ getContractByCodeHash
871
+ );
872
+ },
873
+ connectToDapp: async (
874
+ params: XAlphStakeVaultTypes.CallMethodParams<"connectToDapp">
875
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"connectToDapp">> => {
876
+ return callMethod(
877
+ XAlphStakeVault,
878
+ this,
879
+ "connectToDapp",
880
+ params,
881
+ getContractByCodeHash
882
+ );
883
+ },
884
+ disconnectFromDapp: async (
885
+ params: XAlphStakeVaultTypes.CallMethodParams<"disconnectFromDapp">
886
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"disconnectFromDapp">> => {
887
+ return callMethod(
888
+ XAlphStakeVault,
889
+ this,
890
+ "disconnectFromDapp",
891
+ params,
892
+ getContractByCodeHash
893
+ );
894
+ },
895
+ getWeight: async (
896
+ params: XAlphStakeVaultTypes.CallMethodParams<"getWeight">
897
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"getWeight">> => {
898
+ return callMethod(
899
+ XAlphStakeVault,
900
+ this,
901
+ "getWeight",
902
+ params,
903
+ getContractByCodeHash
904
+ );
905
+ },
906
+ updateDappTemplatesWhitelistMerkleRoot: async (
907
+ params: XAlphStakeVaultTypes.CallMethodParams<"updateDappTemplatesWhitelistMerkleRoot">
908
+ ): Promise<
909
+ XAlphStakeVaultTypes.CallMethodResult<"updateDappTemplatesWhitelistMerkleRoot">
910
+ > => {
911
+ return callMethod(
912
+ XAlphStakeVault,
913
+ this,
914
+ "updateDappTemplatesWhitelistMerkleRoot",
915
+ params,
916
+ getContractByCodeHash
917
+ );
918
+ },
919
+ updateOwner: async (
920
+ params: XAlphStakeVaultTypes.CallMethodParams<"updateOwner">
921
+ ): Promise<XAlphStakeVaultTypes.CallMethodResult<"updateOwner">> => {
922
+ return callMethod(
923
+ XAlphStakeVault,
924
+ this,
925
+ "updateOwner",
926
+ params,
927
+ getContractByCodeHash
928
+ );
929
+ },
930
+ verifyDappTemplatesWhiteListed: async (
931
+ params: XAlphStakeVaultTypes.CallMethodParams<"verifyDappTemplatesWhiteListed">
932
+ ): Promise<
933
+ XAlphStakeVaultTypes.CallMethodResult<"verifyDappTemplatesWhiteListed">
934
+ > => {
935
+ return callMethod(
936
+ XAlphStakeVault,
937
+ this,
938
+ "verifyDappTemplatesWhiteListed",
939
+ params,
940
+ getContractByCodeHash
941
+ );
942
+ },
943
+ };
944
+
945
+ transact = {
946
+ get: async (
947
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"get">
948
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"get">> => {
949
+ return signExecuteMethod(XAlphStakeVault, this, "get", params);
950
+ },
951
+ find: async (
952
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"find">
953
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"find">> => {
954
+ return signExecuteMethod(XAlphStakeVault, this, "find", params);
955
+ },
956
+ remove: async (
957
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"remove">
958
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"remove">> => {
959
+ return signExecuteMethod(XAlphStakeVault, this, "remove", params);
960
+ },
961
+ push: async (
962
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"push">
963
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"push">> => {
964
+ return signExecuteMethod(XAlphStakeVault, this, "push", params);
965
+ },
966
+ removeAt: async (
967
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"removeAt">
968
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"removeAt">> => {
969
+ return signExecuteMethod(XAlphStakeVault, this, "removeAt", params);
970
+ },
971
+ size: async (
972
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"size">
973
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"size">> => {
974
+ return signExecuteMethod(XAlphStakeVault, this, "size", params);
975
+ },
976
+ empty: async (
977
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"empty">
978
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"empty">> => {
979
+ return signExecuteMethod(XAlphStakeVault, this, "empty", params);
980
+ },
981
+ getMerkleRoot: async (
982
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"getMerkleRoot">
983
+ ): Promise<
984
+ XAlphStakeVaultTypes.SignExecuteMethodResult<"getMerkleRoot">
985
+ > => {
986
+ return signExecuteMethod(XAlphStakeVault, this, "getMerkleRoot", params);
987
+ },
988
+ updateRoot: async (
989
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"updateRoot">
990
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"updateRoot">> => {
991
+ return signExecuteMethod(XAlphStakeVault, this, "updateRoot", params);
992
+ },
993
+ verify: async (
994
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"verify">
995
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"verify">> => {
996
+ return signExecuteMethod(XAlphStakeVault, this, "verify", params);
997
+ },
998
+ hashPair: async (
999
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"hashPair">
1000
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"hashPair">> => {
1001
+ return signExecuteMethod(XAlphStakeVault, this, "hashPair", params);
1002
+ },
1003
+ hash: async (
1004
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"hash">
1005
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"hash">> => {
1006
+ return signExecuteMethod(XAlphStakeVault, this, "hash", params);
1007
+ },
1008
+ getStakeTokenId: async (
1009
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"getStakeTokenId">
1010
+ ): Promise<
1011
+ XAlphStakeVaultTypes.SignExecuteMethodResult<"getStakeTokenId">
1012
+ > => {
1013
+ return signExecuteMethod(
1014
+ XAlphStakeVault,
1015
+ this,
1016
+ "getStakeTokenId",
1017
+ params
1018
+ );
1019
+ },
1020
+ getUserStakingInfo: async (
1021
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"getUserStakingInfo">
1022
+ ): Promise<
1023
+ XAlphStakeVaultTypes.SignExecuteMethodResult<"getUserStakingInfo">
1024
+ > => {
1025
+ return signExecuteMethod(
1026
+ XAlphStakeVault,
1027
+ this,
1028
+ "getUserStakingInfo",
1029
+ params
1030
+ );
1031
+ },
1032
+ isStaking: async (
1033
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"isStaking">
1034
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"isStaking">> => {
1035
+ return signExecuteMethod(XAlphStakeVault, this, "isStaking", params);
1036
+ },
1037
+ stake: async (
1038
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"stake">
1039
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"stake">> => {
1040
+ return signExecuteMethod(XAlphStakeVault, this, "stake", params);
1041
+ },
1042
+ unstake: async (
1043
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"unstake">
1044
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"unstake">> => {
1045
+ return signExecuteMethod(XAlphStakeVault, this, "unstake", params);
1046
+ },
1047
+ connectToDapp: async (
1048
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"connectToDapp">
1049
+ ): Promise<
1050
+ XAlphStakeVaultTypes.SignExecuteMethodResult<"connectToDapp">
1051
+ > => {
1052
+ return signExecuteMethod(XAlphStakeVault, this, "connectToDapp", params);
1053
+ },
1054
+ disconnectFromDapp: async (
1055
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"disconnectFromDapp">
1056
+ ): Promise<
1057
+ XAlphStakeVaultTypes.SignExecuteMethodResult<"disconnectFromDapp">
1058
+ > => {
1059
+ return signExecuteMethod(
1060
+ XAlphStakeVault,
1061
+ this,
1062
+ "disconnectFromDapp",
1063
+ params
1064
+ );
1065
+ },
1066
+ getWeight: async (
1067
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"getWeight">
1068
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"getWeight">> => {
1069
+ return signExecuteMethod(XAlphStakeVault, this, "getWeight", params);
1070
+ },
1071
+ updateDappTemplatesWhitelistMerkleRoot: async (
1072
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"updateDappTemplatesWhitelistMerkleRoot">
1073
+ ): Promise<
1074
+ XAlphStakeVaultTypes.SignExecuteMethodResult<"updateDappTemplatesWhitelistMerkleRoot">
1075
+ > => {
1076
+ return signExecuteMethod(
1077
+ XAlphStakeVault,
1078
+ this,
1079
+ "updateDappTemplatesWhitelistMerkleRoot",
1080
+ params
1081
+ );
1082
+ },
1083
+ updateOwner: async (
1084
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"updateOwner">
1085
+ ): Promise<XAlphStakeVaultTypes.SignExecuteMethodResult<"updateOwner">> => {
1086
+ return signExecuteMethod(XAlphStakeVault, this, "updateOwner", params);
1087
+ },
1088
+ verifyDappTemplatesWhiteListed: async (
1089
+ params: XAlphStakeVaultTypes.SignExecuteMethodParams<"verifyDappTemplatesWhiteListed">
1090
+ ): Promise<
1091
+ XAlphStakeVaultTypes.SignExecuteMethodResult<"verifyDappTemplatesWhiteListed">
1092
+ > => {
1093
+ return signExecuteMethod(
1094
+ XAlphStakeVault,
1095
+ this,
1096
+ "verifyDappTemplatesWhiteListed",
1097
+ params
1098
+ );
1099
+ },
1100
+ };
1101
+
1102
+ async multicall<Calls extends XAlphStakeVaultTypes.MultiCallParams>(
1103
+ calls: Calls
1104
+ ): Promise<XAlphStakeVaultTypes.MultiCallResults<Calls>>;
1105
+ async multicall<Callss extends XAlphStakeVaultTypes.MultiCallParams[]>(
1106
+ callss: Narrow<Callss>
1107
+ ): Promise<XAlphStakeVaultTypes.MulticallReturnType<Callss>>;
1108
+ async multicall<
1109
+ Callss extends
1110
+ | XAlphStakeVaultTypes.MultiCallParams
1111
+ | XAlphStakeVaultTypes.MultiCallParams[]
1112
+ >(callss: Callss): Promise<unknown> {
1113
+ return await multicallMethods(
1114
+ XAlphStakeVault,
1115
+ this,
1116
+ callss,
1117
+ getContractByCodeHash
1118
+ );
1119
+ }
1120
+ }