@waterx/sdk 2.4.1 → 3.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 (222) hide show
  1. package/README.md +25 -21
  2. package/dist/src/{utils → account}/account-request.d.ts +2 -2
  3. package/dist/src/{user → account}/account.d.ts +23 -21
  4. package/dist/src/{user → account}/account.js +5 -5
  5. package/dist/src/account/client.d.ts +42 -0
  6. package/dist/src/account/client.js +17 -0
  7. package/dist/src/account/config.d.ts +151 -0
  8. package/dist/src/account/config.js +8 -0
  9. package/dist/src/account/constants.d.ts +5 -0
  10. package/dist/src/account/constants.js +5 -0
  11. package/dist/src/account/fetch/referral.d.ts +15 -0
  12. package/dist/src/account/fetch/referral.js +51 -0
  13. package/dist/src/account/fetch/simulate.d.ts +34 -0
  14. package/dist/src/account/fetch/simulate.js +43 -0
  15. package/dist/src/{utils/consolidate-balance.d.ts → account/funding/balance.d.ts} +3 -8
  16. package/dist/src/{utils/consolidate-balance.js → account/funding/balance.js} +6 -1
  17. package/dist/src/account/funding/consolidate.d.ts +46 -0
  18. package/dist/src/account/funding/consolidate.js +137 -0
  19. package/dist/src/{user → account/funding}/credit.d.ts +10 -10
  20. package/dist/src/{user → account/funding}/credit.js +6 -6
  21. package/dist/src/{user → account/funding}/custody.d.ts +4 -4
  22. package/dist/src/{user → account/funding}/custody.js +2 -2
  23. package/dist/src/{utils → account/funding}/wormhole.d.ts +4 -4
  24. package/dist/src/{utils → account/funding}/wormhole.js +1 -1
  25. package/dist/src/account/index.d.ts +29 -0
  26. package/dist/src/account/index.js +29 -0
  27. package/dist/src/{user → account}/referral.d.ts +3 -3
  28. package/dist/src/{user → account}/referral.js +1 -1
  29. package/dist/src/base-client.d.ts +74 -0
  30. package/dist/src/base-client.js +97 -0
  31. package/dist/src/constants.d.ts +4 -46
  32. package/dist/src/constants.js +8 -52
  33. package/dist/src/generated/bucket_v2_framework/liability.d.ts +0 -26
  34. package/dist/src/generated/bucket_v2_framework/liability.js +0 -28
  35. package/dist/src/generated/waterx_account/account.d.ts +50 -15
  36. package/dist/src/generated/waterx_account/account.js +51 -15
  37. package/dist/src/generated/waterx_oracle/oracle.d.ts +7 -1
  38. package/dist/src/generated/waterx_oracle/oracle.js +7 -2
  39. package/dist/src/{prediction/generated → generated}/waterx_prediction/account_data.d.ts +19 -2
  40. package/dist/src/{prediction/generated → generated}/waterx_prediction/admin.d.ts +3 -1
  41. package/dist/src/{prediction/generated → generated}/waterx_prediction/deps/sui/balance.d.ts +3 -1
  42. package/dist/src/{prediction/generated/waterx_account → generated/waterx_prediction}/deps/sui/table.d.ts +6 -1
  43. package/dist/src/generated/waterx_prediction/events.d.ts +288 -0
  44. package/dist/src/{prediction/generated → generated}/waterx_prediction/events.js +39 -0
  45. package/dist/src/{prediction/generated → generated}/waterx_prediction/global_config.d.ts +6 -1
  46. package/dist/src/{prediction/generated → generated}/waterx_prediction/order.d.ts +34 -1
  47. package/dist/src/{prediction/generated → generated}/waterx_prediction/position.d.ts +16 -1
  48. package/dist/src/{prediction/generated → generated}/waterx_prediction/view.d.ts +69 -4
  49. package/dist/src/{prediction/generated → generated}/waterx_prediction/waterx_prediction.d.ts +162 -2
  50. package/dist/src/{prediction/generated → generated}/waterx_prediction/waterx_prediction.js +99 -0
  51. package/dist/src/generated/waterx_pyth_rule/pyth_rule.d.ts +102 -0
  52. package/dist/src/generated/waterx_pyth_rule/pyth_rule.js +99 -0
  53. package/dist/src/generated/waterx_supra_rule/supra_rule.d.ts +5 -5
  54. package/dist/src/generated/waterx_supra_rule/supra_rule.js +1 -2
  55. package/dist/src/generated/withdrawal_queue/withdrawal_queue.d.ts +23 -23
  56. package/dist/src/generated/withdrawal_queue/withdrawal_queue.js +3 -6
  57. package/dist/src/oracle/aggregate.d.ts +74 -0
  58. package/dist/src/oracle/aggregate.js +112 -0
  59. package/dist/src/oracle/config.d.ts +99 -0
  60. package/dist/src/oracle/config.js +23 -0
  61. package/dist/src/oracle/host.d.ts +32 -0
  62. package/dist/src/oracle/host.js +10 -0
  63. package/dist/src/oracle/index.d.ts +16 -0
  64. package/dist/src/oracle/index.js +18 -0
  65. package/dist/src/oracle/pyth.d.ts +52 -0
  66. package/dist/src/oracle/pyth.js +220 -0
  67. package/dist/src/oracle/rules/constant-rule.d.ts +9 -0
  68. package/dist/src/oracle/rules/constant-rule.js +14 -0
  69. package/dist/src/oracle/rules/pyth-rule.d.ts +11 -0
  70. package/dist/src/oracle/rules/pyth-rule.js +20 -0
  71. package/dist/src/oracle/rules/sponsor.d.ts +28 -0
  72. package/dist/src/oracle/rules/sponsor.js +48 -0
  73. package/dist/src/oracle/rules/supra-rule.d.ts +11 -0
  74. package/dist/src/oracle/rules/supra-rule.js +22 -0
  75. package/dist/src/perp/client.d.ts +78 -0
  76. package/dist/src/perp/client.js +108 -0
  77. package/dist/src/{client.d.ts → perp/config-view.d.ts} +15 -60
  78. package/dist/src/{client.js → perp/config-view.js} +23 -95
  79. package/dist/src/perp/config.d.ts +126 -0
  80. package/dist/src/{config.js → perp/config.js} +11 -12
  81. package/dist/src/perp/constants.d.ts +49 -0
  82. package/dist/src/perp/constants.js +61 -0
  83. package/dist/src/perp/fetch/account.d.ts +43 -0
  84. package/dist/src/perp/fetch/account.js +64 -0
  85. package/dist/src/perp/fetch/bridge.d.ts +90 -0
  86. package/dist/src/perp/fetch/bridge.js +127 -0
  87. package/dist/src/perp/fetch/custody.d.ts +32 -0
  88. package/dist/src/perp/fetch/custody.js +62 -0
  89. package/dist/src/perp/fetch/market.d.ts +30 -0
  90. package/dist/src/perp/fetch/market.js +68 -0
  91. package/dist/src/perp/fetch/positions.d.ts +70 -0
  92. package/dist/src/perp/fetch/positions.js +185 -0
  93. package/dist/src/perp/fetch/simulate.d.ts +12 -0
  94. package/dist/src/perp/fetch/simulate.js +13 -0
  95. package/dist/src/perp/fetch.d.ts +23 -0
  96. package/dist/src/perp/fetch.js +23 -0
  97. package/dist/src/{index.d.ts → perp/index.d.ts} +21 -21
  98. package/dist/src/{index.js → perp/index.js} +21 -21
  99. package/dist/src/perp/tx-builders/common.d.ts +83 -0
  100. package/dist/src/perp/tx-builders/common.js +70 -0
  101. package/dist/src/perp/tx-builders/credit.d.ts +65 -0
  102. package/dist/src/perp/tx-builders/credit.js +62 -0
  103. package/dist/src/perp/tx-builders/rewards.d.ts +30 -0
  104. package/dist/src/perp/tx-builders/rewards.js +34 -0
  105. package/dist/src/perp/tx-builders/trading.d.ts +51 -0
  106. package/dist/src/perp/tx-builders/trading.js +59 -0
  107. package/dist/src/perp/tx-builders/wlp.d.ts +90 -0
  108. package/dist/src/perp/tx-builders/wlp.js +120 -0
  109. package/dist/src/perp/tx-builders.d.ts +23 -0
  110. package/dist/src/perp/tx-builders.js +23 -0
  111. package/dist/src/perp/user/index.d.ts +8 -0
  112. package/dist/src/perp/user/index.js +8 -0
  113. package/dist/src/{user → perp/user}/order.d.ts +7 -7
  114. package/dist/src/{user → perp/user}/order.js +3 -3
  115. package/dist/src/{user → perp/user}/staking.d.ts +4 -4
  116. package/dist/src/{user → perp/user}/staking.js +2 -2
  117. package/dist/src/{user → perp/user}/trading.d.ts +13 -13
  118. package/dist/src/{user → perp/user}/trading.js +2 -2
  119. package/dist/src/{user → perp/user}/wlp.d.ts +7 -7
  120. package/dist/src/{user → perp/user}/wlp.js +3 -3
  121. package/dist/src/prediction/account.js +40 -76
  122. package/dist/src/prediction/client.d.ts +8 -38
  123. package/dist/src/prediction/client.js +11 -67
  124. package/dist/src/prediction/config.d.ts +16 -2
  125. package/dist/src/prediction/config.js +10 -4
  126. package/dist/src/prediction/index.d.ts +11 -11
  127. package/dist/src/prediction/index.js +10 -10
  128. package/dist/src/prediction/prediction.d.ts +45 -0
  129. package/dist/src/prediction/prediction.js +71 -0
  130. package/dist/src/prediction/tx-builders.d.ts +4 -4
  131. package/dist/src/prediction/tx-builders.js +2 -2
  132. package/dist/src/prediction/user/index.d.ts +2 -2
  133. package/dist/src/prediction/user/index.js +1 -1
  134. package/dist/src/prediction/user/position.d.ts +2 -2
  135. package/dist/src/prediction/user/position.js +1 -1
  136. package/dist/src/prediction/utils/bcs.d.ts +5 -0
  137. package/dist/src/prediction/utils/bcs.js +5 -0
  138. package/dist/src/prediction/utils/index.d.ts +7 -0
  139. package/dist/src/prediction/utils/index.js +7 -0
  140. package/dist/src/sdk.d.ts +10 -6
  141. package/dist/src/sdk.js +9 -5
  142. package/dist/src/unified-client.d.ts +140 -145
  143. package/dist/src/unified-client.js +98 -40
  144. package/dist/src/utils/config.d.ts +1 -1
  145. package/package.json +22 -5
  146. package/dist/src/config.d.ts +0 -292
  147. package/dist/src/fetch.d.ts +0 -254
  148. package/dist/src/fetch.js +0 -564
  149. package/dist/src/prediction/generated/bucket_v2_framework/account.d.ts +0 -100
  150. package/dist/src/prediction/generated/bucket_v2_framework/account.js +0 -129
  151. package/dist/src/prediction/generated/bucket_v2_framework/deps/std/type_name.d.ts +0 -6
  152. package/dist/src/prediction/generated/bucket_v2_framework/deps/std/type_name.js +0 -19
  153. package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/balance.d.ts +0 -10
  154. package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_map.d.ts +0 -36
  155. package/dist/src/prediction/generated/bucket_v2_framework/deps/sui/vec_map.js +0 -27
  156. package/dist/src/prediction/generated/bucket_v2_framework/double.d.ts +0 -382
  157. package/dist/src/prediction/generated/bucket_v2_framework/double.js +0 -466
  158. package/dist/src/prediction/generated/bucket_v2_framework/float.d.ts +0 -362
  159. package/dist/src/prediction/generated/bucket_v2_framework/float.js +0 -440
  160. package/dist/src/prediction/generated/bucket_v2_framework/liability.d.ts +0 -193
  161. package/dist/src/prediction/generated/bucket_v2_framework/liability.js +0 -205
  162. package/dist/src/prediction/generated/bucket_v2_framework/linked_table.d.ts +0 -384
  163. package/dist/src/prediction/generated/bucket_v2_framework/linked_table.js +0 -382
  164. package/dist/src/prediction/generated/bucket_v2_framework/sheet.d.ts +0 -344
  165. package/dist/src/prediction/generated/bucket_v2_framework/sheet.js +0 -338
  166. package/dist/src/prediction/generated/utils/index.d.ts +0 -30
  167. package/dist/src/prediction/generated/utils/index.js +0 -160
  168. package/dist/src/prediction/generated/waterx_account/account.d.ts +0 -1589
  169. package/dist/src/prediction/generated/waterx_account/account.js +0 -1758
  170. package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/liability.d.ts +0 -7
  171. package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/liability.js +0 -13
  172. package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/sheet.d.ts +0 -7
  173. package/dist/src/prediction/generated/waterx_account/deps/bucket_v2_framework/sheet.js +0 -16
  174. package/dist/src/prediction/generated/waterx_account/deps/std/type_name.d.ts +0 -6
  175. package/dist/src/prediction/generated/waterx_account/deps/std/type_name.js +0 -19
  176. package/dist/src/prediction/generated/waterx_account/deps/sui/balance.d.ts +0 -10
  177. package/dist/src/prediction/generated/waterx_account/deps/sui/balance.js +0 -14
  178. package/dist/src/prediction/generated/waterx_account/deps/sui/object_table.d.ts +0 -12
  179. package/dist/src/prediction/generated/waterx_account/deps/sui/object_table.js +0 -19
  180. package/dist/src/prediction/generated/waterx_account/deps/sui/vec_map.d.ts +0 -36
  181. package/dist/src/prediction/generated/waterx_account/deps/sui/vec_map.js +0 -27
  182. package/dist/src/prediction/generated/waterx_account/deps/sui/vec_set.d.ts +0 -16
  183. package/dist/src/prediction/generated/waterx_account/deps/sui/vec_set.js +0 -19
  184. package/dist/src/prediction/generated/waterx_account/direct_rule.d.ts +0 -75
  185. package/dist/src/prediction/generated/waterx_account/direct_rule.js +0 -78
  186. package/dist/src/prediction/generated/waterx_account/events.d.ts +0 -33
  187. package/dist/src/prediction/generated/waterx_account/events.js +0 -137
  188. package/dist/src/prediction/generated/waterx_account/version.js +0 -8
  189. package/dist/src/prediction/generated/waterx_prediction/bet_sharing.d.ts +0 -60
  190. package/dist/src/prediction/generated/waterx_prediction/bet_sharing.js +0 -83
  191. package/dist/src/prediction/generated/waterx_prediction/deps/sui/balance.js +0 -14
  192. package/dist/src/prediction/generated/waterx_prediction/deps/sui/table.d.ts +0 -24
  193. package/dist/src/prediction/generated/waterx_prediction/deps/sui/table.js +0 -31
  194. package/dist/src/prediction/generated/waterx_prediction/deps/sui/vec_set.d.ts +0 -16
  195. package/dist/src/prediction/generated/waterx_prediction/deps/sui/vec_set.js +0 -19
  196. package/dist/src/prediction/generated/waterx_prediction/events.d.ts +0 -22
  197. package/dist/src/prediction/generated/waterx_prediction/version.d.ts +0 -10
  198. package/dist/src/tx-builders.d.ts +0 -296
  199. package/dist/src/tx-builders.js +0 -461
  200. package/dist/src/user/index.d.ts +0 -8
  201. package/dist/src/user/index.js +0 -8
  202. package/dist/src/utils/pyth.d.ts +0 -124
  203. package/dist/src/utils/pyth.js +0 -392
  204. /package/dist/src/{utils → account}/account-request.js +0 -0
  205. /package/dist/src/{core → account}/waterx-account.d.ts +0 -0
  206. /package/dist/src/{core → account}/waterx-account.js +0 -0
  207. /package/dist/src/{prediction/generated → generated}/waterx_prediction/account_data.js +0 -0
  208. /package/dist/src/{prediction/generated → generated}/waterx_prediction/admin.js +0 -0
  209. /package/dist/src/{prediction/generated → generated}/waterx_prediction/deps/bucket_v2_framework/linked_table.d.ts +0 -0
  210. /package/dist/src/{prediction/generated → generated}/waterx_prediction/deps/bucket_v2_framework/linked_table.js +0 -0
  211. /package/dist/src/{prediction/generated/bucket_v2_framework → generated/waterx_prediction}/deps/sui/balance.js +0 -0
  212. /package/dist/src/{prediction/generated/waterx_account → generated/waterx_prediction}/deps/sui/table.js +0 -0
  213. /package/dist/src/{prediction/generated/bucket_v2_framework → generated/waterx_prediction}/deps/sui/vec_set.d.ts +0 -0
  214. /package/dist/src/{prediction/generated/bucket_v2_framework → generated/waterx_prediction}/deps/sui/vec_set.js +0 -0
  215. /package/dist/src/{prediction/generated → generated}/waterx_prediction/global_config.js +0 -0
  216. /package/dist/src/{prediction/generated → generated}/waterx_prediction/order.js +0 -0
  217. /package/dist/src/{prediction/generated → generated}/waterx_prediction/outcome.d.ts +0 -0
  218. /package/dist/src/{prediction/generated → generated}/waterx_prediction/outcome.js +0 -0
  219. /package/dist/src/{prediction/generated → generated}/waterx_prediction/position.js +0 -0
  220. /package/dist/src/{prediction/generated/waterx_account → generated/waterx_prediction}/version.d.ts +0 -0
  221. /package/dist/src/{prediction/generated → generated}/waterx_prediction/version.js +0 -0
  222. /package/dist/src/{prediction/generated → generated}/waterx_prediction/view.js +0 -0
