carbon-js-sdk 0.2.9 → 0.2.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.
@@ -16,7 +16,9 @@ declare class InsightsQueryClient {
16
16
  PoolHistory(query: Insights.QueryGetPoolHistoryRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolHistoryResponse>>;
17
17
  PoolVolume(req: Insights.QueryGetPoolVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolVolumeResponse>>;
18
18
  PoolsVolume(req?: Insights.QueryGetPoolsVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsVolumeResponse>>;
19
- CompetitionLeaderboard(req: Insights.QueryGetCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetCompetitionLeaderboardResponse>>;
19
+ CompetitionList(req?: Insights.QueryGetCompetitionListRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetCompetitionListResponse>>;
20
+ VolumeCompetitionLeaderboard(req: Insights.QueryGetVolumeCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetVolumeCompetitionLeaderboardResponse>>;
21
+ PNLCompetitionLeaderboard(req: Insights.QueryGetPNLCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPNLCompetitionLeaderboardResponse>>;
20
22
  PoolsLiquidity(req?: Insights.QueryGetPoolsLiquidityRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsLiquidityResponse>>;
21
23
  MarketsVolume(req?: Insights.QueryGetMarketVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetMarketVolumeResponse>>;
22
24
  Nodes(req?: Insights.QueryGetNodesRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetNodesResponse>>;
@@ -135,18 +135,29 @@ class InsightsQueryClient {
135
135
  return response.data;
136
136
  });
137
137
  }
138
- CompetitionLeaderboard(req) {
138
+ CompetitionList(req = {}) {
139
139
  return __awaiter(this, void 0, void 0, function* () {
140
- const queryParams = {
141
- market: req.market,
142
- from: req.from,
143
- until: req.until,
144
- };
140
+ const request = this.apiManager.path('competition/list', {}, req);
141
+ const response = yield request.get();
142
+ return response.data;
143
+ });
144
+ }
145
+ VolumeCompetitionLeaderboard(req) {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ const queryParams = Object.assign(Object.assign(Object.assign({ competitionId: req.competitionId }, req.from && { from: req.from }), req.until && { until: req.until }), req.market && { market: req.market });
145
148
  const request = this.apiManager.path('competition/leaderboard', {}, queryParams);
146
149
  const response = yield request.get();
147
150
  return response.data;
148
151
  });
149
152
  }
153
+ PNLCompetitionLeaderboard(req) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ const queryParams = Object.assign({ competitionId: req.competitionId }, req.market && { market: req.market });
156
+ const request = this.apiManager.path('competition/leaderboardpnl', {}, queryParams);
157
+ const response = yield request.get();
158
+ return response.data;
159
+ });
160
+ }
150
161
  PoolsLiquidity(req = {}) {
151
162
  return __awaiter(this, void 0, void 0, function* () {
152
163
  const queryParams = {
@@ -37,7 +37,7 @@ const util_1 = require("../util");
37
37
  const address_1 = require("../util/address");
38
38
  const blockchain_1 = require("../util/blockchain");
39
39
  const generic_1 = require("../util/generic");
40
- const plugin_1 = __importDefault(require("@cityofzion/neon-api/lib/plugin"));
40
+ const neon_js_1 = require("@cityofzion/neon-js");
41
41
  const Neon = __importStar(require("@cityofzion/neon-core"));
42
42
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
43
43
  const ethers_1 = require("ethers");
@@ -132,9 +132,9 @@ class NEOClient {
132
132
  ]);
133
133
  const rpcUrl = yield this.getProviderUrl();
134
134
  const apiProvider = networkConfig.network === CarbonSDK_1.default.Network.MainNet
135
- ? new plugin_1.default.neonDB.instance("https://api.switcheo.network")
136
- : new plugin_1.default.neoCli.instance(rpcUrl);
137
- return plugin_1.default.doInvoke({
135
+ ? new neon_js_1.api.neonDB.instance("https://api.switcheo.network")
136
+ : new neon_js_1.api.neoCli.instance(rpcUrl);
137
+ return neon_js_1.api.doInvoke({
138
138
  api: apiProvider,
139
139
  url: rpcUrl,
140
140
  account,
@@ -214,8 +214,8 @@ class NEOClient {
214
214
  sb.emitAppCall(scriptHash, "lock", data);
215
215
  const rpcUrl = yield this.getProviderUrl();
216
216
  const apiProvider = networkConfig.network === CarbonSDK_1.default.Network.MainNet
217
- ? new plugin_1.default.neonDB.instance("https://api.switcheo.network")
218
- : new plugin_1.default.neoCli.instance(rpcUrl);
217
+ ? new neon_js_1.api.neonDB.instance("https://api.switcheo.network")
218
+ : new neon_js_1.api.neoCli.instance(rpcUrl);
219
219
  let invokeTxConfig = {
220
220
  account: Object.assign(Object.assign({}, new Neon.wallet.Account("")), {
221
221
  // overwrite the address and public key to values provided by the ledger.
@@ -233,16 +233,16 @@ class NEOClient {
233
233
  };
234
234
  // similar to Neon.doInvoke(invokeTxConfig), but
235
235
  // separates out sendTx to broadcast to several nodes
236
- invokeTxConfig = yield plugin_1.default.fillBalance(invokeTxConfig);
237
- invokeTxConfig = yield plugin_1.default.createInvocationTx(invokeTxConfig);
238
- invokeTxConfig = yield plugin_1.default.modifyTransactionForEmptyTransaction(invokeTxConfig);
239
- invokeTxConfig = yield plugin_1.default.signTx(invokeTxConfig);
236
+ invokeTxConfig = yield neon_js_1.api.fillBalance(invokeTxConfig);
237
+ invokeTxConfig = yield neon_js_1.api.createInvocationTx(invokeTxConfig);
238
+ invokeTxConfig = yield neon_js_1.api.modifyTransactionForEmptyTransaction(invokeTxConfig);
239
+ invokeTxConfig = yield neon_js_1.api.signTx(invokeTxConfig);
240
240
  // provide notification to caller that signature is
241
241
  // done and proceeding to broadcasting tx
242
242
  if (signCompleteCallback) {
243
243
  signCompleteCallback();
244
244
  }
245
- yield plugin_1.default.sendTx(Object.assign(Object.assign({}, invokeTxConfig), { rpcUrl }));
245
+ yield neon_js_1.api.sendTx(Object.assign(Object.assign({}, invokeTxConfig), { rpcUrl }));
246
246
  return (_a = invokeTxConfig.tx) === null || _a === void 0 ? void 0 : _a.hash;
247
247
  });
248
248
  }
@@ -270,7 +270,7 @@ class NEOClient {
270
270
  const wrapperContractScriptHash = this.getConfig().wrapperScriptHash;
271
271
  const wrapperContractAddress = Neon.wallet.getAddressFromScriptHash(wrapperContractScriptHash);
272
272
  // Build config
273
- const intent = plugin_1.default.makeIntent({ NEO: neoAmount.toNumber() }, wrapperContractAddress);
273
+ const intent = neon_js_1.api.makeIntent({ NEO: neoAmount.toNumber() }, wrapperContractAddress);
274
274
  const props = {
275
275
  scriptHash: wrapperContractScriptHash,
276
276
  operation: "mintTokens",
@@ -279,8 +279,8 @@ class NEOClient {
279
279
  const script = Neon.sc.createScript(props);
280
280
  const networkConfig = this.getNetworkConfig();
281
281
  const apiProvider = networkConfig.network === CarbonSDK_1.default.Network.MainNet
282
- ? new plugin_1.default.neonDB.instance("https://api.switcheo.network")
283
- : new plugin_1.default.neoCli.instance(rpcUrl);
282
+ ? new neon_js_1.api.neonDB.instance("https://api.switcheo.network")
283
+ : new neon_js_1.api.neoCli.instance(rpcUrl);
284
284
  const config = {
285
285
  api: apiProvider,
286
286
  url: rpcUrl,
@@ -289,7 +289,7 @@ class NEOClient {
289
289
  script: script
290
290
  };
291
291
  // Neon API
292
- const response = yield plugin_1.default.doInvoke(config);
292
+ const response = yield neon_js_1.api.doInvoke(config);
293
293
  return response;
294
294
  });
295
295
  }
@@ -5,7 +5,7 @@ export declare const protobufPackage = "Switcheo.carbon.cdp";
5
5
  export interface Params {
6
6
  interestFee: string;
7
7
  liquidationFee: string;
8
- stableCoinInterestRate: string;
8
+ stablecoinInterestRate: string;
9
9
  }
10
10
  export declare const Params: {
11
11
  encode(message: Params, writer?: _m0.Writer): _m0.Writer;
@@ -11,7 +11,7 @@ exports.protobufPackage = "Switcheo.carbon.cdp";
11
11
  const baseParams = {
12
12
  interestFee: "",
13
13
  liquidationFee: "",
14
- stableCoinInterestRate: "",
14
+ stablecoinInterestRate: "",
15
15
  };
16
16
  exports.Params = {
17
17
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -21,8 +21,8 @@ exports.Params = {
21
21
  if (message.liquidationFee !== "") {
22
22
  writer.uint32(18).string(message.liquidationFee);
23
23
  }
24
- if (message.stableCoinInterestRate !== "") {
25
- writer.uint32(26).string(message.stableCoinInterestRate);
24
+ if (message.stablecoinInterestRate !== "") {
25
+ writer.uint32(26).string(message.stablecoinInterestRate);
26
26
  }
27
27
  return writer;
28
28
  },
@@ -40,7 +40,7 @@ exports.Params = {
40
40
  message.liquidationFee = reader.string();
41
41
  break;
42
42
  case 3:
43
- message.stableCoinInterestRate = reader.string();
43
+ message.stablecoinInterestRate = reader.string();
44
44
  break;
45
45
  default:
46
46
  reader.skipType(tag & 7);
@@ -59,10 +59,10 @@ exports.Params = {
59
59
  object.liquidationFee !== undefined && object.liquidationFee !== null
60
60
  ? String(object.liquidationFee)
61
61
  : "";
62
- message.stableCoinInterestRate =
63
- object.stableCoinInterestRate !== undefined &&
64
- object.stableCoinInterestRate !== null
65
- ? String(object.stableCoinInterestRate)
62
+ message.stablecoinInterestRate =
63
+ object.stablecoinInterestRate !== undefined &&
64
+ object.stablecoinInterestRate !== null
65
+ ? String(object.stablecoinInterestRate)
66
66
  : "";
67
67
  return message;
68
68
  },
@@ -72,8 +72,8 @@ exports.Params = {
72
72
  (obj.interestFee = message.interestFee);
73
73
  message.liquidationFee !== undefined &&
74
74
  (obj.liquidationFee = message.liquidationFee);
75
- message.stableCoinInterestRate !== undefined &&
76
- (obj.stableCoinInterestRate = message.stableCoinInterestRate);
75
+ message.stablecoinInterestRate !== undefined &&
76
+ (obj.stablecoinInterestRate = message.stablecoinInterestRate);
77
77
  return obj;
78
78
  },
79
79
  fromPartial(object) {
@@ -81,7 +81,7 @@ exports.Params = {
81
81
  const message = Object.assign({}, baseParams);
82
82
  message.interestFee = (_a = object.interestFee) !== null && _a !== void 0 ? _a : "";
83
83
  message.liquidationFee = (_b = object.liquidationFee) !== null && _b !== void 0 ? _b : "";
84
- message.stableCoinInterestRate = (_c = object.stableCoinInterestRate) !== null && _c !== void 0 ? _c : "";
84
+ message.stablecoinInterestRate = (_c = object.stablecoinInterestRate) !== null && _c !== void 0 ? _c : "";
85
85
  return message;
86
86
  },
87
87
  };
@@ -0,0 +1,23 @@
1
+ import Long from "long";
2
+ import _m0 from "protobufjs/minimal";
3
+ export declare const protobufPackage = "Switcheo.carbon.cdp";
4
+ export interface StablecoinDebtInfo {
5
+ denom: string;
6
+ lastUpdatedTime?: Date;
7
+ totalAccInterest: string;
8
+ totalPrincipal: string;
9
+ interestPerPrincipal: string;
10
+ totalPaidInterest: string;
11
+ }
12
+ export declare const StablecoinDebtInfo: {
13
+ encode(message: StablecoinDebtInfo, writer?: _m0.Writer): _m0.Writer;
14
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): StablecoinDebtInfo;
15
+ fromJSON(object: any): StablecoinDebtInfo;
16
+ toJSON(message: StablecoinDebtInfo): unknown;
17
+ fromPartial(object: DeepPartial<StablecoinDebtInfo>): StablecoinDebtInfo;
18
+ };
19
+ declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
20
+ 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 {} ? {
21
+ [K in keyof T]?: DeepPartial<T[K]>;
22
+ } : Partial<T>;
23
+ export {};
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.StablecoinDebtInfo = exports.protobufPackage = void 0;
7
+ /* eslint-disable */
8
+ const long_1 = __importDefault(require("long"));
9
+ const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
+ const timestamp_1 = require("../google/protobuf/timestamp");
11
+ exports.protobufPackage = "Switcheo.carbon.cdp";
12
+ const baseStablecoinDebtInfo = {
13
+ denom: "",
14
+ totalAccInterest: "",
15
+ totalPrincipal: "",
16
+ interestPerPrincipal: "",
17
+ totalPaidInterest: "",
18
+ };
19
+ exports.StablecoinDebtInfo = {
20
+ encode(message, writer = minimal_1.default.Writer.create()) {
21
+ if (message.denom !== "") {
22
+ writer.uint32(10).string(message.denom);
23
+ }
24
+ if (message.lastUpdatedTime !== undefined) {
25
+ timestamp_1.Timestamp.encode(toTimestamp(message.lastUpdatedTime), writer.uint32(18).fork()).ldelim();
26
+ }
27
+ if (message.totalAccInterest !== "") {
28
+ writer.uint32(26).string(message.totalAccInterest);
29
+ }
30
+ if (message.totalPrincipal !== "") {
31
+ writer.uint32(34).string(message.totalPrincipal);
32
+ }
33
+ if (message.interestPerPrincipal !== "") {
34
+ writer.uint32(42).string(message.interestPerPrincipal);
35
+ }
36
+ if (message.totalPaidInterest !== "") {
37
+ writer.uint32(50).string(message.totalPaidInterest);
38
+ }
39
+ return writer;
40
+ },
41
+ decode(input, length) {
42
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
43
+ let end = length === undefined ? reader.len : reader.pos + length;
44
+ const message = Object.assign({}, baseStablecoinDebtInfo);
45
+ while (reader.pos < end) {
46
+ const tag = reader.uint32();
47
+ switch (tag >>> 3) {
48
+ case 1:
49
+ message.denom = reader.string();
50
+ break;
51
+ case 2:
52
+ message.lastUpdatedTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
53
+ break;
54
+ case 3:
55
+ message.totalAccInterest = reader.string();
56
+ break;
57
+ case 4:
58
+ message.totalPrincipal = reader.string();
59
+ break;
60
+ case 5:
61
+ message.interestPerPrincipal = reader.string();
62
+ break;
63
+ case 6:
64
+ message.totalPaidInterest = reader.string();
65
+ break;
66
+ default:
67
+ reader.skipType(tag & 7);
68
+ break;
69
+ }
70
+ }
71
+ return message;
72
+ },
73
+ fromJSON(object) {
74
+ const message = Object.assign({}, baseStablecoinDebtInfo);
75
+ message.denom =
76
+ object.denom !== undefined && object.denom !== null
77
+ ? String(object.denom)
78
+ : "";
79
+ message.lastUpdatedTime =
80
+ object.lastUpdatedTime !== undefined && object.lastUpdatedTime !== null
81
+ ? fromJsonTimestamp(object.lastUpdatedTime)
82
+ : undefined;
83
+ message.totalAccInterest =
84
+ object.totalAccInterest !== undefined && object.totalAccInterest !== null
85
+ ? String(object.totalAccInterest)
86
+ : "";
87
+ message.totalPrincipal =
88
+ object.totalPrincipal !== undefined && object.totalPrincipal !== null
89
+ ? String(object.totalPrincipal)
90
+ : "";
91
+ message.interestPerPrincipal =
92
+ object.interestPerPrincipal !== undefined &&
93
+ object.interestPerPrincipal !== null
94
+ ? String(object.interestPerPrincipal)
95
+ : "";
96
+ message.totalPaidInterest =
97
+ object.totalPaidInterest !== undefined &&
98
+ object.totalPaidInterest !== null
99
+ ? String(object.totalPaidInterest)
100
+ : "";
101
+ return message;
102
+ },
103
+ toJSON(message) {
104
+ const obj = {};
105
+ message.denom !== undefined && (obj.denom = message.denom);
106
+ message.lastUpdatedTime !== undefined &&
107
+ (obj.lastUpdatedTime = message.lastUpdatedTime.toISOString());
108
+ message.totalAccInterest !== undefined &&
109
+ (obj.totalAccInterest = message.totalAccInterest);
110
+ message.totalPrincipal !== undefined &&
111
+ (obj.totalPrincipal = message.totalPrincipal);
112
+ message.interestPerPrincipal !== undefined &&
113
+ (obj.interestPerPrincipal = message.interestPerPrincipal);
114
+ message.totalPaidInterest !== undefined &&
115
+ (obj.totalPaidInterest = message.totalPaidInterest);
116
+ return obj;
117
+ },
118
+ fromPartial(object) {
119
+ var _a, _b, _c, _d, _e, _f;
120
+ const message = Object.assign({}, baseStablecoinDebtInfo);
121
+ message.denom = (_a = object.denom) !== null && _a !== void 0 ? _a : "";
122
+ message.lastUpdatedTime = (_b = object.lastUpdatedTime) !== null && _b !== void 0 ? _b : undefined;
123
+ message.totalAccInterest = (_c = object.totalAccInterest) !== null && _c !== void 0 ? _c : "";
124
+ message.totalPrincipal = (_d = object.totalPrincipal) !== null && _d !== void 0 ? _d : "";
125
+ message.interestPerPrincipal = (_e = object.interestPerPrincipal) !== null && _e !== void 0 ? _e : "";
126
+ message.totalPaidInterest = (_f = object.totalPaidInterest) !== null && _f !== void 0 ? _f : "";
127
+ return message;
128
+ },
129
+ };
130
+ function toTimestamp(date) {
131
+ const seconds = numberToLong(date.getTime() / 1000);
132
+ const nanos = (date.getTime() % 1000) * 1000000;
133
+ return { seconds, nanos };
134
+ }
135
+ function fromTimestamp(t) {
136
+ let millis = t.seconds.toNumber() * 1000;
137
+ millis += t.nanos / 1000000;
138
+ return new Date(millis);
139
+ }
140
+ function fromJsonTimestamp(o) {
141
+ if (o instanceof Date) {
142
+ return o;
143
+ }
144
+ else if (typeof o === "string") {
145
+ return new Date(o);
146
+ }
147
+ else {
148
+ return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
149
+ }
150
+ }
151
+ function numberToLong(number) {
152
+ return long_1.default.fromNumber(number);
153
+ }
154
+ if (minimal_1.default.util.Long !== long_1.default) {
155
+ minimal_1.default.util.Long = long_1.default;
156
+ minimal_1.default.configure();
157
+ }
@@ -23,7 +23,9 @@ export declare const InsightsEndpoints: {
23
23
  'position/view': string;
24
24
  'position/liquidation': string;
25
25
  'position/liquidation/engine': string;
26
+ 'competition/list': string;
26
27
  'competition/leaderboard': string;
28
+ 'competition/leaderboardpnl': string;
27
29
  'info/denom_gecko_map': string;
28
30
  'market/funding': string;
29
31
  };
@@ -34,7 +34,9 @@ exports.InsightsEndpoints = {
34
34
  'position/liquidation': '/position/liquidation',
35
35
  'position/liquidation/engine': '/position/liquidation/engine',
36
36
  // Competition api
37
+ 'competition/list': '/competition/list',
37
38
  'competition/leaderboard': '/competition/leaderboard',
39
+ 'competition/leaderboardpnl': '/competition/leaderboardpnl',
38
40
  //Coin Gecko Tokens api
39
41
  'info/denom_gecko_map': '/info/denom_gecko_map',
40
42
  //funding
@@ -1,5 +1,25 @@
1
- import { TimeMeta } from "./common";
2
- export interface LeaderboardEntry {
1
+ import { TimeMeta, PageMeta } from "./common";
2
+ export interface CompetitionItem {
3
+ id: string;
4
+ competitionId: string;
5
+ market: string;
6
+ start: string;
7
+ end: string;
8
+ enablePNL: boolean;
9
+ minBalance: number;
10
+ enableVolume: boolean;
11
+ makerIncentive: boolean;
12
+ }
13
+ export interface QueryGetCompetitionListResponse {
14
+ models: CompetitionItem[];
15
+ meta: PageMeta;
16
+ }
17
+ export interface QueryGetCompetitionListRequest {
18
+ limit?: number;
19
+ offset?: number;
20
+ }
21
+ export interface VolumeLeaderboardEntry {
22
+ competitionId: string;
3
23
  address: string;
4
24
  market: string;
5
25
  totalVolume: string;
@@ -7,12 +27,34 @@ export interface LeaderboardEntry {
7
27
  username: string | null;
8
28
  twitter: string | null;
9
29
  }
10
- export interface QueryGetCompetitionLeaderboardResponse {
11
- entries: LeaderboardEntry[];
30
+ export interface QueryGetVolumeCompetitionLeaderboardResponse {
31
+ entries: VolumeLeaderboardEntry[];
32
+ meta: TimeMeta;
33
+ }
34
+ export interface QueryGetVolumeCompetitionLeaderboardRequest {
35
+ competitionId: string;
36
+ market?: string;
37
+ from?: string;
38
+ until?: string;
39
+ }
40
+ export interface PNLLeaderboardEntry {
41
+ competitionId: string;
42
+ address: string;
43
+ market: string;
44
+ realizedPnl: string;
45
+ unrealizedPnl: string;
46
+ initialBalance: string;
47
+ totalPnl: string;
48
+ PnlPercent: string;
49
+ rank: string;
50
+ username: string | null;
51
+ twitter: string | null;
52
+ }
53
+ export interface QueryGetPNLCompetitionLeaderboardResponse {
54
+ entries: PNLLeaderboardEntry[];
12
55
  meta: TimeMeta;
13
56
  }
14
- export interface QueryGetCompetitionLeaderboardRequest {
57
+ export interface QueryGetPNLCompetitionLeaderboardRequest {
58
+ competitionId: string;
15
59
  market?: string;
16
- from: string;
17
- until: string;
18
60
  }
@@ -12,6 +12,7 @@ export declare class AdminModule extends BaseModule {
12
12
  syncToken(params: AdminModule.SyncTokenParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
13
13
  bindToken(params: AdminModule.BindTokenParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
14
14
  unbindToken(params: AdminModule.UnbindTokenParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
15
+ updateToken(params: AdminModule.UpdateTokenParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
15
16
  linkToken(params: AdminModule.LinkTokenParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
16
17
  createMarket(params: AdminModule.CreateMarketParams, opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
17
18
  createMarkets(params: AdminModule.CreateMarketParams[], opts?: CarbonTx.SignTxOpts): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
@@ -64,6 +65,13 @@ export declare namespace AdminModule {
64
65
  bridgeAddress: string;
65
66
  tokenAddress: string;
66
67
  }
68
+ interface UpdateTokenParams {
69
+ denom: string;
70
+ name?: string;
71
+ symbol?: string;
72
+ decimals?: number;
73
+ isActive?: boolean;
74
+ }
67
75
  interface SyncTokenParams {
68
76
  denom: string;
69
77
  }
@@ -105,6 +105,25 @@ class AdminModule extends base_1.default {
105
105
  }, opts);
106
106
  });
107
107
  }
108
+ updateToken(params, opts) {
109
+ return __awaiter(this, void 0, void 0, function* () {
110
+ const wallet = this.getWallet();
111
+ const value = tx_2.MsgUpdateToken.fromPartial({
112
+ updater: wallet.bech32Address,
113
+ denom: params.denom,
114
+ updateTokenParams: {
115
+ name: params.name,
116
+ symbol: params.symbol,
117
+ decimals: params.decimals,
118
+ isActive: params.isActive,
119
+ }
120
+ });
121
+ return yield wallet.sendTx({
122
+ typeUrl: util_1.CarbonTx.Types.MsgUpdateToken,
123
+ value,
124
+ }, opts);
125
+ });
126
+ }
108
127
  linkToken(params, opts) {
109
128
  return __awaiter(this, void 0, void 0, function* () {
110
129
  const wallet = this.getWallet();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-js-sdk",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "TypeScript SDK for Carbon blockchain",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -38,6 +38,7 @@
38
38
  "dependencies": {
39
39
  "@cityofzion/neon-api": "^4.9.0",
40
40
  "@cityofzion/neon-core": "^4.9.0",
41
+ "@cityofzion/neon-js": "^4.9.0",
41
42
  "@cityofzion/neon-core-next": "npm:@cityofzion/neon-core@^5.0.0",
42
43
  "@cosmjs/proto-signing": "^0.28.10",
43
44
  "@cosmjs/stargate": "^0.28.10",