carbon-js-sdk 0.6.1 → 0.6.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.
- package/lib/clients/NEOClient.js +3 -11
- package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.d.ts +76 -0
- package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.js +424 -0
- package/lib/codec/perpsliquidity/event.d.ts +11 -0
- package/lib/codec/perpsliquidity/event.js +61 -1
- package/lib/codec/perpsliquidity/market.d.ts +11 -0
- package/lib/codec/perpsliquidity/market.js +58 -1
- package/lib/codec/perpsliquidity/query.d.ts +29 -4
- package/lib/codec/perpsliquidity/query.js +134 -8
- package/lib/codec/subaccount/legacy.d.ts +19 -0
- package/lib/codec/subaccount/legacy.js +72 -0
- package/lib/modules/erc20.d.ts +4 -0
- package/lib/modules/erc20.js +6 -4
- package/package.json +1 -1
package/lib/clients/NEOClient.js
CHANGED
|
@@ -32,7 +32,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
};
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
34
|
exports.NEOClient = void 0;
|
|
35
|
-
const CarbonSDK_1 = __importDefault(require("../CarbonSDK"));
|
|
36
35
|
const constant_1 = require("../constant");
|
|
37
36
|
const util_1 = require("../util");
|
|
38
37
|
const address_1 = require("../util/address");
|
|
@@ -139,9 +138,7 @@ class NEOClient {
|
|
|
139
138
|
nonce,
|
|
140
139
|
]);
|
|
141
140
|
const rpcUrl = yield this.getProviderUrl();
|
|
142
|
-
const apiProvider =
|
|
143
|
-
? new neon_js_1.api.neonDB.instance("https://api.switcheo.network")
|
|
144
|
-
: new neon_js_1.api.neoCli.instance(rpcUrl);
|
|
141
|
+
const apiProvider = new neon_js_1.api.neoCli.instance(rpcUrl);
|
|
145
142
|
return neon_js_1.api.doInvoke({
|
|
146
143
|
api: apiProvider,
|
|
147
144
|
url: rpcUrl,
|
|
@@ -221,9 +218,7 @@ class NEOClient {
|
|
|
221
218
|
];
|
|
222
219
|
sb.emitAppCall(scriptHash, "lock", data);
|
|
223
220
|
const rpcUrl = yield this.getProviderUrl();
|
|
224
|
-
const apiProvider =
|
|
225
|
-
? new neon_js_1.api.neonDB.instance("https://api.switcheo.network")
|
|
226
|
-
: new neon_js_1.api.neoCli.instance(rpcUrl);
|
|
221
|
+
const apiProvider = new neon_js_1.api.neoCli.instance(rpcUrl);
|
|
227
222
|
let invokeTxConfig = {
|
|
228
223
|
account: Object.assign(Object.assign({}, new Neon.wallet.Account("")), {
|
|
229
224
|
// overwrite the address and public key to values provided by the ledger.
|
|
@@ -285,10 +280,7 @@ class NEOClient {
|
|
|
285
280
|
args: [],
|
|
286
281
|
};
|
|
287
282
|
const script = Neon.sc.createScript(props);
|
|
288
|
-
const
|
|
289
|
-
const apiProvider = networkConfig.network === CarbonSDK_1.default.Network.MainNet
|
|
290
|
-
? new neon_js_1.api.neonDB.instance("https://api.switcheo.network")
|
|
291
|
-
: new neon_js_1.api.neoCli.instance(rpcUrl);
|
|
283
|
+
const apiProvider = new neon_js_1.api.neoCli.instance(rpcUrl);
|
|
292
284
|
const config = {
|
|
293
285
|
api: apiProvider,
|
|
294
286
|
url: rpcUrl,
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import Long from "long";
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { Params } from "../controller/v1/controller";
|
|
4
|
+
import { Params as Params1 } from "../host/v1/host";
|
|
5
|
+
export declare const protobufPackage = "ibc.applications.interchain_accounts.v1";
|
|
6
|
+
/** GenesisState defines the interchain accounts genesis state */
|
|
7
|
+
export interface GenesisState {
|
|
8
|
+
controllerGenesisState?: ControllerGenesisState;
|
|
9
|
+
hostGenesisState?: HostGenesisState;
|
|
10
|
+
}
|
|
11
|
+
/** ControllerGenesisState defines the interchain accounts controller genesis state */
|
|
12
|
+
export interface ControllerGenesisState {
|
|
13
|
+
activeChannels: ActiveChannel[];
|
|
14
|
+
interchainAccounts: RegisteredInterchainAccount[];
|
|
15
|
+
ports: string[];
|
|
16
|
+
params?: Params;
|
|
17
|
+
}
|
|
18
|
+
/** HostGenesisState defines the interchain accounts host genesis state */
|
|
19
|
+
export interface HostGenesisState {
|
|
20
|
+
activeChannels: ActiveChannel[];
|
|
21
|
+
interchainAccounts: RegisteredInterchainAccount[];
|
|
22
|
+
port: string;
|
|
23
|
+
params?: Params1;
|
|
24
|
+
}
|
|
25
|
+
/** ActiveChannel contains a connection ID, port ID and associated active channel ID */
|
|
26
|
+
export interface ActiveChannel {
|
|
27
|
+
connectionId: string;
|
|
28
|
+
portId: string;
|
|
29
|
+
channelId: string;
|
|
30
|
+
}
|
|
31
|
+
/** RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address */
|
|
32
|
+
export interface RegisteredInterchainAccount {
|
|
33
|
+
connectionId: string;
|
|
34
|
+
portId: string;
|
|
35
|
+
accountAddress: string;
|
|
36
|
+
}
|
|
37
|
+
export declare const GenesisState: {
|
|
38
|
+
encode(message: GenesisState, writer?: _m0.Writer): _m0.Writer;
|
|
39
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): GenesisState;
|
|
40
|
+
fromJSON(object: any): GenesisState;
|
|
41
|
+
toJSON(message: GenesisState): unknown;
|
|
42
|
+
fromPartial(object: DeepPartial<GenesisState>): GenesisState;
|
|
43
|
+
};
|
|
44
|
+
export declare const ControllerGenesisState: {
|
|
45
|
+
encode(message: ControllerGenesisState, writer?: _m0.Writer): _m0.Writer;
|
|
46
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ControllerGenesisState;
|
|
47
|
+
fromJSON(object: any): ControllerGenesisState;
|
|
48
|
+
toJSON(message: ControllerGenesisState): unknown;
|
|
49
|
+
fromPartial(object: DeepPartial<ControllerGenesisState>): ControllerGenesisState;
|
|
50
|
+
};
|
|
51
|
+
export declare const HostGenesisState: {
|
|
52
|
+
encode(message: HostGenesisState, writer?: _m0.Writer): _m0.Writer;
|
|
53
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): HostGenesisState;
|
|
54
|
+
fromJSON(object: any): HostGenesisState;
|
|
55
|
+
toJSON(message: HostGenesisState): unknown;
|
|
56
|
+
fromPartial(object: DeepPartial<HostGenesisState>): HostGenesisState;
|
|
57
|
+
};
|
|
58
|
+
export declare const ActiveChannel: {
|
|
59
|
+
encode(message: ActiveChannel, writer?: _m0.Writer): _m0.Writer;
|
|
60
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ActiveChannel;
|
|
61
|
+
fromJSON(object: any): ActiveChannel;
|
|
62
|
+
toJSON(message: ActiveChannel): unknown;
|
|
63
|
+
fromPartial(object: DeepPartial<ActiveChannel>): ActiveChannel;
|
|
64
|
+
};
|
|
65
|
+
export declare const RegisteredInterchainAccount: {
|
|
66
|
+
encode(message: RegisteredInterchainAccount, writer?: _m0.Writer): _m0.Writer;
|
|
67
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RegisteredInterchainAccount;
|
|
68
|
+
fromJSON(object: any): RegisteredInterchainAccount;
|
|
69
|
+
toJSON(message: RegisteredInterchainAccount): unknown;
|
|
70
|
+
fromPartial(object: DeepPartial<RegisteredInterchainAccount>): RegisteredInterchainAccount;
|
|
71
|
+
};
|
|
72
|
+
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
73
|
+
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 {} ? {
|
|
74
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
75
|
+
} : Partial<T>;
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,424 @@
|
|
|
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.RegisteredInterchainAccount = exports.ActiveChannel = exports.HostGenesisState = exports.ControllerGenesisState = exports.GenesisState = exports.protobufPackage = void 0;
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
9
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
+
const controller_1 = require("../controller/v1/controller");
|
|
11
|
+
const host_1 = require("../host/v1/host");
|
|
12
|
+
exports.protobufPackage = "ibc.applications.interchain_accounts.v1";
|
|
13
|
+
const baseGenesisState = {};
|
|
14
|
+
exports.GenesisState = {
|
|
15
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
16
|
+
if (message.controllerGenesisState !== undefined) {
|
|
17
|
+
exports.ControllerGenesisState.encode(message.controllerGenesisState, writer.uint32(10).fork()).ldelim();
|
|
18
|
+
}
|
|
19
|
+
if (message.hostGenesisState !== undefined) {
|
|
20
|
+
exports.HostGenesisState.encode(message.hostGenesisState, writer.uint32(18).fork()).ldelim();
|
|
21
|
+
}
|
|
22
|
+
return writer;
|
|
23
|
+
},
|
|
24
|
+
decode(input, length) {
|
|
25
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
26
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
27
|
+
const message = Object.assign({}, baseGenesisState);
|
|
28
|
+
while (reader.pos < end) {
|
|
29
|
+
const tag = reader.uint32();
|
|
30
|
+
switch (tag >>> 3) {
|
|
31
|
+
case 1:
|
|
32
|
+
message.controllerGenesisState = exports.ControllerGenesisState.decode(reader, reader.uint32());
|
|
33
|
+
break;
|
|
34
|
+
case 2:
|
|
35
|
+
message.hostGenesisState = exports.HostGenesisState.decode(reader, reader.uint32());
|
|
36
|
+
break;
|
|
37
|
+
default:
|
|
38
|
+
reader.skipType(tag & 7);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return message;
|
|
43
|
+
},
|
|
44
|
+
fromJSON(object) {
|
|
45
|
+
const message = Object.assign({}, baseGenesisState);
|
|
46
|
+
message.controllerGenesisState =
|
|
47
|
+
object.controllerGenesisState !== undefined &&
|
|
48
|
+
object.controllerGenesisState !== null
|
|
49
|
+
? exports.ControllerGenesisState.fromJSON(object.controllerGenesisState)
|
|
50
|
+
: undefined;
|
|
51
|
+
message.hostGenesisState =
|
|
52
|
+
object.hostGenesisState !== undefined && object.hostGenesisState !== null
|
|
53
|
+
? exports.HostGenesisState.fromJSON(object.hostGenesisState)
|
|
54
|
+
: undefined;
|
|
55
|
+
return message;
|
|
56
|
+
},
|
|
57
|
+
toJSON(message) {
|
|
58
|
+
const obj = {};
|
|
59
|
+
message.controllerGenesisState !== undefined &&
|
|
60
|
+
(obj.controllerGenesisState = message.controllerGenesisState
|
|
61
|
+
? exports.ControllerGenesisState.toJSON(message.controllerGenesisState)
|
|
62
|
+
: undefined);
|
|
63
|
+
message.hostGenesisState !== undefined &&
|
|
64
|
+
(obj.hostGenesisState = message.hostGenesisState
|
|
65
|
+
? exports.HostGenesisState.toJSON(message.hostGenesisState)
|
|
66
|
+
: undefined);
|
|
67
|
+
return obj;
|
|
68
|
+
},
|
|
69
|
+
fromPartial(object) {
|
|
70
|
+
const message = Object.assign({}, baseGenesisState);
|
|
71
|
+
message.controllerGenesisState =
|
|
72
|
+
object.controllerGenesisState !== undefined &&
|
|
73
|
+
object.controllerGenesisState !== null
|
|
74
|
+
? exports.ControllerGenesisState.fromPartial(object.controllerGenesisState)
|
|
75
|
+
: undefined;
|
|
76
|
+
message.hostGenesisState =
|
|
77
|
+
object.hostGenesisState !== undefined && object.hostGenesisState !== null
|
|
78
|
+
? exports.HostGenesisState.fromPartial(object.hostGenesisState)
|
|
79
|
+
: undefined;
|
|
80
|
+
return message;
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
const baseControllerGenesisState = { ports: "" };
|
|
84
|
+
exports.ControllerGenesisState = {
|
|
85
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
86
|
+
for (const v of message.activeChannels) {
|
|
87
|
+
exports.ActiveChannel.encode(v, writer.uint32(10).fork()).ldelim();
|
|
88
|
+
}
|
|
89
|
+
for (const v of message.interchainAccounts) {
|
|
90
|
+
exports.RegisteredInterchainAccount.encode(v, writer.uint32(18).fork()).ldelim();
|
|
91
|
+
}
|
|
92
|
+
for (const v of message.ports) {
|
|
93
|
+
writer.uint32(26).string(v);
|
|
94
|
+
}
|
|
95
|
+
if (message.params !== undefined) {
|
|
96
|
+
controller_1.Params.encode(message.params, writer.uint32(34).fork()).ldelim();
|
|
97
|
+
}
|
|
98
|
+
return writer;
|
|
99
|
+
},
|
|
100
|
+
decode(input, length) {
|
|
101
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
102
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
103
|
+
const message = Object.assign({}, baseControllerGenesisState);
|
|
104
|
+
message.activeChannels = [];
|
|
105
|
+
message.interchainAccounts = [];
|
|
106
|
+
message.ports = [];
|
|
107
|
+
while (reader.pos < end) {
|
|
108
|
+
const tag = reader.uint32();
|
|
109
|
+
switch (tag >>> 3) {
|
|
110
|
+
case 1:
|
|
111
|
+
message.activeChannels.push(exports.ActiveChannel.decode(reader, reader.uint32()));
|
|
112
|
+
break;
|
|
113
|
+
case 2:
|
|
114
|
+
message.interchainAccounts.push(exports.RegisteredInterchainAccount.decode(reader, reader.uint32()));
|
|
115
|
+
break;
|
|
116
|
+
case 3:
|
|
117
|
+
message.ports.push(reader.string());
|
|
118
|
+
break;
|
|
119
|
+
case 4:
|
|
120
|
+
message.params = controller_1.Params.decode(reader, reader.uint32());
|
|
121
|
+
break;
|
|
122
|
+
default:
|
|
123
|
+
reader.skipType(tag & 7);
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return message;
|
|
128
|
+
},
|
|
129
|
+
fromJSON(object) {
|
|
130
|
+
var _a, _b, _c;
|
|
131
|
+
const message = Object.assign({}, baseControllerGenesisState);
|
|
132
|
+
message.activeChannels = ((_a = object.activeChannels) !== null && _a !== void 0 ? _a : []).map((e) => exports.ActiveChannel.fromJSON(e));
|
|
133
|
+
message.interchainAccounts = ((_b = object.interchainAccounts) !== null && _b !== void 0 ? _b : []).map((e) => exports.RegisteredInterchainAccount.fromJSON(e));
|
|
134
|
+
message.ports = ((_c = object.ports) !== null && _c !== void 0 ? _c : []).map((e) => String(e));
|
|
135
|
+
message.params =
|
|
136
|
+
object.params !== undefined && object.params !== null
|
|
137
|
+
? controller_1.Params.fromJSON(object.params)
|
|
138
|
+
: undefined;
|
|
139
|
+
return message;
|
|
140
|
+
},
|
|
141
|
+
toJSON(message) {
|
|
142
|
+
const obj = {};
|
|
143
|
+
if (message.activeChannels) {
|
|
144
|
+
obj.activeChannels = message.activeChannels.map((e) => e ? exports.ActiveChannel.toJSON(e) : undefined);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
obj.activeChannels = [];
|
|
148
|
+
}
|
|
149
|
+
if (message.interchainAccounts) {
|
|
150
|
+
obj.interchainAccounts = message.interchainAccounts.map((e) => e ? exports.RegisteredInterchainAccount.toJSON(e) : undefined);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
obj.interchainAccounts = [];
|
|
154
|
+
}
|
|
155
|
+
if (message.ports) {
|
|
156
|
+
obj.ports = message.ports.map((e) => e);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
obj.ports = [];
|
|
160
|
+
}
|
|
161
|
+
message.params !== undefined &&
|
|
162
|
+
(obj.params = message.params ? controller_1.Params.toJSON(message.params) : undefined);
|
|
163
|
+
return obj;
|
|
164
|
+
},
|
|
165
|
+
fromPartial(object) {
|
|
166
|
+
var _a, _b, _c;
|
|
167
|
+
const message = Object.assign({}, baseControllerGenesisState);
|
|
168
|
+
message.activeChannels = ((_a = object.activeChannels) !== null && _a !== void 0 ? _a : []).map((e) => exports.ActiveChannel.fromPartial(e));
|
|
169
|
+
message.interchainAccounts = ((_b = object.interchainAccounts) !== null && _b !== void 0 ? _b : []).map((e) => exports.RegisteredInterchainAccount.fromPartial(e));
|
|
170
|
+
message.ports = ((_c = object.ports) !== null && _c !== void 0 ? _c : []).map((e) => e);
|
|
171
|
+
message.params =
|
|
172
|
+
object.params !== undefined && object.params !== null
|
|
173
|
+
? controller_1.Params.fromPartial(object.params)
|
|
174
|
+
: undefined;
|
|
175
|
+
return message;
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
const baseHostGenesisState = { port: "" };
|
|
179
|
+
exports.HostGenesisState = {
|
|
180
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
181
|
+
for (const v of message.activeChannels) {
|
|
182
|
+
exports.ActiveChannel.encode(v, writer.uint32(10).fork()).ldelim();
|
|
183
|
+
}
|
|
184
|
+
for (const v of message.interchainAccounts) {
|
|
185
|
+
exports.RegisteredInterchainAccount.encode(v, writer.uint32(18).fork()).ldelim();
|
|
186
|
+
}
|
|
187
|
+
if (message.port !== "") {
|
|
188
|
+
writer.uint32(26).string(message.port);
|
|
189
|
+
}
|
|
190
|
+
if (message.params !== undefined) {
|
|
191
|
+
host_1.Params.encode(message.params, writer.uint32(34).fork()).ldelim();
|
|
192
|
+
}
|
|
193
|
+
return writer;
|
|
194
|
+
},
|
|
195
|
+
decode(input, length) {
|
|
196
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
197
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
198
|
+
const message = Object.assign({}, baseHostGenesisState);
|
|
199
|
+
message.activeChannels = [];
|
|
200
|
+
message.interchainAccounts = [];
|
|
201
|
+
while (reader.pos < end) {
|
|
202
|
+
const tag = reader.uint32();
|
|
203
|
+
switch (tag >>> 3) {
|
|
204
|
+
case 1:
|
|
205
|
+
message.activeChannels.push(exports.ActiveChannel.decode(reader, reader.uint32()));
|
|
206
|
+
break;
|
|
207
|
+
case 2:
|
|
208
|
+
message.interchainAccounts.push(exports.RegisteredInterchainAccount.decode(reader, reader.uint32()));
|
|
209
|
+
break;
|
|
210
|
+
case 3:
|
|
211
|
+
message.port = reader.string();
|
|
212
|
+
break;
|
|
213
|
+
case 4:
|
|
214
|
+
message.params = host_1.Params.decode(reader, reader.uint32());
|
|
215
|
+
break;
|
|
216
|
+
default:
|
|
217
|
+
reader.skipType(tag & 7);
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return message;
|
|
222
|
+
},
|
|
223
|
+
fromJSON(object) {
|
|
224
|
+
var _a, _b;
|
|
225
|
+
const message = Object.assign({}, baseHostGenesisState);
|
|
226
|
+
message.activeChannels = ((_a = object.activeChannels) !== null && _a !== void 0 ? _a : []).map((e) => exports.ActiveChannel.fromJSON(e));
|
|
227
|
+
message.interchainAccounts = ((_b = object.interchainAccounts) !== null && _b !== void 0 ? _b : []).map((e) => exports.RegisteredInterchainAccount.fromJSON(e));
|
|
228
|
+
message.port =
|
|
229
|
+
object.port !== undefined && object.port !== null
|
|
230
|
+
? String(object.port)
|
|
231
|
+
: "";
|
|
232
|
+
message.params =
|
|
233
|
+
object.params !== undefined && object.params !== null
|
|
234
|
+
? host_1.Params.fromJSON(object.params)
|
|
235
|
+
: undefined;
|
|
236
|
+
return message;
|
|
237
|
+
},
|
|
238
|
+
toJSON(message) {
|
|
239
|
+
const obj = {};
|
|
240
|
+
if (message.activeChannels) {
|
|
241
|
+
obj.activeChannels = message.activeChannels.map((e) => e ? exports.ActiveChannel.toJSON(e) : undefined);
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
obj.activeChannels = [];
|
|
245
|
+
}
|
|
246
|
+
if (message.interchainAccounts) {
|
|
247
|
+
obj.interchainAccounts = message.interchainAccounts.map((e) => e ? exports.RegisteredInterchainAccount.toJSON(e) : undefined);
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
obj.interchainAccounts = [];
|
|
251
|
+
}
|
|
252
|
+
message.port !== undefined && (obj.port = message.port);
|
|
253
|
+
message.params !== undefined &&
|
|
254
|
+
(obj.params = message.params
|
|
255
|
+
? host_1.Params.toJSON(message.params)
|
|
256
|
+
: undefined);
|
|
257
|
+
return obj;
|
|
258
|
+
},
|
|
259
|
+
fromPartial(object) {
|
|
260
|
+
var _a, _b, _c;
|
|
261
|
+
const message = Object.assign({}, baseHostGenesisState);
|
|
262
|
+
message.activeChannels = ((_a = object.activeChannels) !== null && _a !== void 0 ? _a : []).map((e) => exports.ActiveChannel.fromPartial(e));
|
|
263
|
+
message.interchainAccounts = ((_b = object.interchainAccounts) !== null && _b !== void 0 ? _b : []).map((e) => exports.RegisteredInterchainAccount.fromPartial(e));
|
|
264
|
+
message.port = (_c = object.port) !== null && _c !== void 0 ? _c : "";
|
|
265
|
+
message.params =
|
|
266
|
+
object.params !== undefined && object.params !== null
|
|
267
|
+
? host_1.Params.fromPartial(object.params)
|
|
268
|
+
: undefined;
|
|
269
|
+
return message;
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
const baseActiveChannel = {
|
|
273
|
+
connectionId: "",
|
|
274
|
+
portId: "",
|
|
275
|
+
channelId: "",
|
|
276
|
+
};
|
|
277
|
+
exports.ActiveChannel = {
|
|
278
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
279
|
+
if (message.connectionId !== "") {
|
|
280
|
+
writer.uint32(10).string(message.connectionId);
|
|
281
|
+
}
|
|
282
|
+
if (message.portId !== "") {
|
|
283
|
+
writer.uint32(18).string(message.portId);
|
|
284
|
+
}
|
|
285
|
+
if (message.channelId !== "") {
|
|
286
|
+
writer.uint32(26).string(message.channelId);
|
|
287
|
+
}
|
|
288
|
+
return writer;
|
|
289
|
+
},
|
|
290
|
+
decode(input, length) {
|
|
291
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
292
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
293
|
+
const message = Object.assign({}, baseActiveChannel);
|
|
294
|
+
while (reader.pos < end) {
|
|
295
|
+
const tag = reader.uint32();
|
|
296
|
+
switch (tag >>> 3) {
|
|
297
|
+
case 1:
|
|
298
|
+
message.connectionId = reader.string();
|
|
299
|
+
break;
|
|
300
|
+
case 2:
|
|
301
|
+
message.portId = reader.string();
|
|
302
|
+
break;
|
|
303
|
+
case 3:
|
|
304
|
+
message.channelId = reader.string();
|
|
305
|
+
break;
|
|
306
|
+
default:
|
|
307
|
+
reader.skipType(tag & 7);
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return message;
|
|
312
|
+
},
|
|
313
|
+
fromJSON(object) {
|
|
314
|
+
const message = Object.assign({}, baseActiveChannel);
|
|
315
|
+
message.connectionId =
|
|
316
|
+
object.connectionId !== undefined && object.connectionId !== null
|
|
317
|
+
? String(object.connectionId)
|
|
318
|
+
: "";
|
|
319
|
+
message.portId =
|
|
320
|
+
object.portId !== undefined && object.portId !== null
|
|
321
|
+
? String(object.portId)
|
|
322
|
+
: "";
|
|
323
|
+
message.channelId =
|
|
324
|
+
object.channelId !== undefined && object.channelId !== null
|
|
325
|
+
? String(object.channelId)
|
|
326
|
+
: "";
|
|
327
|
+
return message;
|
|
328
|
+
},
|
|
329
|
+
toJSON(message) {
|
|
330
|
+
const obj = {};
|
|
331
|
+
message.connectionId !== undefined &&
|
|
332
|
+
(obj.connectionId = message.connectionId);
|
|
333
|
+
message.portId !== undefined && (obj.portId = message.portId);
|
|
334
|
+
message.channelId !== undefined && (obj.channelId = message.channelId);
|
|
335
|
+
return obj;
|
|
336
|
+
},
|
|
337
|
+
fromPartial(object) {
|
|
338
|
+
var _a, _b, _c;
|
|
339
|
+
const message = Object.assign({}, baseActiveChannel);
|
|
340
|
+
message.connectionId = (_a = object.connectionId) !== null && _a !== void 0 ? _a : "";
|
|
341
|
+
message.portId = (_b = object.portId) !== null && _b !== void 0 ? _b : "";
|
|
342
|
+
message.channelId = (_c = object.channelId) !== null && _c !== void 0 ? _c : "";
|
|
343
|
+
return message;
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
const baseRegisteredInterchainAccount = {
|
|
347
|
+
connectionId: "",
|
|
348
|
+
portId: "",
|
|
349
|
+
accountAddress: "",
|
|
350
|
+
};
|
|
351
|
+
exports.RegisteredInterchainAccount = {
|
|
352
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
353
|
+
if (message.connectionId !== "") {
|
|
354
|
+
writer.uint32(10).string(message.connectionId);
|
|
355
|
+
}
|
|
356
|
+
if (message.portId !== "") {
|
|
357
|
+
writer.uint32(18).string(message.portId);
|
|
358
|
+
}
|
|
359
|
+
if (message.accountAddress !== "") {
|
|
360
|
+
writer.uint32(26).string(message.accountAddress);
|
|
361
|
+
}
|
|
362
|
+
return writer;
|
|
363
|
+
},
|
|
364
|
+
decode(input, length) {
|
|
365
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
366
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
367
|
+
const message = Object.assign({}, baseRegisteredInterchainAccount);
|
|
368
|
+
while (reader.pos < end) {
|
|
369
|
+
const tag = reader.uint32();
|
|
370
|
+
switch (tag >>> 3) {
|
|
371
|
+
case 1:
|
|
372
|
+
message.connectionId = reader.string();
|
|
373
|
+
break;
|
|
374
|
+
case 2:
|
|
375
|
+
message.portId = reader.string();
|
|
376
|
+
break;
|
|
377
|
+
case 3:
|
|
378
|
+
message.accountAddress = reader.string();
|
|
379
|
+
break;
|
|
380
|
+
default:
|
|
381
|
+
reader.skipType(tag & 7);
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return message;
|
|
386
|
+
},
|
|
387
|
+
fromJSON(object) {
|
|
388
|
+
const message = Object.assign({}, baseRegisteredInterchainAccount);
|
|
389
|
+
message.connectionId =
|
|
390
|
+
object.connectionId !== undefined && object.connectionId !== null
|
|
391
|
+
? String(object.connectionId)
|
|
392
|
+
: "";
|
|
393
|
+
message.portId =
|
|
394
|
+
object.portId !== undefined && object.portId !== null
|
|
395
|
+
? String(object.portId)
|
|
396
|
+
: "";
|
|
397
|
+
message.accountAddress =
|
|
398
|
+
object.accountAddress !== undefined && object.accountAddress !== null
|
|
399
|
+
? String(object.accountAddress)
|
|
400
|
+
: "";
|
|
401
|
+
return message;
|
|
402
|
+
},
|
|
403
|
+
toJSON(message) {
|
|
404
|
+
const obj = {};
|
|
405
|
+
message.connectionId !== undefined &&
|
|
406
|
+
(obj.connectionId = message.connectionId);
|
|
407
|
+
message.portId !== undefined && (obj.portId = message.portId);
|
|
408
|
+
message.accountAddress !== undefined &&
|
|
409
|
+
(obj.accountAddress = message.accountAddress);
|
|
410
|
+
return obj;
|
|
411
|
+
},
|
|
412
|
+
fromPartial(object) {
|
|
413
|
+
var _a, _b, _c;
|
|
414
|
+
const message = Object.assign({}, baseRegisteredInterchainAccount);
|
|
415
|
+
message.connectionId = (_a = object.connectionId) !== null && _a !== void 0 ? _a : "";
|
|
416
|
+
message.portId = (_b = object.portId) !== null && _b !== void 0 ? _b : "";
|
|
417
|
+
message.accountAddress = (_c = object.accountAddress) !== null && _c !== void 0 ? _c : "";
|
|
418
|
+
return message;
|
|
419
|
+
},
|
|
420
|
+
};
|
|
421
|
+
if (minimal_1.default.util.Long !== long_1.default) {
|
|
422
|
+
minimal_1.default.util.Long = long_1.default;
|
|
423
|
+
minimal_1.default.configure();
|
|
424
|
+
}
|
|
@@ -41,6 +41,10 @@ export interface WithdrawFromPoolEvent {
|
|
|
41
41
|
shareAmount: string;
|
|
42
42
|
withdrawer: string;
|
|
43
43
|
}
|
|
44
|
+
export interface UpdateMarketUtilizationMultiplierEvent {
|
|
45
|
+
market: string;
|
|
46
|
+
multiplier: string;
|
|
47
|
+
}
|
|
44
48
|
export declare const SetPoolEvent: {
|
|
45
49
|
encode(message: SetPoolEvent, writer?: _m0.Writer): _m0.Writer;
|
|
46
50
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SetPoolEvent;
|
|
@@ -97,6 +101,13 @@ export declare const WithdrawFromPoolEvent: {
|
|
|
97
101
|
toJSON(message: WithdrawFromPoolEvent): unknown;
|
|
98
102
|
fromPartial(object: DeepPartial<WithdrawFromPoolEvent>): WithdrawFromPoolEvent;
|
|
99
103
|
};
|
|
104
|
+
export declare const UpdateMarketUtilizationMultiplierEvent: {
|
|
105
|
+
encode(message: UpdateMarketUtilizationMultiplierEvent, writer?: _m0.Writer): _m0.Writer;
|
|
106
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UpdateMarketUtilizationMultiplierEvent;
|
|
107
|
+
fromJSON(object: any): UpdateMarketUtilizationMultiplierEvent;
|
|
108
|
+
toJSON(message: UpdateMarketUtilizationMultiplierEvent): unknown;
|
|
109
|
+
fromPartial(object: DeepPartial<UpdateMarketUtilizationMultiplierEvent>): UpdateMarketUtilizationMultiplierEvent;
|
|
110
|
+
};
|
|
100
111
|
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
101
112
|
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 {} ? {
|
|
102
113
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.WithdrawFromPoolEvent = exports.DepositToPoolEvent = exports.SetMarketConfigEvent = exports.DeregisterFromPoolEvent = exports.RegisterToPoolEvent = exports.UpdatePoolEvent = exports.NewPoolEvent = exports.SetPoolEvent = exports.protobufPackage = void 0;
|
|
6
|
+
exports.UpdateMarketUtilizationMultiplierEvent = exports.WithdrawFromPoolEvent = exports.DepositToPoolEvent = exports.SetMarketConfigEvent = exports.DeregisterFromPoolEvent = exports.RegisterToPoolEvent = exports.UpdatePoolEvent = exports.NewPoolEvent = exports.SetPoolEvent = exports.protobufPackage = void 0;
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
@@ -591,6 +591,66 @@ exports.WithdrawFromPoolEvent = {
|
|
|
591
591
|
return message;
|
|
592
592
|
},
|
|
593
593
|
};
|
|
594
|
+
const baseUpdateMarketUtilizationMultiplierEvent = {
|
|
595
|
+
market: "",
|
|
596
|
+
multiplier: "",
|
|
597
|
+
};
|
|
598
|
+
exports.UpdateMarketUtilizationMultiplierEvent = {
|
|
599
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
600
|
+
if (message.market !== "") {
|
|
601
|
+
writer.uint32(10).string(message.market);
|
|
602
|
+
}
|
|
603
|
+
if (message.multiplier !== "") {
|
|
604
|
+
writer.uint32(18).string(message.multiplier);
|
|
605
|
+
}
|
|
606
|
+
return writer;
|
|
607
|
+
},
|
|
608
|
+
decode(input, length) {
|
|
609
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
610
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
611
|
+
const message = Object.assign({}, baseUpdateMarketUtilizationMultiplierEvent);
|
|
612
|
+
while (reader.pos < end) {
|
|
613
|
+
const tag = reader.uint32();
|
|
614
|
+
switch (tag >>> 3) {
|
|
615
|
+
case 1:
|
|
616
|
+
message.market = reader.string();
|
|
617
|
+
break;
|
|
618
|
+
case 2:
|
|
619
|
+
message.multiplier = reader.string();
|
|
620
|
+
break;
|
|
621
|
+
default:
|
|
622
|
+
reader.skipType(tag & 7);
|
|
623
|
+
break;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
return message;
|
|
627
|
+
},
|
|
628
|
+
fromJSON(object) {
|
|
629
|
+
const message = Object.assign({}, baseUpdateMarketUtilizationMultiplierEvent);
|
|
630
|
+
message.market =
|
|
631
|
+
object.market !== undefined && object.market !== null
|
|
632
|
+
? String(object.market)
|
|
633
|
+
: "";
|
|
634
|
+
message.multiplier =
|
|
635
|
+
object.multiplier !== undefined && object.multiplier !== null
|
|
636
|
+
? String(object.multiplier)
|
|
637
|
+
: "";
|
|
638
|
+
return message;
|
|
639
|
+
},
|
|
640
|
+
toJSON(message) {
|
|
641
|
+
const obj = {};
|
|
642
|
+
message.market !== undefined && (obj.market = message.market);
|
|
643
|
+
message.multiplier !== undefined && (obj.multiplier = message.multiplier);
|
|
644
|
+
return obj;
|
|
645
|
+
},
|
|
646
|
+
fromPartial(object) {
|
|
647
|
+
var _a, _b;
|
|
648
|
+
const message = Object.assign({}, baseUpdateMarketUtilizationMultiplierEvent);
|
|
649
|
+
message.market = (_a = object.market) !== null && _a !== void 0 ? _a : "";
|
|
650
|
+
message.multiplier = (_b = object.multiplier) !== null && _b !== void 0 ? _b : "";
|
|
651
|
+
return message;
|
|
652
|
+
},
|
|
653
|
+
};
|
|
594
654
|
if (minimal_1.default.util.Long !== long_1.default) {
|
|
595
655
|
minimal_1.default.util.Long = long_1.default;
|
|
596
656
|
minimal_1.default.configure();
|
|
@@ -38,6 +38,10 @@ export interface TWAMarketUtilizationRate {
|
|
|
38
38
|
lastUpdatedAt?: Date;
|
|
39
39
|
twaUtilizationRate: string;
|
|
40
40
|
}
|
|
41
|
+
export interface MarketUtilizationMultiplier {
|
|
42
|
+
market: string;
|
|
43
|
+
multiplier: string;
|
|
44
|
+
}
|
|
41
45
|
export declare const Quote: {
|
|
42
46
|
encode(message: Quote, writer?: _m0.Writer): _m0.Writer;
|
|
43
47
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Quote;
|
|
@@ -66,6 +70,13 @@ export declare const TWAMarketUtilizationRate: {
|
|
|
66
70
|
toJSON(message: TWAMarketUtilizationRate): unknown;
|
|
67
71
|
fromPartial(object: DeepPartial<TWAMarketUtilizationRate>): TWAMarketUtilizationRate;
|
|
68
72
|
};
|
|
73
|
+
export declare const MarketUtilizationMultiplier: {
|
|
74
|
+
encode(message: MarketUtilizationMultiplier, writer?: _m0.Writer): _m0.Writer;
|
|
75
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MarketUtilizationMultiplier;
|
|
76
|
+
fromJSON(object: any): MarketUtilizationMultiplier;
|
|
77
|
+
toJSON(message: MarketUtilizationMultiplier): unknown;
|
|
78
|
+
fromPartial(object: DeepPartial<MarketUtilizationMultiplier>): MarketUtilizationMultiplier;
|
|
79
|
+
};
|
|
69
80
|
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
70
81
|
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 {} ? {
|
|
71
82
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TWAMarketUtilizationRate = exports.UpdateMarketConfigParams = exports.MarketConfig = exports.Quote = exports.protobufPackage = void 0;
|
|
6
|
+
exports.MarketUtilizationMultiplier = exports.TWAMarketUtilizationRate = exports.UpdateMarketConfigParams = exports.MarketConfig = exports.Quote = exports.protobufPackage = void 0;
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
@@ -344,6 +344,63 @@ exports.TWAMarketUtilizationRate = {
|
|
|
344
344
|
return message;
|
|
345
345
|
},
|
|
346
346
|
};
|
|
347
|
+
const baseMarketUtilizationMultiplier = { market: "", multiplier: "" };
|
|
348
|
+
exports.MarketUtilizationMultiplier = {
|
|
349
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
350
|
+
if (message.market !== "") {
|
|
351
|
+
writer.uint32(10).string(message.market);
|
|
352
|
+
}
|
|
353
|
+
if (message.multiplier !== "") {
|
|
354
|
+
writer.uint32(18).string(message.multiplier);
|
|
355
|
+
}
|
|
356
|
+
return writer;
|
|
357
|
+
},
|
|
358
|
+
decode(input, length) {
|
|
359
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
360
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
361
|
+
const message = Object.assign({}, baseMarketUtilizationMultiplier);
|
|
362
|
+
while (reader.pos < end) {
|
|
363
|
+
const tag = reader.uint32();
|
|
364
|
+
switch (tag >>> 3) {
|
|
365
|
+
case 1:
|
|
366
|
+
message.market = reader.string();
|
|
367
|
+
break;
|
|
368
|
+
case 2:
|
|
369
|
+
message.multiplier = reader.string();
|
|
370
|
+
break;
|
|
371
|
+
default:
|
|
372
|
+
reader.skipType(tag & 7);
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return message;
|
|
377
|
+
},
|
|
378
|
+
fromJSON(object) {
|
|
379
|
+
const message = Object.assign({}, baseMarketUtilizationMultiplier);
|
|
380
|
+
message.market =
|
|
381
|
+
object.market !== undefined && object.market !== null
|
|
382
|
+
? String(object.market)
|
|
383
|
+
: "";
|
|
384
|
+
message.multiplier =
|
|
385
|
+
object.multiplier !== undefined && object.multiplier !== null
|
|
386
|
+
? String(object.multiplier)
|
|
387
|
+
: "";
|
|
388
|
+
return message;
|
|
389
|
+
},
|
|
390
|
+
toJSON(message) {
|
|
391
|
+
const obj = {};
|
|
392
|
+
message.market !== undefined && (obj.market = message.market);
|
|
393
|
+
message.multiplier !== undefined && (obj.multiplier = message.multiplier);
|
|
394
|
+
return obj;
|
|
395
|
+
},
|
|
396
|
+
fromPartial(object) {
|
|
397
|
+
var _a, _b;
|
|
398
|
+
const message = Object.assign({}, baseMarketUtilizationMultiplier);
|
|
399
|
+
message.market = (_a = object.market) !== null && _a !== void 0 ? _a : "";
|
|
400
|
+
message.multiplier = (_b = object.multiplier) !== null && _b !== void 0 ? _b : "";
|
|
401
|
+
return message;
|
|
402
|
+
},
|
|
403
|
+
};
|
|
347
404
|
function toTimestamp(date) {
|
|
348
405
|
const seconds = numberToLong(date.getTime() / 1000);
|
|
349
406
|
const nanos = (date.getTime() % 1000) * 1000000;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { PageRequest, PageResponse } from "../cosmos/base/query/v1beta1/pagination";
|
|
3
4
|
import { Params } from "./params";
|
|
4
5
|
import { PoolDetails } from "./pool";
|
|
5
|
-
import {
|
|
6
|
+
import { MarketUtilizationMultiplier } from "./market";
|
|
6
7
|
export declare const protobufPackage = "Switcheo.carbon.perpsliquidity";
|
|
8
|
+
export interface QueryAllPlPoolMarketUtilizationMultiplierRequest {
|
|
9
|
+
pagination?: PageRequest;
|
|
10
|
+
}
|
|
11
|
+
export interface QueryAllPlPoolMarketUtilizationMultiplierResponse {
|
|
12
|
+
marketsUtilizationMultiplier: MarketUtilizationMultiplier[];
|
|
13
|
+
pagination?: PageResponse;
|
|
14
|
+
}
|
|
7
15
|
/** QueryParamsRequest is request type for the Query/Params RPC method. */
|
|
8
16
|
export interface QueryParamsRequest {
|
|
9
17
|
}
|
|
@@ -68,6 +76,20 @@ export interface QueryAllPLPoolInfoResponse {
|
|
|
68
76
|
pools: QueryPLPoolInfoResponse[];
|
|
69
77
|
pagination?: PageResponse;
|
|
70
78
|
}
|
|
79
|
+
export declare const QueryAllPlPoolMarketUtilizationMultiplierRequest: {
|
|
80
|
+
encode(message: QueryAllPlPoolMarketUtilizationMultiplierRequest, writer?: _m0.Writer): _m0.Writer;
|
|
81
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryAllPlPoolMarketUtilizationMultiplierRequest;
|
|
82
|
+
fromJSON(object: any): QueryAllPlPoolMarketUtilizationMultiplierRequest;
|
|
83
|
+
toJSON(message: QueryAllPlPoolMarketUtilizationMultiplierRequest): unknown;
|
|
84
|
+
fromPartial(object: DeepPartial<QueryAllPlPoolMarketUtilizationMultiplierRequest>): QueryAllPlPoolMarketUtilizationMultiplierRequest;
|
|
85
|
+
};
|
|
86
|
+
export declare const QueryAllPlPoolMarketUtilizationMultiplierResponse: {
|
|
87
|
+
encode(message: QueryAllPlPoolMarketUtilizationMultiplierResponse, writer?: _m0.Writer): _m0.Writer;
|
|
88
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryAllPlPoolMarketUtilizationMultiplierResponse;
|
|
89
|
+
fromJSON(object: any): QueryAllPlPoolMarketUtilizationMultiplierResponse;
|
|
90
|
+
toJSON(message: QueryAllPlPoolMarketUtilizationMultiplierResponse): unknown;
|
|
91
|
+
fromPartial(object: DeepPartial<QueryAllPlPoolMarketUtilizationMultiplierResponse>): QueryAllPlPoolMarketUtilizationMultiplierResponse;
|
|
92
|
+
};
|
|
71
93
|
export declare const QueryParamsRequest: {
|
|
72
94
|
encode(_: QueryParamsRequest, writer?: _m0.Writer): _m0.Writer;
|
|
73
95
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueryParamsRequest;
|
|
@@ -191,14 +213,16 @@ export interface Query {
|
|
|
191
213
|
* Get statistical amounts for a particular pool id
|
|
192
214
|
*/
|
|
193
215
|
PoolInfoAll(request: QueryAllPLPoolInfoRequest): Promise<QueryAllPLPoolInfoResponse>;
|
|
216
|
+
/** Get addresses for all plp pools */
|
|
217
|
+
PoolAddressAll(request: QueryAllPlPoolAddressRequest): Promise<QueryAllPlPoolAddressResponse>;
|
|
218
|
+
/** Get markets utilization multiplier for all plp pools-linked markets */
|
|
219
|
+
PoolMarketUtilizationMultiplierAll(request: QueryAllPlPoolMarketUtilizationMultiplierRequest): Promise<QueryAllPlPoolMarketUtilizationMultiplierResponse>;
|
|
194
220
|
/** Get Pool details for a particular id */
|
|
195
221
|
Pool(request: QueryGetPlPoolRequest): Promise<QueryGetPlPoolResponse>;
|
|
196
222
|
/** Get all Pool details */
|
|
197
223
|
PoolAll(request: QueryAllPlPoolsRequest): Promise<QueryAllPlPoolsResponse>;
|
|
198
224
|
/** Get denom => pool_id mappings */
|
|
199
225
|
PoolMappings(request: QueryPlPoolMappingsRequest): Promise<QueryPlPoolMappingsResponse>;
|
|
200
|
-
/** Get addresses for all plp pools */
|
|
201
|
-
PoolAddressAll(request: QueryAllPlPoolAddressRequest): Promise<QueryAllPlPoolAddressResponse>;
|
|
202
226
|
}
|
|
203
227
|
export declare class QueryClientImpl implements Query {
|
|
204
228
|
private readonly rpc;
|
|
@@ -206,10 +230,11 @@ export declare class QueryClientImpl implements Query {
|
|
|
206
230
|
Params(request: QueryParamsRequest): Promise<QueryParamsResponse>;
|
|
207
231
|
PoolInfo(request: QueryPLPoolInfoRequest): Promise<QueryPLPoolInfoResponse>;
|
|
208
232
|
PoolInfoAll(request: QueryAllPLPoolInfoRequest): Promise<QueryAllPLPoolInfoResponse>;
|
|
233
|
+
PoolAddressAll(request: QueryAllPlPoolAddressRequest): Promise<QueryAllPlPoolAddressResponse>;
|
|
234
|
+
PoolMarketUtilizationMultiplierAll(request: QueryAllPlPoolMarketUtilizationMultiplierRequest): Promise<QueryAllPlPoolMarketUtilizationMultiplierResponse>;
|
|
209
235
|
Pool(request: QueryGetPlPoolRequest): Promise<QueryGetPlPoolResponse>;
|
|
210
236
|
PoolAll(request: QueryAllPlPoolsRequest): Promise<QueryAllPlPoolsResponse>;
|
|
211
237
|
PoolMappings(request: QueryPlPoolMappingsRequest): Promise<QueryPlPoolMappingsResponse>;
|
|
212
|
-
PoolAddressAll(request: QueryAllPlPoolAddressRequest): Promise<QueryAllPlPoolAddressResponse>;
|
|
213
238
|
}
|
|
214
239
|
interface Rpc {
|
|
215
240
|
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
@@ -3,14 +3,133 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.QueryClientImpl = exports.QueryAllPLPoolInfoResponse = exports.QueryAllPLPoolInfoRequest = exports.QueryPLPoolInfoResponse = exports.QueryPLPoolInfoRequest = exports.QueryAllPlPoolAddressResponse_AddressesEntry = exports.QueryAllPlPoolAddressResponse = exports.QueryAllPlPoolAddressRequest = exports.QueryPlPoolMappingsResponse_PoolMappingsEntry = exports.QueryPlPoolMappingsResponse = exports.QueryPlPoolMappingsRequest = exports.QueryAllPlPoolsResponse = exports.QueryAllPlPoolsRequest = exports.QueryGetPlPoolResponse = exports.QueryGetPlPoolRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.protobufPackage = void 0;
|
|
6
|
+
exports.QueryClientImpl = exports.QueryAllPLPoolInfoResponse = exports.QueryAllPLPoolInfoRequest = exports.QueryPLPoolInfoResponse = exports.QueryPLPoolInfoRequest = exports.QueryAllPlPoolAddressResponse_AddressesEntry = exports.QueryAllPlPoolAddressResponse = exports.QueryAllPlPoolAddressRequest = exports.QueryPlPoolMappingsResponse_PoolMappingsEntry = exports.QueryPlPoolMappingsResponse = exports.QueryPlPoolMappingsRequest = exports.QueryAllPlPoolsResponse = exports.QueryAllPlPoolsRequest = exports.QueryGetPlPoolResponse = exports.QueryGetPlPoolRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryAllPlPoolMarketUtilizationMultiplierResponse = exports.QueryAllPlPoolMarketUtilizationMultiplierRequest = exports.protobufPackage = void 0;
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
const long_1 = __importDefault(require("long"));
|
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
+
const pagination_1 = require("../cosmos/base/query/v1beta1/pagination");
|
|
10
11
|
const params_1 = require("./params");
|
|
11
12
|
const pool_1 = require("./pool");
|
|
12
|
-
const
|
|
13
|
+
const market_1 = require("./market");
|
|
13
14
|
exports.protobufPackage = "Switcheo.carbon.perpsliquidity";
|
|
15
|
+
const baseQueryAllPlPoolMarketUtilizationMultiplierRequest = {};
|
|
16
|
+
exports.QueryAllPlPoolMarketUtilizationMultiplierRequest = {
|
|
17
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
18
|
+
if (message.pagination !== undefined) {
|
|
19
|
+
pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
|
|
20
|
+
}
|
|
21
|
+
return writer;
|
|
22
|
+
},
|
|
23
|
+
decode(input, length) {
|
|
24
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
25
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
26
|
+
const message = Object.assign({}, baseQueryAllPlPoolMarketUtilizationMultiplierRequest);
|
|
27
|
+
while (reader.pos < end) {
|
|
28
|
+
const tag = reader.uint32();
|
|
29
|
+
switch (tag >>> 3) {
|
|
30
|
+
case 1:
|
|
31
|
+
message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
|
|
32
|
+
break;
|
|
33
|
+
default:
|
|
34
|
+
reader.skipType(tag & 7);
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return message;
|
|
39
|
+
},
|
|
40
|
+
fromJSON(object) {
|
|
41
|
+
const message = Object.assign({}, baseQueryAllPlPoolMarketUtilizationMultiplierRequest);
|
|
42
|
+
message.pagination =
|
|
43
|
+
object.pagination !== undefined && object.pagination !== null
|
|
44
|
+
? pagination_1.PageRequest.fromJSON(object.pagination)
|
|
45
|
+
: undefined;
|
|
46
|
+
return message;
|
|
47
|
+
},
|
|
48
|
+
toJSON(message) {
|
|
49
|
+
const obj = {};
|
|
50
|
+
message.pagination !== undefined &&
|
|
51
|
+
(obj.pagination = message.pagination
|
|
52
|
+
? pagination_1.PageRequest.toJSON(message.pagination)
|
|
53
|
+
: undefined);
|
|
54
|
+
return obj;
|
|
55
|
+
},
|
|
56
|
+
fromPartial(object) {
|
|
57
|
+
const message = Object.assign({}, baseQueryAllPlPoolMarketUtilizationMultiplierRequest);
|
|
58
|
+
message.pagination =
|
|
59
|
+
object.pagination !== undefined && object.pagination !== null
|
|
60
|
+
? pagination_1.PageRequest.fromPartial(object.pagination)
|
|
61
|
+
: undefined;
|
|
62
|
+
return message;
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
const baseQueryAllPlPoolMarketUtilizationMultiplierResponse = {};
|
|
66
|
+
exports.QueryAllPlPoolMarketUtilizationMultiplierResponse = {
|
|
67
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
68
|
+
for (const v of message.marketsUtilizationMultiplier) {
|
|
69
|
+
market_1.MarketUtilizationMultiplier.encode(v, writer.uint32(10).fork()).ldelim();
|
|
70
|
+
}
|
|
71
|
+
if (message.pagination !== undefined) {
|
|
72
|
+
pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim();
|
|
73
|
+
}
|
|
74
|
+
return writer;
|
|
75
|
+
},
|
|
76
|
+
decode(input, length) {
|
|
77
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
78
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
79
|
+
const message = Object.assign({}, baseQueryAllPlPoolMarketUtilizationMultiplierResponse);
|
|
80
|
+
message.marketsUtilizationMultiplier = [];
|
|
81
|
+
while (reader.pos < end) {
|
|
82
|
+
const tag = reader.uint32();
|
|
83
|
+
switch (tag >>> 3) {
|
|
84
|
+
case 1:
|
|
85
|
+
message.marketsUtilizationMultiplier.push(market_1.MarketUtilizationMultiplier.decode(reader, reader.uint32()));
|
|
86
|
+
break;
|
|
87
|
+
case 2:
|
|
88
|
+
message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
|
|
89
|
+
break;
|
|
90
|
+
default:
|
|
91
|
+
reader.skipType(tag & 7);
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return message;
|
|
96
|
+
},
|
|
97
|
+
fromJSON(object) {
|
|
98
|
+
var _a;
|
|
99
|
+
const message = Object.assign({}, baseQueryAllPlPoolMarketUtilizationMultiplierResponse);
|
|
100
|
+
message.marketsUtilizationMultiplier = ((_a = object.marketsUtilizationMultiplier) !== null && _a !== void 0 ? _a : []).map((e) => market_1.MarketUtilizationMultiplier.fromJSON(e));
|
|
101
|
+
message.pagination =
|
|
102
|
+
object.pagination !== undefined && object.pagination !== null
|
|
103
|
+
? pagination_1.PageResponse.fromJSON(object.pagination)
|
|
104
|
+
: undefined;
|
|
105
|
+
return message;
|
|
106
|
+
},
|
|
107
|
+
toJSON(message) {
|
|
108
|
+
const obj = {};
|
|
109
|
+
if (message.marketsUtilizationMultiplier) {
|
|
110
|
+
obj.marketsUtilizationMultiplier =
|
|
111
|
+
message.marketsUtilizationMultiplier.map((e) => e ? market_1.MarketUtilizationMultiplier.toJSON(e) : undefined);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
obj.marketsUtilizationMultiplier = [];
|
|
115
|
+
}
|
|
116
|
+
message.pagination !== undefined &&
|
|
117
|
+
(obj.pagination = message.pagination
|
|
118
|
+
? pagination_1.PageResponse.toJSON(message.pagination)
|
|
119
|
+
: undefined);
|
|
120
|
+
return obj;
|
|
121
|
+
},
|
|
122
|
+
fromPartial(object) {
|
|
123
|
+
var _a;
|
|
124
|
+
const message = Object.assign({}, baseQueryAllPlPoolMarketUtilizationMultiplierResponse);
|
|
125
|
+
message.marketsUtilizationMultiplier = ((_a = object.marketsUtilizationMultiplier) !== null && _a !== void 0 ? _a : []).map((e) => market_1.MarketUtilizationMultiplier.fromPartial(e));
|
|
126
|
+
message.pagination =
|
|
127
|
+
object.pagination !== undefined && object.pagination !== null
|
|
128
|
+
? pagination_1.PageResponse.fromPartial(object.pagination)
|
|
129
|
+
: undefined;
|
|
130
|
+
return message;
|
|
131
|
+
},
|
|
132
|
+
};
|
|
14
133
|
const baseQueryParamsRequest = {};
|
|
15
134
|
exports.QueryParamsRequest = {
|
|
16
135
|
encode(_, writer = minimal_1.default.Writer.create()) {
|
|
@@ -951,10 +1070,12 @@ class QueryClientImpl {
|
|
|
951
1070
|
this.Params = this.Params.bind(this);
|
|
952
1071
|
this.PoolInfo = this.PoolInfo.bind(this);
|
|
953
1072
|
this.PoolInfoAll = this.PoolInfoAll.bind(this);
|
|
1073
|
+
this.PoolAddressAll = this.PoolAddressAll.bind(this);
|
|
1074
|
+
this.PoolMarketUtilizationMultiplierAll =
|
|
1075
|
+
this.PoolMarketUtilizationMultiplierAll.bind(this);
|
|
954
1076
|
this.Pool = this.Pool.bind(this);
|
|
955
1077
|
this.PoolAll = this.PoolAll.bind(this);
|
|
956
1078
|
this.PoolMappings = this.PoolMappings.bind(this);
|
|
957
|
-
this.PoolAddressAll = this.PoolAddressAll.bind(this);
|
|
958
1079
|
}
|
|
959
1080
|
Params(request) {
|
|
960
1081
|
const data = exports.QueryParamsRequest.encode(request).finish();
|
|
@@ -971,6 +1092,16 @@ class QueryClientImpl {
|
|
|
971
1092
|
const promise = this.rpc.request("Switcheo.carbon.perpsliquidity.Query", "PoolInfoAll", data);
|
|
972
1093
|
return promise.then((data) => exports.QueryAllPLPoolInfoResponse.decode(new minimal_1.default.Reader(data)));
|
|
973
1094
|
}
|
|
1095
|
+
PoolAddressAll(request) {
|
|
1096
|
+
const data = exports.QueryAllPlPoolAddressRequest.encode(request).finish();
|
|
1097
|
+
const promise = this.rpc.request("Switcheo.carbon.perpsliquidity.Query", "PoolAddressAll", data);
|
|
1098
|
+
return promise.then((data) => exports.QueryAllPlPoolAddressResponse.decode(new minimal_1.default.Reader(data)));
|
|
1099
|
+
}
|
|
1100
|
+
PoolMarketUtilizationMultiplierAll(request) {
|
|
1101
|
+
const data = exports.QueryAllPlPoolMarketUtilizationMultiplierRequest.encode(request).finish();
|
|
1102
|
+
const promise = this.rpc.request("Switcheo.carbon.perpsliquidity.Query", "PoolMarketUtilizationMultiplierAll", data);
|
|
1103
|
+
return promise.then((data) => exports.QueryAllPlPoolMarketUtilizationMultiplierResponse.decode(new minimal_1.default.Reader(data)));
|
|
1104
|
+
}
|
|
974
1105
|
Pool(request) {
|
|
975
1106
|
const data = exports.QueryGetPlPoolRequest.encode(request).finish();
|
|
976
1107
|
const promise = this.rpc.request("Switcheo.carbon.perpsliquidity.Query", "Pool", data);
|
|
@@ -986,11 +1117,6 @@ class QueryClientImpl {
|
|
|
986
1117
|
const promise = this.rpc.request("Switcheo.carbon.perpsliquidity.Query", "PoolMappings", data);
|
|
987
1118
|
return promise.then((data) => exports.QueryPlPoolMappingsResponse.decode(new minimal_1.default.Reader(data)));
|
|
988
1119
|
}
|
|
989
|
-
PoolAddressAll(request) {
|
|
990
|
-
const data = exports.QueryAllPlPoolAddressRequest.encode(request).finish();
|
|
991
|
-
const promise = this.rpc.request("Switcheo.carbon.perpsliquidity.Query", "PoolAddressAll", data);
|
|
992
|
-
return promise.then((data) => exports.QueryAllPlPoolAddressResponse.decode(new minimal_1.default.Reader(data)));
|
|
993
|
-
}
|
|
994
1120
|
}
|
|
995
1121
|
exports.QueryClientImpl = QueryClientImpl;
|
|
996
1122
|
if (minimal_1.default.util.Long !== long_1.default) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Long from "long";
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
export declare const protobufPackage = "Switcheo.carbon.subaccount";
|
|
4
|
+
export interface SubaccountV2260 {
|
|
5
|
+
mainAccount: string;
|
|
6
|
+
active: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const SubaccountV2260: {
|
|
9
|
+
encode(message: SubaccountV2260, writer?: _m0.Writer): _m0.Writer;
|
|
10
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): SubaccountV2260;
|
|
11
|
+
fromJSON(object: any): SubaccountV2260;
|
|
12
|
+
toJSON(message: SubaccountV2260): unknown;
|
|
13
|
+
fromPartial(object: DeepPartial<SubaccountV2260>): SubaccountV2260;
|
|
14
|
+
};
|
|
15
|
+
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
16
|
+
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 {} ? {
|
|
17
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
18
|
+
} : Partial<T>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
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.SubaccountV2260 = exports.protobufPackage = void 0;
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
9
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
+
exports.protobufPackage = "Switcheo.carbon.subaccount";
|
|
11
|
+
const baseSubaccountV2260 = { mainAccount: "", active: false };
|
|
12
|
+
exports.SubaccountV2260 = {
|
|
13
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
14
|
+
if (message.mainAccount !== "") {
|
|
15
|
+
writer.uint32(10).string(message.mainAccount);
|
|
16
|
+
}
|
|
17
|
+
if (message.active === true) {
|
|
18
|
+
writer.uint32(16).bool(message.active);
|
|
19
|
+
}
|
|
20
|
+
return writer;
|
|
21
|
+
},
|
|
22
|
+
decode(input, length) {
|
|
23
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
24
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
25
|
+
const message = Object.assign({}, baseSubaccountV2260);
|
|
26
|
+
while (reader.pos < end) {
|
|
27
|
+
const tag = reader.uint32();
|
|
28
|
+
switch (tag >>> 3) {
|
|
29
|
+
case 1:
|
|
30
|
+
message.mainAccount = reader.string();
|
|
31
|
+
break;
|
|
32
|
+
case 2:
|
|
33
|
+
message.active = reader.bool();
|
|
34
|
+
break;
|
|
35
|
+
default:
|
|
36
|
+
reader.skipType(tag & 7);
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return message;
|
|
41
|
+
},
|
|
42
|
+
fromJSON(object) {
|
|
43
|
+
const message = Object.assign({}, baseSubaccountV2260);
|
|
44
|
+
message.mainAccount =
|
|
45
|
+
object.mainAccount !== undefined && object.mainAccount !== null
|
|
46
|
+
? String(object.mainAccount)
|
|
47
|
+
: "";
|
|
48
|
+
message.active =
|
|
49
|
+
object.active !== undefined && object.active !== null
|
|
50
|
+
? Boolean(object.active)
|
|
51
|
+
: false;
|
|
52
|
+
return message;
|
|
53
|
+
},
|
|
54
|
+
toJSON(message) {
|
|
55
|
+
const obj = {};
|
|
56
|
+
message.mainAccount !== undefined &&
|
|
57
|
+
(obj.mainAccount = message.mainAccount);
|
|
58
|
+
message.active !== undefined && (obj.active = message.active);
|
|
59
|
+
return obj;
|
|
60
|
+
},
|
|
61
|
+
fromPartial(object) {
|
|
62
|
+
var _a, _b;
|
|
63
|
+
const message = Object.assign({}, baseSubaccountV2260);
|
|
64
|
+
message.mainAccount = (_a = object.mainAccount) !== null && _a !== void 0 ? _a : "";
|
|
65
|
+
message.active = (_b = object.active) !== null && _b !== void 0 ? _b : false;
|
|
66
|
+
return message;
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
if (minimal_1.default.util.Long !== long_1.default) {
|
|
70
|
+
minimal_1.default.util.Long = long_1.default;
|
|
71
|
+
minimal_1.default.configure();
|
|
72
|
+
}
|
package/lib/modules/erc20.d.ts
CHANGED
|
@@ -10,10 +10,14 @@ export declare namespace ERC20Module {
|
|
|
10
10
|
interface ConvertCoinParams {
|
|
11
11
|
denom: string;
|
|
12
12
|
amount: string;
|
|
13
|
+
receiverAddress?: string;
|
|
14
|
+
senderAddress?: string;
|
|
13
15
|
}
|
|
14
16
|
interface ConvertERC20Params {
|
|
15
17
|
contractAddress: string;
|
|
16
18
|
amount: string;
|
|
19
|
+
receiverAddress?: string;
|
|
20
|
+
senderAddress?: string;
|
|
17
21
|
}
|
|
18
22
|
interface RegisterTokenParams {
|
|
19
23
|
creator: string;
|
package/lib/modules/erc20.js
CHANGED
|
@@ -17,6 +17,7 @@ const __1 = require("..");
|
|
|
17
17
|
const base_1 = __importDefault(require("./base"));
|
|
18
18
|
class ERC20Module extends base_1.default {
|
|
19
19
|
convertCoin(params, opts) {
|
|
20
|
+
var _a, _b, _c, _d;
|
|
20
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
22
|
const wallet = this.getWallet();
|
|
22
23
|
const coin = {
|
|
@@ -25,8 +26,8 @@ class ERC20Module extends base_1.default {
|
|
|
25
26
|
};
|
|
26
27
|
const value = __1.Models.MsgConvertCoin.fromPartial({
|
|
27
28
|
coin,
|
|
28
|
-
receiver: wallet.evmHexAddress.toLowerCase(),
|
|
29
|
-
sender: wallet.bech32Address.toLowerCase(),
|
|
29
|
+
receiver: (_b = (_a = params.receiverAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : wallet.evmHexAddress.toLowerCase(),
|
|
30
|
+
sender: (_d = (_c = params.senderAddress) === null || _c === void 0 ? void 0 : _c.toLowerCase()) !== null && _d !== void 0 ? _d : wallet.bech32Address.toLowerCase(),
|
|
30
31
|
});
|
|
31
32
|
return yield wallet.sendTx({
|
|
32
33
|
typeUrl: __1.CarbonTx.Types.MsgConvertCoin,
|
|
@@ -35,13 +36,14 @@ class ERC20Module extends base_1.default {
|
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
convertERC20(params, opts) {
|
|
39
|
+
var _a, _b, _c, _d;
|
|
38
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
41
|
const wallet = this.getWallet();
|
|
40
42
|
const value = __1.Models.MsgConvertERC20.fromPartial({
|
|
41
43
|
contractAddress: params.contractAddress,
|
|
42
44
|
amount: params.amount,
|
|
43
|
-
receiver: wallet.bech32Address.toLowerCase(),
|
|
44
|
-
sender: wallet.bech32Address.toLowerCase(),
|
|
45
|
+
receiver: (_b = (_a = params.receiverAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : wallet.bech32Address.toLowerCase(),
|
|
46
|
+
sender: (_d = (_c = params.senderAddress) === null || _c === void 0 ? void 0 : _c.toLowerCase()) !== null && _d !== void 0 ? _d : wallet.bech32Address.toLowerCase(),
|
|
45
47
|
});
|
|
46
48
|
return yield wallet.sendTx({
|
|
47
49
|
typeUrl: __1.CarbonTx.Types.MsgConvertERC20,
|