package/dist/src/fetch.js DELETED
@@ -1,564 +0,0 @@
1
- /**
2
- * Read-only queries built on top of `waterx_perp_view`.
3
- *
4
- * Each helper builds a one-shot PTB, runs `client.simulate(tx)`, and
5
- * decodes the first command's return values into the matching generated
6
- * BCS struct. The simulated sender is the zero address.
7
- */
8
- import { fromBase64 } from "@mysten/bcs";
9
- import { bcs } from "@mysten/sui/bcs";
10
- import { Transaction } from "@mysten/sui/transactions";
11
- import { COLLATERAL_DECIMALS, DRY_RUN_SENDER } from "./constants.js";
12
- import { burnFeeRate as burnFeeRateCall, creditSupply as creditSupplyCall, hasAsset as hasAssetCall, mintFeeRate as mintFeeRateCall, } from "./generated/native_custody/custody_vault.js";
13
- import { accountBalance as accountBalanceCall, accountIds as accountIdsCall, } from "./generated/waterx_account/account.js";
14
- import { AccountData, accountData as accountDataCall, getAccountOrders as getAccountOrdersCall, getAccountPositions as getAccountPositionsCall, getMarketOrders as getMarketOrdersCall, getMarketPositions as getMarketPositionsCall, getRedeemRequests as getRedeemRequestsCall, GlobalConfigData, globalConfigData as globalConfigDataCall, MarketData, marketData as marketDataCall, OrderData, orderData as orderDataCall, PoolData, poolData as poolDataCall, PositionData, positionData as positionDataCall, positionExists as positionExistsCall, RedeemRequestData, TokenPoolData, tokenPoolData as tokenPoolDataCall, } from "./generated/waterx_perp_view/view.js";
15
- // ============================================================================
16
- // Referral queries (waterx_referral::referral_table)
17
- // ============================================================================
18
- import { isValidReferralCode as isValidReferralCodeCall, referralCodeExists as referralCodeExistsCall, tryGetRefer as tryGetReferCall, } from "./generated/waterx_referral/referral_table.js";
19
- import { bridgeFeeAmount as bridgeFeeAmountCall, bridgeFeeRate as bridgeFeeRateCall, bridgeMinFee as bridgeMinFeeCall, wouldExecuteWormhole as wouldExecuteWormholeCall, } from "./generated/withdrawal_queue/withdrawal_queue.js";
20
- import { dailyBurned as dailyBurnedCall, dailyBurnLimit as dailyBurnLimitCall, dailyMinted as dailyMintedCall, dailyMintLimit as dailyMintLimitCall, maxBurnPerTx as maxBurnPerTxCall, maxMintPerTx as maxMintPerTxCall, mintedFor as mintedForCall, paused as pausedCall, personalBurnCapAmount as personalBurnCapAmountCall, personalBurned as personalBurnedCall, } from "./generated/wormhole_bridge/wormhole_bridge.js";
21
- import { probeAddressCreditBalance, probeParkedBackingAssets, sumParkedBackingAsCreditRaw, } from "./utils/consolidate-balance.js";
22
- function toBytes(b) {
23
- if (!b)
24
- return undefined;
25
- if (typeof b === "string")
26
- return fromBase64(b);
27
- // gRPC returns Uint8Array; JSON-RPC serialization may turn it into a
28
- // numeric-indexed object. Normalize both.
29
- if (b instanceof Uint8Array)
30
- return b;
31
- return new Uint8Array(Object.values(b));
32
- }
33
- async function simulateRaw(client, tx) {
34
- tx.setSender(DRY_RUN_SENDER);
35
- const sim = (await client.simulate(tx));
36
- if (sim.$kind === "FailedTransaction") {
37
- const err = sim.FailedTransaction?.status?.error?.message ?? "FailedTransaction";
38
- throw new Error(`simulate aborted: ${err}`);
39
- }
40
- return sim;
41
- }
42
- function extractAt(sim, commandIndex, returnIndex = 0) {
43
- const ret = sim.commandResults?.[commandIndex]?.returnValues?.[returnIndex];
44
- const bytes = toBytes(ret?.bcs) ?? toBytes(ret?.value?.bcs);
45
- if (!bytes) {
46
- throw new Error(`simulate returned no BCS value at commandResults[${commandIndex}].returnValues[${returnIndex}]`);
47
- }
48
- return bytes;
49
- }
50
- async function simulateAndExtract(client, tx, commandIndex = 0, returnIndex = 0) {
51
- const sim = await simulateRaw(client, tx);
52
- return extractAt(sim, commandIndex, returnIndex);
53
- }
54
- function withLp(client, lpType) {
55
- return lpType ?? client.wlpType();
56
- }
57
- /**
58
- * Look up the registered AccountData for a given wxa account ID.
59
- * Returns `undefined` if the account has no perp data slot installed yet
60
- * (the slot auto-installs on the first `add_position` / `add_order`).
61
- * The underlying view fn returns `Option<AccountData>`.
62
- */
63
- export async function getAccountData(client, accountId) {
64
- const tx = new Transaction();
65
- accountDataCall({
66
- package: client.config.packages.waterx_perp_view.published_at,
67
- arguments: {
68
- wxaRegistry: tx.object(client.config.packages.waterx_account.account_registry),
69
- accountId,
70
- },
71
- })(tx);
72
- const bytes = await simulateAndExtract(client, tx);
73
- const opt = bcs.option(AccountData).parse(bytes);
74
- return opt ?? undefined;
75
- }
76
- export async function getMarketData(client, args) {
77
- const tx = new Transaction();
78
- marketDataCall({
79
- package: client.config.packages.waterx_perp_view.published_at,
80
- arguments: {
81
- marketRegistry: tx.object(client.config.packages.waterx_perp.market_registry_wlp),
82
- ticker: args.ticker,
83
- },
84
- typeArguments: [withLp(client, args.lpType)],
85
- })(tx);
86
- return MarketData.parse(await simulateAndExtract(client, tx));
87
- }
88
- export async function getPoolData(client, args = {}) {
89
- const tx = new Transaction();
90
- poolDataCall({
91
- package: client.config.packages.waterx_perp_view.published_at,
92
- arguments: { pool: tx.object(client.config.packages.wlp.wlp_pool) },
93
- typeArguments: [withLp(client, args.lpType)],
94
- })(tx);
95
- return PoolData.parse(await simulateAndExtract(client, tx));
96
- }
97
- export async function getTokenPoolData(client, args) {
98
- const tx = new Transaction();
99
- tokenPoolDataCall({
100
- package: client.config.packages.waterx_perp_view.published_at,
101
- arguments: {
102
- pool: tx.object(client.config.packages.wlp.wlp_pool),
103
- tokenIndex: args.tokenIndex,
104
- },
105
- typeArguments: [withLp(client, args.lpType)],
106
- })(tx);
107
- return TokenPoolData.parse(await simulateAndExtract(client, tx));
108
- }
109
- export async function getGlobalConfigData(client) {
110
- const tx = new Transaction();
111
- globalConfigDataCall({
112
- package: client.config.packages.waterx_perp_view.published_at,
113
- arguments: { cfg: tx.object(client.config.packages.waterx_perp.global_config) },
114
- })(tx);
115
- return GlobalConfigData.parse(await simulateAndExtract(client, tx));
116
- }
117
- export async function positionExists(client, args) {
118
- const tx = new Transaction();
119
- positionExistsCall({
120
- package: client.config.packages.waterx_perp_view.published_at,
121
- arguments: {
122
- marketRegistry: tx.object(client.config.packages.waterx_perp.market_registry_wlp),
123
- ticker: args.ticker,
124
- positionId: args.positionId,
125
- },
126
- typeArguments: [withLp(client, args.lpType)],
127
- })(tx);
128
- const bytes = await simulateAndExtract(client, tx);
129
- return bcs.bool().parse(bytes);
130
- }
131
- export async function getPosition(client, args) {
132
- const tx = new Transaction();
133
- positionDataCall({
134
- package: client.config.packages.waterx_perp_view.published_at,
135
- arguments: {
136
- marketRegistry: tx.object(client.config.packages.waterx_perp.market_registry_wlp),
137
- ticker: args.ticker,
138
- pool: tx.object(client.config.packages.wlp.wlp_pool),
139
- basePriceUsd: args.basePriceUsd,
140
- collateralPriceUsd: args.collateralPriceUsd,
141
- positionId: args.positionId,
142
- },
143
- typeArguments: [withLp(client, args.lpType)],
144
- })(tx);
145
- return PositionData.parse(await simulateAndExtract(client, tx));
146
- }
147
- export async function getOrder(client, args) {
148
- const tx = new Transaction();
149
- orderDataCall({
150
- package: client.config.packages.waterx_perp_view.published_at,
151
- arguments: {
152
- marketRegistry: tx.object(client.config.packages.waterx_perp.market_registry_wlp),
153
- ticker: args.ticker,
154
- basePriceUsd: args.basePriceUsd,
155
- orderTypeTag: args.orderTypeTag,
156
- triggerPrice: args.triggerPrice,
157
- orderId: args.orderId,
158
- },
159
- typeArguments: [withLp(client, args.lpType)],
160
- })(tx);
161
- return OrderData.parse(await simulateAndExtract(client, tx));
162
- }
163
- export async function getMarketOrders(client, args) {
164
- const tx = new Transaction();
165
- getMarketOrdersCall({
166
- package: client.config.packages.waterx_perp_view.published_at,
167
- arguments: {
168
- marketRegistry: tx.object(client.config.packages.waterx_perp.market_registry_wlp),
169
- ticker: args.ticker,
170
- basePriceUsd: args.basePriceUsd ?? 0n,
171
- cursor: args.cursor ?? 0n,
172
- pageSize: args.pageSize ?? 100n,
173
- },
174
- typeArguments: [withLp(client, args.lpType)],
175
- })(tx);
176
- tx.setSender(DRY_RUN_SENDER);
177
- const sim = (await client.simulate(tx));
178
- const ret = sim.commandResults?.[0]?.returnValues;
179
- if (!ret)
180
- return { orders: [] };
181
- const ordersBytes = toBytes(ret[0]?.bcs) ?? toBytes(ret[0]?.value?.bcs);
182
- const cursorBytes = toBytes(ret[1]?.bcs) ?? toBytes(ret[1]?.value?.bcs);
183
- if (!ordersBytes)
184
- return { orders: [] };
185
- const ordersBuf = ordersBytes;
186
- const orders = bcs.vector(OrderData).parse(ordersBuf);
187
- let nextCursor;
188
- if (cursorBytes) {
189
- const cb = cursorBytes;
190
- const opt = bcs.option(bcs.u64()).parse(cb);
191
- if (opt)
192
- nextCursor = BigInt(opt);
193
- }
194
- return { orders, nextCursor };
195
- }
196
- export async function getMarketPositions(client, args) {
197
- const tx = new Transaction();
198
- getMarketPositionsCall({
199
- package: client.config.packages.waterx_perp_view.published_at,
200
- arguments: {
201
- marketRegistry: tx.object(client.config.packages.waterx_perp.market_registry_wlp),
202
- ticker: args.ticker,
203
- pool: tx.object(client.config.packages.wlp.wlp_pool),
204
- basePriceUsd: args.basePriceUsd,
205
- collateralPriceUsd: args.collateralPriceUsd ?? 0n,
206
- cursor: args.cursor ?? 0n,
207
- pageSize: args.pageSize ?? 100n,
208
- },
209
- typeArguments: [withLp(client, args.lpType)],
210
- })(tx);
211
- tx.setSender(DRY_RUN_SENDER);
212
- const sim = (await client.simulate(tx));
213
- const ret = sim.commandResults?.[0]?.returnValues;
214
- if (!ret)
215
- return { positions: [] };
216
- const positionsBytes = toBytes(ret[0]?.bcs) ?? toBytes(ret[0]?.value?.bcs);
217
- const cursorBytes = toBytes(ret[1]?.bcs) ?? toBytes(ret[1]?.value?.bcs);
218
- if (!positionsBytes)
219
- return { positions: [] };
220
- const buf = positionsBytes;
221
- const positions = bcs.vector(PositionData).parse(buf);
222
- let nextCursor;
223
- if (cursorBytes) {
224
- const cb = cursorBytes;
225
- const opt = bcs.option(bcs.u64()).parse(cb);
226
- if (opt)
227
- nextCursor = BigInt(opt);
228
- }
229
- return { positions, nextCursor };
230
- }
231
- export async function getAccountPositions(client, args) {
232
- const tx = new Transaction();
233
- getAccountPositionsCall({
234
- package: client.config.packages.waterx_perp_view.published_at,
235
- arguments: {
236
- marketRegistry: tx.object(client.config.packages.waterx_perp.market_registry_wlp),
237
- ticker: args.ticker,
238
- pool: tx.object(client.config.packages.wlp.wlp_pool),
239
- wxaRegistry: tx.object(client.config.packages.waterx_account.account_registry),
240
- basePriceUsd: args.basePriceUsd,
241
- collateralPriceUsd: args.collateralPriceUsd ?? 0n,
242
- accountObjectAddress: args.accountObjectAddress,
243
- },
244
- typeArguments: [withLp(client, args.lpType)],
245
- })(tx);
246
- return bcs.vector(PositionData).parse(await simulateAndExtract(client, tx));
247
- }
248
- export async function getAccountOrders(client, args) {
249
- const tx = new Transaction();
250
- getAccountOrdersCall({
251
- package: client.config.packages.waterx_perp_view.published_at,
252
- arguments: {
253
- marketRegistry: tx.object(client.config.packages.waterx_perp.market_registry_wlp),
254
- ticker: args.ticker,
255
- basePriceUsd: args.basePriceUsd ?? 0n,
256
- accountObjectAddress: args.accountObjectAddress,
257
- },
258
- typeArguments: [withLp(client, args.lpType)],
259
- })(tx);
260
- return bcs.vector(OrderData).parse(await simulateAndExtract(client, tx));
261
- }
262
- export async function getRedeemRequests(client, args = {}) {
263
- const tx = new Transaction();
264
- getRedeemRequestsCall({
265
- package: client.config.packages.waterx_perp_view.published_at,
266
- arguments: {
267
- pool: tx.object(client.config.packages.wlp.wlp_pool),
268
- cursor: args.cursor ?? 0n,
269
- pageSize: args.pageSize ?? 100n,
270
- },
271
- typeArguments: [withLp(client, args.lpType)],
272
- })(tx);
273
- tx.setSender(DRY_RUN_SENDER);
274
- const sim = (await client.simulate(tx));
275
- const ret = sim.commandResults?.[0]?.returnValues;
276
- if (!ret)
277
- return { requests: [] };
278
- const reqBytes = toBytes(ret[0]?.bcs) ?? toBytes(ret[0]?.value?.bcs);
279
- const cursorBytes = toBytes(ret[1]?.bcs) ?? toBytes(ret[1]?.value?.bcs);
280
- if (!reqBytes)
281
- return { requests: [] };
282
- const buf = reqBytes;
283
- const requests = bcs.vector(RedeemRequestData).parse(buf);
284
- let nextCursor;
285
- if (cursorBytes) {
286
- const cb = cursorBytes;
287
- const opt = bcs.option(bcs.u64()).parse(cb);
288
- if (opt)
289
- nextCursor = BigInt(opt);
290
- }
291
- return { requests, nextCursor };
292
- }
293
- function requireReferralPackage(client) {
294
- const pkg = client.config.packages.waterx_referral?.published_at;
295
- const table = client.config.packages.waterx_referral?.referral_table;
296
- if (!pkg || !table) {
297
- throw new Error("referral package not configured: set config.packages.waterx_referral.{published_at,referral_table}");
298
- }
299
- return { pkg, table };
300
- }
301
- /** Returns the referrer address bound to `referee`, or `undefined` if none. */
302
- export async function getRefererFor(client, referee) {
303
- const { pkg, table } = requireReferralPackage(client);
304
- const tx = new Transaction();
305
- tryGetReferCall({
306
- package: pkg,
307
- arguments: { table: tx.object(table), referee },
308
- })(tx);
309
- const bytes = await simulateAndExtract(client, tx);
310
- const opt = bcs.option(bcs.Address).parse(bytes);
311
- return opt ?? undefined;
312
- }
313
- /** True if `code` is a syntactically valid referral code (matches the contract's char rules). */
314
- export async function isValidReferralCode(client, code) {
315
- const { pkg } = requireReferralPackage(client);
316
- const tx = new Transaction();
317
- isValidReferralCodeCall({ package: pkg, arguments: { code } })(tx);
318
- const bytes = await simulateAndExtract(client, tx);
319
- return bcs.bool().parse(bytes);
320
- }
321
- /** True if `code` is already claimed in the on-chain ReferralTable. */
322
- export async function referralCodeExists(client, code) {
323
- const { pkg, table } = requireReferralPackage(client);
324
- const tx = new Transaction();
325
- referralCodeExistsCall({
326
- package: pkg,
327
- arguments: { table: tx.object(table), code },
328
- })(tx);
329
- const bytes = await simulateAndExtract(client, tx);
330
- return bcs.bool().parse(bytes);
331
- }
332
- // ============================================================================
333
- // wxa account reads (waterx_account — works on credit-only deployments,
334
- // which have no waterx_perp_view). Simulate `account::*` view functions.
335
- // ============================================================================
336
- /**
337
- * List the wxa account IDs owned by `owner` (`account::account_ids`).
338
- * Returns `[]` when the owner has never created an account. Use this to
339
- * resolve the `account_id` a cross-chain deposit must target before
340
- * filling the EVM `suiRecipient` field.
341
- */
342
- export async function getAccountsByOwner(client, owner) {
343
- const tx = new Transaction();
344
- accountIdsCall({
345
- package: client.config.packages.waterx_account.published_at,
346
- arguments: {
347
- registry: tx.object(client.config.packages.waterx_account.account_registry),
348
- owner,
349
- },
350
- })(tx);
351
- const bytes = await simulateAndExtract(client, tx);
352
- return bcs.vector(bcs.Address).parse(bytes);
353
- }
354
- /**
355
- * A wxa account's stored `Balance<T>` (`account::account_balance<T>`).
356
- * `coinType` defaults to the deployment's CREDIT type — i.e. the bridged
357
- * balance available to withdraw. Returns `0n` for an unknown coin type.
358
- */
359
- export async function getAccountBalance(client, accountId, coinType) {
360
- const tx = new Transaction();
361
- accountBalanceCall({
362
- package: client.config.packages.waterx_account.published_at,
363
- arguments: {
364
- registry: tx.object(client.config.packages.waterx_account.account_registry),
365
- accountId,
366
- },
367
- typeArguments: [coinType ?? client.creditType()],
368
- })(tx);
369
- const bytes = await simulateAndExtract(client, tx);
370
- return BigInt(bcs.u64().parse(bytes));
371
- }
372
- export async function getSpendableCreditBalance(client, accountId) {
373
- const creditType = client.creditType();
374
- const [internalRaw, parkedBacking, addressCredit] = await Promise.all([
375
- getAccountBalance(client, accountId, creditType),
376
- probeParkedBackingAssets(client, accountId),
377
- probeAddressCreditBalance(client, accountId),
378
- ]);
379
- const pendingBackingRaw = sumParkedBackingAsCreditRaw(parkedBacking, COLLATERAL_DECIMALS);
380
- const pendingCreditAtAddressRaw = addressCredit.fundsRaw + addressCredit.coinsRaw;
381
- const totalRaw = internalRaw + pendingBackingRaw + pendingCreditAtAddressRaw;
382
- return {
383
- internalRaw,
384
- pendingBackingRaw,
385
- pendingCreditAtAddressRaw,
386
- totalRaw,
387
- parkedBacking,
388
- };
389
- }
390
- // ============================================================================
391
- // Native custody (custody_vault)
392
- // ============================================================================
393
- function requireCustody(client) {
394
- const nc = client.config.packages.native_custody;
395
- if (!nc?.vault) {
396
- throw new Error("native_custody not configured — set config.packages.native_custody.vault");
397
- }
398
- return { pkg: nc.published_at, vault: nc.vault, creditType: client.creditType() };
399
- }
400
- /** Reads vault-wide native-custody state via `custody_vault::credit_supply`. */
401
- export async function getCustodyVaultData(client) {
402
- const { pkg, vault, creditType } = requireCustody(client);
403
- const tx = new Transaction();
404
- creditSupplyCall({
405
- package: pkg,
406
- arguments: { vault: tx.object(vault) },
407
- typeArguments: [creditType],
408
- })(tx);
409
- const bytes = await simulateAndExtract(client, tx);
410
- return { creditSupply: BigInt(bcs.u64().parse(bytes)) };
411
- }
412
- /**
413
- * Reads per-asset native-custody state for backing asset `assetType`.
414
- *
415
- * Fee rates are the vault's default config — queried with the zero address as
416
- * caller, so no partner discount is applied — as 1e9-scaled `Float` values.
417
- * When the asset is not registered, returns `registered: false` with `0n` rates.
418
- *
419
- * Note: the `SingleVault` balance / decimal / backing / min-burn / deprecated
420
- * fields are not exposed here — the contract's getters for those return a
421
- * `&SingleVault<T>` reference, which a PTB simulate cannot read.
422
- */
423
- export async function getCustodyAssetData(client, assetType) {
424
- const { pkg, vault, creditType } = requireCustody(client);
425
- const typeArguments = [assetType, creditType];
426
- const hasTx = new Transaction();
427
- hasAssetCall({ package: pkg, arguments: { vault: hasTx.object(vault) }, typeArguments })(hasTx);
428
- const registered = bcs.bool().parse(await simulateAndExtract(client, hasTx));
429
- if (!registered)
430
- return { registered: false, mintFeeRate: 0n, burnFeeRate: 0n };
431
- const mintTx = new Transaction();
432
- mintFeeRateCall({
433
- package: pkg,
434
- arguments: { vault: mintTx.object(vault), caller: DRY_RUN_SENDER },
435
- typeArguments,
436
- })(mintTx);
437
- const mintFeeRate = BigInt(bcs.u128().parse(await simulateAndExtract(client, mintTx)));
438
- const burnTx = new Transaction();
439
- burnFeeRateCall({
440
- package: pkg,
441
- arguments: { vault: burnTx.object(vault), caller: DRY_RUN_SENDER },
442
- typeArguments,
443
- })(burnTx);
444
- const burnFeeRate = BigInt(bcs.u128().parse(await simulateAndExtract(client, burnTx)));
445
- return { registered: true, mintFeeRate, burnFeeRate };
446
- }
447
- /**
448
- * Batched read of the bridge's rate-limit / cap state in a single simulate.
449
- * Pass `accountId` to also fetch the per-account burn usage, and `backing`
450
- * to also fetch the destination-chain backing (`minted_for`).
451
- *
452
- * Throws if `wormhole_bridge` (or its `Bridge` object id) is absent from the
453
- * canonical config — e.g. on a network where the Sui bridge isn't published.
454
- */
455
- export async function getBridgeLimits(client, args = {}) {
456
- const pkg = client.config.packages.wormhole_bridge;
457
- if (!pkg?.bridge) {
458
- throw new Error("wormhole_bridge is not deployed on this network (no `bridge` object id in config)");
459
- }
460
- const packageId = pkg.published_at;
461
- const bridge = pkg.bridge;
462
- const tx = new Transaction();
463
- // Fixed-order view calls; indices tracked below.
464
- pausedCall({ package: packageId, arguments: { bridge } })(tx); // 0
465
- dailyMintLimitCall({ package: packageId, arguments: { bridge } })(tx); // 1
466
- dailyMintedCall({ package: packageId, arguments: { bridge } })(tx); // 2
467
- maxMintPerTxCall({ package: packageId, arguments: { bridge } })(tx); // 3
468
- dailyBurnLimitCall({ package: packageId, arguments: { bridge } })(tx); // 4
469
- dailyBurnedCall({ package: packageId, arguments: { bridge } })(tx); // 5
470
- maxBurnPerTxCall({ package: packageId, arguments: { bridge } })(tx); // 6
471
- personalBurnCapAmountCall({ package: packageId, arguments: { bridge } })(tx); // 7
472
- let backingIdx = -1;
473
- if (args.backing) {
474
- backingIdx = 8;
475
- mintedForCall({
476
- package: packageId,
477
- arguments: {
478
- bridge,
479
- chainId: args.backing.wormholeChainId,
480
- token: Array.from(args.backing.token),
481
- },
482
- })(tx);
483
- }
484
- let personalIdx = -1;
485
- if (args.accountId) {
486
- personalIdx = backingIdx === -1 ? 8 : 9;
487
- // Clock (0x6) is auto-injected by the generated wrapper.
488
- personalBurnedCall({
489
- package: packageId,
490
- arguments: { bridge, user: args.accountId },
491
- })(tx);
492
- }
493
- const sim = await simulateRaw(client, tx);
494
- const u64At = (i) => BigInt(bcs.u64().parse(extractAt(sim, i)));
495
- const view = {
496
- paused: bcs.bool().parse(extractAt(sim, 0)),
497
- dailyMintLimit: u64At(1),
498
- dailyMinted: u64At(2),
499
- maxMintPerTx: u64At(3),
500
- dailyBurnLimit: u64At(4),
501
- dailyBurned: u64At(5),
502
- maxBurnPerTx: u64At(6),
503
- personalBurnCapAmount: u64At(7),
504
- };
505
- if (backingIdx >= 0)
506
- view.backingMinted = u64At(backingIdx);
507
- if (personalIdx >= 0)
508
- view.personalBurned = u64At(personalIdx);
509
- return view;
510
- }
511
- function requireWithdrawalQueue(client) {
512
- const wq = client.config.packages.withdrawal_queue;
513
- if (!wq?.queue) {
514
- throw new Error("withdrawal_queue is not deployed on this network (no `queue` object id in config)");
515
- }
516
- return { pkg: wq.published_at, queue: wq.queue };
517
- }
518
- /**
519
- * Estimate the bridge fee for a wormhole (Sui → EVM) CREDIT exit of `amount`
520
- * to `evmDestinationChain`, read in a single simulate from the on-chain
521
- * `withdrawal_queue` views. The charged fee is
522
- * `max(ceil(effectiveRate * amount), effectiveMinFee)`.
523
- *
524
- * Surface UI off `wouldExecute`, NOT `feeAmount` alone — `feeAmount` is the raw
525
- * fee and can equal/exceed `amount` (ceil rounding on a dust entry, or a min-fee
526
- * floor larger than the entry), in which case the on-chain exit aborts its
527
- * net-zero guard (audit L1). `netAmount` is `0n` whenever `wouldExecute` is
528
- * false.
529
- *
530
- * @param args.amount CREDIT base units (the bridged coin's smallest unit).
531
- * @param args.evmDestinationChain WORMHOLE chain id of the destination EVM.
532
- * @param args.creditType CREDIT coin type; defaults to `client.creditType()`.
533
- */
534
- export async function getBridgeFee(client, args) {
535
- const { pkg, queue } = requireWithdrawalQueue(client);
536
- const amount = BigInt(args.amount);
537
- const common = {
538
- package: pkg,
539
- typeArguments: [args.creditType ?? client.creditType()],
540
- };
541
- const chain = args.evmDestinationChain;
542
- const tx = new Transaction();
543
- // Fixed-order view calls; indices tracked below.
544
- bridgeFeeAmountCall({
545
- ...common,
546
- arguments: { queue, evmDestinationChain: chain, amount },
547
- })(tx); // 0
548
- wouldExecuteWormholeCall({
549
- ...common,
550
- arguments: { queue, evmDestinationChain: chain, amount },
551
- })(tx); // 1
552
- bridgeFeeRateCall({ ...common, arguments: { queue, evmDestinationChain: chain } })(tx); // 2
553
- bridgeMinFeeCall({ ...common, arguments: { queue, evmDestinationChain: chain } })(tx); // 3
554
- const sim = await simulateRaw(client, tx);
555
- const feeAmount = BigInt(bcs.u64().parse(extractAt(sim, 0)));
556
- const wouldExecute = bcs.bool().parse(extractAt(sim, 1));
557
- return {
558
- feeAmount,
559
- wouldExecute,
560
- effectiveRate: BigInt(bcs.u128().parse(extractAt(sim, 2))),
561
- effectiveMinFee: BigInt(bcs.u64().parse(extractAt(sim, 3))),
562
- netAmount: wouldExecute ? amount - feeAmount : 0n,
563
- };
564
- }
@@ -1,100 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- /** Module for Account Abstraction */
5
- import { MoveStruct, type RawTransactionArgument } from '../utils/index.ts';
6
- import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
7
- export declare const ACCOUNT: MoveStruct<any, any>;
8
- export declare const Account: MoveStruct<any, any>;
9
- export declare const AccountRequest: MoveStruct<any, any>;
10
- export interface NewArguments {
11
- alias: RawTransactionArgument<string | null>;
12
- }
13
- export interface NewOptions {
14
- package?: string;
15
- arguments: NewArguments | [
16
- alias: RawTransactionArgument<string | null>
17
- ];
18
- }
19
- /** Public Funs */
20
- export declare function _new(options: NewOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
21
- export interface RequestOptions {
22
- package?: string;
23
- arguments?: [
24
- ];
25
- }
26
- export declare function request(options?: RequestOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
27
- export interface RequestWithAccountArguments {
28
- account: RawTransactionArgument<string>;
29
- }
30
- export interface RequestWithAccountOptions {
31
- package?: string;
32
- arguments: RequestWithAccountArguments | [
33
- account: RawTransactionArgument<string>
34
- ];
35
- }
36
- export declare function requestWithAccount(options: RequestWithAccountOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
37
- export interface ReceiveArguments {
38
- account: RawTransactionArgument<string>;
39
- receiving: TransactionArgument;
40
- }
41
- export interface ReceiveOptions {
42
- package?: string;
43
- arguments: ReceiveArguments | [
44
- account: RawTransactionArgument<string>,
45
- receiving: TransactionArgument
46
- ];
47
- typeArguments: [
48
- string
49
- ];
50
- }
51
- export declare function receive(options: ReceiveOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
52
- export interface UpdateAliasArguments {
53
- account: RawTransactionArgument<string>;
54
- alias: RawTransactionArgument<string>;
55
- }
56
- export interface UpdateAliasOptions {
57
- package?: string;
58
- arguments: UpdateAliasArguments | [
59
- account: RawTransactionArgument<string>,
60
- alias: RawTransactionArgument<string>
61
- ];
62
- }
63
- export declare function updateAlias(options: UpdateAliasOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
64
- export interface CreateArguments {
65
- alias: RawTransactionArgument<string | null>;
66
- }
67
- export interface CreateOptions {
68
- package?: string;
69
- arguments: CreateArguments | [
70
- alias: RawTransactionArgument<string | null>
71
- ];
72
- }
73
- /** Entry Funs */
74
- export declare function create(options: CreateOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
75
- export interface AccountAddressArguments {
76
- account: RawTransactionArgument<string>;
77
- }
78
- export interface AccountAddressOptions {
79
- package?: string;
80
- arguments: AccountAddressArguments | [
81
- account: RawTransactionArgument<string>
82
- ];
83
- }
84
- export declare function accountAddress(options: AccountAddressOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
85
- export interface RequestAddressArguments {
86
- req: TransactionArgument;
87
- }
88
- export interface RequestAddressOptions {
89
- package?: string;
90
- arguments: RequestAddressArguments | [
91
- req: TransactionArgument
92
- ];
93
- }
94
- export declare function requestAddress(options: RequestAddressOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
95
- export interface AliasLengthLimitOptions {
96
- package?: string;
97
- arguments?: [
98
- ];
99
- }
100
- export declare function aliasLengthLimit(options?: AliasLengthLimitOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;