ault-sdk-ts 0.0.2-alpha.5
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/LICENSE +21 -0
- package/README.md +932 -0
- package/dist/agent/create-agent-client.d.ts +3 -0
- package/dist/agent/sign-and-broadcast.d.ts +38 -0
- package/dist/agent/tx/clob.d.ts +7 -0
- package/dist/agent/tx-executor.d.ts +17 -0
- package/dist/client.d.ts +61 -0
- package/dist/core/address.d.ts +14 -0
- package/dist/core/base64.d.ts +2 -0
- package/dist/core/clob-msgs.d.ts +33 -0
- package/dist/core/errors.d.ts +17 -0
- package/dist/core/http.d.ts +14 -0
- package/dist/core/network.d.ts +59 -0
- package/dist/core/pagination.d.ts +14 -0
- package/dist/core/query.d.ts +5 -0
- package/dist/core/with-status-fallback.d.ts +5 -0
- package/dist/eip712/builder.d.ts +45 -0
- package/dist/eip712/field-order.d.ts +2 -0
- package/dist/eip712/msg-encoders.generated.d.ts +1 -0
- package/dist/eip712/msg.generated.d.ts +109 -0
- package/dist/eip712/registry.d.ts +36 -0
- package/dist/eip712/registry.generated.d.ts +2 -0
- package/dist/eip712/sign-and-broadcast.d.ts +55 -0
- package/dist/eip712/signers.d.ts +83 -0
- package/dist/eip712/types.d.ts +58 -0
- package/dist/high-level/address-utils.d.ts +2 -0
- package/dist/high-level/create-client.d.ts +26 -0
- package/dist/high-level/query-helpers.d.ts +3 -0
- package/dist/high-level/signer.d.ts +6 -0
- package/dist/high-level/tx/agent.d.ts +3 -0
- package/dist/high-level/tx/authority.d.ts +3 -0
- package/dist/high-level/tx/clob.d.ts +3 -0
- package/dist/high-level/tx/context.d.ts +5 -0
- package/dist/high-level/tx/license.d.ts +3 -0
- package/dist/high-level/tx/market.d.ts +3 -0
- package/dist/high-level/tx/miner.d.ts +3 -0
- package/dist/high-level/tx/ratelimit.d.ts +3 -0
- package/dist/high-level/tx/reward.d.ts +3 -0
- package/dist/high-level/tx/staking.d.ts +3 -0
- package/dist/high-level/tx/tokenregistry.d.ts +3 -0
- package/dist/high-level/tx-executor.d.ts +18 -0
- package/dist/high-level/types.d.ts +477 -0
- package/dist/high-level-client.d.ts +2 -0
- package/dist/index.cjs +18434 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +18162 -0
- package/dist/index.js.map +1 -0
- package/dist/proto/duration-json.d.ts +6 -0
- package/dist/proto/gen/amino/amino.d.ts +1 -0
- package/dist/proto/gen/ault/agent/v1/agent.d.ts +63 -0
- package/dist/proto/gen/ault/agent/v1/genesis.d.ts +44 -0
- package/dist/proto/gen/ault/agent/v1/params.d.ts +42 -0
- package/dist/proto/gen/ault/agent/v1/query.d.ts +73 -0
- package/dist/proto/gen/ault/agent/v1/tx.d.ts +91 -0
- package/dist/proto/gen/ault/authority/v1/authority.d.ts +15 -0
- package/dist/proto/gen/ault/authority/v1/genesis.d.ts +36 -0
- package/dist/proto/gen/ault/authority/v1/query.d.ts +53 -0
- package/dist/proto/gen/ault/authority/v1/tx.d.ts +50 -0
- package/dist/proto/gen/ault/clob/v1/fee.d.ts +37 -0
- package/dist/proto/gen/ault/clob/v1/genesis.d.ts +56 -0
- package/dist/proto/gen/ault/clob/v1/order_book.d.ts +32 -0
- package/dist/proto/gen/ault/clob/v1/params.d.ts +29 -0
- package/dist/proto/gen/ault/clob/v1/query.d.ts +56 -0
- package/dist/proto/gen/ault/clob/v1/tx.d.ts +116 -0
- package/dist/proto/gen/ault/license/v1/genesis.d.ts +140 -0
- package/dist/proto/gen/ault/license/v1/license.d.ts +151 -0
- package/dist/proto/gen/ault/license/v1/query.d.ts +273 -0
- package/dist/proto/gen/ault/license/v1/tx.d.ts +227 -0
- package/dist/proto/gen/ault/market/v1/genesis.d.ts +28 -0
- package/dist/proto/gen/ault/market/v1/market.d.ts +66 -0
- package/dist/proto/gen/ault/market/v1/params.d.ts +34 -0
- package/dist/proto/gen/ault/market/v1/query.d.ts +48 -0
- package/dist/proto/gen/ault/market/v1/tx.d.ts +87 -0
- package/dist/proto/gen/ault/miner/v1/genesis.d.ts +166 -0
- package/dist/proto/gen/ault/miner/v1/miner.d.ts +232 -0
- package/dist/proto/gen/ault/miner/v1/query.d.ts +254 -0
- package/dist/proto/gen/ault/miner/v1/tx.d.ts +207 -0
- package/dist/proto/gen/ault/ratelimit/v1/genesis.d.ts +27 -0
- package/dist/proto/gen/ault/ratelimit/v1/params.d.ts +35 -0
- package/dist/proto/gen/ault/ratelimit/v1/query.d.ts +42 -0
- package/dist/proto/gen/ault/ratelimit/v1/tx.d.ts +32 -0
- package/dist/proto/gen/ault/reward/v1/genesis.d.ts +67 -0
- package/dist/proto/gen/ault/reward/v1/query.d.ts +93 -0
- package/dist/proto/gen/ault/reward/v1/reward.d.ts +53 -0
- package/dist/proto/gen/ault/reward/v1/tx.d.ts +120 -0
- package/dist/proto/gen/ault/spot/v1/genesis.d.ts +26 -0
- package/dist/proto/gen/ault/spot/v1/order.d.ts +66 -0
- package/dist/proto/gen/ault/tokenregistry/v1/genesis.d.ts +34 -0
- package/dist/proto/gen/ault/tokenregistry/v1/query.d.ts +77 -0
- package/dist/proto/gen/ault/tokenregistry/v1/tokenregistry.d.ts +118 -0
- package/dist/proto/gen/ault/tokenregistry/v1/tx.d.ts +132 -0
- package/dist/proto/gen/cosmos/base/query/v1beta1/pagination.d.ts +82 -0
- package/dist/proto/gen/cosmos/base/v1beta1/coin.d.ts +59 -0
- package/dist/proto/gen/cosmos/distribution/v1beta1/distribution.d.ts +162 -0
- package/dist/proto/gen/cosmos/distribution/v1beta1/tx.d.ts +140 -0
- package/dist/proto/gen/cosmos/msg/v1/msg.d.ts +1 -0
- package/dist/proto/gen/cosmos/staking/v1beta1/staking.d.ts +310 -0
- package/dist/proto/gen/cosmos/staking/v1beta1/tx.d.ts +144 -0
- package/dist/proto/gen/cosmos_proto/cosmos.d.ts +80 -0
- package/dist/proto/gen/gogoproto/gogo.d.ts +1 -0
- package/dist/proto/gen/google/api/annotations.d.ts +1 -0
- package/dist/proto/gen/google/api/http.d.ts +379 -0
- package/dist/proto/gen/google/protobuf/any.d.ts +144 -0
- package/dist/proto/gen/google/protobuf/descriptor.d.ts +1285 -0
- package/dist/proto/gen/google/protobuf/duration.d.ts +99 -0
- package/dist/proto/gen/google/protobuf/timestamp.d.ts +128 -0
- package/dist/proto/gen/tendermint/abci/types.d.ts +507 -0
- package/dist/proto/gen/tendermint/crypto/keys.d.ts +27 -0
- package/dist/proto/gen/tendermint/crypto/proof.d.ts +57 -0
- package/dist/proto/gen/tendermint/types/params.d.ts +112 -0
- package/dist/proto/gen/tendermint/types/types.d.ts +197 -0
- package/dist/proto/gen/tendermint/types/validator.d.ts +54 -0
- package/dist/proto/gen/tendermint/version/types.d.ts +41 -0
- package/dist/proto/tx-encode.d.ts +78 -0
- package/dist/rest/agent.d.ts +12 -0
- package/dist/rest/authority.d.ts +12 -0
- package/dist/rest/clob.d.ts +11 -0
- package/dist/rest/context.d.ts +22 -0
- package/dist/rest/dex-fetcher.d.ts +10 -0
- package/dist/rest/dex-types.generated.d.ts +780 -0
- package/dist/rest/dex.d.ts +34 -0
- package/dist/rest/dex.generated.d.ts +1381 -0
- package/dist/rest/license.d.ts +79 -0
- package/dist/rest/market.d.ts +11 -0
- package/dist/rest/miner.d.ts +59 -0
- package/dist/rest/ratelimit.d.ts +7 -0
- package/dist/rest/reward.d.ts +25 -0
- package/dist/rest/staking.d.ts +38 -0
- package/dist/rest/tokenregistry.d.ts +11 -0
- package/dist/rest/types.d.ts +871 -0
- package/dist/utils/address.d.ts +6 -0
- package/dist/utils/chain-id.d.ts +1 -0
- package/dist/utils/cosmos-dec.d.ts +2 -0
- package/dist/ws/client.d.ts +37 -0
- package/dist/ws/index.d.ts +5 -0
- package/dist/ws/types.d.ts +66 -0
- package/package.json +103 -0
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import type { NetworkConfig } from "../core/network";
|
|
2
|
+
import type { FetchWithRetryOptions, FetchFn } from "../core/http";
|
|
3
|
+
import type { AultClient } from "../client";
|
|
4
|
+
import type { AgentApi } from "../rest/agent";
|
|
5
|
+
import type { AuthorityApi, AuthorityRoleInput } from "../rest/authority";
|
|
6
|
+
import type { ClobApi } from "../rest/clob";
|
|
7
|
+
import type { LicenseApi } from "../rest/license";
|
|
8
|
+
import type { MarketApi } from "../rest/market";
|
|
9
|
+
import type { MinerApi } from "../rest/miner";
|
|
10
|
+
import type { RateLimitApi } from "../rest/ratelimit";
|
|
11
|
+
import type { RewardApi } from "../rest/reward";
|
|
12
|
+
import type { StakingApi } from "../rest/staking";
|
|
13
|
+
import type { TokenRegistryApi } from "../rest/tokenregistry";
|
|
14
|
+
import type { License } from "../rest/types";
|
|
15
|
+
import type { Params as AgentParams } from "../proto/gen/ault/agent/v1/params";
|
|
16
|
+
import type { Role } from "../proto/gen/ault/authority/v1/authority";
|
|
17
|
+
import type { Params as ClobParams } from "../proto/gen/ault/clob/v1/params";
|
|
18
|
+
import type { Params as LicenseChainParams } from "../proto/gen/ault/license/v1/license";
|
|
19
|
+
import type { Params as MarketParams } from "../proto/gen/ault/market/v1/params";
|
|
20
|
+
import type { MarketType } from "../proto/gen/ault/market/v1/market";
|
|
21
|
+
import type { Params as MinerChainParams } from "../proto/gen/ault/miner/v1/miner";
|
|
22
|
+
import type { Params as RateLimitParams } from "../proto/gen/ault/ratelimit/v1/params";
|
|
23
|
+
import type { Params as RewardParams } from "../proto/gen/ault/reward/v1/reward";
|
|
24
|
+
import type { Any as ProtoAny } from "../proto/gen/google/protobuf/any";
|
|
25
|
+
import type { Duration } from "../proto/gen/google/protobuf/duration";
|
|
26
|
+
import type { Eip1193ProviderLike, EthersSignerLike, PrivySignTypedDataLike, SignerInput, ViemWalletLike } from "../eip712/signers";
|
|
27
|
+
import type { BigIntLike } from "../core/address";
|
|
28
|
+
export type { BigIntLike };
|
|
29
|
+
export type MarketTypeInput = MarketType;
|
|
30
|
+
export type MarketUpdateInput = {
|
|
31
|
+
marketId: Uint8Array;
|
|
32
|
+
makerFeeRate: string;
|
|
33
|
+
takerFeeRate: string;
|
|
34
|
+
};
|
|
35
|
+
/** Common transaction options available on all methods */
|
|
36
|
+
export interface TxOptions {
|
|
37
|
+
gasLimit?: string;
|
|
38
|
+
feeAmount?: string;
|
|
39
|
+
memo?: string;
|
|
40
|
+
confirmationTimeoutMs?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Flexible signer input that supports multiple wallet types.
|
|
44
|
+
* Can be explicitly typed or auto-detected via duck-typing.
|
|
45
|
+
*/
|
|
46
|
+
export type FlexibleSignerInput = {
|
|
47
|
+
type: "viem";
|
|
48
|
+
wallet: ViemWalletLike;
|
|
49
|
+
preferRpc?: boolean;
|
|
50
|
+
} | {
|
|
51
|
+
type: "ethers";
|
|
52
|
+
signer: EthersSignerLike;
|
|
53
|
+
} | {
|
|
54
|
+
type: "privy";
|
|
55
|
+
signTypedData: PrivySignTypedDataLike;
|
|
56
|
+
address?: string;
|
|
57
|
+
} | {
|
|
58
|
+
type: "privateKey";
|
|
59
|
+
key: string;
|
|
60
|
+
} | {
|
|
61
|
+
type: "eip1193";
|
|
62
|
+
provider: Eip1193ProviderLike;
|
|
63
|
+
address: string;
|
|
64
|
+
} | SignerInput;
|
|
65
|
+
/**
|
|
66
|
+
* Options for creating a high-level client.
|
|
67
|
+
*/
|
|
68
|
+
export interface ClientOptions {
|
|
69
|
+
/** Network configuration (required) */
|
|
70
|
+
network: NetworkConfig;
|
|
71
|
+
/** Signer - can be viem wallet, ethers signer, privy, private key, or EIP-1193 */
|
|
72
|
+
signer: FlexibleSignerInput;
|
|
73
|
+
/** Optional: explicitly provide signer address (auto-detected if possible) */
|
|
74
|
+
signerAddress?: string;
|
|
75
|
+
/** Optional: custom fetch function */
|
|
76
|
+
fetchFn?: FetchFn;
|
|
77
|
+
/** Optional: fetch retry options */
|
|
78
|
+
fetchOptions?: FetchWithRetryOptions;
|
|
79
|
+
/** Optional: default gas limit for transactions */
|
|
80
|
+
defaultGasLimit?: string;
|
|
81
|
+
/** Optional: default memo for transactions */
|
|
82
|
+
defaultMemo?: string;
|
|
83
|
+
/** Optional: default time to wait for DeliverTx confirmation before returning a provisional result */
|
|
84
|
+
defaultConfirmationTimeoutMs?: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Result of a transaction.
|
|
88
|
+
*/
|
|
89
|
+
export interface TxResult {
|
|
90
|
+
/** Transaction hash */
|
|
91
|
+
txHash: string;
|
|
92
|
+
/** Result code (0 = success). When `confirmed` is false this is -1 (poll timed out). */
|
|
93
|
+
code: number;
|
|
94
|
+
/** Raw log from the transaction */
|
|
95
|
+
rawLog?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Whether the transaction outcome is definitively known.
|
|
98
|
+
* - `true` -- definitive result: CheckTx rejection, or DeliverTx result observed via polling.
|
|
99
|
+
* - `false` -- tx was broadcast and polling timed out; outcome unknown. Use txHash to query later.
|
|
100
|
+
* - `undefined` -- tx was broadcast but confirmation lookup was unavailable.
|
|
101
|
+
* The `code` field reflects the CheckTx result only.
|
|
102
|
+
*/
|
|
103
|
+
confirmed?: boolean;
|
|
104
|
+
/** Whether the transaction was definitively successful on-chain. */
|
|
105
|
+
success: boolean;
|
|
106
|
+
}
|
|
107
|
+
export interface LicenseTxApi {
|
|
108
|
+
mintLicense(params: {
|
|
109
|
+
to: string;
|
|
110
|
+
uri: string;
|
|
111
|
+
reason?: string;
|
|
112
|
+
} & TxOptions): Promise<TxResult>;
|
|
113
|
+
batchMintLicense(params: {
|
|
114
|
+
recipients: Array<{
|
|
115
|
+
to: string;
|
|
116
|
+
uri: string;
|
|
117
|
+
}>;
|
|
118
|
+
reason?: string;
|
|
119
|
+
} & TxOptions): Promise<TxResult>;
|
|
120
|
+
transferLicense(params: {
|
|
121
|
+
licenseId: BigIntLike;
|
|
122
|
+
to: string;
|
|
123
|
+
reason?: string;
|
|
124
|
+
} & TxOptions): Promise<TxResult>;
|
|
125
|
+
burnLicense(params: {
|
|
126
|
+
licenseId: BigIntLike;
|
|
127
|
+
reason?: string;
|
|
128
|
+
} & TxOptions): Promise<TxResult>;
|
|
129
|
+
revokeLicense(params: {
|
|
130
|
+
licenseId: BigIntLike;
|
|
131
|
+
reason?: string;
|
|
132
|
+
} & TxOptions): Promise<TxResult>;
|
|
133
|
+
setTokenURI(params: {
|
|
134
|
+
licenseId: BigIntLike;
|
|
135
|
+
uri: string;
|
|
136
|
+
} & TxOptions): Promise<TxResult>;
|
|
137
|
+
approveMember(params: {
|
|
138
|
+
member: string;
|
|
139
|
+
} & TxOptions): Promise<TxResult>;
|
|
140
|
+
batchApproveMember(params: {
|
|
141
|
+
members: string[];
|
|
142
|
+
} & TxOptions): Promise<TxResult>;
|
|
143
|
+
revokeMember(params: {
|
|
144
|
+
member: string;
|
|
145
|
+
} & TxOptions): Promise<TxResult>;
|
|
146
|
+
batchRevokeMember(params: {
|
|
147
|
+
members: string[];
|
|
148
|
+
} & TxOptions): Promise<TxResult>;
|
|
149
|
+
setKYCApprovers(params: {
|
|
150
|
+
add?: string[];
|
|
151
|
+
remove?: string[];
|
|
152
|
+
} & TxOptions): Promise<TxResult>;
|
|
153
|
+
setMinters(params: {
|
|
154
|
+
add?: string[];
|
|
155
|
+
remove?: string[];
|
|
156
|
+
} & TxOptions): Promise<TxResult>;
|
|
157
|
+
updateLicenseParams(params: {
|
|
158
|
+
params: LicenseChainParams;
|
|
159
|
+
} & TxOptions): Promise<TxResult>;
|
|
160
|
+
}
|
|
161
|
+
export interface MinerTxApi {
|
|
162
|
+
delegateMining(params: {
|
|
163
|
+
licenseIds: BigIntLike[];
|
|
164
|
+
operator: string;
|
|
165
|
+
} & TxOptions): Promise<TxResult>;
|
|
166
|
+
cancelMiningDelegation(params: {
|
|
167
|
+
licenseIds: BigIntLike[];
|
|
168
|
+
} & TxOptions): Promise<TxResult>;
|
|
169
|
+
redelegateMining(params: {
|
|
170
|
+
licenseIds: BigIntLike[];
|
|
171
|
+
newOperator: string;
|
|
172
|
+
} & TxOptions): Promise<TxResult>;
|
|
173
|
+
setOwnerVrfKey(params: {
|
|
174
|
+
vrfPubkey: Uint8Array;
|
|
175
|
+
possessionProof: Uint8Array;
|
|
176
|
+
nonce: bigint | number;
|
|
177
|
+
} & TxOptions): Promise<TxResult>;
|
|
178
|
+
submitWork(params: {
|
|
179
|
+
licenseId: BigIntLike;
|
|
180
|
+
epoch: BigIntLike;
|
|
181
|
+
y: Uint8Array;
|
|
182
|
+
proof: Uint8Array;
|
|
183
|
+
} & TxOptions): Promise<TxResult>;
|
|
184
|
+
batchSubmitWork(params: {
|
|
185
|
+
submissions: Array<{
|
|
186
|
+
licenseId: BigIntLike;
|
|
187
|
+
epoch: BigIntLike;
|
|
188
|
+
y: Uint8Array;
|
|
189
|
+
proof: Uint8Array;
|
|
190
|
+
}>;
|
|
191
|
+
} & TxOptions): Promise<TxResult>;
|
|
192
|
+
registerOperator(params: {
|
|
193
|
+
commissionRate: number;
|
|
194
|
+
commissionRecipient?: string;
|
|
195
|
+
} & TxOptions): Promise<TxResult>;
|
|
196
|
+
unregisterOperator(params?: TxOptions): Promise<TxResult>;
|
|
197
|
+
updateOperatorInfo(params: {
|
|
198
|
+
newCommissionRate: number;
|
|
199
|
+
newCommissionRecipient?: string;
|
|
200
|
+
} & TxOptions): Promise<TxResult>;
|
|
201
|
+
updateMinerParams(params: {
|
|
202
|
+
params: MinerChainParams;
|
|
203
|
+
} & TxOptions): Promise<TxResult>;
|
|
204
|
+
}
|
|
205
|
+
export interface AgentTxApi {
|
|
206
|
+
approveAgent(params: {
|
|
207
|
+
agentPubkey: ProtoAny;
|
|
208
|
+
name?: string;
|
|
209
|
+
expiry?: Duration;
|
|
210
|
+
} & TxOptions): Promise<TxResult>;
|
|
211
|
+
revokeAgent(params: {
|
|
212
|
+
agentAddress: string;
|
|
213
|
+
} & TxOptions): Promise<TxResult>;
|
|
214
|
+
updateAgentParams(params: {
|
|
215
|
+
params: AgentParams;
|
|
216
|
+
} & TxOptions): Promise<TxResult>;
|
|
217
|
+
}
|
|
218
|
+
export interface AuthorityTxApi {
|
|
219
|
+
grantRole(params: {
|
|
220
|
+
role: AuthorityRoleInput;
|
|
221
|
+
members: string[];
|
|
222
|
+
} & TxOptions): Promise<TxResult>;
|
|
223
|
+
revokeRole(params: {
|
|
224
|
+
role: AuthorityRoleInput;
|
|
225
|
+
members: string[];
|
|
226
|
+
} & TxOptions): Promise<TxResult>;
|
|
227
|
+
}
|
|
228
|
+
export interface MarketTxApi {
|
|
229
|
+
createMarket(params: {
|
|
230
|
+
marketType: MarketTypeInput;
|
|
231
|
+
baseDenom: string;
|
|
232
|
+
quoteDenom: string;
|
|
233
|
+
tickPrecision: number;
|
|
234
|
+
} & TxOptions): Promise<TxResult>;
|
|
235
|
+
updateMarket(params: {
|
|
236
|
+
updates: MarketUpdateInput[];
|
|
237
|
+
} & TxOptions): Promise<TxResult>;
|
|
238
|
+
haltMarkets(params: {
|
|
239
|
+
marketIds: Uint8Array[];
|
|
240
|
+
} & TxOptions): Promise<TxResult>;
|
|
241
|
+
resumeMarkets(params: {
|
|
242
|
+
marketIds: Uint8Array[];
|
|
243
|
+
} & TxOptions): Promise<TxResult>;
|
|
244
|
+
haltAllMarkets(params?: TxOptions): Promise<TxResult>;
|
|
245
|
+
resumeAllMarkets(params?: TxOptions): Promise<TxResult>;
|
|
246
|
+
updateMarketParams(params: {
|
|
247
|
+
params: MarketParams;
|
|
248
|
+
} & TxOptions): Promise<TxResult>;
|
|
249
|
+
}
|
|
250
|
+
export interface ClobTxApi {
|
|
251
|
+
placeLimitOrder(params: {
|
|
252
|
+
marketId: Uint8Array;
|
|
253
|
+
isBuy: boolean;
|
|
254
|
+
price: string;
|
|
255
|
+
quantity: string;
|
|
256
|
+
lifespan: Duration;
|
|
257
|
+
postOnly?: boolean;
|
|
258
|
+
builderAddress?: string;
|
|
259
|
+
builderFeeRate?: string;
|
|
260
|
+
} & TxOptions): Promise<TxResult>;
|
|
261
|
+
placeMarketOrder(params: {
|
|
262
|
+
marketId: Uint8Array;
|
|
263
|
+
isBuy: boolean;
|
|
264
|
+
deposit: string;
|
|
265
|
+
worstPrice?: string;
|
|
266
|
+
priceTolerance?: string;
|
|
267
|
+
builderAddress?: string;
|
|
268
|
+
builderFeeRate?: string;
|
|
269
|
+
} & TxOptions): Promise<TxResult>;
|
|
270
|
+
cancelOrders(params: {
|
|
271
|
+
orderIds: Uint8Array[];
|
|
272
|
+
} & TxOptions): Promise<TxResult>;
|
|
273
|
+
placeScaleOrder(params: {
|
|
274
|
+
marketId: Uint8Array;
|
|
275
|
+
isBuy: boolean;
|
|
276
|
+
lowPrice: string;
|
|
277
|
+
highPrice: string;
|
|
278
|
+
totalQuantity: string;
|
|
279
|
+
weights: number[];
|
|
280
|
+
lifespan: Duration;
|
|
281
|
+
postOnly?: boolean;
|
|
282
|
+
builderAddress?: string;
|
|
283
|
+
builderFeeRate?: string;
|
|
284
|
+
} & TxOptions): Promise<TxResult>;
|
|
285
|
+
updateClobParams(params: {
|
|
286
|
+
params: ClobParams;
|
|
287
|
+
} & TxOptions): Promise<TxResult>;
|
|
288
|
+
}
|
|
289
|
+
export interface RateLimitTxApi {
|
|
290
|
+
updateRateLimitParams(params: {
|
|
291
|
+
params: RateLimitParams;
|
|
292
|
+
} & TxOptions): Promise<TxResult>;
|
|
293
|
+
}
|
|
294
|
+
export interface RewardTxApi {
|
|
295
|
+
setReferralCode(params: {
|
|
296
|
+
code: string;
|
|
297
|
+
} & TxOptions): Promise<TxResult>;
|
|
298
|
+
setReferral(params: {
|
|
299
|
+
code: string;
|
|
300
|
+
} & TxOptions): Promise<TxResult>;
|
|
301
|
+
updateEligibleReferrers(params: {
|
|
302
|
+
add?: string[];
|
|
303
|
+
remove?: string[];
|
|
304
|
+
} & TxOptions): Promise<TxResult>;
|
|
305
|
+
approveBuilder(params: {
|
|
306
|
+
builder: string;
|
|
307
|
+
maxFeeRate: string;
|
|
308
|
+
} & TxOptions): Promise<TxResult>;
|
|
309
|
+
revokeBuilder(params: {
|
|
310
|
+
builder: string;
|
|
311
|
+
} & TxOptions): Promise<TxResult>;
|
|
312
|
+
setDeployerShare(params: {
|
|
313
|
+
marketId: Uint8Array;
|
|
314
|
+
recipient: string;
|
|
315
|
+
shareRate: string;
|
|
316
|
+
} & TxOptions): Promise<TxResult>;
|
|
317
|
+
updateRewardParams(params: {
|
|
318
|
+
params: RewardParams;
|
|
319
|
+
} & TxOptions): Promise<TxResult>;
|
|
320
|
+
}
|
|
321
|
+
export interface StakingTxApi {
|
|
322
|
+
delegate(params: {
|
|
323
|
+
validatorAddress: string;
|
|
324
|
+
amount: {
|
|
325
|
+
denom: string;
|
|
326
|
+
amount: string;
|
|
327
|
+
};
|
|
328
|
+
} & TxOptions): Promise<TxResult>;
|
|
329
|
+
undelegate(params: {
|
|
330
|
+
validatorAddress: string;
|
|
331
|
+
amount: {
|
|
332
|
+
denom: string;
|
|
333
|
+
amount: string;
|
|
334
|
+
};
|
|
335
|
+
} & TxOptions): Promise<TxResult>;
|
|
336
|
+
redelegate(params: {
|
|
337
|
+
validatorAddressSrc: string;
|
|
338
|
+
validatorAddressDst: string;
|
|
339
|
+
amount: {
|
|
340
|
+
denom: string;
|
|
341
|
+
amount: string;
|
|
342
|
+
};
|
|
343
|
+
} & TxOptions): Promise<TxResult>;
|
|
344
|
+
withdrawRewards(params: {
|
|
345
|
+
validatorAddresses: string[];
|
|
346
|
+
} & TxOptions): Promise<TxResult>;
|
|
347
|
+
}
|
|
348
|
+
export interface TokenRegistryTxApi {
|
|
349
|
+
enableTokenRegistryTransfers(params?: TxOptions): Promise<TxResult>;
|
|
350
|
+
disableTokenRegistryTransfers(params?: TxOptions): Promise<TxResult>;
|
|
351
|
+
registerTokenPair(params: {
|
|
352
|
+
erc20Address: string;
|
|
353
|
+
enabled: boolean;
|
|
354
|
+
} & TxOptions): Promise<TxResult>;
|
|
355
|
+
enableTokenPair(params: {
|
|
356
|
+
erc20Address: string;
|
|
357
|
+
} & TxOptions): Promise<TxResult>;
|
|
358
|
+
disableTokenPair(params: {
|
|
359
|
+
erc20Address: string;
|
|
360
|
+
} & TxOptions): Promise<TxResult>;
|
|
361
|
+
cleanupTokenPair(params: {
|
|
362
|
+
erc20Address: string;
|
|
363
|
+
} & TxOptions): Promise<TxResult>;
|
|
364
|
+
}
|
|
365
|
+
export interface LicenseDelegationStatus {
|
|
366
|
+
licenseId: string;
|
|
367
|
+
isDelegated: boolean;
|
|
368
|
+
operator: string | null;
|
|
369
|
+
}
|
|
370
|
+
export interface LicenseAnalysis {
|
|
371
|
+
total: number;
|
|
372
|
+
active: number;
|
|
373
|
+
delegated: number;
|
|
374
|
+
licenses: License[];
|
|
375
|
+
delegations: Array<{
|
|
376
|
+
licenseId: string;
|
|
377
|
+
operator: string;
|
|
378
|
+
}>;
|
|
379
|
+
}
|
|
380
|
+
export interface ParallelQueryApi {
|
|
381
|
+
getAllLicenseIds(owner: string): Promise<string[]>;
|
|
382
|
+
getLicenseDetailsParallel(licenseIds: string[]): Promise<Array<License | null>>;
|
|
383
|
+
getLicenseDelegationsParallel(licenseIds: string[]): Promise<LicenseDelegationStatus[]>;
|
|
384
|
+
analyzeLicenses(owner: string): Promise<LicenseAnalysis>;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* High-level client interface for the Ault SDK.
|
|
388
|
+
* Provides simplified methods for common operations.
|
|
389
|
+
*/
|
|
390
|
+
export interface Client extends AgentTxApi, AuthorityTxApi, ClobTxApi, LicenseTxApi, MarketTxApi, MinerTxApi, RateLimitTxApi, RewardTxApi, StakingTxApi, TokenRegistryTxApi, ParallelQueryApi {
|
|
391
|
+
/** Network configuration */
|
|
392
|
+
readonly network: NetworkConfig;
|
|
393
|
+
/** Signer address in Ault bech32 format */
|
|
394
|
+
readonly address: string;
|
|
395
|
+
/** Agent module queries */
|
|
396
|
+
readonly agent: AgentApi;
|
|
397
|
+
/** Authority module queries */
|
|
398
|
+
readonly authority: AuthorityApi;
|
|
399
|
+
/** CLOB module queries */
|
|
400
|
+
readonly clob: ClobApi;
|
|
401
|
+
/** License module queries */
|
|
402
|
+
readonly license: LicenseApi;
|
|
403
|
+
/** Market module queries */
|
|
404
|
+
readonly market: MarketApi;
|
|
405
|
+
/** Miner module queries */
|
|
406
|
+
readonly miner: MinerApi;
|
|
407
|
+
/** Rate limit module queries */
|
|
408
|
+
readonly ratelimit: RateLimitApi;
|
|
409
|
+
/** Reward module queries */
|
|
410
|
+
readonly reward: RewardApi;
|
|
411
|
+
/** Staking/distribution queries */
|
|
412
|
+
readonly staking: StakingApi;
|
|
413
|
+
/** Token registry module queries */
|
|
414
|
+
readonly tokenregistry: TokenRegistryApi;
|
|
415
|
+
/** Access to the underlying low-level client for advanced use cases. */
|
|
416
|
+
readonly _lowLevel: AultClient;
|
|
417
|
+
}
|
|
418
|
+
export type { RewardParams, Role, ProtoAny };
|
|
419
|
+
export interface AgentClientOptions {
|
|
420
|
+
network: NetworkConfig;
|
|
421
|
+
masterAddress: string;
|
|
422
|
+
agentPrivateKey: string;
|
|
423
|
+
fetchFn?: FetchFn;
|
|
424
|
+
fetchOptions?: FetchWithRetryOptions;
|
|
425
|
+
defaultGasLimit?: string;
|
|
426
|
+
defaultMemo?: string;
|
|
427
|
+
defaultConfirmationTimeoutMs?: number;
|
|
428
|
+
defaultTimeoutSeconds?: number;
|
|
429
|
+
}
|
|
430
|
+
export interface AgentTxOptions extends TxOptions {
|
|
431
|
+
timeoutSeconds?: number;
|
|
432
|
+
}
|
|
433
|
+
export interface AgentClobTxApi {
|
|
434
|
+
placeLimitOrder(params: {
|
|
435
|
+
marketId: Uint8Array;
|
|
436
|
+
isBuy: boolean;
|
|
437
|
+
price: string;
|
|
438
|
+
quantity: string;
|
|
439
|
+
lifespan: Duration;
|
|
440
|
+
postOnly?: boolean;
|
|
441
|
+
builderAddress?: string;
|
|
442
|
+
builderFeeRate?: string;
|
|
443
|
+
} & AgentTxOptions): Promise<TxResult>;
|
|
444
|
+
placeMarketOrder(params: {
|
|
445
|
+
marketId: Uint8Array;
|
|
446
|
+
isBuy: boolean;
|
|
447
|
+
deposit: string;
|
|
448
|
+
worstPrice?: string;
|
|
449
|
+
priceTolerance?: string;
|
|
450
|
+
builderAddress?: string;
|
|
451
|
+
builderFeeRate?: string;
|
|
452
|
+
} & AgentTxOptions): Promise<TxResult>;
|
|
453
|
+
cancelOrders(params: {
|
|
454
|
+
orderIds: Uint8Array[];
|
|
455
|
+
} & AgentTxOptions): Promise<TxResult>;
|
|
456
|
+
placeScaleOrder(params: {
|
|
457
|
+
marketId: Uint8Array;
|
|
458
|
+
isBuy: boolean;
|
|
459
|
+
lowPrice: string;
|
|
460
|
+
highPrice: string;
|
|
461
|
+
totalQuantity: string;
|
|
462
|
+
weights: number[];
|
|
463
|
+
lifespan: Duration;
|
|
464
|
+
postOnly?: boolean;
|
|
465
|
+
builderAddress?: string;
|
|
466
|
+
builderFeeRate?: string;
|
|
467
|
+
} & AgentTxOptions): Promise<TxResult>;
|
|
468
|
+
}
|
|
469
|
+
export interface AgentClient extends AgentClobTxApi {
|
|
470
|
+
readonly network: NetworkConfig;
|
|
471
|
+
readonly masterAddress: string;
|
|
472
|
+
readonly agentAddress: string;
|
|
473
|
+
readonly agent: AgentApi;
|
|
474
|
+
readonly clob: ClobApi;
|
|
475
|
+
readonly market: MarketApi;
|
|
476
|
+
readonly _lowLevel: AultClient;
|
|
477
|
+
}
|