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.
Files changed (138) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +932 -0
  3. package/dist/agent/create-agent-client.d.ts +3 -0
  4. package/dist/agent/sign-and-broadcast.d.ts +38 -0
  5. package/dist/agent/tx/clob.d.ts +7 -0
  6. package/dist/agent/tx-executor.d.ts +17 -0
  7. package/dist/client.d.ts +61 -0
  8. package/dist/core/address.d.ts +14 -0
  9. package/dist/core/base64.d.ts +2 -0
  10. package/dist/core/clob-msgs.d.ts +33 -0
  11. package/dist/core/errors.d.ts +17 -0
  12. package/dist/core/http.d.ts +14 -0
  13. package/dist/core/network.d.ts +59 -0
  14. package/dist/core/pagination.d.ts +14 -0
  15. package/dist/core/query.d.ts +5 -0
  16. package/dist/core/with-status-fallback.d.ts +5 -0
  17. package/dist/eip712/builder.d.ts +45 -0
  18. package/dist/eip712/field-order.d.ts +2 -0
  19. package/dist/eip712/msg-encoders.generated.d.ts +1 -0
  20. package/dist/eip712/msg.generated.d.ts +109 -0
  21. package/dist/eip712/registry.d.ts +36 -0
  22. package/dist/eip712/registry.generated.d.ts +2 -0
  23. package/dist/eip712/sign-and-broadcast.d.ts +55 -0
  24. package/dist/eip712/signers.d.ts +83 -0
  25. package/dist/eip712/types.d.ts +58 -0
  26. package/dist/high-level/address-utils.d.ts +2 -0
  27. package/dist/high-level/create-client.d.ts +26 -0
  28. package/dist/high-level/query-helpers.d.ts +3 -0
  29. package/dist/high-level/signer.d.ts +6 -0
  30. package/dist/high-level/tx/agent.d.ts +3 -0
  31. package/dist/high-level/tx/authority.d.ts +3 -0
  32. package/dist/high-level/tx/clob.d.ts +3 -0
  33. package/dist/high-level/tx/context.d.ts +5 -0
  34. package/dist/high-level/tx/license.d.ts +3 -0
  35. package/dist/high-level/tx/market.d.ts +3 -0
  36. package/dist/high-level/tx/miner.d.ts +3 -0
  37. package/dist/high-level/tx/ratelimit.d.ts +3 -0
  38. package/dist/high-level/tx/reward.d.ts +3 -0
  39. package/dist/high-level/tx/staking.d.ts +3 -0
  40. package/dist/high-level/tx/tokenregistry.d.ts +3 -0
  41. package/dist/high-level/tx-executor.d.ts +18 -0
  42. package/dist/high-level/types.d.ts +477 -0
  43. package/dist/high-level-client.d.ts +2 -0
  44. package/dist/index.cjs +18434 -0
  45. package/dist/index.cjs.map +1 -0
  46. package/dist/index.d.ts +38 -0
  47. package/dist/index.js +18162 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/proto/duration-json.d.ts +6 -0
  50. package/dist/proto/gen/amino/amino.d.ts +1 -0
  51. package/dist/proto/gen/ault/agent/v1/agent.d.ts +63 -0
  52. package/dist/proto/gen/ault/agent/v1/genesis.d.ts +44 -0
  53. package/dist/proto/gen/ault/agent/v1/params.d.ts +42 -0
  54. package/dist/proto/gen/ault/agent/v1/query.d.ts +73 -0
  55. package/dist/proto/gen/ault/agent/v1/tx.d.ts +91 -0
  56. package/dist/proto/gen/ault/authority/v1/authority.d.ts +15 -0
  57. package/dist/proto/gen/ault/authority/v1/genesis.d.ts +36 -0
  58. package/dist/proto/gen/ault/authority/v1/query.d.ts +53 -0
  59. package/dist/proto/gen/ault/authority/v1/tx.d.ts +50 -0
  60. package/dist/proto/gen/ault/clob/v1/fee.d.ts +37 -0
  61. package/dist/proto/gen/ault/clob/v1/genesis.d.ts +56 -0
  62. package/dist/proto/gen/ault/clob/v1/order_book.d.ts +32 -0
  63. package/dist/proto/gen/ault/clob/v1/params.d.ts +29 -0
  64. package/dist/proto/gen/ault/clob/v1/query.d.ts +56 -0
  65. package/dist/proto/gen/ault/clob/v1/tx.d.ts +116 -0
  66. package/dist/proto/gen/ault/license/v1/genesis.d.ts +140 -0
  67. package/dist/proto/gen/ault/license/v1/license.d.ts +151 -0
  68. package/dist/proto/gen/ault/license/v1/query.d.ts +273 -0
  69. package/dist/proto/gen/ault/license/v1/tx.d.ts +227 -0
  70. package/dist/proto/gen/ault/market/v1/genesis.d.ts +28 -0
  71. package/dist/proto/gen/ault/market/v1/market.d.ts +66 -0
  72. package/dist/proto/gen/ault/market/v1/params.d.ts +34 -0
  73. package/dist/proto/gen/ault/market/v1/query.d.ts +48 -0
  74. package/dist/proto/gen/ault/market/v1/tx.d.ts +87 -0
  75. package/dist/proto/gen/ault/miner/v1/genesis.d.ts +166 -0
  76. package/dist/proto/gen/ault/miner/v1/miner.d.ts +232 -0
  77. package/dist/proto/gen/ault/miner/v1/query.d.ts +254 -0
  78. package/dist/proto/gen/ault/miner/v1/tx.d.ts +207 -0
  79. package/dist/proto/gen/ault/ratelimit/v1/genesis.d.ts +27 -0
  80. package/dist/proto/gen/ault/ratelimit/v1/params.d.ts +35 -0
  81. package/dist/proto/gen/ault/ratelimit/v1/query.d.ts +42 -0
  82. package/dist/proto/gen/ault/ratelimit/v1/tx.d.ts +32 -0
  83. package/dist/proto/gen/ault/reward/v1/genesis.d.ts +67 -0
  84. package/dist/proto/gen/ault/reward/v1/query.d.ts +93 -0
  85. package/dist/proto/gen/ault/reward/v1/reward.d.ts +53 -0
  86. package/dist/proto/gen/ault/reward/v1/tx.d.ts +120 -0
  87. package/dist/proto/gen/ault/spot/v1/genesis.d.ts +26 -0
  88. package/dist/proto/gen/ault/spot/v1/order.d.ts +66 -0
  89. package/dist/proto/gen/ault/tokenregistry/v1/genesis.d.ts +34 -0
  90. package/dist/proto/gen/ault/tokenregistry/v1/query.d.ts +77 -0
  91. package/dist/proto/gen/ault/tokenregistry/v1/tokenregistry.d.ts +118 -0
  92. package/dist/proto/gen/ault/tokenregistry/v1/tx.d.ts +132 -0
  93. package/dist/proto/gen/cosmos/base/query/v1beta1/pagination.d.ts +82 -0
  94. package/dist/proto/gen/cosmos/base/v1beta1/coin.d.ts +59 -0
  95. package/dist/proto/gen/cosmos/distribution/v1beta1/distribution.d.ts +162 -0
  96. package/dist/proto/gen/cosmos/distribution/v1beta1/tx.d.ts +140 -0
  97. package/dist/proto/gen/cosmos/msg/v1/msg.d.ts +1 -0
  98. package/dist/proto/gen/cosmos/staking/v1beta1/staking.d.ts +310 -0
  99. package/dist/proto/gen/cosmos/staking/v1beta1/tx.d.ts +144 -0
  100. package/dist/proto/gen/cosmos_proto/cosmos.d.ts +80 -0
  101. package/dist/proto/gen/gogoproto/gogo.d.ts +1 -0
  102. package/dist/proto/gen/google/api/annotations.d.ts +1 -0
  103. package/dist/proto/gen/google/api/http.d.ts +379 -0
  104. package/dist/proto/gen/google/protobuf/any.d.ts +144 -0
  105. package/dist/proto/gen/google/protobuf/descriptor.d.ts +1285 -0
  106. package/dist/proto/gen/google/protobuf/duration.d.ts +99 -0
  107. package/dist/proto/gen/google/protobuf/timestamp.d.ts +128 -0
  108. package/dist/proto/gen/tendermint/abci/types.d.ts +507 -0
  109. package/dist/proto/gen/tendermint/crypto/keys.d.ts +27 -0
  110. package/dist/proto/gen/tendermint/crypto/proof.d.ts +57 -0
  111. package/dist/proto/gen/tendermint/types/params.d.ts +112 -0
  112. package/dist/proto/gen/tendermint/types/types.d.ts +197 -0
  113. package/dist/proto/gen/tendermint/types/validator.d.ts +54 -0
  114. package/dist/proto/gen/tendermint/version/types.d.ts +41 -0
  115. package/dist/proto/tx-encode.d.ts +78 -0
  116. package/dist/rest/agent.d.ts +12 -0
  117. package/dist/rest/authority.d.ts +12 -0
  118. package/dist/rest/clob.d.ts +11 -0
  119. package/dist/rest/context.d.ts +22 -0
  120. package/dist/rest/dex-fetcher.d.ts +10 -0
  121. package/dist/rest/dex-types.generated.d.ts +780 -0
  122. package/dist/rest/dex.d.ts +34 -0
  123. package/dist/rest/dex.generated.d.ts +1381 -0
  124. package/dist/rest/license.d.ts +79 -0
  125. package/dist/rest/market.d.ts +11 -0
  126. package/dist/rest/miner.d.ts +59 -0
  127. package/dist/rest/ratelimit.d.ts +7 -0
  128. package/dist/rest/reward.d.ts +25 -0
  129. package/dist/rest/staking.d.ts +38 -0
  130. package/dist/rest/tokenregistry.d.ts +11 -0
  131. package/dist/rest/types.d.ts +871 -0
  132. package/dist/utils/address.d.ts +6 -0
  133. package/dist/utils/chain-id.d.ts +1 -0
  134. package/dist/utils/cosmos-dec.d.ts +2 -0
  135. package/dist/ws/client.d.ts +37 -0
  136. package/dist/ws/index.d.ts +5 -0
  137. package/dist/ws/types.d.ts +66 -0
  138. package/package.json +103 -0
