@waterx/sdk 4.1.0 → 4.3.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.
- package/README.md +29 -19
- package/dist/cjs/src/account/config.d.ts +3 -2
- package/dist/cjs/src/generated/waterx_rule/waterx_rule.d.ts +7 -134
- package/dist/cjs/src/generated/waterx_rule/waterx_rule.js +8 -154
- package/dist/cjs/src/oracle/aggregate.d.ts +21 -21
- package/dist/cjs/src/oracle/aggregate.js +121 -71
- package/dist/cjs/src/oracle/config.d.ts +38 -72
- package/dist/cjs/src/oracle/config.js +0 -56
- package/dist/cjs/src/oracle/host.d.ts +24 -20
- package/dist/cjs/src/oracle/index.d.ts +7 -3
- package/dist/cjs/src/oracle/index.js +41 -8
- package/dist/cjs/src/oracle/price-update-rule.d.ts +32 -11
- package/dist/cjs/src/oracle/price-update-rule.js +23 -3
- package/dist/cjs/src/oracle/pyth.d.ts +44 -0
- package/dist/cjs/src/oracle/pyth.js +48 -6
- package/dist/cjs/src/oracle/read-plane.d.ts +70 -0
- package/dist/cjs/src/oracle/read-plane.js +85 -0
- package/dist/cjs/src/oracle/rule-registry.d.ts +6 -4
- package/dist/cjs/src/oracle/rule-registry.js +6 -4
- package/dist/cjs/src/oracle/rules/pyth-core-rule.js +6 -5
- package/dist/cjs/src/oracle/rules/pyth-lazer-rule.d.ts +21 -0
- package/dist/cjs/src/oracle/rules/pyth-lazer-rule.js +34 -6
- package/dist/cjs/src/oracle/rules/pyth-rule.js +5 -4
- package/dist/cjs/src/oracle/rules/waterx-rule.d.ts +42 -5
- package/dist/cjs/src/oracle/rules/waterx-rule.js +61 -18
- package/dist/cjs/src/oracle/source-list.d.ts +36 -0
- package/dist/cjs/src/oracle/source-list.js +57 -0
- package/dist/cjs/src/perp/client.d.ts +41 -28
- package/dist/cjs/src/perp/client.js +32 -20
- package/dist/cjs/src/perp/config-view.js +7 -6
- package/dist/cjs/src/perp/config.d.ts +6 -6
- package/dist/cjs/src/perp/config.js +12 -12
- package/dist/cjs/src/perp/index.d.ts +3 -3
- package/dist/cjs/src/perp/index.js +11 -4
- package/dist/cjs/src/perp/user/staking.js +2 -1
- package/dist/cjs/src/unified-client.d.ts +14 -9
- package/dist/cjs/src/unified-client.js +2 -2
- package/dist/cjs/src/utils/config.js +2 -1
- package/dist/cjs/src/utils/record.d.ts +12 -0
- package/dist/cjs/src/utils/record.js +22 -0
- package/dist/src/account/config.d.ts +3 -2
- package/dist/src/generated/waterx_rule/waterx_rule.d.ts +7 -134
- package/dist/src/generated/waterx_rule/waterx_rule.js +7 -143
- package/dist/src/oracle/aggregate.d.ts +21 -21
- package/dist/src/oracle/aggregate.js +121 -71
- package/dist/src/oracle/config.d.ts +38 -72
- package/dist/src/oracle/config.js +1 -55
- package/dist/src/oracle/host.d.ts +24 -20
- package/dist/src/oracle/index.d.ts +7 -3
- package/dist/src/oracle/index.js +32 -10
- package/dist/src/oracle/price-update-rule.d.ts +32 -11
- package/dist/src/oracle/price-update-rule.js +22 -3
- package/dist/src/oracle/pyth.d.ts +44 -0
- package/dist/src/oracle/pyth.js +45 -5
- package/dist/src/oracle/read-plane.d.ts +70 -0
- package/dist/src/oracle/read-plane.js +81 -0
- package/dist/src/oracle/rule-registry.d.ts +6 -4
- package/dist/src/oracle/rule-registry.js +6 -4
- package/dist/src/oracle/rules/pyth-core-rule.js +7 -6
- package/dist/src/oracle/rules/pyth-lazer-rule.d.ts +21 -0
- package/dist/src/oracle/rules/pyth-lazer-rule.js +33 -5
- package/dist/src/oracle/rules/pyth-rule.js +5 -4
- package/dist/src/oracle/rules/waterx-rule.d.ts +42 -5
- package/dist/src/oracle/rules/waterx-rule.js +57 -15
- package/dist/src/oracle/source-list.d.ts +36 -0
- package/dist/src/oracle/source-list.js +53 -0
- package/dist/src/perp/client.d.ts +41 -28
- package/dist/src/perp/client.js +33 -21
- package/dist/src/perp/config-view.js +7 -6
- package/dist/src/perp/config.d.ts +6 -6
- package/dist/src/perp/config.js +11 -9
- package/dist/src/perp/index.d.ts +3 -3
- package/dist/src/perp/index.js +2 -2
- package/dist/src/perp/user/staking.js +2 -1
- package/dist/src/unified-client.d.ts +14 -9
- package/dist/src/unified-client.js +2 -2
- package/dist/src/utils/config.js +2 -1
- package/dist/src/utils/record.d.ts +12 -0
- package/dist/src/utils/record.js +19 -0
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.PerpConfigView = void 0;
|
|
14
|
+
const record_ts_1 = require("../utils/record.js");
|
|
14
15
|
class PerpConfigView {
|
|
15
16
|
getConfig;
|
|
16
17
|
getWormhole;
|
|
@@ -29,21 +30,21 @@ class PerpConfigView {
|
|
|
29
30
|
}
|
|
30
31
|
/** `waterx_perp.markets[ticker]`, throws if unknown. */
|
|
31
32
|
getMarket(ticker) {
|
|
32
|
-
const m = this.config.packages.waterx_perp?.markets
|
|
33
|
+
const m = (0, record_ts_1.ownEntry)(this.config.packages.waterx_perp?.markets, ticker);
|
|
33
34
|
if (!m)
|
|
34
35
|
throw new Error(`Unknown market ticker: ${ticker}`);
|
|
35
36
|
return m;
|
|
36
37
|
}
|
|
37
38
|
/** `waterx_oracle.aggregators[ticker]`, throws if unknown. */
|
|
38
39
|
getAggregator(ticker) {
|
|
39
|
-
const a = this.config.packages.waterx_oracle?.aggregators
|
|
40
|
+
const a = (0, record_ts_1.ownEntry)(this.config.packages.waterx_oracle?.aggregators, ticker);
|
|
40
41
|
if (!a)
|
|
41
42
|
throw new Error(`No aggregator listed for ticker: ${ticker}`);
|
|
42
43
|
return a;
|
|
43
44
|
}
|
|
44
45
|
/** `pyth_rule.feeds[ticker]`, throws if unknown. */
|
|
45
46
|
getPythFeed(ticker) {
|
|
46
|
-
const f = this.config.packages.pyth_rule?.feeds
|
|
47
|
+
const f = (0, record_ts_1.ownEntry)(this.config.packages.pyth_rule?.feeds, ticker);
|
|
47
48
|
if (!f)
|
|
48
49
|
throw new Error(`No pyth feed listed for ticker: ${ticker}`);
|
|
49
50
|
return f;
|
|
@@ -69,7 +70,7 @@ class PerpConfigView {
|
|
|
69
70
|
const c = this.config.packages.constant_rule;
|
|
70
71
|
if (!c?.published_at || !c.config)
|
|
71
72
|
return false;
|
|
72
|
-
return c.feeds
|
|
73
|
+
return (0, record_ts_1.ownEntry)(c.feeds, ticker) !== undefined;
|
|
73
74
|
}
|
|
74
75
|
/**
|
|
75
76
|
* The `supra_rule` config when it is deployed, enabled, and fully wired
|
|
@@ -95,7 +96,7 @@ class PerpConfigView {
|
|
|
95
96
|
*/
|
|
96
97
|
getPoolTokenType(tickerOrName) {
|
|
97
98
|
const poolTokens = this.config.packages.wlp?.pool_tokens ?? {};
|
|
98
|
-
const exact = poolTokens
|
|
99
|
+
const exact = (0, record_ts_1.ownEntry)(poolTokens, tickerOrName);
|
|
99
100
|
if (exact)
|
|
100
101
|
return exact;
|
|
101
102
|
for (const t of Object.values(poolTokens)) {
|
|
@@ -118,7 +119,7 @@ class PerpConfigView {
|
|
|
118
119
|
* reward coin type, so callers don't need a separate alias-to-type lookup.
|
|
119
120
|
*/
|
|
120
121
|
getRewarders(stakeAlias) {
|
|
121
|
-
const map = this.config.packages.waterx_staking?.rewarders
|
|
122
|
+
const map = (0, record_ts_1.ownEntry)(this.config.packages.waterx_staking?.rewarders, stakeAlias);
|
|
122
123
|
if (!map)
|
|
123
124
|
return [];
|
|
124
125
|
return Object.entries(map).map(([alias, entry]) => ({ alias, ...entry }));
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
* `waterx-config` repo (default: GitHub raw).
|
|
4
4
|
*
|
|
5
5
|
* The schema mirrors the canonical JSON layout one-to-one (each package
|
|
6
|
-
* groups its own object IDs + per-ticker maps). External chain infra
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* groups its own object IDs + per-ticker maps). External chain infra is
|
|
7
|
+
* **not** in the JSON — each oracle source owns its own per-network table
|
|
8
|
+
* (`PYTH_CORE_INFRA` in `oracle/pyth.ts`, `LAZER_INFRA` in
|
|
9
|
+
* `oracle/rules/pyth-lazer-rule.ts`); Wormhole bridge infra lives in
|
|
10
|
+
* `WORMHOLE_DEFAULTS` below.
|
|
10
11
|
*/
|
|
11
12
|
import type { AccountPackages, BasePackageEntry, WormholeInfraConfig } from "../account/config.ts";
|
|
12
13
|
import type { OraclePackages } from "../oracle/config.ts";
|
|
13
14
|
import type { Network } from "./constants.ts";
|
|
14
15
|
export type { AccountConfig, AccountPackages, BasePackageEntry, NativeCustodyAsset, NativeCustodyPackage, WaterxCreditPackage, WaterxReferralPackage, WithdrawalQueuePackage, WormholeBridgePackage, WormholeInfraConfig, WxaAccountPackage, } from "../account/config.ts";
|
|
15
|
-
export type { ConstantFeedEntry, OracleConfig, OraclePackages,
|
|
16
|
-
export { PYTH_DEFAULTS, WATERX_DEFAULTS } from "../oracle/config.ts";
|
|
16
|
+
export type { ConstantFeedEntry, OracleConfig, OraclePackages, PythAccessConfig, PythFetchPolicy, PythLazerRulePackage, PythRulePackage, PythSponsorRulePackage, SupraFeedEntry, SupraRulePackage, WaterxConstantRulePackage, WaterxAccessConfig, WaterxOraclePackage, WaterxRulePackage, } from "../oracle/config.ts";
|
|
17
17
|
export interface WaterxPerpMarketEntry {
|
|
18
18
|
market: string;
|
|
19
19
|
config: string;
|
|
@@ -4,29 +4,29 @@
|
|
|
4
4
|
* `waterx-config` repo (default: GitHub raw).
|
|
5
5
|
*
|
|
6
6
|
* The schema mirrors the canonical JSON layout one-to-one (each package
|
|
7
|
-
* groups its own object IDs + per-ticker maps). External chain infra
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* groups its own object IDs + per-ticker maps). External chain infra is
|
|
8
|
+
* **not** in the JSON — each oracle source owns its own per-network table
|
|
9
|
+
* (`PYTH_CORE_INFRA` in `oracle/pyth.ts`, `LAZER_INFRA` in
|
|
10
|
+
* `oracle/rules/pyth-lazer-rule.ts`); Wormhole bridge infra lives in
|
|
11
|
+
* `WORMHOLE_DEFAULTS` below.
|
|
11
12
|
*/
|
|
12
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.WORMHOLE_DEFAULTS =
|
|
14
|
+
exports.WORMHOLE_DEFAULTS = void 0;
|
|
14
15
|
exports.clearConfigCache = clearConfigCache;
|
|
15
16
|
exports.loadConfig = loadConfig;
|
|
16
17
|
const update_fetch_ts_1 = require("../oracle/update-fetch.js");
|
|
17
|
-
var config_ts_1 = require("../oracle/config.js");
|
|
18
|
-
Object.defineProperty(exports, "PYTH_DEFAULTS", { enumerable: true, get: function () { return config_ts_1.PYTH_DEFAULTS; } });
|
|
19
|
-
Object.defineProperty(exports, "WATERX_DEFAULTS", { enumerable: true, get: function () { return config_ts_1.WATERX_DEFAULTS; } });
|
|
20
18
|
// ============================================================================
|
|
21
|
-
// Wormhole
|
|
19
|
+
// Wormhole — external chain infra, defaults by network
|
|
22
20
|
// ============================================================================
|
|
23
21
|
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
22
|
+
// Oracle-source infra lives with each source (`PYTH_CORE_INFRA` in
|
|
23
|
+
// `oracle/pyth.ts`, `LAZER_INFRA` in `oracle/rules/pyth-lazer-rule.ts`);
|
|
24
|
+
// `client.pyth` is the caller-supplied access slice only (`PythAccessConfig`,
|
|
25
|
+
// re-exported at the top of this file).
|
|
26
26
|
// `WormholeInfraConfig` is defined in `account/config.ts` (funding base) and
|
|
27
27
|
// re-exported at the top of this file. `state_id` is the same shared Sui
|
|
28
28
|
// Wormhole `State` object Pyth uses (kept in sync with
|
|
29
|
-
// `
|
|
29
|
+
// `PYTH_CORE_INFRA[*].wormhole_state_id`).
|
|
30
30
|
exports.WORMHOLE_DEFAULTS = {
|
|
31
31
|
MAINNET: {
|
|
32
32
|
state_id: "0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { PerpClient } from "./client.ts";
|
|
2
2
|
export type { CreateClientOptions } from "./client.ts";
|
|
3
|
-
export {
|
|
4
|
-
export type { BasePackageEntry, ConstantFeedEntry, WaterxReferralPackage, LoadConfigOptions, NativeCustodyAsset, NativeCustodyPackage,
|
|
3
|
+
export { WORMHOLE_DEFAULTS, clearConfigCache, loadConfig } from "./config.ts";
|
|
4
|
+
export type { BasePackageEntry, ConstantFeedEntry, WaterxReferralPackage, LoadConfigOptions, NativeCustodyAsset, NativeCustodyPackage, PythAccessConfig, PythFetchPolicy, PythLazerRulePackage, PythRulePackage, PythSponsorRulePackage, SupraFeedEntry, SupraRulePackage, TestnetFaucetPackage, WaterXConfig, WaterXPackages, WaterxCreditPackage, WaterxOraclePackage, WaterxPerpMarketEntry, WaterxPerpPackage, WaterxStakingPackage, WithdrawalQueuePackage, WlpPackage, WormholeBridgePackage, WormholeInfraConfig, WxaAccountPackage, } from "./config.ts";
|
|
5
5
|
export { ACTION_ADD_PRE_ORDER, ACTION_CANCEL_ORDER, ACTION_CANCEL_PRE_ORDER, ACTION_CLOSE_POSITION, ACTION_DECREASE_POSITION, ACTION_DEPOSIT_COLLATERAL, ACTION_INCREASE_POSITION, ACTION_LIQUIDATE, ACTION_OPEN_POSITION, ACTION_PLACE_ORDER, ACTION_UPDATE_ORDER, ACTION_WITHDRAW_COLLATERAL, BPS_SCALE, DOUBLE_SCALE, DRY_RUN_SENDER, FLOAT_SCALE, ORDER_LIMIT_BUY, ORDER_LIMIT_SELL, ORDER_STOP_BUY, ORDER_STOP_SELL, ORDER_TAG_WILDCARD, PERM_ALL, PERM_ALL_TRADING, PERM_CANCEL_ORDER, PERM_CLOSE_POSITION, PERM_DECREASE_POSITION, PERM_DEPOSIT_COLLATERAL, PERM_INCREASE_POSITION, PERM_MINT_WLP, PERM_OPEN_POSITION, PERM_PLACE_ORDER, PERM_REDEEM_WLP, PERM_WITHDRAW_COLLATERAL, STAKING_PERM_DEPOSIT_STAKE, STAKING_PERM_REDEEM_STAKE, STAKING_PERM_CLAIM_REWARD, STAKING_PERM_ALL, MS_PER_MINUTE, MS_PER_HOUR, MS_PER_YEAR, SUI_DECIMALS, WLP_DECIMALS, COLLATERAL_DECIMALS, TOKEN_DECIMALS, } from "./constants.ts";
|
|
6
6
|
export type { Network } from "./constants.ts";
|
|
7
7
|
export { getMarketTickers, getCollateralAssets } from "../utils/config.ts";
|
|
@@ -13,7 +13,7 @@ export type { EstLiqPriceViewOpts } from "./liq-view.ts";
|
|
|
13
13
|
export * from "./user/index.ts";
|
|
14
14
|
export * from "./tx-builders.ts";
|
|
15
15
|
export * from "./fetch.ts";
|
|
16
|
-
export { FetchPolicyError, LazerApiKeyMissingError, OracleFeeSourceUnavailableError, OracleSourceNotImplementedError, PythCache, aggregateTicker, aggregateTickerWithConstant, aggregateTickerWithPyth, buildPythPriceUpdateCalls, fetchPriceFeedsUpdateData, refreshOraclePrices, updatePythPrices, } from "../oracle/index.ts";
|
|
16
|
+
export { FetchPolicyError, LazerApiKeyMissingError, OracleFeeSourceUnavailableError, OracleSourceNotImplementedError, PythCache, aggregateTicker, aggregateTickerWithConstant, aggregateTickerWithPyth, ORACLE_SOURCES, buildPythPriceUpdateCalls, fetchPriceFeedsUpdateData, isOracleSource, parseOracleSourceList, pythCoreHermesEndpoint, pythProHermesEndpoint, refreshOraclePrices, resolveHermesReadEndpoint, updatePythPrices, waterxEnvelopeOf, waterxQuoteCenterEndpoint, } from "../oracle/index.ts";
|
|
17
17
|
export type { FetchPolicy, OracleFeeSource, OracleSource, UpdateDataProvider, } from "../oracle/index.ts";
|
|
18
18
|
export { fetchDepositVaa, fetchVaa, listBridgeWithdrawalVaas, listVaasByEmitter, padEvmEmitter, toWormholescanEmitter, vaaBase64ToBytes, vaaBase64ToHex, vaaBytesToBase64, waitForVaa, } from "../account/funding/wormhole.ts";
|
|
19
19
|
export type { VaaListItem, VaaResponse, WormholescanOptions } from "../account/funding/wormhole.ts";
|
|
@@ -36,14 +36,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.getMarketTickers = exports.TOKEN_DECIMALS = exports.COLLATERAL_DECIMALS = exports.WLP_DECIMALS = exports.SUI_DECIMALS = exports.MS_PER_YEAR = exports.MS_PER_HOUR = exports.MS_PER_MINUTE = exports.STAKING_PERM_ALL = exports.STAKING_PERM_CLAIM_REWARD = exports.STAKING_PERM_REDEEM_STAKE = exports.STAKING_PERM_DEPOSIT_STAKE = exports.PERM_WITHDRAW_COLLATERAL = exports.PERM_REDEEM_WLP = exports.PERM_PLACE_ORDER = exports.PERM_OPEN_POSITION = exports.PERM_MINT_WLP = exports.PERM_INCREASE_POSITION = exports.PERM_DEPOSIT_COLLATERAL = exports.PERM_DECREASE_POSITION = exports.PERM_CLOSE_POSITION = exports.PERM_CANCEL_ORDER = exports.PERM_ALL_TRADING = exports.PERM_ALL = exports.ORDER_TAG_WILDCARD = exports.ORDER_STOP_SELL = exports.ORDER_STOP_BUY = exports.ORDER_LIMIT_SELL = exports.ORDER_LIMIT_BUY = exports.FLOAT_SCALE = exports.DRY_RUN_SENDER = exports.DOUBLE_SCALE = exports.BPS_SCALE = exports.ACTION_WITHDRAW_COLLATERAL = exports.ACTION_UPDATE_ORDER = exports.ACTION_PLACE_ORDER = exports.ACTION_OPEN_POSITION = exports.ACTION_LIQUIDATE = exports.ACTION_INCREASE_POSITION = exports.ACTION_DEPOSIT_COLLATERAL = exports.ACTION_DECREASE_POSITION = exports.ACTION_CLOSE_POSITION = exports.ACTION_CANCEL_PRE_ORDER = exports.ACTION_CANCEL_ORDER = exports.ACTION_ADD_PRE_ORDER = exports.loadConfig = exports.clearConfigCache = exports.WORMHOLE_DEFAULTS = exports.
|
|
40
|
-
exports.
|
|
41
|
-
exports.withdrawalQueueCalls = exports.nativeCustodyCalls = exports.referralCalls = exports.pythSponsorRuleCalls = exports.pythRuleCalls = exports.oracleCalls = exports.stakingCalls = exports.wxaAccountCalls = exports.viewCalls = exports.lpPoolCalls = exports.tradingCalls = exports.MarketConfigBcs = exports.MarketBcs = exports.OrderBcs = exports.PositionBcs = exports.TokenPoolDataBcs = exports.RedeemRequestDataBcs = exports.PositionDataBcs = exports.PoolDataBcs = exports.OrderDataBcs = exports.MarketDataBcs = exports.GlobalConfigDataBcs = exports.AccountDataBcs = exports.waitForVaa = exports.vaaBytesToBase64 = void 0;
|
|
39
|
+
exports.getCollateralAssets = exports.getMarketTickers = exports.TOKEN_DECIMALS = exports.COLLATERAL_DECIMALS = exports.WLP_DECIMALS = exports.SUI_DECIMALS = exports.MS_PER_YEAR = exports.MS_PER_HOUR = exports.MS_PER_MINUTE = exports.STAKING_PERM_ALL = exports.STAKING_PERM_CLAIM_REWARD = exports.STAKING_PERM_REDEEM_STAKE = exports.STAKING_PERM_DEPOSIT_STAKE = exports.PERM_WITHDRAW_COLLATERAL = exports.PERM_REDEEM_WLP = exports.PERM_PLACE_ORDER = exports.PERM_OPEN_POSITION = exports.PERM_MINT_WLP = exports.PERM_INCREASE_POSITION = exports.PERM_DEPOSIT_COLLATERAL = exports.PERM_DECREASE_POSITION = exports.PERM_CLOSE_POSITION = exports.PERM_CANCEL_ORDER = exports.PERM_ALL_TRADING = exports.PERM_ALL = exports.ORDER_TAG_WILDCARD = exports.ORDER_STOP_SELL = exports.ORDER_STOP_BUY = exports.ORDER_LIMIT_SELL = exports.ORDER_LIMIT_BUY = exports.FLOAT_SCALE = exports.DRY_RUN_SENDER = exports.DOUBLE_SCALE = exports.BPS_SCALE = exports.ACTION_WITHDRAW_COLLATERAL = exports.ACTION_UPDATE_ORDER = exports.ACTION_PLACE_ORDER = exports.ACTION_OPEN_POSITION = exports.ACTION_LIQUIDATE = exports.ACTION_INCREASE_POSITION = exports.ACTION_DEPOSIT_COLLATERAL = exports.ACTION_DECREASE_POSITION = exports.ACTION_CLOSE_POSITION = exports.ACTION_CANCEL_PRE_ORDER = exports.ACTION_CANCEL_ORDER = exports.ACTION_ADD_PRE_ORDER = exports.loadConfig = exports.clearConfigCache = exports.WORMHOLE_DEFAULTS = exports.PerpClient = void 0;
|
|
40
|
+
exports.fetchDepositVaa = exports.waterxQuoteCenterEndpoint = exports.waterxEnvelopeOf = exports.updatePythPrices = exports.resolveHermesReadEndpoint = exports.refreshOraclePrices = exports.pythProHermesEndpoint = exports.pythCoreHermesEndpoint = exports.parseOracleSourceList = exports.isOracleSource = exports.fetchPriceFeedsUpdateData = exports.buildPythPriceUpdateCalls = exports.ORACLE_SOURCES = exports.aggregateTickerWithPyth = exports.aggregateTickerWithConstant = exports.aggregateTicker = exports.PythCache = exports.OracleSourceNotImplementedError = exports.OracleFeeSourceUnavailableError = exports.LazerApiKeyMissingError = exports.FetchPolicyError = exports.calcEstLiqPriceRawFromView = exports.formatFundingInterval = exports.rawPrice = exports.decodeFundingIndexDelta = exports.calcWlpRedeemOut = exports.calcWlpPrice = exports.calcWlpMintOut = exports.calcWlpIncentiveApy = exports.calcViewEstLiqFeesUsd = exports.calcUnrealizedPnl = exports.calcTotalTradingFeeRate = exports.calcTokenUtilizationBps = exports.calcRealLiqNetCostUsd = exports.calcPositionBorrowFee = exports.calcNotional = exports.calcMaxReducibleCollateralUsd = exports.calcLeverage = exports.calcImpactFeeRate = exports.calcFundingRate = exports.calcFundingFeeUsd = exports.calcFee = exports.calcEstLiqPriceRaw = exports.calcEstLiqPrice = exports.calcEffectiveCollateralUsd = exports.calcDynamicFeeBps = exports.calcBorrowRateAccrual = exports.calcBorrowRate = exports.annualizeFundingRate = exports.annualizedApyFromRatio = void 0;
|
|
41
|
+
exports.withdrawalQueueCalls = exports.nativeCustodyCalls = exports.referralCalls = exports.pythSponsorRuleCalls = exports.pythRuleCalls = exports.oracleCalls = exports.stakingCalls = exports.wxaAccountCalls = exports.viewCalls = exports.lpPoolCalls = exports.tradingCalls = exports.MarketConfigBcs = exports.MarketBcs = exports.OrderBcs = exports.PositionBcs = exports.TokenPoolDataBcs = exports.RedeemRequestDataBcs = exports.PositionDataBcs = exports.PoolDataBcs = exports.OrderDataBcs = exports.MarketDataBcs = exports.GlobalConfigDataBcs = exports.AccountDataBcs = exports.waitForVaa = exports.vaaBytesToBase64 = exports.vaaBase64ToHex = exports.vaaBase64ToBytes = exports.toWormholescanEmitter = exports.padEvmEmitter = exports.listVaasByEmitter = exports.listBridgeWithdrawalVaas = exports.fetchVaa = void 0;
|
|
42
42
|
// ======== Core ========
|
|
43
43
|
var client_ts_1 = require("./client.js");
|
|
44
44
|
Object.defineProperty(exports, "PerpClient", { enumerable: true, get: function () { return client_ts_1.PerpClient; } });
|
|
45
45
|
var config_ts_1 = require("./config.js");
|
|
46
|
-
Object.defineProperty(exports, "PYTH_DEFAULTS", { enumerable: true, get: function () { return config_ts_1.PYTH_DEFAULTS; } });
|
|
47
46
|
Object.defineProperty(exports, "WORMHOLE_DEFAULTS", { enumerable: true, get: function () { return config_ts_1.WORMHOLE_DEFAULTS; } });
|
|
48
47
|
Object.defineProperty(exports, "clearConfigCache", { enumerable: true, get: function () { return config_ts_1.clearConfigCache; } });
|
|
49
48
|
Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return config_ts_1.loadConfig; } });
|
|
@@ -145,10 +144,18 @@ Object.defineProperty(exports, "PythCache", { enumerable: true, get: function ()
|
|
|
145
144
|
Object.defineProperty(exports, "aggregateTicker", { enumerable: true, get: function () { return index_ts_1.aggregateTicker; } });
|
|
146
145
|
Object.defineProperty(exports, "aggregateTickerWithConstant", { enumerable: true, get: function () { return index_ts_1.aggregateTickerWithConstant; } });
|
|
147
146
|
Object.defineProperty(exports, "aggregateTickerWithPyth", { enumerable: true, get: function () { return index_ts_1.aggregateTickerWithPyth; } });
|
|
147
|
+
Object.defineProperty(exports, "ORACLE_SOURCES", { enumerable: true, get: function () { return index_ts_1.ORACLE_SOURCES; } });
|
|
148
148
|
Object.defineProperty(exports, "buildPythPriceUpdateCalls", { enumerable: true, get: function () { return index_ts_1.buildPythPriceUpdateCalls; } });
|
|
149
149
|
Object.defineProperty(exports, "fetchPriceFeedsUpdateData", { enumerable: true, get: function () { return index_ts_1.fetchPriceFeedsUpdateData; } });
|
|
150
|
+
Object.defineProperty(exports, "isOracleSource", { enumerable: true, get: function () { return index_ts_1.isOracleSource; } });
|
|
151
|
+
Object.defineProperty(exports, "parseOracleSourceList", { enumerable: true, get: function () { return index_ts_1.parseOracleSourceList; } });
|
|
152
|
+
Object.defineProperty(exports, "pythCoreHermesEndpoint", { enumerable: true, get: function () { return index_ts_1.pythCoreHermesEndpoint; } });
|
|
153
|
+
Object.defineProperty(exports, "pythProHermesEndpoint", { enumerable: true, get: function () { return index_ts_1.pythProHermesEndpoint; } });
|
|
150
154
|
Object.defineProperty(exports, "refreshOraclePrices", { enumerable: true, get: function () { return index_ts_1.refreshOraclePrices; } });
|
|
155
|
+
Object.defineProperty(exports, "resolveHermesReadEndpoint", { enumerable: true, get: function () { return index_ts_1.resolveHermesReadEndpoint; } });
|
|
151
156
|
Object.defineProperty(exports, "updatePythPrices", { enumerable: true, get: function () { return index_ts_1.updatePythPrices; } });
|
|
157
|
+
Object.defineProperty(exports, "waterxEnvelopeOf", { enumerable: true, get: function () { return index_ts_1.waterxEnvelopeOf; } });
|
|
158
|
+
Object.defineProperty(exports, "waterxQuoteCenterEndpoint", { enumerable: true, get: function () { return index_ts_1.waterxQuoteCenterEndpoint; } });
|
|
152
159
|
// ======== Wormhole / Wormholescan utilities (credit bridge) ========
|
|
153
160
|
var wormhole_ts_1 = require("../account/funding/wormhole.js");
|
|
154
161
|
Object.defineProperty(exports, "fetchDepositVaa", { enumerable: true, get: function () { return wormhole_ts_1.fetchDepositVaa; } });
|
|
@@ -55,9 +55,10 @@ exports.unstake = unstake;
|
|
|
55
55
|
exports.claimReward = claimReward;
|
|
56
56
|
const account_request_ts_1 = require("../../account/account-request.js");
|
|
57
57
|
const staking = __importStar(require("../../generated/waterx_staking/waterx_staking.js"));
|
|
58
|
+
const record_ts_1 = require("../../utils/record.js");
|
|
58
59
|
const validate_ts_1 = require("../../utils/validate.js");
|
|
59
60
|
function pool(client, stakeAlias) {
|
|
60
|
-
const id = client.config.packages.waterx_staking?.pools
|
|
61
|
+
const id = (0, record_ts_1.ownEntry)(client.config.packages.waterx_staking?.pools, stakeAlias);
|
|
61
62
|
if (!id) {
|
|
62
63
|
throw new Error(`config.packages.waterx_staking.pools[${stakeAlias}] is not set — staking is not deployed for this stake type`);
|
|
63
64
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Exposes three namespaces over the two product-line sub-clients:
|
|
5
5
|
*
|
|
6
|
-
* const client = await WaterXClient.create({ network: "TESTNET" });
|
|
6
|
+
* const client = await WaterXClient.create({ network: "TESTNET", oracleSource: "pyth_rule" });
|
|
7
7
|
* client.account.createAccount(tx, { alias }); // -> shared waterx_account + funding
|
|
8
8
|
* client.perp.placeOrderRequest(tx, params); // -> perp builder
|
|
9
9
|
* client.predict.placeOrder(tx, params); // -> prediction builder
|
|
@@ -370,20 +370,25 @@ export interface ClientCreateOptions {
|
|
|
370
370
|
/**
|
|
371
371
|
* The perp line's oracle price-update source (perp-line only — the
|
|
372
372
|
* prediction line has no oracle leg), forwarded to `PerpClient.create`.
|
|
373
|
+
* REQUIRED — there is NO default source: every deployment names its source
|
|
374
|
+
* explicitly (wire it from your own env var, e.g. `ORACLE_SOURCE`).
|
|
373
375
|
* Source-neutral by design: a source need not be Pyth (see `'waterx_rule'`).
|
|
374
376
|
*
|
|
375
|
-
* - `'pyth_rule'`
|
|
377
|
+
* - `'pyth_rule'` — Pyth Core updates; infra in the source's own
|
|
378
|
+
* `PYTH_CORE_INFRA` table.
|
|
376
379
|
* - `'pyth_lazer_rule'` — Pyth Lazer signed updates (pair with `pythApiKey`
|
|
377
|
-
* and a config carrying `packages.pyth_lazer_rule`)
|
|
380
|
+
* and a config carrying `packages.pyth_lazer_rule`); infra in the
|
|
381
|
+
* source's own `LAZER_INFRA` table.
|
|
378
382
|
* - `'waterx_rule'` — the first-party WaterX quote-center (Nautilus-TEE,
|
|
379
|
-
* ed25519 signed batches; no credential, no per-update fee)
|
|
380
|
-
*
|
|
383
|
+
* ed25519 signed batches; no credential, no per-update fee); infra in the
|
|
384
|
+
* source's own `WATERX_INFRA` table. Pair with `waterxEndpoint` /
|
|
385
|
+
* `waterxFetch` when the browser needs a proxy.
|
|
381
386
|
*
|
|
382
387
|
* Each source is self-contained with no cross-source fallback; selecting a
|
|
383
388
|
* source whose feed for a ticker is absent fails at tx-build (not at init).
|
|
384
389
|
* See perp `CreateClientOptions.oracleSource` for the full note.
|
|
385
390
|
*/
|
|
386
|
-
oracleSource
|
|
391
|
+
oracleSource: OracleSource | OracleSource[];
|
|
387
392
|
/**
|
|
388
393
|
* Pyth Lazer access token, forwarded to the perp line. Required under
|
|
389
394
|
* `oracleSource: 'pyth_lazer_rule'`, unused by `'pyth_rule'`. A SECRET —
|
|
@@ -395,7 +400,7 @@ export interface ClientCreateOptions {
|
|
|
395
400
|
pythFetch?: PythFetchPolicy;
|
|
396
401
|
/**
|
|
397
402
|
* Quote-center base URL for `oracleSource: 'waterx_rule'`, forwarded to the
|
|
398
|
-
* perp line — overrides the per-network `
|
|
403
|
+
* perp line — overrides the source's own per-network `WATERX_INFRA` default.
|
|
399
404
|
*
|
|
400
405
|
* `waterx_rule` is the one source a BROWSER fetches itself, so it is bound by
|
|
401
406
|
* the quote-center deployment's CORS allowlist: a front end whose origin is
|
|
@@ -406,7 +411,7 @@ export interface ClientCreateOptions {
|
|
|
406
411
|
waterxEndpoint?: string;
|
|
407
412
|
/**
|
|
408
413
|
* Retry/timeout policy — and `fetchImpl` — for the perp line's quote-center
|
|
409
|
-
* fetch. Falls back to
|
|
414
|
+
* fetch. Falls back to the built-in defaults — never to `pythFetch`.
|
|
410
415
|
*/
|
|
411
416
|
waterxFetch?: FetchPolicy;
|
|
412
417
|
/** Perp-line overrides (network, grpcUrl, waterxConfigUrl, cache, …). */
|
|
@@ -448,6 +453,6 @@ export declare class WaterXClient {
|
|
|
448
453
|
* `waterx-config` JSON) and returns a ready client. Each line can target a
|
|
449
454
|
* different network via `opts.perp.network` / `opts.predict.network`.
|
|
450
455
|
*/
|
|
451
|
-
static create(opts
|
|
456
|
+
static create(opts: ClientCreateOptions): Promise<WaterXClient>;
|
|
452
457
|
}
|
|
453
458
|
export {};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Exposes three namespaces over the two product-line sub-clients:
|
|
6
6
|
*
|
|
7
|
-
* const client = await WaterXClient.create({ network: "TESTNET" });
|
|
7
|
+
* const client = await WaterXClient.create({ network: "TESTNET", oracleSource: "pyth_rule" });
|
|
8
8
|
* client.account.createAccount(tx, { alias }); // -> shared waterx_account + funding
|
|
9
9
|
* client.perp.placeOrderRequest(tx, params); // -> perp builder
|
|
10
10
|
* client.predict.placeOrder(tx, params); // -> prediction builder
|
|
@@ -186,7 +186,7 @@ class WaterXClient {
|
|
|
186
186
|
* `waterx-config` JSON) and returns a ready client. Each line can target a
|
|
187
187
|
* different network via `opts.perp.network` / `opts.predict.network`.
|
|
188
188
|
*/
|
|
189
|
-
static async create(opts
|
|
189
|
+
static async create(opts) {
|
|
190
190
|
const baseNetwork = opts.network ?? "TESTNET";
|
|
191
191
|
const { network: perpNetwork, ...perpRest } = opts.perp ?? {};
|
|
192
192
|
const { network: predictNetwork, ...predictRest } = opts.predict ?? {};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getMarketTickers = getMarketTickers;
|
|
4
4
|
exports.getCollateralAssets = getCollateralAssets;
|
|
5
|
+
const record_ts_1 = require("./record.js");
|
|
5
6
|
/** Returns all registered market tickers (e.g. "BTCUSD") from waterx-config. */
|
|
6
7
|
function getMarketTickers(config) {
|
|
7
8
|
return Object.keys(config.packages.waterx_perp.markets);
|
|
@@ -15,5 +16,5 @@ function getMarketTickers(config) {
|
|
|
15
16
|
*/
|
|
16
17
|
function getCollateralAssets(config) {
|
|
17
18
|
const feeds = config.packages.pyth_rule?.feeds ?? {};
|
|
18
|
-
return Object.keys(config.packages.wlp.pool_tokens).filter((t) => feeds
|
|
19
|
+
return Object.keys(config.packages.wlp.pool_tokens).filter((t) => (0, record_ts_1.ownEntry)(feeds, t) !== undefined);
|
|
19
20
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Own-key record lookup. Ticker-keyed config records (`feeds`, `markets`,
|
|
3
|
+
* `aggregators`) are indexed with caller-supplied strings; a bare bracket
|
|
4
|
+
* read — like the `in` operator — walks the prototype chain, so a ticker
|
|
5
|
+
* named like an `Object.prototype` key ("toString", "constructor", …) reads
|
|
6
|
+
* as an inherited Function instead of "absent" and leaks into batches sent
|
|
7
|
+
* to the network. Every such lookup funnels through here so the answer is
|
|
8
|
+
* own-keys-only, everywhere, instead of per-site `Object.hasOwn` guards
|
|
9
|
+
* that drift.
|
|
10
|
+
*/
|
|
11
|
+
/** `record[key]` iff `key` is an OWN key — `undefined` for an absent record, an absent key, or a prototype-chain hit. */
|
|
12
|
+
export declare function ownEntry<T extends Record<string, unknown>>(record: T | undefined, key: string): T[string] | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Own-key record lookup. Ticker-keyed config records (`feeds`, `markets`,
|
|
4
|
+
* `aggregators`) are indexed with caller-supplied strings; a bare bracket
|
|
5
|
+
* read — like the `in` operator — walks the prototype chain, so a ticker
|
|
6
|
+
* named like an `Object.prototype` key ("toString", "constructor", …) reads
|
|
7
|
+
* as an inherited Function instead of "absent" and leaks into batches sent
|
|
8
|
+
* to the network. Every such lookup funnels through here so the answer is
|
|
9
|
+
* own-keys-only, everywhere, instead of per-site `Object.hasOwn` guards
|
|
10
|
+
* that drift.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.ownEntry = ownEntry;
|
|
14
|
+
/** `record[key]` iff `key` is an OWN key — `undefined` for an absent record, an absent key, or a prototype-chain hit. */
|
|
15
|
+
function ownEntry(record, key) {
|
|
16
|
+
// The `T extends Record<...>` form (rather than `Record<string, V>`) keeps
|
|
17
|
+
// union-typed records inferable; TS then resolves `record[key]` only to the
|
|
18
|
+
// constraint's `unknown`, so restate the definitionally-true index type.
|
|
19
|
+
return record !== undefined && Object.hasOwn(record, key)
|
|
20
|
+
? record[key]
|
|
21
|
+
: undefined;
|
|
22
|
+
}
|
|
@@ -73,8 +73,9 @@ export interface WithdrawalQueuePackage {
|
|
|
73
73
|
/**
|
|
74
74
|
* Wormhole infra for the cross-chain credit bridge. `state_id` is the same
|
|
75
75
|
* shared Sui Wormhole `State` object Pyth uses (kept in sync with
|
|
76
|
-
* `
|
|
77
|
-
* `WaterXConfig.wormhole` if a deployment ever points
|
|
76
|
+
* `PYTH_CORE_INFRA[*].wormhole_state_id` in `oracle/pyth.ts`). Override
|
|
77
|
+
* per-deployment via `WaterXConfig.wormhole` if a deployment ever points
|
|
78
|
+
* elsewhere.
|
|
78
79
|
*/
|
|
79
80
|
export interface WormholeInfraConfig {
|
|
80
81
|
/** Shared Sui Wormhole `State` object. */
|
|
@@ -70,11 +70,6 @@ export declare const BatchPricePayload: MoveStruct<{
|
|
|
70
70
|
length: number;
|
|
71
71
|
}, string>;
|
|
72
72
|
}, "@waterx/rule::waterx_rule::BatchPricePayload">;
|
|
73
|
-
export declare const MerkleRoot: MoveStruct<{
|
|
74
|
-
root: import("@mysten/sui/bcs").BcsType<number[], Iterable<number> & {
|
|
75
|
-
length: number;
|
|
76
|
-
}, string>;
|
|
77
|
-
}, "@waterx/rule::waterx_rule::MerkleRoot">;
|
|
78
73
|
export declare const FeedConfig: MoveStruct<{
|
|
79
74
|
ticker: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
80
75
|
sources: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
@@ -219,82 +214,17 @@ export interface CollectBatchLatestOptions {
|
|
|
219
214
|
* and so aborts on any stale item, this path runs alongside Pyth/Supra. To let
|
|
220
215
|
* those cover a lagging TEE — the blast-radius bound in the GCP ADR — a
|
|
221
216
|
* _freshness_ miss ABSTAINS (records `none`, which `aggregator::remove_outliers`
|
|
222
|
-
* drops before the `weight_threshold` fail-closed check)
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
* not
|
|
226
|
-
*
|
|
227
|
-
* with the on-chain feed config is a red flag, not a liveness blip. Bad signature,
|
|
228
|
-
* malformed batch, and a future timestamp always abort.
|
|
217
|
+
* drops before the `weight_threshold` fail-closed check). A _config/integrity_
|
|
218
|
+
* mismatch (source / ticker / method / confidence / deviation) still ABORTS: an
|
|
219
|
+
* enclave whose signed payload disagrees with the on-chain feed config is a red
|
|
220
|
+
* flag, not a liveness blip. Bad signature, malformed batch, a future timestamp,
|
|
221
|
+
* and replay always abort.
|
|
229
222
|
*
|
|
230
223
|
* Every gate is identical to `feed_batch_item_latest`; only the abort-vs-abstain
|
|
231
|
-
* disposition of the freshness
|
|
232
|
-
*
|
|
224
|
+
* disposition of the two freshness gates differs, and the sink is the caller's
|
|
225
|
+
* collector rather than a fresh single-rule one.
|
|
233
226
|
*/
|
|
234
227
|
export declare function collectBatchLatest(options: CollectBatchLatestOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
235
|
-
export interface FeedSingleWithProofArguments {
|
|
236
|
-
oracleObj: RawTransactionArgument<string>;
|
|
237
|
-
config: RawTransactionArgument<string>;
|
|
238
|
-
enclaveConfig: RawTransactionArgument<string>;
|
|
239
|
-
enclave: RawTransactionArgument<string>;
|
|
240
|
-
timestampMs: RawTransactionArgument<number | bigint>;
|
|
241
|
-
item: TransactionArgument;
|
|
242
|
-
proof: RawTransactionArgument<Array<Array<number>>>;
|
|
243
|
-
sig: RawTransactionArgument<Array<number>>;
|
|
244
|
-
}
|
|
245
|
-
export interface FeedSingleWithProofOptions {
|
|
246
|
-
package?: string;
|
|
247
|
-
arguments: FeedSingleWithProofArguments | [
|
|
248
|
-
oracleObj: RawTransactionArgument<string>,
|
|
249
|
-
config: RawTransactionArgument<string>,
|
|
250
|
-
enclaveConfig: RawTransactionArgument<string>,
|
|
251
|
-
enclave: RawTransactionArgument<string>,
|
|
252
|
-
timestampMs: RawTransactionArgument<number | bigint>,
|
|
253
|
-
item: TransactionArgument,
|
|
254
|
-
proof: RawTransactionArgument<Array<Array<number>>>,
|
|
255
|
-
sig: RawTransactionArgument<Array<number>>
|
|
256
|
-
];
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Streaming per-symbol sibling of `feed_batch_latest`. Verifies ONE enclave
|
|
260
|
-
* signature over a Merkle `root`, checks `item` is a leaf of that root via
|
|
261
|
-
* `proof`, then runs the identical per-item gates + `oracle::aggregate`. Use for a
|
|
262
|
-
* WaterxRule-only aggregator; for a Pyth-coexisting aggregator use
|
|
263
|
-
* `collect_single_with_proof`.
|
|
264
|
-
*/
|
|
265
|
-
export declare function feedSingleWithProof(options: FeedSingleWithProofOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
266
|
-
export interface CollectSingleWithProofArguments {
|
|
267
|
-
collector: TransactionArgument;
|
|
268
|
-
config: RawTransactionArgument<string>;
|
|
269
|
-
enclaveConfig: RawTransactionArgument<string>;
|
|
270
|
-
enclave: RawTransactionArgument<string>;
|
|
271
|
-
timestampMs: RawTransactionArgument<number | bigint>;
|
|
272
|
-
item: TransactionArgument;
|
|
273
|
-
proof: RawTransactionArgument<Array<Array<number>>>;
|
|
274
|
-
sig: RawTransactionArgument<Array<number>>;
|
|
275
|
-
}
|
|
276
|
-
export interface CollectSingleWithProofOptions {
|
|
277
|
-
package?: string;
|
|
278
|
-
arguments: CollectSingleWithProofArguments | [
|
|
279
|
-
collector: TransactionArgument,
|
|
280
|
-
config: RawTransactionArgument<string>,
|
|
281
|
-
enclaveConfig: RawTransactionArgument<string>,
|
|
282
|
-
enclave: RawTransactionArgument<string>,
|
|
283
|
-
timestampMs: RawTransactionArgument<number | bigint>,
|
|
284
|
-
item: TransactionArgument,
|
|
285
|
-
proof: RawTransactionArgument<Array<Array<number>>>,
|
|
286
|
-
sig: RawTransactionArgument<Array<number>>
|
|
287
|
-
];
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Collect-only sibling of `feed_single_with_proof` for the dual-rule latest path
|
|
291
|
-
* (WaterX alongside Pyth on one aggregator), mirroring `collect_batch_latest`:
|
|
292
|
-
* verifies root + proof, feeds the leaf into the caller's `PriceCollector` WITHOUT
|
|
293
|
-
* calling `oracle::aggregate`. Abort vs abstain matches `collect_batch_latest`
|
|
294
|
-
* exactly — a config/integrity mismatch aborts, a freshness miss abstains so Pyth
|
|
295
|
-
* can cover a lagging TEE.
|
|
296
|
-
*/
|
|
297
|
-
export declare function collectSingleWithProof(options: CollectSingleWithProofOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
298
228
|
export interface QuoteForTimestampArguments {
|
|
299
229
|
config: RawTransactionArgument<string>;
|
|
300
230
|
enclaveConfig: RawTransactionArgument<string>;
|
|
@@ -491,27 +421,6 @@ export interface BatchPriceIntentOptions {
|
|
|
491
421
|
];
|
|
492
422
|
}
|
|
493
423
|
export declare function batchPriceIntent(options?: BatchPriceIntentOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
494
|
-
export interface MerkleRootIntentOptions {
|
|
495
|
-
package?: string;
|
|
496
|
-
arguments?: [
|
|
497
|
-
];
|
|
498
|
-
}
|
|
499
|
-
export declare function merkleRootIntent(options?: MerkleRootIntentOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
500
|
-
export interface LeafHashOfArguments {
|
|
501
|
-
item: TransactionArgument;
|
|
502
|
-
}
|
|
503
|
-
export interface LeafHashOfOptions {
|
|
504
|
-
package?: string;
|
|
505
|
-
arguments: LeafHashOfArguments | [
|
|
506
|
-
item: TransactionArgument
|
|
507
|
-
];
|
|
508
|
-
}
|
|
509
|
-
/**
|
|
510
|
-
* The keccak256 leaf hash for `item` — `keccak256(0x00 || BCS(item))`. Exposed so
|
|
511
|
-
* the off-chain builder / SDK can be pinned against the on-chain encoding in a
|
|
512
|
-
* cross-implementation golden test.
|
|
513
|
-
*/
|
|
514
|
-
export declare function leafHashOf(options: LeafHashOfOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
515
424
|
export interface MaxBatchSizeOptions {
|
|
516
425
|
package?: string;
|
|
517
426
|
arguments?: [
|
|
@@ -808,42 +717,6 @@ export interface SourceGataUsdtPerpWsOptions {
|
|
|
808
717
|
];
|
|
809
718
|
}
|
|
810
719
|
export declare function sourceGataUsdtPerpWs(options?: SourceGataUsdtPerpWsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
811
|
-
export interface SourceBybitSpotWsOptions {
|
|
812
|
-
package?: string;
|
|
813
|
-
arguments?: [
|
|
814
|
-
];
|
|
815
|
-
}
|
|
816
|
-
export declare function sourceBybitSpotWs(options?: SourceBybitSpotWsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
817
|
-
export interface SourceXstockEquityRestOptions {
|
|
818
|
-
package?: string;
|
|
819
|
-
arguments?: [
|
|
820
|
-
];
|
|
821
|
-
}
|
|
822
|
-
export declare function sourceXstockEquityRest(options?: SourceXstockEquityRestOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
823
|
-
export interface SourceOkxSpotWsOptions {
|
|
824
|
-
package?: string;
|
|
825
|
-
arguments?: [
|
|
826
|
-
];
|
|
827
|
-
}
|
|
828
|
-
export declare function sourceOkxSpotWs(options?: SourceOkxSpotWsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
829
|
-
export interface SourceHyperliquidPerpWsOptions {
|
|
830
|
-
package?: string;
|
|
831
|
-
arguments?: [
|
|
832
|
-
];
|
|
833
|
-
}
|
|
834
|
-
export declare function sourceHyperliquidPerpWs(options?: SourceHyperliquidPerpWsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
835
|
-
export interface SourceGateioSpotWsOptions {
|
|
836
|
-
package?: string;
|
|
837
|
-
arguments?: [
|
|
838
|
-
];
|
|
839
|
-
}
|
|
840
|
-
export declare function sourceGateioSpotWs(options?: SourceGateioSpotWsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
841
|
-
export interface SourceKrakenSpotWsOptions {
|
|
842
|
-
package?: string;
|
|
843
|
-
arguments?: [
|
|
844
|
-
];
|
|
845
|
-
}
|
|
846
|
-
export declare function sourceKrakenSpotWs(options?: SourceKrakenSpotWsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
847
720
|
export interface MethodDirectOptions {
|
|
848
721
|
package?: string;
|
|
849
722
|
arguments?: [
|