carbon-js-sdk 0.11.65 → 0.11.66-beta.2

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 (50) hide show
  1. package/lib/clients/CarbonQueryClient.d.ts +2 -0
  2. package/lib/clients/CarbonQueryClient.js +2 -0
  3. package/lib/clients/InsightsQueryClient.d.ts +1 -0
  4. package/lib/clients/InsightsQueryClient.js +12 -0
  5. package/lib/clients/TokenClient.js +1 -0
  6. package/lib/codec/Switcheo/carbon/perpspool/event.d.ts +94 -27
  7. package/lib/codec/Switcheo/carbon/perpspool/event.js +610 -119
  8. package/lib/codec/Switcheo/carbon/perpspool/export.d.ts +8 -6
  9. package/lib/codec/Switcheo/carbon/perpspool/export.js +52 -5
  10. package/lib/codec/Switcheo/carbon/perpspool/genesis.d.ts +18 -1
  11. package/lib/codec/Switcheo/carbon/perpspool/genesis.js +128 -3
  12. package/lib/codec/Switcheo/carbon/perpspool/market.d.ts +36 -13
  13. package/lib/codec/Switcheo/carbon/perpspool/market.js +174 -97
  14. package/lib/codec/Switcheo/carbon/perpspool/params.d.ts +21 -4
  15. package/lib/codec/Switcheo/carbon/perpspool/params.js +313 -46
  16. package/lib/codec/Switcheo/carbon/perpspool/pool.d.ts +17 -1
  17. package/lib/codec/Switcheo/carbon/perpspool/pool.js +66 -1
  18. package/lib/codec/Switcheo/carbon/perpspool/query.d.ts +188 -6
  19. package/lib/codec/Switcheo/carbon/perpspool/query.js +932 -40
  20. package/lib/codec/Switcheo/carbon/perpspool/quote.d.ts +49 -0
  21. package/lib/codec/Switcheo/carbon/perpspool/quote.js +229 -0
  22. package/lib/codec/Switcheo/carbon/perpspool/tx.d.ts +172 -0
  23. package/lib/codec/Switcheo/carbon/perpspool/tx.js +910 -1
  24. package/lib/codec/google/protobuf/descriptor.d.ts +10 -6
  25. package/lib/codec/google/protobuf/descriptor.js +8 -3
  26. package/lib/codec/index.d.ts +14 -0
  27. package/lib/codec/index.js +723 -68
  28. package/lib/constant/index.d.ts +2 -1
  29. package/lib/constant/index.js +2 -1
  30. package/lib/insights/common.d.ts +1 -0
  31. package/lib/insights/common.js +1 -0
  32. package/lib/modules/grant.d.ts +15 -19
  33. package/lib/modules/grant.js +105 -158
  34. package/lib/modules/leverage.d.ts +1 -0
  35. package/lib/modules/leverage.js +6 -2
  36. package/lib/modules/order.d.ts +11 -3
  37. package/lib/modules/order.js +30 -39
  38. package/lib/modules/perpspool.d.ts +24 -0
  39. package/lib/modules/perpspool.js +83 -0
  40. package/lib/modules/position.d.ts +1 -0
  41. package/lib/modules/position.js +6 -2
  42. package/lib/provider/amino/types/grant.js +23 -1
  43. package/lib/provider/amino/types/perpspool.js +34 -0
  44. package/lib/provider/amino/utils.d.ts +3 -3
  45. package/lib/provider/amino/utils.js +3 -2
  46. package/lib/util/eip712.js +6 -4
  47. package/lib/util/tx.d.ts +16 -0
  48. package/lib/util/tx.js +1 -1
  49. package/lib/wallet/CarbonWallet.js +19 -24
  50. package/package.json +1 -1
@@ -48,6 +48,7 @@ import { QueryClientImpl as SubaccountQueryClient } from "../codec/Switcheo/carb
48
48
  import { QueryClientImpl as AllianceClient } from "../codec/alliance/alliance/query";
49
49
  import { QueryClientImpl as PerpspoolQueryClient } from "../codec/Switcheo/carbon/perpspool/query";
50
50
  import { QueryClientImpl as ERC20QueryClient } from "../codec/Switcheo/carbon/erc20/query";
51
+ import { QueryClientImpl as AdminQueryClient } from "../codec/Switcheo/carbon/admin/query";
51
52
  import { Tendermint37Client } from "@cosmjs/tendermint-rpc";
52
53
  import BlockchainClient from "./BlockchainClient";