@@ -0,0 +1,79 @@
1
+ import { type RestContext } from "./context";
2
+ import type { License, LicenseStatus, LicenseModuleParams, PageResponse, PaginationParams } from "./types";
3
+ export interface LicenseApi {
4
+ getLicense: (id: string | number) => Promise<{
5
+ license: License;
6
+ }>;
7
+ getLicenses: (params?: {
8
+ status?: LicenseStatus;
9
+ pagination?: PaginationParams;
10
+ }) => Promise<{
11
+ licenses: License[];
12
+ pagination?: PageResponse;
13
+ }>;
14
+ getLicensesByOwner: (owner: string, params?: {
15
+ pagination?: PaginationParams;
16
+ }) => Promise<{
17
+ licenses: License[];
18
+ pagination?: PageResponse;
19
+ }>;
20
+ getBalance: (owner: string) => Promise<{
21
+ balance: string;
22
+ }>;
23
+ getOwner: (id: string | number) => Promise<{
24
+ owner: string;
25
+ }>;
26
+ getTokenOfOwnerByIndex: (owner: string, index: number) => Promise<{
27
+ id: string;
28
+ }>;
29
+ getOwnedBy: (owner: string, params?: {
30
+ pagination?: PaginationParams;
31
+ }) => Promise<{
32
+ license_ids: string[];
33
+ pagination?: PageResponse;
34
+ }>;
35
+ getLicensesByOwnerAll: (owner: string) => Promise<{
36
+ license_ids: string[];
37
+ total: number;
38
+ }>;
39
+ getTotalSupply: () => Promise<{
40
+ total_supply: string;
41
+ }>;
42
+ isActive: (id: string | number) => Promise<{
43
+ is_active: boolean;
44
+ }>;
45
+ getParams: () => Promise<{
46
+ params: LicenseModuleParams;
47
+ }>;
48
+ getMinters: (params?: {
49
+ pagination?: PaginationParams;
50
+ }) => Promise<{
51
+ minters: string[];
52
+ pagination?: PageResponse;
53
+ }>;
54
+ getTransferUnlockTime: () => Promise<{
55
+ unlock_time: string;
56
+ }>;
57
+ getKycApprovers: (params?: {
58
+ pagination?: PaginationParams;
59
+ }) => Promise<{
60
+ approvers: string[];
61
+ pagination?: PageResponse;
62
+ }>;
63
+ getApprovedMembers: (params?: {
64
+ pagination?: PaginationParams;
65
+ }) => Promise<{
66
+ members: string[];
67
+ pagination?: PageResponse;
68
+ }>;
69
+ isApprovedMember: (address: string) => Promise<{
70
+ is_approved: boolean;
71
+ }>;
72
+ isKycApprover: (address: string) => Promise<{
73
+ is_approver: boolean;
74
+ }>;
75
+ getActiveLicenseCountAt: (owner: string, snapshotTime: string) => Promise<{
76
+ count: string;
77
+ }>;
78
+ }
79
+ export declare function createLicenseApi(context: RestContext): LicenseApi;
@@ -0,0 +1,11 @@
1
+ import { type RestContext } from "./context";
2
+ import type { PaginationParams } from "./types";
3
+ import { QueryMarketResponse, QueryMarketsResponse, QueryParamsResponse } from "../proto/gen/ault/market/v1/query";
4
+ export interface MarketApi {
5
+ getParams: () => Promise<QueryParamsResponse>;
6
+ getMarkets: (params?: {
7
+ pagination?: PaginationParams;
8
+ }) => Promise<QueryMarketsResponse>;
9
+ getMarket: (marketId: Uint8Array | string) => Promise<QueryMarketResponse>;
10
+ }
11
+ export declare function createMarketApi(context: RestContext): MarketApi;
@@ -0,0 +1,59 @@
1
+ import { type RestContext } from "./context";
2
+ import type { MiningDelegation, Operator, EpochInfo, LicenseMinerInfo, OwnerKeyInfo, EmissionInfo, YearEmission, LicensePayouts, MinerModuleParams, PageResponse, PaginationParams } from "./types";
3
+ export interface MinerApi {
4
+ getCurrentEpoch: () => Promise<{
5
+ epoch: string;
6
+ seed: string;
7
+ threshold: string;
8
+ }>;
9
+ getLicenseMinerInfo: (licenseId: string | number) => Promise<LicenseMinerInfo>;
10
+ getBeacon: (epoch: string | number) => Promise<{
11
+ r: string;
12
+ finalized: boolean;
13
+ }>;
14
+ getParams: () => Promise<{
15
+ params: MinerModuleParams;
16
+ }>;
17
+ getOwnerKey: (owner: string) => Promise<OwnerKeyInfo>;
18
+ getEmissionInfo: () => Promise<EmissionInfo>;
19
+ getEmissionSchedule: () => Promise<{
20
+ schedule: YearEmission[];
21
+ }>;
22
+ getEpochInfo: (epoch: string | number) => Promise<{
23
+ info: EpochInfo;
24
+ }>;
25
+ getEpochs: (params?: {
26
+ pagination?: PaginationParams;
27
+ }) => Promise<{
28
+ epochs: EpochInfo[];
29
+ pagination?: PageResponse;
30
+ }>;
31
+ getEpochsAll: () => Promise<{
32
+ epochs: EpochInfo[];
33
+ total: number;
34
+ }>;
35
+ getOperator: (operator: string) => Promise<{
36
+ operator: Operator | null;
37
+ }>;
38
+ getOperators: (params?: {
39
+ pagination?: PaginationParams;
40
+ }) => Promise<{
41
+ operators: Operator[];
42
+ pagination?: PageResponse;
43
+ }>;
44
+ getLicenseDelegation: (licenseId: string | number) => Promise<{
45
+ delegation: MiningDelegation | null;
46
+ is_delegated: boolean;
47
+ }>;
48
+ getDelegatedLicenses: (operator: string, params?: {
49
+ pagination?: PaginationParams;
50
+ }) => Promise<{
51
+ license_ids: string[];
52
+ pagination?: PageResponse;
53
+ }>;
54
+ getLicensePayouts: (licenseId: string | number, params?: {
55
+ fromEpoch?: string | number;
56
+ toEpoch?: string | number;
57
+ }) => Promise<LicensePayouts>;
58
+ }
59
+ export declare function createMinerApi(context: RestContext): MinerApi;
@@ -0,0 +1,7 @@
1
+ import { type RestContext } from "./context";
2
+ import { QueryParamsResponse, QueryRateLimitConfigResponse } from "../proto/gen/ault/ratelimit/v1/query";
3
+ export interface RateLimitApi {
4
+ getRateLimitConfig: (msgType: string) => Promise<QueryRateLimitConfigResponse>;
5
+ getParams: () => Promise<QueryParamsResponse>;
6
+ }
7
+ export declare function createRateLimitApi(context: RestContext): RateLimitApi;
@@ -0,0 +1,25 @@
1
+ import { type RestContext } from "./context";
2
+ import type { PaginationParams } from "./types";
3
+ import { QueryBuilderAllowancesResponse, QueryDeployerShareResponse, QueryEligibleReferrersResponse, QueryParamsResponse, QueryReferralCodeResponse, QueryReferrerResponse } from "../proto/gen/ault/reward/v1/query";
4
+ export type RewardReferrerParams = {
5
+ code: string;
6
+ referee?: never;
7
+ } | {
8
+ referee: string;
9
+ code?: never;
10
+ };
11
+ export interface RewardApi {
12
+ getParams: () => Promise<QueryParamsResponse>;
13
+ getReferrer: (params: RewardReferrerParams) => Promise<QueryReferrerResponse>;
14
+ getReferralCode: (referrer: string) => Promise<QueryReferralCodeResponse>;
15
+ getEligibleReferrers: (params?: {
16
+ pagination?: PaginationParams;
17
+ }) => Promise<QueryEligibleReferrersResponse>;
18
+ getDeployerShare: (marketId: Uint8Array | string) => Promise<QueryDeployerShareResponse>;
19
+ getBuilderAllowances: (params?: {
20
+ user?: string;
21
+ builder?: string;
22
+ pagination?: PaginationParams;
23
+ }) => Promise<QueryBuilderAllowancesResponse>;
24
+ }
25
+ export declare function createRewardApi(context: RestContext): RewardApi;
@@ -0,0 +1,38 @@
1
+ import { type RestContext } from "./context";
2
+ import type { Validator, DelegationResponse, DelegationResponseEnvelope, UnbondingDelegation, DelegationReward, DecCoin, StakingParams, StakingPool, ValidatorStatus, PageResponse, PaginationParams } from "./types";
3
+ export interface StakingApi {
4
+ getValidators: (params?: {
5
+ status?: ValidatorStatus;
6
+ pagination?: PaginationParams;
7
+ }) => Promise<{
8
+ validators: Validator[];
9
+ pagination?: PageResponse;
10
+ }>;
11
+ getValidator: (validatorAddress: string) => Promise<{
12
+ validator: Validator;
13
+ }>;
14
+ getDelegation: (delegatorAddress: string, validatorAddress: string) => Promise<DelegationResponseEnvelope>;
15
+ getDelegations: (delegatorAddress: string, params?: {
16
+ pagination?: PaginationParams;
17
+ }) => Promise<{
18
+ delegation_responses: DelegationResponse[];
19
+ pagination?: PageResponse;
20
+ }>;
21
+ getUnbondingDelegations: (delegatorAddress: string, params?: {
22
+ pagination?: PaginationParams;
23
+ }) => Promise<{
24
+ unbonding_responses: UnbondingDelegation[];
25
+ pagination?: PageResponse;
26
+ }>;
27
+ getStakingRewards: (delegatorAddress: string) => Promise<{
28
+ rewards: DelegationReward[];
29
+ total: DecCoin[];
30
+ }>;
31
+ getStakingParams: () => Promise<{
32
+ params: StakingParams;
33
+ }>;
34
+ getStakingPool: () => Promise<{
35
+ pool: StakingPool;
36
+ }>;
37
+ }
38
+ export declare function createStakingApi(context: RestContext): StakingApi;
@@ -0,0 +1,11 @@
1
+ import { type RestContext } from "./context";
2
+ import type { PaginationParams } from "./types";
3
+ import { QueryParamsResponse, QueryTokenPairResponse, QueryTokenPairsResponse } from "../proto/gen/ault/tokenregistry/v1/query";
4
+ export interface TokenRegistryApi {
5
+ getParams: () => Promise<QueryParamsResponse>;
6
+ getTokenPair: (token: string) => Promise<QueryTokenPairResponse>;
7
+ getTokenPairs: (params?: {
8
+ pagination?: PaginationParams;
9
+ }) => Promise<QueryTokenPairsResponse>;
10
+ }
11
+ export declare function createTokenRegistryApi(context: RestContext): TokenRegistryApi;