aftermath-ts-sdk 1.2.64 → 1.2.65
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/dist/general/dynamicGas/dynamicGas.d.ts +34 -0
- package/dist/general/dynamicGas/dynamicGas.d.ts.map +1 -1
- package/dist/general/dynamicGas/dynamicGas.js +34 -0
- package/dist/general/dynamicGas/dynamicGasTypes.d.ts +25 -0
- package/dist/general/dynamicGas/dynamicGasTypes.d.ts.map +1 -1
- package/dist/general/prices/prices.d.ts +73 -0
- package/dist/general/prices/prices.d.ts.map +1 -1
- package/dist/general/prices/prices.js +73 -0
- package/dist/general/providers/aftermath.d.ts +106 -25
- package/dist/general/providers/aftermath.d.ts.map +1 -1
- package/dist/general/providers/aftermath.js +108 -27
- package/dist/general/providers/aftermathApi.d.ts +127 -8
- package/dist/general/providers/aftermathApi.d.ts.map +1 -1
- package/dist/general/providers/aftermathApi.js +132 -12
- package/dist/general/types/castingTypes.d.ts +0 -7
- package/dist/general/types/castingTypes.d.ts.map +1 -1
- package/dist/general/types/castingTypes.js +6 -0
- package/dist/general/types/generalTypes.d.ts +228 -7
- package/dist/general/types/generalTypes.d.ts.map +1 -1
- package/dist/general/types/suiTypes.d.ts +0 -16
- package/dist/general/types/suiTypes.d.ts.map +1 -1
- package/dist/general/types/suiTypes.js +3 -25
- package/dist/general/utils/casting.d.ts +159 -3
- package/dist/general/utils/casting.d.ts.map +1 -1
- package/dist/general/utils/casting.js +162 -16
- package/dist/general/utils/fixedUtils.d.ts +89 -2
- package/dist/general/utils/fixedUtils.d.ts.map +1 -1
- package/dist/general/utils/fixedUtils.js +81 -4
- package/dist/general/utils/helpers.d.ts +320 -9
- package/dist/general/utils/helpers.d.ts.map +1 -1
- package/dist/general/utils/helpers.js +350 -89
- package/dist/general/utils/iFixedUtils.d.ts +64 -0
- package/dist/general/utils/iFixedUtils.d.ts.map +1 -1
- package/dist/general/utils/iFixedUtils.js +64 -0
- package/dist/general/wallet/wallet.d.ts +75 -0
- package/dist/general/wallet/wallet.d.ts.map +1 -1
- package/dist/general/wallet/wallet.js +75 -5
- package/dist/packages/auth/auth.d.ts +113 -0
- package/dist/packages/auth/auth.d.ts.map +1 -1
- package/dist/packages/auth/auth.js +129 -15
- package/dist/packages/auth/authTypes.d.ts +66 -0
- package/dist/packages/auth/authTypes.d.ts.map +1 -1
- package/dist/packages/coin/coin.d.ts +250 -0
- package/dist/packages/coin/coin.d.ts.map +1 -1
- package/dist/packages/coin/coin.js +238 -14
- package/dist/packages/coin/coinTypes.d.ts +93 -0
- package/dist/packages/coin/coinTypes.d.ts.map +1 -1
- package/dist/packages/dca/dca.d.ts +124 -35
- package/dist/packages/dca/dca.d.ts.map +1 -1
- package/dist/packages/dca/dca.js +127 -37
- package/dist/packages/dca/dcaTypes.d.ts +213 -28
- package/dist/packages/dca/dcaTypes.d.ts.map +1 -1
- package/dist/packages/farms/farms.d.ts +184 -1
- package/dist/packages/farms/farms.d.ts.map +1 -1
- package/dist/packages/farms/farms.js +185 -11
- package/dist/packages/farms/farmsStakedPosition.d.ts +140 -6
- package/dist/packages/farms/farmsStakedPosition.d.ts.map +1 -1
- package/dist/packages/farms/farmsStakedPosition.js +189 -144
- package/dist/packages/farms/farmsStakingPool.d.ts +161 -1
- package/dist/packages/farms/farmsStakingPool.d.ts.map +1 -1
- package/dist/packages/farms/farmsStakingPool.js +176 -70
- package/dist/packages/farms/farmsTypes.d.ts +283 -2
- package/dist/packages/farms/farmsTypes.d.ts.map +1 -1
- package/dist/packages/farms/farmsTypes.js +18 -0
- package/dist/packages/limitOrders/limitOrders.d.ts +108 -21
- package/dist/packages/limitOrders/limitOrders.d.ts.map +1 -1
- package/dist/packages/limitOrders/limitOrders.js +110 -22
- package/dist/packages/limitOrders/limitOrdersTypes.d.ts +142 -0
- package/dist/packages/limitOrders/limitOrdersTypes.d.ts.map +1 -1
- package/dist/packages/multisig/multisig.d.ts +33 -4
- package/dist/packages/multisig/multisig.d.ts.map +1 -1
- package/dist/packages/multisig/multisig.js +33 -4
- package/dist/packages/multisig/multisigTypes.d.ts +17 -0
- package/dist/packages/multisig/multisigTypes.d.ts.map +1 -1
- package/dist/packages/perpetuals/api/perpetualsApi.d.ts.map +1 -1
- package/dist/packages/pools/pool.d.ts +327 -85
- package/dist/packages/pools/pool.d.ts.map +1 -1
- package/dist/packages/pools/pool.js +333 -91
- package/dist/packages/pools/pools.d.ts +299 -37
- package/dist/packages/pools/pools.d.ts.map +1 -1
- package/dist/packages/pools/pools.js +306 -52
- package/dist/packages/pools/poolsTypes.d.ts +267 -2
- package/dist/packages/pools/poolsTypes.d.ts.map +1 -1
- package/dist/packages/referralVault/referralVault.d.ts +37 -0
- package/dist/packages/referralVault/referralVault.d.ts.map +1 -1
- package/dist/packages/referralVault/referralVault.js +37 -0
- package/dist/packages/router/router.d.ts +213 -17
- package/dist/packages/router/router.d.ts.map +1 -1
- package/dist/packages/router/router.js +214 -18
- package/dist/packages/router/routerTypes.d.ts +198 -14
- package/dist/packages/router/routerTypes.d.ts.map +1 -1
- package/dist/packages/staking/staking.d.ts +301 -43
- package/dist/packages/staking/staking.d.ts.map +1 -1
- package/dist/packages/staking/staking.js +308 -51
- package/dist/packages/staking/stakingTypes.d.ts +426 -6
- package/dist/packages/staking/stakingTypes.d.ts.map +1 -1
- package/dist/packages/staking/stakingTypes.js +19 -0
- package/dist/packages/sui/sui.d.ts +39 -0
- package/dist/packages/sui/sui.d.ts.map +1 -1
- package/dist/packages/sui/sui.js +39 -0
- package/dist/packages/userData/userData.d.ts +66 -12
- package/dist/packages/userData/userData.d.ts.map +1 -1
- package/dist/packages/userData/userData.js +66 -12
- package/dist/packages/userData/userDataTypes.d.ts +19 -0
- package/dist/packages/userData/userDataTypes.d.ts.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -1
- package/package.json +1 -1
- package/dist/general/historicalData/historicalData.d.ts +0 -15
- package/dist/general/historicalData/historicalData.d.ts.map +0 -1
- package/dist/general/historicalData/historicalData.js +0 -45
- package/dist/general/historicalData/historicalDataTypes.d.ts +0 -10
- package/dist/general/historicalData/historicalDataTypes.d.ts.map +0 -1
- package/dist/general/historicalData/historicalDataTypes.js +0 -2
|
@@ -21,10 +21,8 @@ const casting_1 = require("../utils/casting");
|
|
|
21
21
|
const caller_1 = require("../utils/caller");
|
|
22
22
|
const prices_1 = require("../prices/prices");
|
|
23
23
|
const packages_1 = require("../../packages");
|
|
24
|
-
const historicalData_1 = require("../historicalData/historicalData");
|
|
25
24
|
const perpetuals_1 = require("../../packages/perpetuals");
|
|
26
25
|
const oracle_1 = require("../../packages/oracle/oracle");
|
|
27
|
-
// import { PriceFeeds } from "../priceFeeds/priceFeeds";
|
|
28
26
|
const farms_1 = require("../../packages/farms/farms");
|
|
29
27
|
const dynamicGas_1 = require("../dynamicGas/dynamicGas");
|
|
30
28
|
const aftermathApi_1 = require("./aftermathApi");
|
|
@@ -34,10 +32,13 @@ const multisig_1 = require("../../packages/multisig/multisig");
|
|
|
34
32
|
const limitOrders_1 = require("../../packages/limitOrders/limitOrders");
|
|
35
33
|
const userData_1 = require("../../packages/userData/userData");
|
|
36
34
|
/**
|
|
37
|
-
*
|
|
35
|
+
* The `Aftermath` class serves as the primary entry point for interacting with
|
|
36
|
+
* the Aftermath Finance protocols and utilities on the Sui blockchain.
|
|
37
|
+
* It provides various sub-providers (e.g. `Router`, `Staking`, `Farms`)
|
|
38
|
+
* initialized under the specified network environment (MAINNET, TESTNET, etc).
|
|
38
39
|
*
|
|
39
40
|
* @example
|
|
40
|
-
* ```
|
|
41
|
+
* ```typescript
|
|
41
42
|
* // Create provider
|
|
42
43
|
* const aftermath = new Aftermath("MAINNET");
|
|
43
44
|
* // Create package provider
|
|
@@ -54,10 +55,11 @@ class Aftermath extends caller_1.Caller {
|
|
|
54
55
|
// Constructor
|
|
55
56
|
// =========================================================================
|
|
56
57
|
/**
|
|
57
|
-
* Creates `Aftermath` provider to call
|
|
58
|
+
* Creates an `Aftermath` provider instance to call the Aftermath Finance APIs
|
|
59
|
+
* and interact with Sui-based protocols.
|
|
58
60
|
*
|
|
59
|
-
* @param network - The Sui network
|
|
60
|
-
* @
|
|
61
|
+
* @param network - The target Sui network ("MAINNET", "TESTNET", "DEVNET", or "LOCAL").
|
|
62
|
+
* @param Provider - Optionally pass a custom `AftermathApi` instance if you already have one.
|
|
61
63
|
*/
|
|
62
64
|
constructor(network, Provider) {
|
|
63
65
|
super({
|
|
@@ -73,69 +75,122 @@ class Aftermath extends caller_1.Caller {
|
|
|
73
75
|
// Packages
|
|
74
76
|
// =========================================================================
|
|
75
77
|
/**
|
|
76
|
-
* Returns an instance of the Pools class
|
|
77
|
-
*
|
|
78
|
+
* Returns an instance of the `Pools` class, which handles DEX pool operations
|
|
79
|
+
* within the Aftermath platform (if supported).
|
|
78
80
|
*/
|
|
79
81
|
this.Pools = () => new pools_1.Pools(this.config, this.Provider);
|
|
80
82
|
/**
|
|
81
|
-
*
|
|
82
|
-
* @returns A new instance of the Staking class.
|
|
83
|
+
* Returns an instance of the `Staking` class for Aftermath's staking and unstaking features.
|
|
83
84
|
*/
|
|
84
85
|
this.Staking = () => new staking_1.Staking(this.config, this.Provider);
|
|
86
|
+
/**
|
|
87
|
+
* Returns an instance of `LeveragedStaking` for advanced leveraged staking workflows (if supported).
|
|
88
|
+
*/
|
|
85
89
|
this.LeveragedStaking = () => new packages_1.LeveragedStaking(this.config);
|
|
90
|
+
/**
|
|
91
|
+
* Returns an instance of `SuiFrens`, a specialized package for social or utility services.
|
|
92
|
+
*/
|
|
86
93
|
this.SuiFrens = () => new suiFrens_1.SuiFrens(this.config, this.Provider);
|
|
94
|
+
/**
|
|
95
|
+
* Returns an instance of `Faucet`, allowing test/dev networks to dispense tokens.
|
|
96
|
+
*/
|
|
87
97
|
this.Faucet = () => new faucet_1.Faucet(this.config, this.Provider);
|
|
88
98
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
99
|
+
* Returns an instance of the `Router` class, which handles smart order routing
|
|
100
|
+
* across multiple DEX protocols.
|
|
91
101
|
*/
|
|
92
102
|
this.Router = () => new packages_1.Router(this.config);
|
|
103
|
+
/**
|
|
104
|
+
* Returns an instance of `NftAmm`, which supports NFT AMM (automated market maker) features.
|
|
105
|
+
*/
|
|
93
106
|
this.NftAmm = () => new packages_1.NftAmm(this.config, this.Provider);
|
|
107
|
+
/**
|
|
108
|
+
* Returns an instance of `ReferralVault` for referral-based interactions in the protocol.
|
|
109
|
+
*/
|
|
94
110
|
this.ReferralVault = () => new packages_1.ReferralVault(this.config, this.Provider);
|
|
111
|
+
/**
|
|
112
|
+
* Returns an instance of `Perpetuals` for futures or perpetual contract interactions.
|
|
113
|
+
*/
|
|
95
114
|
this.Perpetuals = () => new perpetuals_1.Perpetuals(this.config);
|
|
115
|
+
/**
|
|
116
|
+
* Returns an instance of `Oracle`, which provides price oracles or other data feed services.
|
|
117
|
+
*/
|
|
96
118
|
this.Oracle = () => new oracle_1.Oracle(this.config, this.Provider);
|
|
97
119
|
/**
|
|
98
|
-
*
|
|
99
|
-
* @returns A new instance of the Farms class.
|
|
120
|
+
* Returns an instance of `Farms` for yield farming or liquidity mining functionalities.
|
|
100
121
|
*/
|
|
101
122
|
this.Farms = () => new farms_1.Farms(this.config, this.Provider);
|
|
102
123
|
/**
|
|
103
|
-
*
|
|
104
|
-
* @returns A new instance of the DCA class.
|
|
124
|
+
* Returns an instance of the `Dca` class, supporting dollar-cost averaging logic.
|
|
105
125
|
*/
|
|
106
126
|
this.Dca = () => new dca_1.Dca(this.config);
|
|
127
|
+
/**
|
|
128
|
+
* Returns an instance of `Multisig`, enabling multi-signature address creation and management.
|
|
129
|
+
*/
|
|
107
130
|
this.Multisig = () => new multisig_1.Multisig(this.config, this.Provider);
|
|
131
|
+
/**
|
|
132
|
+
* Returns an instance of `LimitOrders`, supporting limit order placement on certain DEX protocols.
|
|
133
|
+
*/
|
|
108
134
|
this.LimitOrders = () => new limitOrders_1.LimitOrders(this.config);
|
|
135
|
+
/**
|
|
136
|
+
* Returns an instance of `UserData` for creating and managing user-specific data or key storage.
|
|
137
|
+
*/
|
|
109
138
|
this.UserData = () => new userData_1.UserData(this.config);
|
|
110
139
|
// =========================================================================
|
|
111
140
|
// General
|
|
112
141
|
// =========================================================================
|
|
142
|
+
/**
|
|
143
|
+
* Returns an instance of `Sui` for low-level Sui chain information and utilities.
|
|
144
|
+
*/
|
|
113
145
|
this.Sui = () => new packages_1.Sui(this.config, this.Provider);
|
|
146
|
+
/**
|
|
147
|
+
* Returns an instance of `Prices`, which provides coin price data from external or internal feeds.
|
|
148
|
+
*/
|
|
114
149
|
this.Prices = () => new prices_1.Prices(this.config);
|
|
115
150
|
/**
|
|
116
|
-
* Creates a new instance
|
|
117
|
-
*
|
|
118
|
-
*
|
|
151
|
+
* Creates a new `Wallet` instance for a specific user address, enabling you to fetch balances,
|
|
152
|
+
* transaction history, etc.
|
|
153
|
+
*
|
|
154
|
+
* @param address - The Sui address of the wallet (e.g., "0x<32_byte_hex>").
|
|
119
155
|
*/
|
|
120
156
|
this.Wallet = (address) => new wallet_1.Wallet(address, this.config, this.Provider);
|
|
121
157
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
158
|
+
* Returns an instance of the `Coin` class, which handles coin metadata, decimal conversions,
|
|
159
|
+
* and other coin-related utilities for a specified `CoinType`.
|
|
160
|
+
*
|
|
161
|
+
* @param coinType - Optionally specify a coin type for immediate usage in coin methods.
|
|
125
162
|
*/
|
|
126
163
|
this.Coin = (coinType) => new coin_1.Coin(coinType, this.config, this.Provider);
|
|
127
|
-
|
|
128
|
-
|
|
164
|
+
/**
|
|
165
|
+
* Returns an instance of `DynamicGas`, enabling dynamic assignment of gas
|
|
166
|
+
* objects or sponsored transactions for user operations.
|
|
167
|
+
*/
|
|
129
168
|
this.DynamicGas = () => new dynamicGas_1.DynamicGas(this.config);
|
|
169
|
+
/**
|
|
170
|
+
* Returns an instance of `Auth`, handling user authentication or token-based flows (if applicable).
|
|
171
|
+
*/
|
|
130
172
|
this.Auth = () => new packages_1.Auth(this.config);
|
|
131
173
|
}
|
|
132
174
|
// =========================================================================
|
|
133
175
|
// Public Methods
|
|
134
176
|
// =========================================================================
|
|
177
|
+
/**
|
|
178
|
+
* Initializes the Aftermath provider by fetching addresses from the backend
|
|
179
|
+
* and configuring the Sui fullnode client. This method must be called before
|
|
180
|
+
* performing many API operations.
|
|
181
|
+
*
|
|
182
|
+
* @param inputs - Optional object allowing you to override the default `fullnodeUrl`.
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* const afSdk = new Aftermath("MAINNET");
|
|
186
|
+
* await afSdk.init(); // sets up internal providers
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
135
189
|
init(inputs) {
|
|
136
190
|
var _a;
|
|
137
191
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
192
|
const addresses = yield this.getAddresses();
|
|
193
|
+
// Determine the fullnode URL based on the chosen network or user override
|
|
139
194
|
const fullnodeUrl = (_a = inputs === null || inputs === void 0 ? void 0 : inputs.fullnodeUrl) !== null && _a !== void 0 ? _a : (this.network === "LOCAL"
|
|
140
195
|
? "http://127.0.0.1:9000"
|
|
141
196
|
: this.network === "DEVNET"
|
|
@@ -143,6 +198,7 @@ class Aftermath extends caller_1.Caller {
|
|
|
143
198
|
: this.network === "TESTNET"
|
|
144
199
|
? "https://fullnode.testnet.sui.io:443"
|
|
145
200
|
: "https://fullnode.mainnet.sui.io:443");
|
|
201
|
+
// Create a new AftermathApi provider
|
|
146
202
|
this.Provider = new aftermathApi_1.AftermathApi(new client_1.SuiClient({
|
|
147
203
|
transport: new client_1.SuiHTTPTransport({
|
|
148
204
|
url: fullnodeUrl,
|
|
@@ -151,14 +207,32 @@ class Aftermath extends caller_1.Caller {
|
|
|
151
207
|
});
|
|
152
208
|
}
|
|
153
209
|
/**
|
|
154
|
-
* Retrieves the addresses
|
|
155
|
-
*
|
|
210
|
+
* Retrieves the Aftermath-specific on-chain addresses (object IDs, packages, etc.).
|
|
211
|
+
*
|
|
212
|
+
* @returns A `ConfigAddresses` object containing relevant addresses for the protocol.
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```typescript
|
|
216
|
+
* const addresses = await aftermath.getAddresses();
|
|
217
|
+
* console.log(addresses); // { routerPackageId: "...", someOtherPackageId: "..." }
|
|
218
|
+
* ```
|
|
156
219
|
*/
|
|
157
220
|
getAddresses() {
|
|
158
221
|
return __awaiter(this, void 0, void 0, function* () {
|
|
159
222
|
return this.fetchApi("addresses");
|
|
160
223
|
});
|
|
161
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Returns the base URL used for Aftermath API calls.
|
|
227
|
+
*
|
|
228
|
+
* @returns The base URL for this instance's API.
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* ```typescript
|
|
232
|
+
* const apiBaseUrl = aftermath.getApiBaseUrl();
|
|
233
|
+
* console.log(apiBaseUrl); // "https://api.after..."
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
162
236
|
getApiBaseUrl() {
|
|
163
237
|
return this.apiBaseUrl;
|
|
164
238
|
}
|
|
@@ -167,5 +241,12 @@ exports.Aftermath = Aftermath;
|
|
|
167
241
|
// =========================================================================
|
|
168
242
|
// Utils
|
|
169
243
|
// =========================================================================
|
|
244
|
+
/**
|
|
245
|
+
* Exposes a set of helper functions for general-purpose usage across
|
|
246
|
+
* the Aftermath ecosystem. Includes utilities for math, logging, etc.
|
|
247
|
+
*/
|
|
170
248
|
Aftermath.helpers = helpers_1.Helpers;
|
|
249
|
+
/**
|
|
250
|
+
* Exposes a set of casting utilities for data type conversions (e.g., BigInt <-> fixed).
|
|
251
|
+
*/
|
|
171
252
|
Aftermath.casting = casting_1.Casting;
|
|
@@ -29,58 +29,177 @@ import { MultisigApi } from "../../packages/multisig/api/multisigApi";
|
|
|
29
29
|
import { UserDataApi } from "../../packages/userData/api/userDataApi";
|
|
30
30
|
import { LimitOrdersApi } from "../../packages/limitOrders/api/limitOrdersApi";
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* The `AftermathApi` class is a low-level factory and reference point for
|
|
33
|
+
* interacting directly with underlying API modules (e.g., PoolsApi, StakingApi).
|
|
34
|
+
* It encapsulates a configured `SuiClient` and the known `addresses` for the
|
|
35
|
+
* Aftermath protocol, allowing flexible or advanced usage scenarios.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* import { AftermathApi } from "aftermath-ts-sdk";
|
|
40
|
+
* import { SuiClient, SuiHTTPTransport } from "@mysten/sui/client";
|
|
41
|
+
*
|
|
42
|
+
* const addresses = { ... }; // from aftermath.getAddresses()
|
|
43
|
+
* const suiClient = new SuiClient({
|
|
44
|
+
* transport: new SuiHTTPTransport({
|
|
45
|
+
* url: "https://fullnode.mainnet.sui.io",
|
|
46
|
+
* }),
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* const afApi = new AftermathApi(suiClient, addresses);
|
|
50
|
+
* // access protocol APIs
|
|
51
|
+
* const poolsApi = afApi.Pools();
|
|
52
|
+
* ```
|
|
34
53
|
*/
|
|
35
54
|
export declare class AftermathApi {
|
|
36
55
|
readonly provider: SuiClient;
|
|
37
56
|
readonly addresses: ConfigAddresses;
|
|
38
57
|
readonly providerV0?: SuiClientV0 | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Static helper references for quick usage without instantiating the class.
|
|
60
|
+
*/
|
|
39
61
|
static helpers: {
|
|
62
|
+
/** Helpers for accessing or iterating over dynamic fields in Sui objects. */
|
|
40
63
|
dynamicFields: typeof DynamicFieldsApiHelpers;
|
|
64
|
+
/** Helpers for working with Sui events and pagination. */
|
|
41
65
|
events: typeof EventsApiHelpers;
|
|
66
|
+
/** Helpers for reading on-chain data in an "inspection" manner (designed for Summaries). */
|
|
42
67
|
inspections: typeof InspectionsApiHelpers;
|
|
68
|
+
/** Helpers for retrieving and parsing Sui objects by ID or type. */
|
|
43
69
|
objects: typeof ObjectsApiHelpers;
|
|
70
|
+
/** Helpers for reading transaction data (by digest, query, etc.). */
|
|
44
71
|
transactions: typeof TransactionsApiHelpers;
|
|
72
|
+
/** Helper for wallet-based operations, separate from the main `Wallet` classes. */
|
|
45
73
|
wallet: typeof WalletApi;
|
|
74
|
+
/** Low-level direct coin operations, separate from the higher-level `Coin` class. */
|
|
46
75
|
coin: typeof CoinApi;
|
|
76
|
+
/** Low-level Sui chain data ops, separate from the higher-level `Sui` class. */
|
|
47
77
|
sui: typeof SuiApi;
|
|
48
78
|
};
|
|
49
79
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
80
|
+
* Constructs a new instance of the `AftermathApi`, binding the given Sui client
|
|
81
|
+
* to the known `addresses`. Optionally, a `providerV0` can be passed for
|
|
82
|
+
* legacy transaction building or older Sui libraries.
|
|
83
|
+
*
|
|
84
|
+
* @param provider - The `SuiClient` for on-chain queries and transactions.
|
|
85
|
+
* @param addresses - The config addresses (object IDs, package IDs, etc.) for the Aftermath protocol.
|
|
86
|
+
* @param providerV0 - An optional legacy `SuiClient` from `@mysten/sui.js/client`.
|
|
54
87
|
*/
|
|
55
88
|
constructor(provider: SuiClient, addresses: ConfigAddresses, providerV0?: SuiClientV0 | undefined);
|
|
89
|
+
/**
|
|
90
|
+
* Creates a new `DynamicFieldsApiHelpers` instance for complex object field queries.
|
|
91
|
+
*/
|
|
56
92
|
DynamicFields: () => DynamicFieldsApiHelpers;
|
|
93
|
+
/**
|
|
94
|
+
* Creates a new `EventsApiHelpers` instance for querying Sui events.
|
|
95
|
+
*/
|
|
57
96
|
Events: () => EventsApiHelpers;
|
|
97
|
+
/**
|
|
98
|
+
* Creates a new `InspectionsApiHelpers` instance for reading Summaries or inspection data.
|
|
99
|
+
*/
|
|
58
100
|
Inspections: () => InspectionsApiHelpers;
|
|
101
|
+
/**
|
|
102
|
+
* Creates a new `ObjectsApiHelpers` instance for object retrieval/manipulation.
|
|
103
|
+
*/
|
|
59
104
|
Objects: () => ObjectsApiHelpers;
|
|
105
|
+
/**
|
|
106
|
+
* Creates a new `TransactionsApiHelpers` instance for querying or parsing transaction data.
|
|
107
|
+
*/
|
|
60
108
|
Transactions: () => TransactionsApiHelpers;
|
|
109
|
+
/**
|
|
110
|
+
* Creates a new `WalletApi` instance for direct wallet-based operations (fetching balances, etc.).
|
|
111
|
+
*/
|
|
61
112
|
Wallet: () => WalletApi;
|
|
113
|
+
/**
|
|
114
|
+
* Creates a new `NftsApi` instance for retrieving and interacting with NFT data.
|
|
115
|
+
*/
|
|
62
116
|
Nfts: () => NftsApi;
|
|
117
|
+
/**
|
|
118
|
+
* Creates a new `CoinApi` instance for detailed coin operations.
|
|
119
|
+
*/
|
|
63
120
|
Coin: () => CoinApi;
|
|
121
|
+
/**
|
|
122
|
+
* Creates a new `SuiApi` instance for lower-level Sui chain interactions.
|
|
123
|
+
*/
|
|
64
124
|
Sui: () => SuiApi;
|
|
125
|
+
/**
|
|
126
|
+
* Creates a new `PoolsApi` instance for pool-related interactions (AMM pools, liquidity, etc.).
|
|
127
|
+
*/
|
|
65
128
|
Pools: () => PoolsApi;
|
|
129
|
+
/**
|
|
130
|
+
* Creates a new `FaucetApi` instance for dispensing tokens on supported dev/test networks.
|
|
131
|
+
*/
|
|
66
132
|
Faucet: () => FaucetApi;
|
|
133
|
+
/**
|
|
134
|
+
* Creates a new `SuiFrensApi` instance for special social or token gating utilities on Sui.
|
|
135
|
+
*/
|
|
67
136
|
SuiFrens: () => SuiFrensApi;
|
|
137
|
+
/**
|
|
138
|
+
* Creates a new `StakingApi` instance for advanced or direct staking operations on Sui.
|
|
139
|
+
*/
|
|
68
140
|
Staking: () => StakingApi;
|
|
141
|
+
/**
|
|
142
|
+
* Creates a new `NftAmmApi` instance for NFT AMM logic (buy, sell, liquidity).
|
|
143
|
+
*/
|
|
69
144
|
NftAmm: () => NftAmmApi;
|
|
145
|
+
/**
|
|
146
|
+
* Creates a new `ReferralVaultApi` instance for referral-based logic in Aftermath.
|
|
147
|
+
*/
|
|
70
148
|
ReferralVault: () => ReferralVaultApi;
|
|
149
|
+
/**
|
|
150
|
+
* Creates a new `PerpetualsApi` instance for futures or perpetual derivatives on Sui.
|
|
151
|
+
*/
|
|
71
152
|
Perpetuals: () => PerpetualsApi;
|
|
153
|
+
/**
|
|
154
|
+
* Creates a new `OracleApi` instance for price or data feed oracles.
|
|
155
|
+
*/
|
|
72
156
|
Oracle: () => OracleApi;
|
|
157
|
+
/**
|
|
158
|
+
* Creates a new `FarmsApi` instance for yield farming or liquidity mining interactions.
|
|
159
|
+
*/
|
|
73
160
|
Farms: () => FarmsApi;
|
|
161
|
+
/**
|
|
162
|
+
* Creates a new `DcaApi` instance for dollar-cost averaging logic.
|
|
163
|
+
*/
|
|
74
164
|
Dca: () => DcaApi;
|
|
165
|
+
/**
|
|
166
|
+
* Creates a new `MultisigApi` instance for multi-signature address creation and management.
|
|
167
|
+
*/
|
|
75
168
|
Multisig: () => MultisigApi;
|
|
169
|
+
/**
|
|
170
|
+
* Creates a new `LimitOrdersApi` instance for placing limit orders on supported DEX protocols.
|
|
171
|
+
*/
|
|
76
172
|
LimitOrders: () => LimitOrdersApi;
|
|
173
|
+
/**
|
|
174
|
+
* Creates a new `UserDataApi` instance for managing user-specific data storage or sign-on logic.
|
|
175
|
+
*/
|
|
77
176
|
UserData: () => UserDataApi;
|
|
78
177
|
/**
|
|
79
|
-
* Creates a new instance
|
|
80
|
-
* @returns A new instance of the RouterApi class.
|
|
178
|
+
* Creates a new `RouterApi` instance for best-price trade routing across multiple DEX liquidity sources.
|
|
81
179
|
*/
|
|
82
180
|
Router: () => RouterApi;
|
|
181
|
+
/**
|
|
182
|
+
* Creates a new `LeveragedStakingApi` instance for leveraged staking operations,
|
|
183
|
+
* optionally using `ScallopProviders` if needed.
|
|
184
|
+
*
|
|
185
|
+
* @param ScallopProviders - An optional object containing references to Scallop's Sui modules or providers.
|
|
186
|
+
*/
|
|
83
187
|
LeveragedStaking: (ScallopProviders?: any) => LeveragedStakingApi;
|
|
188
|
+
/**
|
|
189
|
+
* Attempts to decode a Move error message into a structured error code,
|
|
190
|
+
* package ID, module name, and descriptive error string.
|
|
191
|
+
*
|
|
192
|
+
* @param inputs - An object containing the raw `errorMessage`.
|
|
193
|
+
* @returns An object with `errorCode`, `packageId`, `module`, and `error` if translation is successful, or `undefined`.
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```typescript
|
|
197
|
+
* const errorDecoded = afApi.translateMoveErrorMessage({ errorMessage: "MoveAbort at ..." });
|
|
198
|
+
* if (errorDecoded) {
|
|
199
|
+
* console.log(errorDecoded.errorCode, errorDecoded.error);
|
|
200
|
+
* }
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
84
203
|
translateMoveErrorMessage: <T extends MoveErrorsInterface>(inputs: {
|
|
85
204
|
errorMessage: string;
|
|
86
205
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aftermathApi.d.ts","sourceRoot":"","sources":["../../../src/general/providers/aftermathApi.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE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