ault-sdk-ts 0.0.2-alpha.7 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +375 -50
- package/dist/agent/attach.d.ts +26 -0
- package/dist/agent/sign-and-broadcast.d.ts +9 -2
- package/dist/agent/tx/clob.d.ts +8 -1
- package/dist/agent/tx-executor.d.ts +24 -2
- package/dist/client.d.ts +6 -7
- package/dist/core/clob-gas.d.ts +28 -0
- package/dist/core/clob-msgs.d.ts +31 -5
- package/dist/core/clob-responses.d.ts +20 -0
- package/dist/core/cloid.d.ts +4 -0
- package/dist/core/errors.d.ts +79 -0
- package/dist/core/manifest-fetcher.d.ts +12 -0
- package/dist/core/manifest-resolver.d.ts +121 -0
- package/dist/core/manifest-types.d.ts +102 -0
- package/dist/core/network.d.ts +42 -13
- package/dist/eip712/msg.generated.d.ts +26 -10
- package/dist/eip712/registry.d.ts +2 -0
- package/dist/eip712/sign-and-broadcast.d.ts +27 -3
- package/dist/high-level/cloid-lookup.d.ts +9 -0
- package/dist/high-level/create-client.d.ts +15 -11
- package/dist/high-level/tx/accountx.d.ts +3 -0
- package/dist/high-level/tx/agent.d.ts +1 -1
- package/dist/high-level/tx/clob.d.ts +1 -1
- package/dist/high-level/tx/context.d.ts +8 -0
- package/dist/high-level/tx/license.d.ts +1 -1
- package/dist/high-level/tx/miner.d.ts +1 -1
- package/dist/high-level/tx/reward.d.ts +1 -1
- package/dist/high-level/tx/staking.d.ts +1 -1
- package/dist/high-level/tx-executor.d.ts +23 -3
- package/dist/high-level/types.d.ts +356 -100
- package/dist/high-level-client.d.ts +1 -1
- package/dist/index.cjs +16101 -7908
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +15860 -7678
- package/dist/index.js.map +1 -1
- package/dist/proto/gen/ault/accountx/v1/genesis.d.ts +38 -0
- package/dist/proto/gen/ault/accountx/v1/params.d.ts +32 -0
- package/dist/proto/gen/ault/accountx/v1/query.d.ts +88 -0
- package/dist/proto/gen/ault/accountx/v1/tx.d.ts +52 -0
- package/dist/proto/gen/ault/agent/v1/tx.d.ts +4 -5
- package/dist/proto/gen/ault/authority/v1/authority.d.ts +2 -0
- package/dist/proto/gen/ault/clob/v1/genesis.d.ts +6 -5
- package/dist/proto/gen/ault/clob/v1/query.d.ts +14 -0
- package/dist/proto/gen/ault/clob/v1/tx.d.ts +30 -3
- package/dist/proto/gen/ault/common/v1/system.d.ts +31 -0
- package/dist/proto/gen/ault/license/v1/genesis.d.ts +1 -26
- package/dist/proto/gen/ault/license/v1/license.d.ts +0 -26
- package/dist/proto/gen/ault/license/v1/query.d.ts +44 -18
- package/dist/proto/gen/ault/market/v1/market.d.ts +1 -0
- package/dist/proto/gen/ault/market/v1/tx.d.ts +9 -0
- package/dist/proto/gen/ault/miner/v1/genesis.d.ts +52 -84
- package/dist/proto/gen/ault/miner/v1/miner.d.ts +10 -45
- package/dist/proto/gen/ault/miner/v1/query.d.ts +0 -13
- package/dist/proto/gen/ault/spot/v1/genesis.d.ts +2 -2
- package/dist/proto/gen/ault/spot/v1/order.d.ts +12 -4
- package/dist/proto/gen/ault/systemtx/v1/genesis.d.ts +37 -0
- package/dist/proto/gen/ault/tokenregistry/v1/genesis.d.ts +3 -3
- package/dist/proto/gen/ault/tokenregistry/v1/query.d.ts +2 -2
- package/dist/proto/gen/ault/tokenregistry/v1/tokenregistry.d.ts +24 -15
- package/dist/proto/gen/ault/tokenregistry/v1/tx.d.ts +1 -16
- package/dist/proto/gen/cosmos/bank/v1beta1/bank.d.ts +119 -0
- package/dist/proto/gen/cosmos/bank/v1beta1/query.d.ts +264 -0
- package/dist/proto/gen/cosmos/distribution/v1beta1/query.d.ts +203 -0
- package/dist/proto/gen/cosmos/query/v1/query.d.ts +1 -0
- package/dist/proto/gen/cosmos/staking/v1beta1/query.d.ts +275 -0
- package/dist/proto/gen/google/api/http.d.ts +20 -28
- package/dist/proto/gen/tendermint/abci/types.d.ts +23 -0
- package/dist/proto/tx-decode.d.ts +18 -0
- package/dist/rest/accountx.d.ts +8 -0
- package/dist/rest/bank.d.ts +15 -0
- package/dist/rest/clob.d.ts +9 -1
- package/dist/rest/context.d.ts +4 -4
- package/dist/rest/dex-types.generated.d.ts +363 -120
- package/dist/rest/dex.d.ts +6 -0
- package/dist/rest/dex.generated.d.ts +599 -83
- package/dist/rest/feemarket.d.ts +114 -0
- package/dist/rest/license.d.ts +21 -59
- package/dist/rest/miner.d.ts +16 -46
- package/dist/rest/portfolio.d.ts +103 -0
- package/dist/rest/staking.d.ts +14 -28
- package/dist/rest/tokenregistry.d.ts +3 -1
- package/dist/rest/types.d.ts +82 -858
- package/dist/utils/address.d.ts +2 -0
- package/dist/utils/opaque-id.d.ts +25 -0
- package/dist/utils/tx-hash.d.ts +1 -0
- package/dist/ws/client.d.ts +45 -5
- package/dist/ws/types.d.ts +380 -21
- package/package.json +2 -1
- package/dist/agent/create-agent-client.d.ts +0 -3
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { PageRequest, PageResponse } from "../../base/query/v1beta1/pagination";
|
|
3
|
+
import { DelegationResponse, HistoricalInfo, Params, Pool, RedelegationResponse, UnbondingDelegation, Validator } from "./staking";
|
|
4
|
+
export declare const protobufPackage = "cosmos.staking.v1beta1";
|
|
5
|
+
/** QueryValidatorsRequest is request type for Query/Validators RPC method. */
|
|
6
|
+
export interface QueryValidatorsRequest {
|
|
7
|
+
/** status enables to query for validators matching a given status. */
|
|
8
|
+
status: string;
|
|
9
|
+
/** pagination defines an optional pagination for the request. */
|
|
10
|
+
pagination: PageRequest | undefined;
|
|
11
|
+
}
|
|
12
|
+
/** QueryValidatorsResponse is response type for the Query/Validators RPC method */
|
|
13
|
+
export interface QueryValidatorsResponse {
|
|
14
|
+
/** validators contains all the queried validators. */
|
|
15
|
+
validators: Validator[];
|
|
16
|
+
/** pagination defines the pagination in the response. */
|
|
17
|
+
pagination: PageResponse | undefined;
|
|
18
|
+
}
|
|
19
|
+
/** QueryValidatorRequest is response type for the Query/Validator RPC method */
|
|
20
|
+
export interface QueryValidatorRequest {
|
|
21
|
+
/** validator_addr defines the validator address to query for. */
|
|
22
|
+
validatorAddr: string;
|
|
23
|
+
}
|
|
24
|
+
/** QueryValidatorResponse is response type for the Query/Validator RPC method */
|
|
25
|
+
export interface QueryValidatorResponse {
|
|
26
|
+
/** validator defines the validator info. */
|
|
27
|
+
validator: Validator | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* QueryValidatorDelegationsRequest is request type for the
|
|
31
|
+
* Query/ValidatorDelegations RPC method
|
|
32
|
+
*/
|
|
33
|
+
export interface QueryValidatorDelegationsRequest {
|
|
34
|
+
/** validator_addr defines the validator address to query for. */
|
|
35
|
+
validatorAddr: string;
|
|
36
|
+
/** pagination defines an optional pagination for the request. */
|
|
37
|
+
pagination: PageRequest | undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* QueryValidatorDelegationsResponse is response type for the
|
|
41
|
+
* Query/ValidatorDelegations RPC method
|
|
42
|
+
*/
|
|
43
|
+
export interface QueryValidatorDelegationsResponse {
|
|
44
|
+
delegationResponses: DelegationResponse[];
|
|
45
|
+
/** pagination defines the pagination in the response. */
|
|
46
|
+
pagination: PageResponse | undefined;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* QueryValidatorUnbondingDelegationsRequest is required type for the
|
|
50
|
+
* Query/ValidatorUnbondingDelegations RPC method
|
|
51
|
+
*/
|
|
52
|
+
export interface QueryValidatorUnbondingDelegationsRequest {
|
|
53
|
+
/** validator_addr defines the validator address to query for. */
|
|
54
|
+
validatorAddr: string;
|
|
55
|
+
/** pagination defines an optional pagination for the request. */
|
|
56
|
+
pagination: PageRequest | undefined;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* QueryValidatorUnbondingDelegationsResponse is response type for the
|
|
60
|
+
* Query/ValidatorUnbondingDelegations RPC method.
|
|
61
|
+
*/
|
|
62
|
+
export interface QueryValidatorUnbondingDelegationsResponse {
|
|
63
|
+
unbondingResponses: UnbondingDelegation[];
|
|
64
|
+
/** pagination defines the pagination in the response. */
|
|
65
|
+
pagination: PageResponse | undefined;
|
|
66
|
+
}
|
|
67
|
+
/** QueryDelegationRequest is request type for the Query/Delegation RPC method. */
|
|
68
|
+
export interface QueryDelegationRequest {
|
|
69
|
+
/** delegator_addr defines the delegator address to query for. */
|
|
70
|
+
delegatorAddr: string;
|
|
71
|
+
/** validator_addr defines the validator address to query for. */
|
|
72
|
+
validatorAddr: string;
|
|
73
|
+
}
|
|
74
|
+
/** QueryDelegationResponse is response type for the Query/Delegation RPC method. */
|
|
75
|
+
export interface QueryDelegationResponse {
|
|
76
|
+
/** delegation_responses defines the delegation info of a delegation. */
|
|
77
|
+
delegationResponse: DelegationResponse | undefined;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* QueryUnbondingDelegationRequest is request type for the
|
|
81
|
+
* Query/UnbondingDelegation RPC method.
|
|
82
|
+
*/
|
|
83
|
+
export interface QueryUnbondingDelegationRequest {
|
|
84
|
+
/** delegator_addr defines the delegator address to query for. */
|
|
85
|
+
delegatorAddr: string;
|
|
86
|
+
/** validator_addr defines the validator address to query for. */
|
|
87
|
+
validatorAddr: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* QueryDelegationResponse is response type for the Query/UnbondingDelegation
|
|
91
|
+
* RPC method.
|
|
92
|
+
*/
|
|
93
|
+
export interface QueryUnbondingDelegationResponse {
|
|
94
|
+
/** unbond defines the unbonding information of a delegation. */
|
|
95
|
+
unbond: UnbondingDelegation | undefined;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* QueryDelegatorDelegationsRequest is request type for the
|
|
99
|
+
* Query/DelegatorDelegations RPC method.
|
|
100
|
+
*/
|
|
101
|
+
export interface QueryDelegatorDelegationsRequest {
|
|
102
|
+
/** delegator_addr defines the delegator address to query for. */
|
|
103
|
+
delegatorAddr: string;
|
|
104
|
+
/** pagination defines an optional pagination for the request. */
|
|
105
|
+
pagination: PageRequest | undefined;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* QueryDelegatorDelegationsResponse is response type for the
|
|
109
|
+
* Query/DelegatorDelegations RPC method.
|
|
110
|
+
*/
|
|
111
|
+
export interface QueryDelegatorDelegationsResponse {
|
|
112
|
+
/** delegation_responses defines all the delegations' info of a delegator. */
|
|
113
|
+
delegationResponses: DelegationResponse[];
|
|
114
|
+
/** pagination defines the pagination in the response. */
|
|
115
|
+
pagination: PageResponse | undefined;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* QueryDelegatorUnbondingDelegationsRequest is request type for the
|
|
119
|
+
* Query/DelegatorUnbondingDelegations RPC method.
|
|
120
|
+
*/
|
|
121
|
+
export interface QueryDelegatorUnbondingDelegationsRequest {
|
|
122
|
+
/** delegator_addr defines the delegator address to query for. */
|
|
123
|
+
delegatorAddr: string;
|
|
124
|
+
/** pagination defines an optional pagination for the request. */
|
|
125
|
+
pagination: PageRequest | undefined;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* QueryUnbondingDelegatorDelegationsResponse is response type for the
|
|
129
|
+
* Query/UnbondingDelegatorDelegations RPC method.
|
|
130
|
+
*/
|
|
131
|
+
export interface QueryDelegatorUnbondingDelegationsResponse {
|
|
132
|
+
unbondingResponses: UnbondingDelegation[];
|
|
133
|
+
/** pagination defines the pagination in the response. */
|
|
134
|
+
pagination: PageResponse | undefined;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* QueryRedelegationsRequest is request type for the Query/Redelegations RPC
|
|
138
|
+
* method.
|
|
139
|
+
*/
|
|
140
|
+
export interface QueryRedelegationsRequest {
|
|
141
|
+
/** delegator_addr defines the delegator address to query for. */
|
|
142
|
+
delegatorAddr: string;
|
|
143
|
+
/** src_validator_addr defines the validator address to redelegate from. */
|
|
144
|
+
srcValidatorAddr: string;
|
|
145
|
+
/** dst_validator_addr defines the validator address to redelegate to. */
|
|
146
|
+
dstValidatorAddr: string;
|
|
147
|
+
/** pagination defines an optional pagination for the request. */
|
|
148
|
+
pagination: PageRequest | undefined;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* QueryRedelegationsResponse is response type for the Query/Redelegations RPC
|
|
152
|
+
* method.
|
|
153
|
+
*/
|
|
154
|
+
export interface QueryRedelegationsResponse {
|
|
155
|
+
redelegationResponses: RedelegationResponse[];
|
|
156
|
+
/** pagination defines the pagination in the response. */
|
|
157
|
+
pagination: PageResponse | undefined;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* QueryDelegatorValidatorsRequest is request type for the
|
|
161
|
+
* Query/DelegatorValidators RPC method.
|
|
162
|
+
*/
|
|
163
|
+
export interface QueryDelegatorValidatorsRequest {
|
|
164
|
+
/** delegator_addr defines the delegator address to query for. */
|
|
165
|
+
delegatorAddr: string;
|
|
166
|
+
/** pagination defines an optional pagination for the request. */
|
|
167
|
+
pagination: PageRequest | undefined;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* QueryDelegatorValidatorsResponse is response type for the
|
|
171
|
+
* Query/DelegatorValidators RPC method.
|
|
172
|
+
*/
|
|
173
|
+
export interface QueryDelegatorValidatorsResponse {
|
|
174
|
+
/** validators defines the validators' info of a delegator. */
|
|
175
|
+
validators: Validator[];
|
|
176
|
+
/** pagination defines the pagination in the response. */
|
|
177
|
+
pagination: PageResponse | undefined;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* QueryDelegatorValidatorRequest is request type for the
|
|
181
|
+
* Query/DelegatorValidator RPC method.
|
|
182
|
+
*/
|
|
183
|
+
export interface QueryDelegatorValidatorRequest {
|
|
184
|
+
/** delegator_addr defines the delegator address to query for. */
|
|
185
|
+
delegatorAddr: string;
|
|
186
|
+
/** validator_addr defines the validator address to query for. */
|
|
187
|
+
validatorAddr: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* QueryDelegatorValidatorResponse response type for the
|
|
191
|
+
* Query/DelegatorValidator RPC method.
|
|
192
|
+
*/
|
|
193
|
+
export interface QueryDelegatorValidatorResponse {
|
|
194
|
+
/** validator defines the validator info. */
|
|
195
|
+
validator: Validator | undefined;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC
|
|
199
|
+
* method.
|
|
200
|
+
*/
|
|
201
|
+
export interface QueryHistoricalInfoRequest {
|
|
202
|
+
/** height defines at which height to query the historical info. */
|
|
203
|
+
height: bigint;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC
|
|
207
|
+
* method.
|
|
208
|
+
*/
|
|
209
|
+
export interface QueryHistoricalInfoResponse {
|
|
210
|
+
/** hist defines the historical info at the given height. */
|
|
211
|
+
hist: HistoricalInfo | undefined;
|
|
212
|
+
}
|
|
213
|
+
/** QueryPoolRequest is request type for the Query/Pool RPC method. */
|
|
214
|
+
export interface QueryPoolRequest {
|
|
215
|
+
}
|
|
216
|
+
/** QueryPoolResponse is response type for the Query/Pool RPC method. */
|
|
217
|
+
export interface QueryPoolResponse {
|
|
218
|
+
/** pool defines the pool info. */
|
|
219
|
+
pool: Pool | undefined;
|
|
220
|
+
}
|
|
221
|
+
/** QueryParamsRequest is request type for the Query/Params RPC method. */
|
|
222
|
+
export interface QueryParamsRequest {
|
|
223
|
+
}
|
|
224
|
+
/** QueryParamsResponse is response type for the Query/Params RPC method. */
|
|
225
|
+
export interface QueryParamsResponse {
|
|
226
|
+
/** params holds all the parameters of this module. */
|
|
227
|
+
params: Params | undefined;
|
|
228
|
+
}
|
|
229
|
+
export declare const QueryValidatorsRequest: MessageFns<QueryValidatorsRequest>;
|
|
230
|
+
export declare const QueryValidatorsResponse: MessageFns<QueryValidatorsResponse>;
|
|
231
|
+
export declare const QueryValidatorRequest: MessageFns<QueryValidatorRequest>;
|
|
232
|
+
export declare const QueryValidatorResponse: MessageFns<QueryValidatorResponse>;
|
|
233
|
+
export declare const QueryValidatorDelegationsRequest: MessageFns<QueryValidatorDelegationsRequest>;
|
|
234
|
+
export declare const QueryValidatorDelegationsResponse: MessageFns<QueryValidatorDelegationsResponse>;
|
|
235
|
+
export declare const QueryValidatorUnbondingDelegationsRequest: MessageFns<QueryValidatorUnbondingDelegationsRequest>;
|
|
236
|
+
export declare const QueryValidatorUnbondingDelegationsResponse: MessageFns<QueryValidatorUnbondingDelegationsResponse>;
|
|
237
|
+
export declare const QueryDelegationRequest: MessageFns<QueryDelegationRequest>;
|
|
238
|
+
export declare const QueryDelegationResponse: MessageFns<QueryDelegationResponse>;
|
|
239
|
+
export declare const QueryUnbondingDelegationRequest: MessageFns<QueryUnbondingDelegationRequest>;
|
|
240
|
+
export declare const QueryUnbondingDelegationResponse: MessageFns<QueryUnbondingDelegationResponse>;
|
|
241
|
+
export declare const QueryDelegatorDelegationsRequest: MessageFns<QueryDelegatorDelegationsRequest>;
|
|
242
|
+
export declare const QueryDelegatorDelegationsResponse: MessageFns<QueryDelegatorDelegationsResponse>;
|
|
243
|
+
export declare const QueryDelegatorUnbondingDelegationsRequest: MessageFns<QueryDelegatorUnbondingDelegationsRequest>;
|
|
244
|
+
export declare const QueryDelegatorUnbondingDelegationsResponse: MessageFns<QueryDelegatorUnbondingDelegationsResponse>;
|
|
245
|
+
export declare const QueryRedelegationsRequest: MessageFns<QueryRedelegationsRequest>;
|
|
246
|
+
export declare const QueryRedelegationsResponse: MessageFns<QueryRedelegationsResponse>;
|
|
247
|
+
export declare const QueryDelegatorValidatorsRequest: MessageFns<QueryDelegatorValidatorsRequest>;
|
|
248
|
+
export declare const QueryDelegatorValidatorsResponse: MessageFns<QueryDelegatorValidatorsResponse>;
|
|
249
|
+
export declare const QueryDelegatorValidatorRequest: MessageFns<QueryDelegatorValidatorRequest>;
|
|
250
|
+
export declare const QueryDelegatorValidatorResponse: MessageFns<QueryDelegatorValidatorResponse>;
|
|
251
|
+
export declare const QueryHistoricalInfoRequest: MessageFns<QueryHistoricalInfoRequest>;
|
|
252
|
+
export declare const QueryHistoricalInfoResponse: MessageFns<QueryHistoricalInfoResponse>;
|
|
253
|
+
export declare const QueryPoolRequest: MessageFns<QueryPoolRequest>;
|
|
254
|
+
export declare const QueryPoolResponse: MessageFns<QueryPoolResponse>;
|
|
255
|
+
export declare const QueryParamsRequest: MessageFns<QueryParamsRequest>;
|
|
256
|
+
export declare const QueryParamsResponse: MessageFns<QueryParamsResponse>;
|
|
257
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
258
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
259
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
260
|
+
} : Partial<T>;
|
|
261
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
262
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
263
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
264
|
+
} & {
|
|
265
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
266
|
+
};
|
|
267
|
+
export interface MessageFns<T> {
|
|
268
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
269
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
270
|
+
fromJSON(object: any): T;
|
|
271
|
+
toJSON(message: T): unknown;
|
|
272
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
273
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
274
|
+
}
|
|
275
|
+
export {};
|
|
@@ -23,7 +23,7 @@ export interface Http {
|
|
|
23
23
|
fullyDecodeReservedExpansion: boolean;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* gRPC Transcoding
|
|
27
27
|
*
|
|
28
28
|
* gRPC Transcoding is a feature for mapping between a gRPC method and one or
|
|
29
29
|
* more HTTP REST endpoints. It allows developers to build a single API service
|
|
@@ -64,9 +64,8 @@ export interface Http {
|
|
|
64
64
|
*
|
|
65
65
|
* This enables an HTTP REST to gRPC mapping as below:
|
|
66
66
|
*
|
|
67
|
-
* HTTP
|
|
68
|
-
*
|
|
69
|
-
* `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
|
|
67
|
+
* - HTTP: `GET /v1/messages/123456`
|
|
68
|
+
* - gRPC: `GetMessage(name: "messages/123456")`
|
|
70
69
|
*
|
|
71
70
|
* Any fields in the request message which are not bound by the path template
|
|
72
71
|
* automatically become HTTP query parameters if there is no HTTP request body.
|
|
@@ -90,11 +89,9 @@ export interface Http {
|
|
|
90
89
|
*
|
|
91
90
|
* This enables a HTTP JSON to RPC mapping as below:
|
|
92
91
|
*
|
|
93
|
-
* HTTP
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
|
|
97
|
-
* "foo"))`
|
|
92
|
+
* - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo`
|
|
93
|
+
* - gRPC: `GetMessage(message_id: "123456" revision: 2 sub:
|
|
94
|
+
* SubMessage(subfield: "foo"))`
|
|
98
95
|
*
|
|
99
96
|
* Note that fields which are mapped to URL query parameters must have a
|
|
100
97
|
* primitive type or a repeated primitive type or a non-repeated message type.
|
|
@@ -124,10 +121,8 @@ export interface Http {
|
|
|
124
121
|
* representation of the JSON in the request body is determined by
|
|
125
122
|
* protos JSON encoding:
|
|
126
123
|
*
|
|
127
|
-
* HTTP
|
|
128
|
-
*
|
|
129
|
-
* `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
|
|
130
|
-
* "123456" message { text: "Hi!" })`
|
|
124
|
+
* - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
|
|
125
|
+
* - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
|
|
131
126
|
*
|
|
132
127
|
* The special name `*` can be used in the body mapping to define that
|
|
133
128
|
* every field not bound by the path template should be mapped to the
|
|
@@ -149,10 +144,8 @@ export interface Http {
|
|
|
149
144
|
*
|
|
150
145
|
* The following HTTP JSON to RPC mapping is enabled:
|
|
151
146
|
*
|
|
152
|
-
* HTTP
|
|
153
|
-
*
|
|
154
|
-
* `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
|
|
155
|
-
* "123456" text: "Hi!")`
|
|
147
|
+
* - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }`
|
|
148
|
+
* - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")`
|
|
156
149
|
*
|
|
157
150
|
* Note that when using `*` in the body mapping, it is not possible to
|
|
158
151
|
* have HTTP parameters, as all fields not bound by the path end in
|
|
@@ -180,13 +173,13 @@ export interface Http {
|
|
|
180
173
|
*
|
|
181
174
|
* This enables the following two alternative HTTP JSON to RPC mappings:
|
|
182
175
|
*
|
|
183
|
-
* HTTP
|
|
184
|
-
*
|
|
185
|
-
* `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
|
|
186
|
-
* `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
|
|
187
|
-
* "123456")`
|
|
176
|
+
* - HTTP: `GET /v1/messages/123456`
|
|
177
|
+
* - gRPC: `GetMessage(message_id: "123456")`
|
|
188
178
|
*
|
|
189
|
-
*
|
|
179
|
+
* - HTTP: `GET /v1/users/me/messages/123456`
|
|
180
|
+
* - gRPC: `GetMessage(user_id: "me" message_id: "123456")`
|
|
181
|
+
*
|
|
182
|
+
* Rules for HTTP mapping
|
|
190
183
|
*
|
|
191
184
|
* 1. Leaf request fields (recursive expansion nested messages in the request
|
|
192
185
|
* message) are classified into three categories:
|
|
@@ -205,7 +198,7 @@ export interface Http {
|
|
|
205
198
|
* request body, all
|
|
206
199
|
* fields are passed via URL path and URL query parameters.
|
|
207
200
|
*
|
|
208
|
-
*
|
|
201
|
+
* Path template syntax
|
|
209
202
|
*
|
|
210
203
|
* Template = "/" Segments [ Verb ] ;
|
|
211
204
|
* Segments = Segment { "/" Segment } ;
|
|
@@ -244,7 +237,7 @@ export interface Http {
|
|
|
244
237
|
* Document](https://developers.google.com/discovery/v1/reference/apis) as
|
|
245
238
|
* `{+var}`.
|
|
246
239
|
*
|
|
247
|
-
*
|
|
240
|
+
* Using gRPC API Service Configuration
|
|
248
241
|
*
|
|
249
242
|
* gRPC API Service Configuration (service config) is a configuration language
|
|
250
243
|
* for configuring a gRPC service to become a user-facing product. The
|
|
@@ -259,15 +252,14 @@ export interface Http {
|
|
|
259
252
|
* specified in the service config will override any matching transcoding
|
|
260
253
|
* configuration in the proto.
|
|
261
254
|
*
|
|
262
|
-
*
|
|
255
|
+
* The following example selects a gRPC method and applies an `HttpRule` to it:
|
|
263
256
|
*
|
|
264
257
|
* http:
|
|
265
258
|
* rules:
|
|
266
|
-
* # Selects a gRPC method and applies HttpRule to it.
|
|
267
259
|
* - selector: example.v1.Messaging.GetMessage
|
|
268
260
|
* get: /v1/messages/{message_id}/{sub.subfield}
|
|
269
261
|
*
|
|
270
|
-
*
|
|
262
|
+
* Special notes
|
|
271
263
|
*
|
|
272
264
|
* When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
|
|
273
265
|
* proto to JSON conversion must follow the [proto3
|
|
@@ -2,6 +2,7 @@ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
|
2
2
|
import { PublicKey } from "../crypto/keys";
|
|
3
3
|
import { ProofOps } from "../crypto/proof";
|
|
4
4
|
import { ConsensusParams } from "../types/params";
|
|
5
|
+
import { Header } from "../types/types";
|
|
5
6
|
import { BlockIDFlag } from "../types/validator";
|
|
6
7
|
export declare const protobufPackage = "tendermint.abci";
|
|
7
8
|
export declare enum CheckTxType {
|
|
@@ -36,6 +37,9 @@ export interface Request {
|
|
|
36
37
|
extendVote?: RequestExtendVote | undefined;
|
|
37
38
|
verifyVoteExtension?: RequestVerifyVoteExtension | undefined;
|
|
38
39
|
finalizeBlock?: RequestFinalizeBlock | undefined;
|
|
40
|
+
/** 16~99 are reserved for merging original tendermint */
|
|
41
|
+
beginRecheckTx?: RequestBeginRecheckTx | undefined;
|
|
42
|
+
endRecheckTx?: RequestEndRecheckTx | undefined;
|
|
39
43
|
}
|
|
40
44
|
export interface RequestEcho {
|
|
41
45
|
message: string;
|
|
@@ -154,6 +158,12 @@ export interface RequestFinalizeBlock {
|
|
|
154
158
|
/** proposer_address is the address of the public key of the original proposer of the block. */
|
|
155
159
|
proposerAddress: Uint8Array;
|
|
156
160
|
}
|
|
161
|
+
export interface RequestBeginRecheckTx {
|
|
162
|
+
header: Header | undefined;
|
|
163
|
+
}
|
|
164
|
+
export interface RequestEndRecheckTx {
|
|
165
|
+
height: bigint;
|
|
166
|
+
}
|
|
157
167
|
export interface Response {
|
|
158
168
|
exception?: ResponseException | undefined;
|
|
159
169
|
echo?: ResponseEcho | undefined;
|
|
@@ -172,6 +182,9 @@ export interface Response {
|
|
|
172
182
|
extendVote?: ResponseExtendVote | undefined;
|
|
173
183
|
verifyVoteExtension?: ResponseVerifyVoteExtension | undefined;
|
|
174
184
|
finalizeBlock?: ResponseFinalizeBlock | undefined;
|
|
185
|
+
/** 17~99 are reserved for merging original tendermint */
|
|
186
|
+
beginRecheckTx?: ResponseBeginRecheckTx | undefined;
|
|
187
|
+
endRecheckTx?: ResponseEndRecheckTx | undefined;
|
|
175
188
|
}
|
|
176
189
|
/** nondeterministic */
|
|
177
190
|
export interface ResponseException {
|
|
@@ -325,6 +338,12 @@ export interface ResponseFinalizeBlock {
|
|
|
325
338
|
*/
|
|
326
339
|
appHash: Uint8Array;
|
|
327
340
|
}
|
|
341
|
+
export interface ResponseBeginRecheckTx {
|
|
342
|
+
code: number;
|
|
343
|
+
}
|
|
344
|
+
export interface ResponseEndRecheckTx {
|
|
345
|
+
code: number;
|
|
346
|
+
}
|
|
328
347
|
export interface CommitInfo {
|
|
329
348
|
round: number;
|
|
330
349
|
votes: VoteInfo[];
|
|
@@ -456,6 +475,8 @@ export declare const RequestProcessProposal: MessageFns<RequestProcessProposal>;
|
|
|
456
475
|
export declare const RequestExtendVote: MessageFns<RequestExtendVote>;
|
|
457
476
|
export declare const RequestVerifyVoteExtension: MessageFns<RequestVerifyVoteExtension>;
|
|
458
477
|
export declare const RequestFinalizeBlock: MessageFns<RequestFinalizeBlock>;
|
|
478
|
+
export declare const RequestBeginRecheckTx: MessageFns<RequestBeginRecheckTx>;
|
|
479
|
+
export declare const RequestEndRecheckTx: MessageFns<RequestEndRecheckTx>;
|
|
459
480
|
export declare const Response: MessageFns<Response>;
|
|
460
481
|
export declare const ResponseException: MessageFns<ResponseException>;
|
|
461
482
|
export declare const ResponseEcho: MessageFns<ResponseEcho>;
|
|
@@ -474,6 +495,8 @@ export declare const ResponseProcessProposal: MessageFns<ResponseProcessProposal
|
|
|
474
495
|
export declare const ResponseExtendVote: MessageFns<ResponseExtendVote>;
|
|
475
496
|
export declare const ResponseVerifyVoteExtension: MessageFns<ResponseVerifyVoteExtension>;
|
|
476
497
|
export declare const ResponseFinalizeBlock: MessageFns<ResponseFinalizeBlock>;
|
|
498
|
+
export declare const ResponseBeginRecheckTx: MessageFns<ResponseBeginRecheckTx>;
|
|
499
|
+
export declare const ResponseEndRecheckTx: MessageFns<ResponseEndRecheckTx>;
|
|
477
500
|
export declare const CommitInfo: MessageFns<CommitInfo>;
|
|
478
501
|
export declare const ExtendedCommitInfo: MessageFns<ExtendedCommitInfo>;
|
|
479
502
|
export declare const Event: MessageFns<Event>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decodes the `msg_responses` of a committed transaction from the hex blob the
|
|
3
|
+
* chain returns in `tx_response.data`.
|
|
4
|
+
*
|
|
5
|
+
* `tx_response.data` is the protobuf-encoded `cosmos.base.abci.v1beta1.TxMsgData`
|
|
6
|
+
* (`{ repeated Any msg_responses = 2 }`). Rather than generate the whole
|
|
7
|
+
* `abci.proto`, this reads the one field we need (field 2, the `Any`s) directly
|
|
8
|
+
* off the wire with the same `BinaryReader` the generated codecs use, then hands
|
|
9
|
+
* each entry to the generated `Any.decode`. Field 1 (the deprecated `data`
|
|
10
|
+
* field) and any future fields are skipped.
|
|
11
|
+
*
|
|
12
|
+
* Returns an empty array for an empty/missing blob. This is wire decoding, not a
|
|
13
|
+
* REST + zod workaround — there is no `Query*Response` involved.
|
|
14
|
+
*/
|
|
15
|
+
export declare function decodeTxMsgResponses(dataHex: string | undefined): Array<{
|
|
16
|
+
typeUrl: string;
|
|
17
|
+
value: Uint8Array;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RestContext } from "./context";
|
|
2
|
+
import { QueryIsOpenedResponse, QueryLabelResponse, QueryParamsResponse } from "../proto/gen/ault/accountx/v1/query";
|
|
3
|
+
export interface AccountxApi {
|
|
4
|
+
isOpened: (address: string) => Promise<QueryIsOpenedResponse>;
|
|
5
|
+
getLabel: (address: string) => Promise<QueryLabelResponse>;
|
|
6
|
+
getParams: () => Promise<QueryParamsResponse>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createAccountxApi(context: RestContext): AccountxApi;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type RestContext } from "./context";
|
|
2
|
+
import { QueryAllBalancesResponse, QueryBalanceResponse, QueryDenomMetadataResponse, QuerySupplyOfResponse, QueryTotalSupplyResponse } from "../proto/gen/cosmos/bank/v1beta1/query";
|
|
3
|
+
import type { PaginationParams } from "./types";
|
|
4
|
+
export interface BankApi {
|
|
5
|
+
getBalance: (address: string, denom: string) => Promise<QueryBalanceResponse>;
|
|
6
|
+
getAllBalances: (address: string, params?: {
|
|
7
|
+
pagination?: PaginationParams;
|
|
8
|
+
}) => Promise<QueryAllBalancesResponse>;
|
|
9
|
+
getDenomMetadata: (denom: string) => Promise<QueryDenomMetadataResponse>;
|
|
10
|
+
getSupplyByDenom: (denom: string) => Promise<QuerySupplyOfResponse>;
|
|
11
|
+
getTotalSupply: (params?: {
|
|
12
|
+
pagination?: PaginationParams;
|
|
13
|
+
}) => Promise<QueryTotalSupplyResponse>;
|
|
14
|
+
}
|
|
15
|
+
export declare function createBankApi(context: RestContext): BankApi;
|
package/dist/rest/clob.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { type RestContext } from "./context";
|
|
2
2
|
import type { PaginationParams } from "./types";
|
|
3
|
-
import { QueryOrderResponse, QueryOrdersResponse } from "../proto/gen/ault/clob/v1/query";
|
|
3
|
+
import { QueryOrderResponse, QueryOrdersResponse, QueryParamsResponse } from "../proto/gen/ault/clob/v1/query";
|
|
4
4
|
export interface ClobApi {
|
|
5
|
+
getParams: () => Promise<QueryParamsResponse>;
|
|
5
6
|
getOrder: (orderId: Uint8Array | string) => Promise<QueryOrderResponse>;
|
|
7
|
+
/**
|
|
8
|
+
* Resolves a live order by its `(orderer, cloid)` pair against the node's CLOB
|
|
9
|
+
* state. The cloid index is dropped once the order closes, so a miss returns
|
|
10
|
+
* `{ order: undefined }` rather than throwing (non-404 failures still throw),
|
|
11
|
+
* letting a caller fall back to the indexed dex-api. `cloid` is raw 8 bytes.
|
|
12
|
+
*/
|
|
13
|
+
getOrderByCloid: (orderer: string, cloid: Uint8Array) => Promise<QueryOrderResponse>;
|
|
6
14
|
getOrders: (params?: {
|
|
7
15
|
marketId?: Uint8Array | string;
|
|
8
16
|
pagination?: PaginationParams;
|
package/dist/rest/context.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../proto/duration-json";
|
|
2
2
|
import { type FetchWithRetryOptions, type FetchFn } from "../core/http";
|
|
3
|
-
import type {
|
|
3
|
+
import type { PageResponse } from "../proto/gen/cosmos/base/query/v1beta1/pagination";
|
|
4
4
|
export declare const REST_CONTEXT_BRAND: unique symbol;
|
|
5
5
|
export interface RestContext {
|
|
6
6
|
[REST_CONTEXT_BRAND]: true;
|
|
@@ -13,10 +13,10 @@ export interface ProtoJsonCodec<T> {
|
|
|
13
13
|
fromJSON(object: unknown): T;
|
|
14
14
|
}
|
|
15
15
|
export declare function buildFetchOptions(context: RestContext, overrides?: FetchWithRetryOptions): FetchWithRetryOptions;
|
|
16
|
-
export declare function fetchRest<T>(context: RestContext, path: string, fetchOptions?: FetchWithRetryOptions, schema?: ZodType<T>): Promise<T>;
|
|
17
16
|
export declare function fetchProtoJson<T>(context: RestContext, path: string, codec: ProtoJsonCodec<T>, fetchOptions?: FetchWithRetryOptions): Promise<T>;
|
|
18
|
-
export declare function
|
|
19
|
-
|
|
17
|
+
export declare function fetchAllPaginatedProto<TResponse extends {
|
|
18
|
+
pagination?: PageResponse | undefined;
|
|
19
|
+
}, TItem>(context: RestContext, path: string, codec: ProtoJsonCodec<TResponse>, getItems: (res: TResponse) => TItem[]): Promise<{
|
|
20
20
|
items: TItem[];
|
|
21
21
|
total: number;
|
|
22
22
|
}>;
|