53
54
  import GrpcQueryClient from "./GrpcQueryClient";
@@ -113,6 +114,7 @@ declare class CarbonQueryClient {
113
114
  evmmerge: EvmMergeQueryClient;
114
115
  evmbank: EvmBankQueryClient;
115
116
  erc20: ERC20QueryClient;
117
+ admin: AdminQueryClient;
116
118
  constructor(opts: CarbonQueryClientOpts);
117
119
  }
118
120
  export default CarbonQueryClient;
@@ -53,6 +53,7 @@ const query_47 = require("../codec/Switcheo/carbon/subaccount/query");
53
53
  const query_48 = require("../codec/alliance/alliance/query");
54
54
  const query_49 = require("../codec/Switcheo/carbon/perpspool/query");
55
55
  const query_50 = require("../codec/Switcheo/carbon/erc20/query");
56
+ const query_51 = require("../codec/Switcheo/carbon/admin/query");
56
57
  const stargate_1 = require("@cosmjs/stargate");
57
58
  const BlockchainClient_1 = __importDefault(require("./BlockchainClient"));
58
59
  class CarbonQueryClient {
@@ -103,6 +104,7 @@ class CarbonQueryClient {
103
104
  this.cosmosTm = new query_10.ServiceClientImpl(rpcClient);
104
105
  this.alliance = new query_48.QueryClientImpl(rpcClient);
105
106
  this.erc20 = new query_50.QueryClientImpl(rpcClient);
107
+ this.admin = new query_51.QueryClientImpl(rpcClient);
106
108
  this.ibc = {
107
109
  controller: new query_28.QueryClientImpl(rpcClient),
108
110
  host: new query_29.QueryClientImpl(rpcClient),
@@ -24,6 +24,7 @@ declare class InsightsQueryClient {
24
24
  PoolHistory(query: Insights.QueryGetPoolHistoryRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolHistoryResponse>>;
25
25
  PerpPoolHistory(query: Insights.QueryGetPerpPoolHistoryRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPerpPoolHistoryResponse>>;
26
26
  PerpPoolApy(query: Insights.QueryPerpPoolAPY): Promise<Insights.InsightsQueryResponse<Insights.QueryPerpPoolAPYResponse>>;
27
+ UserVaultApy(query: Insights.QueryPerpPoolAPY): Promise<Insights.InsightsQueryResponse<Insights.QueryPerpPoolAPYResponse>>;
27
28
  PoolVolume(req: Insights.QueryGetPoolVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolVolumeResponse>>;
28
29
  PoolsVolume(req?: Insights.QueryGetPoolsVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsVolumeResponse>>;
29
30
  UserRewardsClaimHistory(req: Insights.QueryGetUserRewardsClaimHistoryRequest): Promise<InsightsQueryResponse<Insights.QueryGetUserRewardsClaimHistoryResponse>>;
@@ -199,6 +199,18 @@ class InsightsQueryClient {
199
199
  return response.data;
200
200
  });
201
201
  }
202
+ UserVaultApy(query) {
203
+ var _a, _b;
204
+ return __awaiter(this, void 0, void 0, function* () {
205
+ const routeParams = { id: query.id };
206
+ const request = this.apiManager.path("pool/vault/apy", routeParams, {
207
+ limit: (_a = query.limit) !== null && _a !== void 0 ? _a : 10,
208
+ offset: (_b = query.offset) !== null && _b !== void 0 ? _b : 0,
209
+ });
210
+ const response = yield request.get();
211
+ return response.data;
212
+ });
213
+ }
202
214
  PoolVolume(req) {
203
215
  return __awaiter(this, void 0, void 0, function* () {
204
216
  const routeParams = { poolId: req.poolId };
@@ -643,6 +643,7 @@ class TokenClient {
643
643
  var _a, _b;
644
644
  return __awaiter(this, void 0, void 0, function* () {
645
645
  this.usdValues.iusd = number_1.BN_ONE;
646
+ this.usdValues.cgusd = number_1.BN_ONE;
646
647
  //Get corresponding geckoId for denoms and removes any duplicated geckoIds (espeically for different wrapped tokens as they correspond to the same geckoId(same price))
647
648
  const geckoIds = denoms.reduce((coinIds, denom) => {
648
649
  // To ensure that ibc denoms are not added to the gecko ids list, the default is removed.
@@ -2,6 +2,8 @@ import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
3
  import { Pool } from "./pool";
4
4
  import { MarketConfig } from "./market";
5
+ import { UserVault } from "./user_vault";
6
+ import { QuoteStrategy } from "./quote";
5
7
  export declare const protobufPackage = "Switcheo.carbon.perpspool";
6
8
  export interface PoolEvent {
7
9
  pool?: Pool;
@@ -18,7 +20,11 @@ export interface DeregisterFromPoolEvent {
18
20
  export interface SetMarketConfigEvent {
19
21
  marketConfig?: MarketConfig;
20
22
  }
21
- export interface DepositToPoolEvent {
23
+ export interface UpdateMarketLiquidityUsageMultiplierEvent {
24
+ marketId: string;
25
+ multiplier: string;
26
+ }
27
+ export interface DepositToVaultEvent {
22
28
  poolId: Long;
23
29
  denom: string;
24
30
  amount: string;
@@ -26,26 +32,52 @@ export interface DepositToPoolEvent {
26
32
  shareAmount: string;
27
33
  initialShareAmountBurnt: string;
28
34
  depositor: string;
29
- feeToPoolDenom: string;
30
- feeToPoolAmount: string;
31
- feeToPoolCommissionDenom: string;
32
- feeToPoolCommissionAmount: string;
35
+ vaultFeeDenom: string;
36
+ vaultFeeAmount: string;
37
+ commissionFeeDenom: string;
38
+ commissionFeeAmount: string;
39
+ vaultType: Long;
33
40
  }
34
- export interface WithdrawFromPoolEvent {
41
+ export interface WithdrawFromVaultEvent {
35
42
  poolId: Long;
36
43
  denom: string;
37
44
  amount: string;
38
45
  shareDenom: string;
39
46
  shareAmount: string;
40
47
  withdrawer: string;
41
- feeToPoolDenom: string;
42
- feeToPoolAmount: string;
43
- feeToCommissionDenom: string;
44
- feeToCommissionAmount: string;
48
+ vaultFeeDenom: string;
49
+ vaultFeeAmount: string;
50
+ commissionFeeDenom: string;
51
+ commissionFeeAmount: string;
52
+ vaultType: Long;
45
53
  }
46
- export interface UpdateMarketLiquidityUsageMultiplierEvent {
47
- marketId: string;
48
- multiplier: string;
54
+ export interface UserVaultWithdrawalPendingEvent {
55
+ vaultId: Long;
56
+ address: string;
57
+ sharesAmount: string;
58
+ processId: Long;
59
+ requestTime?: Date;
60
+ }
61
+ export interface UserVaultWithdrawalReleasedEvent {
62
+ vaultId: Long;
63
+ processId: Long;
64
+ address: string;
65
+ sharesDenom: string;
66
+ sharesAmount: string;
67
+ receivedDenom: string;
68
+ receivedAmount: string;
69
+ requestTime?: Date;
70
+ completionTime?: Date;
71
+ error: string;
72
+ }
73
+ export interface UserVaultEvent {
74
+ vault?: UserVault;
75
+ }
76
+ export interface UserVaultClosedEvent {
77
+ id: Long;
78
+ }
79
+ export interface SetQuoteStrategyEvent {
80
+ quoteStrategy?: QuoteStrategy;
49
81
  }
50
82
  export declare const PoolEvent: {
51
83
  encode(message: PoolEvent, writer?: _m0.Writer): _m0.Writer;
@@ -75,20 +107,6 @@ export declare const SetMarketConfigEvent: {
75
107
  toJSON(message: SetMarketConfigEvent): unknown;
76
108
  fromPartial(object: DeepPartial<SetMarketConfigEvent>): SetMarketConfigEvent;
77
109
  };
78
- export declare const DepositToPoolEvent: {
79
- encode(message: DepositToPoolEvent, writer?: _m0.Writer): _m0.Writer;
80
- decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DepositToPoolEvent;
81
- fromJSON(object: any): DepositToPoolEvent;
82
- toJSON(message: DepositToPoolEvent): unknown;
83
- fromPartial(object: DeepPartial<DepositToPoolEvent>): DepositToPoolEvent;
84
- };
85
- export declare const WithdrawFromPoolEvent: {
86
- encode(message: WithdrawFromPoolEvent, writer?: _m0.Writer): _m0.Writer;
87
- decode(input: _m0.Reader | Uint8Array, length?: number | undefined): WithdrawFromPoolEvent;
88
- fromJSON(object: any): WithdrawFromPoolEvent;
89
- toJSON(message: WithdrawFromPoolEvent): unknown;
90
- fromPartial(object: DeepPartial<WithdrawFromPoolEvent>): WithdrawFromPoolEvent;
91
- };
92
110
  export declare const UpdateMarketLiquidityUsageMultiplierEvent: {
93
111
  encode(message: UpdateMarketLiquidityUsageMultiplierEvent, writer?: _m0.Writer): _m0.Writer;
94
112
  decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UpdateMarketLiquidityUsageMultiplierEvent;
@@ -96,6 +114,55 @@ export declare const UpdateMarketLiquidityUsageMultiplierEvent: {
96
114
  toJSON(message: UpdateMarketLiquidityUsageMultiplierEvent): unknown;
97
115
  fromPartial(object: DeepPartial<UpdateMarketLiquidityUsageMultiplierEvent>): UpdateMarketLiquidityUsageMultiplierEvent;
98
116
  };
117
+ export declare const DepositToVaultEvent: {
118
+ encode(message: DepositToVaultEvent, writer?: _m0.Writer): _m0.Writer;
119
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DepositToVaultEvent;
120
+ fromJSON(object: any): DepositToVaultEvent;
121
+ toJSON(message: DepositToVaultEvent): unknown;
122
+ fromPartial(object: DeepPartial<DepositToVaultEvent>): DepositToVaultEvent;
123
+ };
124
+ export declare const WithdrawFromVaultEvent: {
125
+ encode(message: WithdrawFromVaultEvent, writer?: _m0.Writer): _m0.Writer;
126
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): WithdrawFromVaultEvent;
127
+ fromJSON(object: any): WithdrawFromVaultEvent;
128
+ toJSON(message: WithdrawFromVaultEvent): unknown;
129
+ fromPartial(object: DeepPartial<WithdrawFromVaultEvent>): WithdrawFromVaultEvent;
130
+ };
131
+ export declare const UserVaultWithdrawalPendingEvent: {
132
+ encode(message: UserVaultWithdrawalPendingEvent, writer?: _m0.Writer): _m0.Writer;
133
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UserVaultWithdrawalPendingEvent;
134
+ fromJSON(object: any): UserVaultWithdrawalPendingEvent;
135
+ toJSON(message: UserVaultWithdrawalPendingEvent): unknown;
136
+ fromPartial(object: DeepPartial<UserVaultWithdrawalPendingEvent>): UserVaultWithdrawalPendingEvent;
137
+ };
138
+ export declare const UserVaultWithdrawalReleasedEvent: {
139
+ encode(message: UserVaultWithdrawalReleasedEvent, writer?: _m0.Writer): _m0.Writer;
140
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UserVaultWithdrawalReleasedEvent;
141
+ fromJSON(object: any): UserVaultWithdrawalReleasedEvent;
142
+ toJSON(message: UserVaultWithdrawalReleasedEvent): unknown;
143
+ fromPartial(object: DeepPartial<UserVaultWithdrawalReleasedEvent>): UserVaultWithdrawalReleasedEvent;
144
+ };
145
+ export declare const UserVaultEvent: {
146
+ encode(message: UserVaultEvent, writer?: _m0.Writer): _m0.Writer;
147
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UserVaultEvent;
148
+ fromJSON(object: any): UserVaultEvent;
149
+ toJSON(message: UserVaultEvent): unknown;
150
+ fromPartial(object: DeepPartial<UserVaultEvent>): UserVaultEvent;
151
+ };
152
+ export declare const UserVaultClosedEvent: {
153
+ encode(message: UserVaultClosedEvent, writer?: _m0.Writer): _m0.Writer;
154
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UserVaultClosedEvent;
155
+ fromJSON(object: any): UserVaultClosedEvent;
156
+ toJSON(message: UserVaultClosedEvent): unknown;
157
+ fromPartial(object: DeepPartial<UserVaultClosedEvent>): UserVaultClosedEvent;
158
+ };
159
+ export declare const SetQuoteStrategyEvent: {
160
+ encode(message: SetQuoteStrategyEvent, writer?: _m0.Writer): _m0.Writer;
161
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SetQuoteStrategyEvent;
162
+ fromJSON(object: any): SetQuoteStrategyEvent;
163
+ toJSON(message: SetQuoteStrategyEvent): unknown;
164
+ fromPartial(object: DeepPartial<SetQuoteStrategyEvent>): SetQuoteStrategyEvent;
165
+ };
99
166
  declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
100
167
  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 {} ? {
101
168
  [K in keyof T]?: DeepPartial<T[K]>;