carbon-js-sdk 0.8.10 → 0.8.11

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.
@@ -1,6 +1,6 @@
1
1
  import { NetworkConfig } from "../constant";
2
2
  import { Insights } from "../index";
3
- import { InsightsQueryResponse } from "../insights";
3
+ import { ConnectedWalletParams, ConnectedWalletResponse, InsightsQueryResponse } from "../insights";
4
4
  import { APIUtils } from "../util";
5
5
  declare class InsightsQueryClient {
6
6
  readonly apiManager: APIUtils.APIManager<typeof Insights.InsightsEndpoints>;
@@ -17,9 +17,11 @@ declare class InsightsQueryClient {
17
17
  TotalUsers(req?: Insights.QueryGetTotalUsersRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetTotalUsersResponse>>;
18
18
  Pools(req?: Insights.QueryGetPoolsRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsResponse>>;
19
19
  PoolHistory(query: Insights.QueryGetPoolHistoryRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolHistoryResponse>>;
20
+ PerpPoolHistory(query: Insights.QueryGetPerpPoolHistoryRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPerpPoolHistoryResponse>>;
20
21
  PoolVolume(req: Insights.QueryGetPoolVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolVolumeResponse>>;
21
22
  PoolsVolume(req?: Insights.QueryGetPoolsVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsVolumeResponse>>;
22
23
  UserRewardsClaimHistory(req: Insights.QueryGetUserRewardsClaimHistoryRequest): Promise<InsightsQueryResponse<Insights.QueryGetUserRewardsClaimHistoryResponse>>;
24
+ UserWalletConnected(body: ConnectedWalletParams): Promise<ConnectedWalletResponse>;
23
25
  CompetitionList(req?: Insights.QueryGetCompetitionListRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetCompetitionListResponse>>;
24
26
  /**
25
27
  * endpoint for legacy Demex Trading volume Competition (circa. 2021-2022). Keeping this here as endpoint has not been removed.
@@ -140,6 +140,18 @@ class InsightsQueryClient {
140
140
  return response.data;
141
141
  });
142
142
  }
143
+ PerpPoolHistory(query) {
144
+ var _a, _b;
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ const request = this.apiManager.path("pool/perp/history", {}, {
147
+ limit: (_a = query.limit) !== null && _a !== void 0 ? _a : 10,
148
+ offset: (_b = query.offset) !== null && _b !== void 0 ? _b : 0,
149
+ address: query.address,
150
+ });
151
+ const response = yield request.get();
152
+ return response.data;
153
+ });
154
+ }
143
155
  PoolVolume(req) {
144
156
  return __awaiter(this, void 0, void 0, function* () {
145
157
  const routeParams = { poolId: req.poolId };
@@ -174,6 +186,13 @@ class InsightsQueryClient {
174
186
  return response.data;
175
187
  });
176
188
  }
189
+ UserWalletConnected(body) {
190
+ return __awaiter(this, void 0, void 0, function* () {
191
+ const request = this.apiManager.path('user/connected/wallet');
192
+ const response = yield request.post({ body });
193
+ return response.data;
194
+ });
195
+ }
177
196
  CompetitionList(req = {}) {
178
197
  return __awaiter(this, void 0, void 0, function* () {
179
198
  const request = this.apiManager.path("competition/list", {}, req);
@@ -0,0 +1,108 @@
1
+ import Long from "long";
2
+ import _m0 from "protobufjs/minimal";
3
+ import { Coin } from "../../../cosmos/base/v1beta1/coin";
4
+ export declare const protobufPackage = "Switcheo.carbon.bridge";
5
+ export interface BridgeState {
6
+ id: string;
7
+ name: string;
8
+ isEnabled: boolean;
9
+ }
10
+ /** each bridge have multiple connections to different chains */
11
+ export interface Connection {
12
+ /** = bridgeId_chainId */
13
+ connectionId: string;
14
+ bridgeId: string;
15
+ chainId: string;
16
+ chainDisplayName: string;
17
+ tokenGatewayAddress: string;
18
+ encoding: string;
19
+ escrowAddress: string;
20
+ isEnabled: boolean;
21
+ }
22
+ /** each connection can have multiple external tokens, which contains the mapping to native denom */
23
+ export interface ExternalTokenMapping {
24
+ connectionId: string;
25
+ isEnabled: boolean;
26
+ isCarbonOwned: boolean;
27
+ externalAddress: string;
28
+ /** corresponding carbon native denom */
29
+ denom: string;
30
+ }
31
+ /** accounts/contracts from external chains can be allowed to execute certain predefined functions on carbon */
32
+ export interface ExternalExecutor {
33
+ connectionId: string;
34
+ externalAddress: string;
35
+ carbonAddress: string;
36
+ }
37
+ /** contracts from external chains that can be executed by carbon */
38
+ export interface ExecutableContract {
39
+ connectionId: string;
40
+ address: string;
41
+ }
42
+ /** RelayFee */
43
+ export interface RelayFee {
44
+ relayerDepositAddress: string;
45
+ fee?: Coin;
46
+ }
47
+ /** WithdrawalDetails */
48
+ export interface WithdrawalDetails {
49
+ connectionId: string;
50
+ sender: string;
51
+ receiver: string;
52
+ coin?: Coin;
53
+ relayFee?: RelayFee;
54
+ }
55
+ export declare const BridgeState: {
56
+ encode(message: BridgeState, writer?: _m0.Writer): _m0.Writer;
57
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): BridgeState;
58
+ fromJSON(object: any): BridgeState;
59
+ toJSON(message: BridgeState): unknown;
60
+ fromPartial(object: DeepPartial<BridgeState>): BridgeState;
61
+ };
62
+ export declare const Connection: {
63
+ encode(message: Connection, writer?: _m0.Writer): _m0.Writer;
64
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Connection;
65
+ fromJSON(object: any): Connection;
66
+ toJSON(message: Connection): unknown;
67
+ fromPartial(object: DeepPartial<Connection>): Connection;
68
+ };
69
+ export declare const ExternalTokenMapping: {
70
+ encode(message: ExternalTokenMapping, writer?: _m0.Writer): _m0.Writer;
71
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ExternalTokenMapping;
72
+ fromJSON(object: any): ExternalTokenMapping;
73
+ toJSON(message: ExternalTokenMapping): unknown;
74
+ fromPartial(object: DeepPartial<ExternalTokenMapping>): ExternalTokenMapping;
75
+ };
76
+ export declare const ExternalExecutor: {
77
+ encode(message: ExternalExecutor, writer?: _m0.Writer): _m0.Writer;
78
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ExternalExecutor;
79
+ fromJSON(object: any): ExternalExecutor;
80
+ toJSON(message: ExternalExecutor): unknown;
81
+ fromPartial(object: DeepPartial<ExternalExecutor>): ExternalExecutor;
82
+ };
83
+ export declare const ExecutableContract: {
84
+ encode(message: ExecutableContract, writer?: _m0.Writer): _m0.Writer;
85
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ExecutableContract;
86
+ fromJSON(object: any): ExecutableContract;
87
+ toJSON(message: ExecutableContract): unknown;
88
+ fromPartial(object: DeepPartial<ExecutableContract>): ExecutableContract;
89
+ };
90
+ export declare const RelayFee: {
91
+ encode(message: RelayFee, writer?: _m0.Writer): _m0.Writer;
92
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RelayFee;
93
+ fromJSON(object: any): RelayFee;
94
+ toJSON(message: RelayFee): unknown;
95
+ fromPartial(object: DeepPartial<RelayFee>): RelayFee;
96
+ };
97
+ export declare const WithdrawalDetails: {
98
+ encode(message: WithdrawalDetails, writer?: _m0.Writer): _m0.Writer;
99
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): WithdrawalDetails;
100
+ fromJSON(object: any): WithdrawalDetails;
101
+ toJSON(message: WithdrawalDetails): unknown;
102
+ fromPartial(object: DeepPartial<WithdrawalDetails>): WithdrawalDetails;
103
+ };
104
+ declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
105
+ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
106
+ [K in keyof T]?: DeepPartial<T[K]>;
107
+ } : Partial<T>;
108
+ export {};