aftermath-ts-sdk 1.2.51 → 1.2.52-perps.4
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 +62 -28
- package/dist/general/apiHelpers/eventsApiHelpers.d.ts +1 -1
- package/dist/general/apiHelpers/eventsApiHelpers.d.ts.map +1 -1
- package/dist/general/apiHelpers/eventsApiHelpers.js +4 -1
- package/dist/general/apiHelpers/transactionsApiHelpers.d.ts +6 -0
- package/dist/general/apiHelpers/transactionsApiHelpers.d.ts.map +1 -1
- package/dist/general/apiHelpers/transactionsApiHelpers.js +46 -0
- 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/coinGeckoTypes.d.ts +2 -0
- package/dist/general/prices/coinGeckoTypes.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 +107 -27
- package/dist/general/providers/aftermath.d.ts.map +1 -1
- package/dist/general/providers/aftermath.js +110 -30
- package/dist/general/providers/aftermathApi.d.ts +128 -10
- package/dist/general/providers/aftermathApi.d.ts.map +1 -1
- package/dist/general/providers/aftermathApi.js +133 -14
- package/dist/general/types/castingTypes.d.ts +15 -7
- package/dist/general/types/castingTypes.d.ts.map +1 -1
- package/dist/general/types/castingTypes.js +6 -0
- package/dist/general/types/configTypes.d.ts +14 -8
- package/dist/general/types/configTypes.d.ts.map +1 -1
- package/dist/general/types/generalTypes.d.ts +229 -7
- package/dist/general/types/generalTypes.d.ts.map +1 -1
- package/dist/general/types/moveErrorsInterface.d.ts +1 -1
- package/dist/general/types/moveErrorsInterface.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/caller.d.ts +6 -3
- package/dist/general/utils/caller.d.ts.map +1 -1
- package/dist/general/utils/caller.js +22 -4
- package/dist/general/utils/casting.d.ts +156 -5
- package/dist/general/utils/casting.d.ts.map +1 -1
- package/dist/general/utils/casting.js +159 -18
- 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 +327 -10
- package/dist/general/utils/helpers.d.ts.map +1 -1
- package/dist/general/utils/helpers.js +409 -91
- 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 +76 -1
- 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 -4
- package/dist/packages/auth/auth.d.ts.map +1 -1
- package/dist/packages/auth/auth.js +190 -59
- package/dist/packages/auth/authTypes.d.ts +66 -0
- package/dist/packages/auth/authTypes.d.ts.map +1 -1
- package/dist/packages/coin/api/coinApi.d.ts.map +1 -1
- package/dist/packages/coin/api/coinApi.js +29 -20
- package/dist/packages/coin/coin.d.ts +256 -1
- package/dist/packages/coin/coin.d.ts.map +1 -1
- package/dist/packages/coin/coin.js +246 -15
- package/dist/packages/coin/coinTypes.d.ts +95 -0
- package/dist/packages/coin/coinTypes.d.ts.map +1 -1
- package/dist/packages/dca/api/dcaApi.d.ts +2 -0
- package/dist/packages/dca/api/dcaApi.d.ts.map +1 -1
- package/dist/packages/dca/api/dcaApi.js +6 -3
- package/dist/packages/dca/dca.d.ts +125 -35
- package/dist/packages/dca/dca.d.ts.map +1 -1
- package/dist/packages/dca/dca.js +135 -43
- package/dist/packages/dca/dcaTypes.d.ts +217 -42
- package/dist/packages/dca/dcaTypes.d.ts.map +1 -1
- package/dist/packages/farms/api/farmsApi.d.ts +725 -58
- package/dist/packages/farms/api/farmsApi.d.ts.map +1 -1
- package/dist/packages/farms/api/farmsApi.js +1149 -153
- package/dist/packages/farms/api/farmsApiCasting.d.ts +34 -18
- package/dist/packages/farms/api/farmsApiCasting.d.ts.map +1 -1
- package/dist/packages/farms/api/farmsApiCasting.js +218 -17
- package/dist/packages/farms/api/farmsApiCastingTypes.d.ts +117 -21
- package/dist/packages/farms/api/farmsApiCastingTypes.d.ts.map +1 -1
- package/dist/packages/farms/farms.d.ts +200 -12
- package/dist/packages/farms/farms.d.ts.map +1 -1
- package/dist/packages/farms/farms.js +204 -50
- package/dist/packages/farms/farmsStakedPosition.d.ts +143 -8
- package/dist/packages/farms/farmsStakedPosition.d.ts.map +1 -1
- package/dist/packages/farms/farmsStakedPosition.js +243 -137
- package/dist/packages/farms/farmsStakingPool.d.ts +171 -3
- package/dist/packages/farms/farmsStakingPool.d.ts.map +1 -1
- package/dist/packages/farms/farmsStakingPool.js +233 -73
- package/dist/packages/farms/farmsTypes.d.ts +310 -2
- package/dist/packages/farms/farmsTypes.d.ts.map +1 -1
- package/dist/packages/farms/farmsTypes.js +47 -0
- package/dist/packages/faucet/api/faucetApi.d.ts +9 -17
- package/dist/packages/faucet/api/faucetApi.d.ts.map +1 -1
- package/dist/packages/faucet/api/faucetApi.js +44 -49
- package/dist/packages/faucet/api/faucetApiCasting.d.ts.map +1 -1
- package/dist/packages/faucet/api/faucetApiCasting.js +8 -5
- package/dist/packages/faucet/api/faucetApiCastingTypes.d.ts +1 -4
- package/dist/packages/faucet/api/faucetApiCastingTypes.d.ts.map +1 -1
- package/dist/packages/faucet/faucet.d.ts +1 -1
- package/dist/packages/faucet/faucet.d.ts.map +1 -1
- package/dist/packages/faucet/faucet.js +1 -1
- package/dist/packages/faucet/faucetTypes.d.ts +2 -3
- package/dist/packages/faucet/faucetTypes.d.ts.map +1 -1
- package/dist/packages/limitOrders/api/limitOrdersApi.d.ts +12 -0
- package/dist/packages/limitOrders/api/limitOrdersApi.d.ts.map +1 -0
- package/dist/packages/limitOrders/api/limitOrdersApi.js +25 -0
- package/dist/packages/limitOrders/index.d.ts +2 -0
- package/dist/packages/limitOrders/index.d.ts.map +1 -0
- package/dist/packages/limitOrders/index.js +17 -0
- package/dist/packages/limitOrders/limitOrders.d.ts +143 -0
- package/dist/packages/limitOrders/limitOrders.d.ts.map +1 -0
- package/dist/packages/limitOrders/limitOrders.js +190 -0
- package/dist/packages/limitOrders/limitOrdersTypes.d.ts +211 -0
- package/dist/packages/limitOrders/limitOrdersTypes.d.ts.map +1 -0
- package/dist/packages/multisig/multisig.d.ts +34 -5
- 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/nftAmm/nftAmm.d.ts +1 -1
- package/dist/packages/nftAmm/nftAmm.d.ts.map +1 -1
- package/dist/packages/perpetuals/api/perpetualsApi.d.ts +38 -23
- package/dist/packages/perpetuals/api/perpetualsApi.d.ts.map +1 -1
- package/dist/packages/perpetuals/api/perpetualsApi.js +740 -299
- package/dist/packages/perpetuals/api/perpetualsApiCasting.d.ts +10 -6
- package/dist/packages/perpetuals/api/perpetualsApiCasting.d.ts.map +1 -1
- package/dist/packages/perpetuals/api/perpetualsApiCasting.js +112 -42
- package/dist/packages/perpetuals/perpetuals.d.ts +33 -4
- package/dist/packages/perpetuals/perpetuals.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetuals.js +105 -18
- package/dist/packages/perpetuals/perpetualsAccount.d.ts +107 -33
- package/dist/packages/perpetuals/perpetualsAccount.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsAccount.js +569 -68
- package/dist/packages/perpetuals/perpetualsCastingTypes.d.ts +104 -25
- package/dist/packages/perpetuals/perpetualsCastingTypes.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsMarket.d.ts +31 -9
- package/dist/packages/perpetuals/perpetualsMarket.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsMarket.js +85 -77
- package/dist/packages/perpetuals/perpetualsTypes.d.ts +349 -379
- package/dist/packages/perpetuals/perpetualsTypes.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsTypes.js +43 -113
- package/dist/packages/pools/api/poolsApiCasting.d.ts.map +1 -1
- package/dist/packages/pools/api/poolsApiCasting.js +0 -1
- package/dist/packages/pools/pool.d.ts +333 -106
- package/dist/packages/pools/pool.d.ts.map +1 -1
- package/dist/packages/pools/pool.js +347 -119
- package/dist/packages/pools/pools.d.ts +307 -39
- package/dist/packages/pools/pools.d.ts.map +1 -1
- package/dist/packages/pools/pools.js +323 -54
- 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 +38 -1
- package/dist/packages/referralVault/referralVault.d.ts.map +1 -1
- package/dist/packages/referralVault/referralVault.js +37 -0
- package/dist/packages/router/api/routerApi.d.ts +2 -2
- package/dist/packages/router/api/routerApi.d.ts.map +1 -1
- package/dist/packages/router/api/routerApi.js +19 -11
- package/dist/packages/router/router.d.ts +214 -18
- package/dist/packages/router/router.d.ts.map +1 -1
- package/dist/packages/router/router.js +216 -20
- package/dist/packages/router/routerTypes.d.ts +202 -17
- package/dist/packages/router/routerTypes.d.ts.map +1 -1
- package/dist/packages/staking/staking.d.ts +306 -45
- package/dist/packages/staking/staking.d.ts.map +1 -1
- package/dist/packages/staking/staking.js +313 -51
- package/dist/packages/staking/stakingTypes.d.ts +431 -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 +40 -1
- package/dist/packages/sui/sui.d.ts.map +1 -1
- package/dist/packages/sui/sui.js +39 -0
- package/dist/packages/suiFrens/stakedSuiFren.d.ts +1 -1
- package/dist/packages/suiFrens/stakedSuiFren.d.ts.map +1 -1
- package/dist/packages/suiFrens/suiFren.d.ts +1 -1
- package/dist/packages/suiFrens/suiFren.d.ts.map +1 -1
- package/dist/packages/suiFrens/suiFrens.d.ts +1 -1
- package/dist/packages/suiFrens/suiFrens.d.ts.map +1 -1
- package/dist/packages/userData/api/userDataApi.d.ts +6 -0
- package/dist/packages/userData/api/userDataApi.d.ts.map +1 -0
- package/dist/packages/userData/api/userDataApi.js +12 -0
- package/dist/packages/userData/index.d.ts +2 -0
- package/dist/packages/userData/index.d.ts.map +1 -0
- package/dist/packages/userData/index.js +17 -0
- package/dist/packages/userData/userData.d.ts +89 -0
- package/dist/packages/userData/userData.d.ts.map +1 -0
- package/dist/packages/userData/userData.js +119 -0
- package/dist/packages/userData/userDataTypes.d.ts +29 -0
- package/dist/packages/userData/userDataTypes.d.ts.map +1 -0
- 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/packages/dca/api/dcaApiCasting.d.ts +0 -11
- package/dist/packages/dca/api/dcaApiCasting.d.ts.map +0 -1
- package/dist/packages/dca/api/dcaApiCasting.js +0 -186
- package/dist/packages/dca/api/dcaApiCastingTypes.d.ts +0 -142
- package/dist/packages/dca/api/dcaApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/oracle/api/oracleApi.d.ts +0 -13
- package/dist/packages/oracle/api/oracleApi.d.ts.map +0 -1
- package/dist/packages/oracle/api/oracleApi.js +0 -35
- package/dist/packages/oracle/oracle.d.ts +0 -15
- package/dist/packages/oracle/oracle.d.ts.map +0 -1
- package/dist/packages/oracle/oracle.js +0 -46
- package/dist/packages/oracle/oracleTypes.d.ts +0 -2
- package/dist/packages/oracle/oracleTypes.d.ts.map +0 -1
- package/dist/packages/oracle/oracleTypes.js +0 -2
- /package/dist/{general/historicalData/historicalDataTypes.js → packages/limitOrders/limitOrdersTypes.js} +0 -0
- /package/dist/packages/{dca/api/dcaApiCastingTypes.js → userData/userDataTypes.js} +0 -0
|
@@ -1,120 +1,342 @@
|
|
|
1
1
|
import { DynamicFieldInfo, EventId, SuiTransactionBlockResponse } from "@mysten/sui/client";
|
|
2
2
|
import { SuiNetwork } from "./suiTypes";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a token or currency balance in the system, defined as a bigint.
|
|
5
|
+
*/
|
|
3
6
|
export type Balance = bigint;
|
|
7
|
+
/**
|
|
8
|
+
* Represents a fixed-point integer using a bigint. May be used for calculations requiring
|
|
9
|
+
* precision (e.g., decimal-like math).
|
|
10
|
+
*/
|
|
4
11
|
export type IFixed = bigint;
|
|
12
|
+
export type SuiCheckpoint = bigint;
|
|
13
|
+
/**
|
|
14
|
+
* Represents a gas budget for transactions. Typically a raw `number`.
|
|
15
|
+
*/
|
|
5
16
|
export type GasBudget = number;
|
|
17
|
+
/**
|
|
18
|
+
* Represents a timestamp in milliseconds or seconds. Typically a raw `number`.
|
|
19
|
+
*/
|
|
6
20
|
export type Timestamp = number;
|
|
21
|
+
/**
|
|
22
|
+
* A single byte, typically expressed as a `number` from 0 to 255.
|
|
23
|
+
*/
|
|
7
24
|
export type Byte = number;
|
|
25
|
+
/**
|
|
26
|
+
* Defines the allowable slippage in a trading scenario, expressed as an unscaled percentage (e.g., 0.01 = 1%).
|
|
27
|
+
*/
|
|
8
28
|
export type Slippage = number;
|
|
9
29
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @remarks 0.54 = 54%
|
|
30
|
+
* Represents an unscaled percentage (e.g., 0.01 = 1%).
|
|
13
31
|
*/
|
|
14
32
|
export type Percentage = number;
|
|
33
|
+
/**
|
|
34
|
+
* Annual percentage rate (APR), expressed as a `number` (e.g., 0.01 = 1%).
|
|
35
|
+
*/
|
|
15
36
|
export type Apr = number;
|
|
37
|
+
/**
|
|
38
|
+
* Annual percentage yield (APY), expressed as a `number` (e.g., 0.01 = 1%).
|
|
39
|
+
*/
|
|
16
40
|
export type Apy = number;
|
|
41
|
+
/**
|
|
42
|
+
* Represents the version of an on-chain object, expressed as a `number`.
|
|
43
|
+
*/
|
|
17
44
|
export type ObjectVersion = number;
|
|
45
|
+
/**
|
|
46
|
+
* Represents an error code from a Move smart contract, typically a `number`.
|
|
47
|
+
*/
|
|
18
48
|
export type MoveErrorCode = number;
|
|
49
|
+
/**
|
|
50
|
+
* Represents a serialized transaction in a base64 or similar format.
|
|
51
|
+
*/
|
|
19
52
|
export type SerializedTransaction = string;
|
|
53
|
+
/**
|
|
54
|
+
* Represents raw transaction bytes in a base64 or similar format.
|
|
55
|
+
*/
|
|
20
56
|
export type TxBytes = string;
|
|
57
|
+
/**
|
|
58
|
+
* Represents a BigInt in string form, typically used for JSON serialization.
|
|
59
|
+
*/
|
|
21
60
|
export type BigIntAsString = string;
|
|
61
|
+
/**
|
|
62
|
+
* Represents a numeric value in string form, typically used for JSON serialization.
|
|
63
|
+
*/
|
|
22
64
|
export type NumberAsString = string;
|
|
65
|
+
/**
|
|
66
|
+
* Represents an IFixed value in string form, typically used for JSON serialization.
|
|
67
|
+
*/
|
|
23
68
|
export type IFixedAsString = string;
|
|
69
|
+
/**
|
|
70
|
+
* A key type used in certain contexts, typically a string (e.g., "ed25519", "secp256k1").
|
|
71
|
+
*/
|
|
24
72
|
export type KeyType = string;
|
|
73
|
+
/**
|
|
74
|
+
* Represents any string identifying an object type, such as "0x2::sui::SUI".
|
|
75
|
+
*/
|
|
25
76
|
export type AnyObjectType = string;
|
|
77
|
+
/**
|
|
78
|
+
* Represents the name of a Move module, e.g. "Router" or "Coin".
|
|
79
|
+
*/
|
|
26
80
|
export type ModuleName = string;
|
|
81
|
+
/**
|
|
82
|
+
* Represents the name of a Move function, e.g. "swap" or "mint".
|
|
83
|
+
*/
|
|
27
84
|
export type FunctionName = string;
|
|
85
|
+
/**
|
|
86
|
+
* Represents the ID of a published Move package on the Sui network, e.g. "0x<package_id>".
|
|
87
|
+
*/
|
|
28
88
|
export type PackageId = string;
|
|
89
|
+
/**
|
|
90
|
+
* Represents a color in a string format (e.g., "#FFFFFF" or "blue").
|
|
91
|
+
*/
|
|
29
92
|
export type Color = string;
|
|
93
|
+
/**
|
|
94
|
+
* Represents a URL in string format (e.g., "https://example.com").
|
|
95
|
+
*/
|
|
30
96
|
export type Url = string;
|
|
97
|
+
/**
|
|
98
|
+
* Represents a local resource URL (e.g., "file://path/to/resource").
|
|
99
|
+
*/
|
|
31
100
|
export type LocalUrl = string;
|
|
101
|
+
/**
|
|
102
|
+
* Represents a file path (e.g., "/usr/local/bin").
|
|
103
|
+
*/
|
|
32
104
|
export type FilePath = string;
|
|
105
|
+
/**
|
|
106
|
+
* Represents an on-chain object ID (e.g., "0x<32-byte_hex>").
|
|
107
|
+
*/
|
|
33
108
|
export type ObjectId = string;
|
|
109
|
+
/**
|
|
110
|
+
* Represents a Sui wallet address (e.g., "0x<address>").
|
|
111
|
+
*/
|
|
34
112
|
export type SuiAddress = string;
|
|
113
|
+
/**
|
|
114
|
+
* Represents a TransactionDigest from a Sui transaction, typically a hex-encoded string.
|
|
115
|
+
*/
|
|
35
116
|
export type TransactionDigest = string;
|
|
117
|
+
/**
|
|
118
|
+
* Represents a single byte in string form, usually hex-encoded (e.g., "0xFF").
|
|
119
|
+
*/
|
|
36
120
|
export type StringByte = string;
|
|
121
|
+
/**
|
|
122
|
+
* Represents an object's digest, typically a hex-encoded string.
|
|
123
|
+
*/
|
|
37
124
|
export type ObjectDigest = string;
|
|
125
|
+
/**
|
|
126
|
+
* Represents an IFixed type as an array of bytes.
|
|
127
|
+
*/
|
|
38
128
|
export type IFixedAsBytes = Byte[];
|
|
129
|
+
/**
|
|
130
|
+
* Represents an IFixed type in string form, each byte also in string form.
|
|
131
|
+
*/
|
|
39
132
|
export type IFixedAsStringBytes = string[];
|
|
133
|
+
/**
|
|
134
|
+
* Represents an ID as an array of bytes in string form.
|
|
135
|
+
*/
|
|
40
136
|
export type IdAsStringBytes = string[];
|
|
41
137
|
/**
|
|
42
|
-
*
|
|
138
|
+
* Holds information about third-party fees in transactions, including the recipient
|
|
139
|
+
* and the fee percentage to be collected.
|
|
43
140
|
*/
|
|
44
141
|
export interface ExternalFee {
|
|
45
142
|
/**
|
|
46
|
-
* Address of recipient for collected fees
|
|
143
|
+
* Address of the recipient for collected fees.
|
|
47
144
|
*/
|
|
48
145
|
recipient: SuiAddress;
|
|
49
146
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
147
|
+
* Percentage of the fee to be collected.
|
|
52
148
|
* @remarks 0.54 = 54%
|
|
53
149
|
*/
|
|
54
150
|
feePercentage: Percentage;
|
|
55
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* A function signature for signing arbitrary messages. Typically used in
|
|
154
|
+
* cryptographic contexts.
|
|
155
|
+
*/
|
|
56
156
|
export type SignMessageCallback = (args: {
|
|
57
157
|
message: Uint8Array;
|
|
58
158
|
}) => Promise<{
|
|
59
159
|
signature: string;
|
|
60
160
|
}>;
|
|
161
|
+
/**
|
|
162
|
+
* Generic shape for events with optional paging cursor data.
|
|
163
|
+
*/
|
|
61
164
|
export interface IndexerEventsWithCursor<EventType> {
|
|
165
|
+
/**
|
|
166
|
+
* An array of events of type `EventType`.
|
|
167
|
+
*/
|
|
62
168
|
events: EventType[];
|
|
169
|
+
/**
|
|
170
|
+
* The next cursor position. If undefined, no more events are available.
|
|
171
|
+
*/
|
|
63
172
|
nextCursor: number | undefined;
|
|
64
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* A generic shape for events with a Sui-based cursor structure.
|
|
176
|
+
*/
|
|
65
177
|
export interface EventsWithCursor<EventType> {
|
|
178
|
+
/**
|
|
179
|
+
* An array of events of type `EventType`.
|
|
180
|
+
*/
|
|
66
181
|
events: EventType[];
|
|
182
|
+
/**
|
|
183
|
+
* The next cursor position. If null, no more events are available.
|
|
184
|
+
*/
|
|
67
185
|
nextCursor: EventId | null;
|
|
68
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Represents a Sui event, typically including type, timestamp, and transaction digest.
|
|
189
|
+
*/
|
|
69
190
|
export interface Event {
|
|
191
|
+
/**
|
|
192
|
+
* A string identifying the Move event type.
|
|
193
|
+
*/
|
|
70
194
|
type: AnyObjectType;
|
|
195
|
+
/**
|
|
196
|
+
* Timestamp of the event, if available.
|
|
197
|
+
*/
|
|
71
198
|
timestamp: Timestamp | undefined;
|
|
199
|
+
/**
|
|
200
|
+
* The transaction digest associated with the event.
|
|
201
|
+
*/
|
|
72
202
|
txnDigest: TransactionDigest;
|
|
73
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Common inputs for event retrieval, including an optional cursor and limit.
|
|
206
|
+
*/
|
|
74
207
|
export interface EventsInputs {
|
|
208
|
+
/**
|
|
209
|
+
* Cursor for pagination, often an EventId or numeric index.
|
|
210
|
+
*/
|
|
75
211
|
cursor?: EventId;
|
|
212
|
+
/**
|
|
213
|
+
* Limit for pagination, specifying the maximum number of events.
|
|
214
|
+
*/
|
|
76
215
|
limit?: number;
|
|
77
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Inputs for retrieving user events, extending from general event inputs
|
|
219
|
+
* and including the user's wallet address.
|
|
220
|
+
*/
|
|
78
221
|
export type UserEventsInputs = EventsInputs & {
|
|
79
222
|
walletAddress: SuiAddress;
|
|
80
223
|
};
|
|
224
|
+
/**
|
|
225
|
+
* Represents a Sui object, including its ID and type.
|
|
226
|
+
*/
|
|
81
227
|
export interface Object {
|
|
228
|
+
/**
|
|
229
|
+
* The on-chain object ID.
|
|
230
|
+
*/
|
|
82
231
|
objectId: ObjectId;
|
|
232
|
+
/**
|
|
233
|
+
* The Move type of the object.
|
|
234
|
+
*/
|
|
83
235
|
objectType: AnyObjectType;
|
|
84
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* Holds the dynamic fields and an optional next cursor for pagination.
|
|
239
|
+
*/
|
|
85
240
|
export interface DynamicFieldsWithCursor {
|
|
241
|
+
/**
|
|
242
|
+
* An array of dynamic field information objects.
|
|
243
|
+
*/
|
|
86
244
|
dynamicFields: DynamicFieldInfo[];
|
|
245
|
+
/**
|
|
246
|
+
* The next cursor for pagination. If null, no more fields are available.
|
|
247
|
+
*/
|
|
87
248
|
nextCursor: ObjectId | null;
|
|
88
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* Holds the dynamic field objects and an optional next cursor for pagination.
|
|
252
|
+
*/
|
|
89
253
|
export interface DynamicFieldObjectsWithCursor<ObjectType> {
|
|
254
|
+
/**
|
|
255
|
+
* An array of objects derived from dynamic fields.
|
|
256
|
+
*/
|
|
90
257
|
dynamicFieldObjects: ObjectType[];
|
|
258
|
+
/**
|
|
259
|
+
* The next cursor for pagination. If null, no more fields are available.
|
|
260
|
+
*/
|
|
91
261
|
nextCursor: ObjectId | null;
|
|
92
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* Inputs for fetching dynamic fields, including optional cursor and limit for pagination.
|
|
265
|
+
*/
|
|
93
266
|
export interface DynamicFieldsInputs {
|
|
94
267
|
cursor?: ObjectId;
|
|
95
268
|
limit?: number;
|
|
96
269
|
}
|
|
270
|
+
/**
|
|
271
|
+
* A collection of transactions with a cursor for pagination.
|
|
272
|
+
*/
|
|
97
273
|
export interface TransactionsWithCursor {
|
|
274
|
+
/**
|
|
275
|
+
* An array of Sui transactions.
|
|
276
|
+
*/
|
|
98
277
|
transactions: SuiTransactionBlockResponse[];
|
|
278
|
+
/**
|
|
279
|
+
* The next cursor for pagination. If null, no more transactions are available.
|
|
280
|
+
*/
|
|
99
281
|
nextCursor: TransactionDigest | null;
|
|
100
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Generic shape for API data requests that include pagination parameters.
|
|
285
|
+
*/
|
|
101
286
|
export interface ApiDataWithCursorBody<CursorType> {
|
|
287
|
+
/**
|
|
288
|
+
* Cursor for pagination.
|
|
289
|
+
*/
|
|
102
290
|
cursor?: CursorType;
|
|
291
|
+
/**
|
|
292
|
+
* Limit for pagination.
|
|
293
|
+
*/
|
|
103
294
|
limit?: number;
|
|
104
295
|
}
|
|
296
|
+
/**
|
|
297
|
+
* Specifies the shape for API calls involving events.
|
|
298
|
+
*/
|
|
105
299
|
export type ApiEventsBody = ApiDataWithCursorBody<EventId>;
|
|
300
|
+
/**
|
|
301
|
+
* Specifies the shape for API calls involving dynamic fields.
|
|
302
|
+
*/
|
|
106
303
|
export type ApiDynamicFieldsBody = ApiDataWithCursorBody<ObjectId>;
|
|
304
|
+
/**
|
|
305
|
+
* Specifies the shape for API calls involving transactions.
|
|
306
|
+
*/
|
|
107
307
|
export type ApiTransactionsBody = ApiDataWithCursorBody<TransactionDigest>;
|
|
308
|
+
/**
|
|
309
|
+
* Body payload for indexer-based event queries, using a numeric cursor.
|
|
310
|
+
*/
|
|
108
311
|
export type ApiIndexerEventsBody = ApiDataWithCursorBody<number>;
|
|
312
|
+
/**
|
|
313
|
+
* Body payload for indexer-based user events, extending from `ApiIndexerEventsBody`.
|
|
314
|
+
*/
|
|
109
315
|
export type ApiIndexerUserEventsBody = ApiIndexerEventsBody & {
|
|
316
|
+
/**
|
|
317
|
+
* The wallet address of the user.
|
|
318
|
+
*/
|
|
110
319
|
walletAddress: SuiAddress;
|
|
111
320
|
};
|
|
321
|
+
/**
|
|
322
|
+
* Represents query parameters for retrieving data with skip/limit pagination in an indexer.
|
|
323
|
+
*/
|
|
112
324
|
export interface IndexerDataWithCursorQueryParams {
|
|
113
325
|
skip: number;
|
|
114
326
|
limit: number;
|
|
115
327
|
}
|
|
328
|
+
/**
|
|
329
|
+
* Configuration for constructing a `Caller`. Includes network specification
|
|
330
|
+
* and optional access token for authentication.
|
|
331
|
+
*/
|
|
116
332
|
export interface CallerConfig {
|
|
333
|
+
/**
|
|
334
|
+
* The target Sui network (e.g., "MAINNET", "TESTNET").
|
|
335
|
+
*/
|
|
117
336
|
network?: SuiNetwork;
|
|
337
|
+
/**
|
|
338
|
+
* Access token used for authenticated requests, if required.
|
|
339
|
+
*/
|
|
118
340
|
accessToken?: string;
|
|
119
341
|
}
|
|
120
342
|
//# sourceMappingURL=generalTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generalTypes.d.ts","sourceRoot":"","sources":["../../../src/general/types/generalTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,OAAO,EACP,2BAA2B,EAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"generalTypes.d.ts","sourceRoot":"","sources":["../../../src/general/types/generalTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,OAAO,EACP,2BAA2B,EAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAC5B,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC;AAE1B;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC;AAEzB;;GAEG;AACH,MAAM,M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C;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -2,5 +2,5 @@ import { ModuleName, MoveErrorCode, PackageId } from "./generalTypes";
|
|
|
2
2
|
export interface MoveErrorsInterface {
|
|
3
3
|
readonly moveErrors: MoveErrors;
|
|
4
4
|
}
|
|
5
|
-
export type MoveErrors = Record<PackageId, Record<ModuleName, Record<MoveErrorCode, string>>>;
|
|
5
|
+
export type MoveErrors = Record<PackageId, Record<"ANY" | ModuleName, Record<MoveErrorCode, string>>>;
|
|
6
6
|
//# sourceMappingURL=moveErrorsInterface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moveErrorsInterface.d.ts","sourceRoot":"","sources":["../../../src/general/types/moveErrorsInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;CAChC;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAC9B,SAAS,
|
|
1
|
+
{"version":3,"file":"moveErrorsInterface.d.ts","sourceRoot":"","sources":["../../../src/general/types/moveErrorsInterface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;CAChC;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,CAC9B,SAAS,EAGT,MAAM,CAAC,KAAK,GAAG,UAAU,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CACzD,CAAC"}
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
import { Balance, ObjectId } from "./generalTypes";
|
|
2
1
|
export type SuiNetwork = "DEVNET" | "TESTNET" | "LOCAL" | "MAINNET" | (string & {});
|
|
3
|
-
export interface ObjectTable<K, V> {
|
|
4
|
-
objectId: ObjectId;
|
|
5
|
-
size: number;
|
|
6
|
-
}
|
|
7
|
-
export interface Table<K, V> {
|
|
8
|
-
objectId: ObjectId;
|
|
9
|
-
size: number;
|
|
10
|
-
}
|
|
11
|
-
export interface SuiBalance {
|
|
12
|
-
objectId: ObjectId;
|
|
13
|
-
value: Balance;
|
|
14
|
-
}
|
|
15
|
-
export interface EpochTimeLock {
|
|
16
|
-
epoch: EpochTimeStamp;
|
|
17
|
-
}
|
|
18
2
|
//# sourceMappingURL=suiTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suiTypes.d.ts","sourceRoot":"","sources":["../../../src/general/types/suiTypes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"suiTypes.d.ts","sourceRoot":"","sources":["../../../src/general/types/suiTypes.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GACnB,QAAQ,GACR,SAAS,GACT,OAAO,GACP,SAAS,GACT,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -1,27 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// =========================================================================
|
|
3
|
+
// Network
|
|
4
|
+
// =========================================================================
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// export interface StakedSui {
|
|
4
|
-
// objectId: ObjectId;
|
|
5
|
-
// validatorAddress: SuiAddress;
|
|
6
|
-
// poolStartingEpoch: number;
|
|
7
|
-
// delegationRequestEpoch: number;
|
|
8
|
-
// principal: Balance;
|
|
9
|
-
// }
|
|
10
|
-
// export interface Delegation {
|
|
11
|
-
// objectId: ObjectId;
|
|
12
|
-
// stakedSuiId: ObjectId;
|
|
13
|
-
// poolTokens: Balance;
|
|
14
|
-
// principalSuiAmount: Balance;
|
|
15
|
-
// }
|
|
16
|
-
// export interface StakedSuiWithDelegation {
|
|
17
|
-
// stakedSui: StakedSui;
|
|
18
|
-
// delegation?: Delegation;
|
|
19
|
-
// }
|
|
20
|
-
// export interface AuthorityPublicKeyBytes {
|
|
21
|
-
// pubKey: string;
|
|
22
|
-
// bytes: bigint;
|
|
23
|
-
// }
|
|
24
|
-
// export interface CommitteeInfo {
|
|
25
|
-
// committeeInfo: AuthorityPublicKeyBytes[];
|
|
26
|
-
// epoch: EpochTimeStamp;
|
|
27
|
-
// }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Transaction } from "@mysten/sui/transactions";
|
|
2
|
-
import { ApiEventsBody, ApiIndexerEventsBody, CallerConfig, EventsWithCursor, IndexerEventsWithCursor, UniqueId, Url } from "../../types";
|
|
2
|
+
import { ApiEventsBody, ApiIndexerEventsBody, CallerConfig, EventsWithCursor, IndexerEventsWithCursor, SuiAddress, UniqueId, Url } from "../../types";
|
|
3
3
|
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
4
4
|
export declare class Caller {
|
|
5
5
|
readonly config: CallerConfig;
|
|
@@ -12,8 +12,11 @@ export declare class Caller {
|
|
|
12
12
|
protected fetchApi<Output, BodyType = undefined>(url: Url, body?: BodyType, signal?: AbortSignal, options?: {
|
|
13
13
|
disableBigIntJsonParsing?: boolean;
|
|
14
14
|
}): Promise<Output>;
|
|
15
|
-
protected fetchApiTransaction<BodyType = undefined>(url: Url, body?: BodyType
|
|
15
|
+
protected fetchApiTransaction<BodyType = undefined>(url: Url, body?: BodyType & {
|
|
16
|
+
walletAddress: SuiAddress;
|
|
17
|
+
}, signal?: AbortSignal, options?: {
|
|
16
18
|
disableBigIntJsonParsing?: boolean;
|
|
19
|
+
txKind?: boolean;
|
|
17
20
|
}): Promise<Transaction>;
|
|
18
21
|
protected fetchApiTransactionV0<BodyType = undefined>(url: Url, body?: BodyType, signal?: AbortSignal, options?: {
|
|
19
22
|
disableBigIntJsonParsing?: boolean;
|
|
@@ -21,7 +24,7 @@ export declare class Caller {
|
|
|
21
24
|
protected fetchApiEvents<EventType, BodyType = ApiEventsBody>(url: Url, body: BodyType, signal?: AbortSignal, options?: {
|
|
22
25
|
disableBigIntJsonParsing?: boolean;
|
|
23
26
|
}): Promise<EventsWithCursor<EventType>>;
|
|
24
|
-
protected fetchApiIndexerEvents<EventType, BodyType
|
|
27
|
+
protected fetchApiIndexerEvents<EventType, BodyType extends ApiIndexerEventsBody>(url: Url, body: BodyType, signal?: AbortSignal, options?: {
|
|
25
28
|
disableBigIntJsonParsing?: boolean;
|
|
26
29
|
}): Promise<IndexerEventsWithCursor<EventType>>;
|
|
27
30
|
protected setAccessToken: (accessToken: UniqueId) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caller.d.ts","sourceRoot":"","sources":["../../../src/general/utils/caller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACN,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"caller.d.ts","sourceRoot":"","sources":["../../../src/general/utils/caller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACN,aAAa,EACb,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EAEvB,UAAU,EAEV,QAAQ,EACR,GAAG,EACH,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,qBAAa,MAAM;aAQD,MAAM,EAAE,YAAY;IACpC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAR9B,SAAS,CAAC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,wBAAwB,CAAC,EAAE,OAAO,CAAC;KACnC,GACC,OAAO,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAiB9C,SAAS,CAAC,cAAc,gBAAiB,QAAQ,UAE/C;CACF"}
|
|
@@ -24,7 +24,7 @@ class Caller {
|
|
|
24
24
|
if (this.apiBaseUrl === undefined)
|
|
25
25
|
throw new Error("no apiBaseUrl: unable to fetch data");
|
|
26
26
|
// TODO: handle url prefixing and api calls based on network differently
|
|
27
|
-
return `${this.apiBaseUrl}/api/${this.apiUrlPrefix
|
|
27
|
+
return `${this.apiBaseUrl}/api/${this.apiUrlPrefix + (url === "" ? "" : "/")}${url}`;
|
|
28
28
|
};
|
|
29
29
|
this.setAccessToken = (accessToken) => {
|
|
30
30
|
this.config.accessToken = accessToken;
|
|
@@ -80,7 +80,9 @@ class Caller {
|
|
|
80
80
|
})();
|
|
81
81
|
}
|
|
82
82
|
const apiCallUrl = this.urlForApiCall(url);
|
|
83
|
-
const headers = Object.assign({
|
|
83
|
+
const headers = Object.assign({
|
|
84
|
+
// "Content-Type": "text/plain",
|
|
85
|
+
"Content-Type": "application/json" }, (this.config.accessToken
|
|
84
86
|
? { Authorization: `Bearer ${this.config.accessToken}` }
|
|
85
87
|
: {}));
|
|
86
88
|
const uncastResponse = yield (body === undefined
|
|
@@ -100,7 +102,15 @@ class Caller {
|
|
|
100
102
|
}
|
|
101
103
|
fetchApiTransaction(url, body, signal, options) {
|
|
102
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
-
|
|
105
|
+
const txKind = yield this.fetchApi(url, body, signal, options);
|
|
106
|
+
const tx = (options === null || options === void 0 ? void 0 : options.txKind)
|
|
107
|
+
? transactions_1.Transaction.fromKind(txKind)
|
|
108
|
+
: transactions_1.Transaction.from(txKind);
|
|
109
|
+
// NOTE: is this needed ?
|
|
110
|
+
if (body === null || body === void 0 ? void 0 : body.walletAddress) {
|
|
111
|
+
tx.setSender(body.walletAddress);
|
|
112
|
+
}
|
|
113
|
+
return tx;
|
|
104
114
|
});
|
|
105
115
|
}
|
|
106
116
|
fetchApiTransactionV0(url, body, signal, options) {
|
|
@@ -114,8 +124,16 @@ class Caller {
|
|
|
114
124
|
});
|
|
115
125
|
}
|
|
116
126
|
fetchApiIndexerEvents(url, body, signal, options) {
|
|
127
|
+
var _a, _b;
|
|
117
128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
-
|
|
129
|
+
const events = yield this.fetchApi(url, body, signal, options);
|
|
130
|
+
// TODO: handle this logic on af-fe instead (to handle max limit case)
|
|
131
|
+
return {
|
|
132
|
+
events,
|
|
133
|
+
nextCursor: events.length < ((_a = body.limit) !== null && _a !== void 0 ? _a : 1)
|
|
134
|
+
? undefined
|
|
135
|
+
: events.length + ((_b = body.cursor) !== null && _b !== void 0 ? _b : 0),
|
|
136
|
+
};
|
|
119
137
|
});
|
|
120
138
|
}
|
|
121
139
|
}
|