carbon-js-sdk 0.11.73 → 0.11.75
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/CarbonSDK.d.ts +1 -0
- package/lib/CarbonSDK.js +60 -9
- package/lib/codec/Switcheo/carbon/adl/bad_debt.d.ts +23 -0
- package/lib/codec/Switcheo/carbon/adl/bad_debt.js +110 -0
- package/lib/codec/Switcheo/carbon/adl/query.d.ts +84 -0
- package/lib/codec/Switcheo/carbon/adl/query.js +411 -2
- package/lib/codec/Switcheo/carbon/adl/tx.d.ts +32 -0
- package/lib/codec/Switcheo/carbon/adl/tx.js +131 -2
- package/lib/codec/Switcheo/carbon/broker/export.d.ts +3 -2
- package/lib/codec/Switcheo/carbon/broker/export.js +8 -1
- package/lib/codec/Switcheo/carbon/broker/genesis.d.ts +2 -0
- package/lib/codec/Switcheo/carbon/broker/genesis.js +19 -1
- package/lib/codec/Switcheo/carbon/broker/params.d.ts +34 -0
- package/lib/codec/Switcheo/carbon/broker/params.js +142 -0
- package/lib/codec/Switcheo/carbon/broker/query.d.ts +26 -0
- package/lib/codec/Switcheo/carbon/broker/query.js +95 -1
- package/lib/codec/Switcheo/carbon/broker/tx.d.ts +27 -0
- package/lib/codec/Switcheo/carbon/broker/tx.js +109 -1
- package/lib/codec/Switcheo/carbon/cdp/asset_params.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/cdp/asset_params.js +7 -7
- package/lib/codec/Switcheo/carbon/cdp/query.d.ts +0 -2
- package/lib/codec/Switcheo/carbon/cdp/query.js +4 -36
- package/lib/codec/Switcheo/carbon/coin/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/coin/export.js +16 -3
- package/lib/codec/Switcheo/carbon/coin/genesis.d.ts +3 -1
- package/lib/codec/Switcheo/carbon/coin/genesis.js +24 -1
- package/lib/codec/Switcheo/carbon/coin/params.d.ts +2 -0
- package/lib/codec/Switcheo/carbon/coin/params.js +40 -2
- package/lib/codec/Switcheo/carbon/coin/query.d.ts +93 -0
- package/lib/codec/Switcheo/carbon/coin/query.js +456 -1
- package/lib/codec/Switcheo/carbon/coin/token.d.ts +5 -2
- package/lib/codec/Switcheo/carbon/coin/token.js +50 -14
- package/lib/codec/Switcheo/carbon/coin/tx.d.ts +85 -1
- package/lib/codec/Switcheo/carbon/coin/tx.js +443 -3
- package/lib/codec/Switcheo/carbon/erc20/export.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/erc20/export.js +2 -2
- package/lib/codec/Switcheo/carbon/leverage/event.d.ts +1 -0
- package/lib/codec/Switcheo/carbon/leverage/event.js +13 -1
- package/lib/codec/Switcheo/carbon/leverage/export.d.ts +3 -2
- package/lib/codec/Switcheo/carbon/leverage/export.js +10 -1
- package/lib/codec/Switcheo/carbon/leverage/genesis.d.ts +2 -0
- package/lib/codec/Switcheo/carbon/leverage/genesis.js +19 -1
- package/lib/codec/Switcheo/carbon/leverage/leverage.d.ts +1 -0
- package/lib/codec/Switcheo/carbon/leverage/leverage.js +13 -1
- package/lib/codec/Switcheo/carbon/leverage/params.d.ts +34 -0
- package/lib/codec/Switcheo/carbon/leverage/params.js +142 -0
- package/lib/codec/Switcheo/carbon/leverage/query.d.ts +26 -0
- package/lib/codec/Switcheo/carbon/leverage/query.js +95 -1
- package/lib/codec/Switcheo/carbon/leverage/tx.d.ts +52 -0
- package/lib/codec/Switcheo/carbon/leverage/tx.js +226 -1
- package/lib/codec/Switcheo/carbon/position/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/position/export.js +8 -1
- package/lib/codec/Switcheo/carbon/position/position.d.ts +28 -0
- package/lib/codec/Switcheo/carbon/position/position.js +213 -1
- package/lib/codec/Switcheo/carbon/position/query.d.ts +61 -1
- package/lib/codec/Switcheo/carbon/position/query.js +287 -1
- package/lib/codec/alliance/alliance/alliance.d.ts +9 -5
- package/lib/codec/alliance/alliance/gov.d.ts +7 -6
- package/lib/codec/alliance/alliance/query.d.ts +8 -2
- package/lib/codec/alliance/alliance/tx.d.ts +7 -6
- package/lib/codec/cosmos/gov/v1/export.d.ts +1 -1
- package/lib/codec/cosmos/gov/v1/export.js +5 -5
- package/lib/codec/cosmos/staking/v1beta1/export.d.ts +2 -2
- package/lib/codec/cosmos/staking/v1beta1/export.js +8 -8
- package/lib/codec/cosmos/tx/v1beta1/export.d.ts +1 -1
- package/lib/codec/cosmos/tx/v1beta1/export.js +5 -5
- package/lib/codec/google/protobuf/descriptor.d.ts +53 -0
- package/lib/codec/google/protobuf/descriptor.js +206 -3
- package/lib/codec/ibc/applications/interchain_accounts/v1/export.d.ts +1 -1
- package/lib/codec/ibc/applications/interchain_accounts/v1/export.js +3 -3
- package/lib/codec/ibc/core/channel/v1/export.d.ts +2 -2
- package/lib/codec/ibc/core/channel/v1/export.js +8 -8
- package/lib/codec/ibc/core/connection/v1/export.d.ts +1 -1
- package/lib/codec/ibc/core/connection/v1/export.js +3 -3
- package/lib/codec/ibc/lightclients/solomachine/v2/export.d.ts +1 -1
- package/lib/codec/ibc/lightclients/solomachine/v2/export.js +3 -3
- package/lib/codec/index.d.ts +18 -1
- package/lib/codec/index.js +1068 -568
- package/lib/modules/coin.d.ts +7 -0
- package/lib/modules/coin.js +20 -1
- package/lib/modules/leverage.d.ts +5 -0
- package/lib/modules/leverage.js +12 -0
- package/lib/provider/amino/types/coin.js +6 -0
- package/lib/provider/amino/types/leverage.js +6 -0
- package/lib/util/tx.d.ts +14 -0
- package/lib/wallet/CarbonWallet.d.ts +22 -40
- package/lib/wallet/CarbonWallet.js +64 -102
- package/lib/websocket/models.d.ts +11 -2
- package/package.json +2 -2
package/lib/CarbonSDK.d.ts
CHANGED
|
@@ -128,6 +128,7 @@ declare class CarbonSDK {
|
|
|
128
128
|
connectWithMetamask(metamask: MetaMask, opts?: CarbonWalletGenericOpts, evmWalletOpts?: EvmWalletOpts): Promise<ConnectedCarbonSDK>;
|
|
129
129
|
connectWithRainbowKit(rainbowKit: RainbowKitAccount, rainbowKitWalletOpts: RainbowKitWalletOpts, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
130
130
|
connectViewOnly(bech32Address: string, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
131
|
+
connectWithQr(granteeMnemonic: string, granterAddress: string, expiry: Date, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
131
132
|
getConfig(): NetworkConfig;
|
|
132
133
|
getTokenClient(): TokenClient;
|
|
133
134
|
getConnectedWallet(): CarbonWallet;
|
package/lib/CarbonSDK.js
CHANGED
|
@@ -265,24 +265,31 @@ class CarbonSDK {
|
|
|
265
265
|
return new CarbonSDK(opts);
|
|
266
266
|
}
|
|
267
267
|
async connectWithPrivateKey(privateKey, opts) {
|
|
268
|
-
const wallet = wallet_1.CarbonWallet
|
|
268
|
+
const wallet = new wallet_1.CarbonWallet({
|
|
269
269
|
...opts,
|
|
270
|
+
mode: "privateKey",
|
|
271
|
+
privateKey,
|
|
270
272
|
network: this.network,
|
|
271
273
|
config: this.configOverride,
|
|
272
274
|
});
|
|
273
275
|
return this.connect(wallet, opts);
|
|
274
276
|
}
|
|
275
277
|
async connectWithMnemonic(mnemonic, opts) {
|
|
276
|
-
const wallet = wallet_1.CarbonWallet
|
|
278
|
+
const wallet = new wallet_1.CarbonWallet({
|
|
277
279
|
...opts,
|
|
280
|
+
mode: "mnemonic",
|
|
281
|
+
mnemonic,
|
|
278
282
|
network: this.network,
|
|
279
283
|
config: this.configOverride,
|
|
280
284
|
});
|
|
281
285
|
return this.connect(wallet, opts);
|
|
282
286
|
}
|
|
283
287
|
async connectWithSigner(signer, publicKeyBase64, opts) {
|
|
284
|
-
const wallet = wallet_1.CarbonWallet
|
|
288
|
+
const wallet = new wallet_1.CarbonWallet({
|
|
285
289
|
...opts,
|
|
290
|
+
mode: "customSigner",
|
|
291
|
+
signer,
|
|
292
|
+
publicKeyBase64,
|
|
286
293
|
network: this.network,
|
|
287
294
|
config: this.configOverride,
|
|
288
295
|
});
|
|
@@ -291,8 +298,12 @@ class CarbonSDK {
|
|
|
291
298
|
async connectWithLedger(ledger, opts) {
|
|
292
299
|
const publicKeyBuffer = await ledger.getPubKey();
|
|
293
300
|
const publicKeyBase64 = publicKeyBuffer.toString("base64");
|
|
294
|
-
const
|
|
301
|
+
const signer = new wallet_1.CarbonLedgerSigner(ledger);
|
|
302
|
+
const wallet = new wallet_1.CarbonWallet({
|
|
295
303
|
...opts,
|
|
304
|
+
mode: "customSigner",
|
|
305
|
+
signer,
|
|
306
|
+
publicKeyBase64,
|
|
296
307
|
network: this.network,
|
|
297
308
|
config: this.configOverride,
|
|
298
309
|
});
|
|
@@ -304,10 +315,18 @@ class CarbonSDK {
|
|
|
304
315
|
await keplr.experimentalSuggestChain(chainInfo);
|
|
305
316
|
const keplrKey = await keplr.getKey(chainId);
|
|
306
317
|
await keplr.enable(chainId);
|
|
307
|
-
const
|
|
318
|
+
const signer = keplrKey.isNanoLedger
|
|
319
|
+
? provider_1.KeplrAccount.createKeplrSignerAmino(keplr, chainInfo, keplrKey)
|
|
320
|
+
: provider_1.KeplrAccount.createKeplrSigner(keplr, chainInfo, keplrKey);
|
|
321
|
+
const publicKeyBase64 = Buffer.from(keplrKey.pubKey).toString("base64");
|
|
322
|
+
const wallet = new wallet_1.CarbonWallet({
|
|
308
323
|
...opts,
|
|
324
|
+
mode: "customSigner",
|
|
325
|
+
signer,
|
|
326
|
+
publicKeyBase64,
|
|
309
327
|
network: this.network,
|
|
310
328
|
config: this.configOverride,
|
|
329
|
+
providerAgent: constant_1.ProviderAgent.KeplrExtension,
|
|
311
330
|
});
|
|
312
331
|
return this.connect(wallet, opts);
|
|
313
332
|
}
|
|
@@ -317,10 +336,16 @@ class CarbonSDK {
|
|
|
317
336
|
await leap.experimentalSuggestChain(chainInfo);
|
|
318
337
|
const leapKey = await leap.getKey(chainId);
|
|
319
338
|
await leap.enable(chainId);
|
|
320
|
-
const
|
|
339
|
+
const signer = leapKey.isNanoLedger ? provider_1.LeapAccount.createLeapSignerAmino(leap, chainId) : provider_1.LeapAccount.createLeapSigner(leap, chainId);
|
|
340
|
+
const publicKeyBase64 = Buffer.from(leapKey.pubKey).toString("base64");
|
|
341
|
+
const wallet = new wallet_1.CarbonWallet({
|
|
321
342
|
...opts,
|
|
343
|
+
mode: "customSigner",
|
|
344
|
+
signer,
|
|
345
|
+
publicKeyBase64,
|
|
322
346
|
network: this.network,
|
|
323
347
|
config: this.configOverride,
|
|
348
|
+
providerAgent: constant_1.ProviderAgent.LeapExtension,
|
|
324
349
|
});
|
|
325
350
|
return this.connect(wallet, opts);
|
|
326
351
|
}
|
|
@@ -341,10 +366,15 @@ class CarbonSDK {
|
|
|
341
366
|
message = result.message;
|
|
342
367
|
signature = result.signature;
|
|
343
368
|
}
|
|
344
|
-
const
|
|
369
|
+
const signer = MetaMask_1.MetaMask.createMetamaskSigner(metamask, evmChainId, pubKey, addressOptions);
|
|
370
|
+
const wallet = new wallet_1.CarbonWallet({
|
|
345
371
|
...opts,
|
|
372
|
+
mode: "customSigner",
|
|
373
|
+
signer,
|
|
374
|
+
publicKeyBase64: pubKey,
|
|
346
375
|
network: this.network,
|
|
347
376
|
config: this.configOverride,
|
|
377
|
+
providerAgent: constant_1.ProviderAgent.MetamaskExtension,
|
|
348
378
|
});
|
|
349
379
|
if (noJwtProvided) {
|
|
350
380
|
const authRequest = {
|
|
@@ -374,10 +404,16 @@ class CarbonSDK {
|
|
|
374
404
|
message = result.message;
|
|
375
405
|
signature = result.signature;
|
|
376
406
|
}
|
|
377
|
-
const
|
|
407
|
+
const signer = RainbowKitAccount_1.default.createRainbowKitSigner(rainbowKit, evmChainId, pubKey, addressOptions);
|
|
408
|
+
const wallet = new wallet_1.CarbonWallet({
|
|
378
409
|
...opts,
|
|
410
|
+
mode: "customSigner",
|
|
411
|
+
signer,
|
|
412
|
+
publicKeyBase64: pubKey,
|
|
379
413
|
network: this.network,
|
|
380
414
|
config: this.configOverride,
|
|
415
|
+
providerAgent: rainbowKitWalletOpts.walletProvider,
|
|
416
|
+
isRainbowKit: true,
|
|
381
417
|
});
|
|
382
418
|
if (noJwtProvided) {
|
|
383
419
|
const authRequest = {
|
|
@@ -391,8 +427,23 @@ class CarbonSDK {
|
|
|
391
427
|
return this.connect(wallet, opts);
|
|
392
428
|
}
|
|
393
429
|
async connectViewOnly(bech32Address, opts) {
|
|
394
|
-
const wallet = wallet_1.CarbonWallet
|
|
430
|
+
const wallet = new wallet_1.CarbonWallet({
|
|
395
431
|
...opts,
|
|
432
|
+
mode: "viewOnly",
|
|
433
|
+
bech32Address,
|
|
434
|
+
network: this.network,
|
|
435
|
+
config: this.configOverride,
|
|
436
|
+
});
|
|
437
|
+
return this.connect(wallet, opts);
|
|
438
|
+
}
|
|
439
|
+
async connectWithQr(granteeMnemonic, granterAddress, expiry, opts) {
|
|
440
|
+
const wallet = new wallet_1.CarbonWallet({
|
|
441
|
+
...opts,
|
|
442
|
+
mode: "qr",
|
|
443
|
+
mnemonic: granteeMnemonic,
|
|
444
|
+
granter: granterAddress,
|
|
445
|
+
bech32Address: granterAddress,
|
|
446
|
+
expiry,
|
|
396
447
|
network: this.network,
|
|
397
448
|
config: this.configOverride,
|
|
398
449
|
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Long from "long";
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { OutstandingPosition } from "../liquidation/outstanding_position";
|
|
4
|
+
export declare const protobufPackage = "Switcheo.carbon.adl";
|
|
5
|
+
export interface AdlBadDebt {
|
|
6
|
+
amount: string;
|
|
7
|
+
markPrice: string;
|
|
8
|
+
buyExpiredOp?: OutstandingPosition;
|
|
9
|
+
sellExpiredOp?: OutstandingPosition;
|
|
10
|
+
}
|
|
11
|
+
export declare const AdlBadDebt: {
|
|
12
|
+
encode(message: AdlBadDebt, writer?: _m0.Writer): _m0.Writer;
|
|
13
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AdlBadDebt;
|
|
14
|
+
fromJSON(object: any): AdlBadDebt;
|
|
15
|
+
toJSON(message: AdlBadDebt): unknown;
|
|
16
|
+
create(base?: DeepPartial<AdlBadDebt>): AdlBadDebt;
|
|
17
|
+
fromPartial(object: DeepPartial<AdlBadDebt>): AdlBadDebt;
|
|
18
|
+
};
|
|
19
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
20
|
+
export 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,110 @@
|
|
|
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.AdlBadDebt = exports.protobufPackage = void 0;
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
9
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
+
const outstanding_position_1 = require("../liquidation/outstanding_position");
|
|
11
|
+
exports.protobufPackage = "Switcheo.carbon.adl";
|
|
12
|
+
function createBaseAdlBadDebt() {
|
|
13
|
+
return { amount: "", markPrice: "", buyExpiredOp: undefined, sellExpiredOp: undefined };
|
|
14
|
+
}
|
|
15
|
+
exports.AdlBadDebt = {
|
|
16
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
17
|
+
if (message.amount !== "") {
|
|
18
|
+
writer.uint32(10).string(message.amount);
|
|
19
|
+
}
|
|
20
|
+
if (message.markPrice !== "") {
|
|
21
|
+
writer.uint32(18).string(message.markPrice);
|
|
22
|
+
}
|
|
23
|
+
if (message.buyExpiredOp !== undefined) {
|
|
24
|
+
outstanding_position_1.OutstandingPosition.encode(message.buyExpiredOp, writer.uint32(26).fork()).ldelim();
|
|
25
|
+
}
|
|
26
|
+
if (message.sellExpiredOp !== undefined) {
|
|
27
|
+
outstanding_position_1.OutstandingPosition.encode(message.sellExpiredOp, writer.uint32(34).fork()).ldelim();
|
|
28
|
+
}
|
|
29
|
+
return writer;
|
|
30
|
+
},
|
|
31
|
+
decode(input, length) {
|
|
32
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
33
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
34
|
+
const message = createBaseAdlBadDebt();
|
|
35
|
+
while (reader.pos < end) {
|
|
36
|
+
const tag = reader.uint32();
|
|
37
|
+
switch (tag >>> 3) {
|
|
38
|
+
case 1:
|
|
39
|
+
if (tag !== 10) {
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
message.amount = reader.string();
|
|
43
|
+
continue;
|
|
44
|
+
case 2:
|
|
45
|
+
if (tag !== 18) {
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
message.markPrice = reader.string();
|
|
49
|
+
continue;
|
|
50
|
+
case 3:
|
|
51
|
+
if (tag !== 26) {
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
message.buyExpiredOp = outstanding_position_1.OutstandingPosition.decode(reader, reader.uint32());
|
|
55
|
+
continue;
|
|
56
|
+
case 4:
|
|
57
|
+
if (tag !== 34) {
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
message.sellExpiredOp = outstanding_position_1.OutstandingPosition.decode(reader, reader.uint32());
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
reader.skipType(tag & 7);
|
|
67
|
+
}
|
|
68
|
+
return message;
|
|
69
|
+
},
|
|
70
|
+
fromJSON(object) {
|
|
71
|
+
return {
|
|
72
|
+
amount: isSet(object.amount) ? String(object.amount) : "",
|
|
73
|
+
markPrice: isSet(object.markPrice) ? String(object.markPrice) : "",
|
|
74
|
+
buyExpiredOp: isSet(object.buyExpiredOp) ? outstanding_position_1.OutstandingPosition.fromJSON(object.buyExpiredOp) : undefined,
|
|
75
|
+
sellExpiredOp: isSet(object.sellExpiredOp) ? outstanding_position_1.OutstandingPosition.fromJSON(object.sellExpiredOp) : undefined,
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
toJSON(message) {
|
|
79
|
+
const obj = {};
|
|
80
|
+
message.amount !== undefined && (obj.amount = message.amount);
|
|
81
|
+
message.markPrice !== undefined && (obj.markPrice = message.markPrice);
|
|
82
|
+
message.buyExpiredOp !== undefined &&
|
|
83
|
+
(obj.buyExpiredOp = message.buyExpiredOp ? outstanding_position_1.OutstandingPosition.toJSON(message.buyExpiredOp) : undefined);
|
|
84
|
+
message.sellExpiredOp !== undefined &&
|
|
85
|
+
(obj.sellExpiredOp = message.sellExpiredOp ? outstanding_position_1.OutstandingPosition.toJSON(message.sellExpiredOp) : undefined);
|
|
86
|
+
return obj;
|
|
87
|
+
},
|
|
88
|
+
create(base) {
|
|
89
|
+
return exports.AdlBadDebt.fromPartial(base ?? {});
|
|
90
|
+
},
|
|
91
|
+
fromPartial(object) {
|
|
92
|
+
const message = createBaseAdlBadDebt();
|
|
93
|
+
message.amount = object.amount ?? "";
|
|
94
|
+
message.markPrice = object.markPrice ?? "";
|
|
95
|
+
message.buyExpiredOp = (object.buyExpiredOp !== undefined && object.buyExpiredOp !== null)
|
|
96
|
+
? outstanding_position_1.OutstandingPosition.fromPartial(object.buyExpiredOp)
|
|
97
|
+
: undefined;
|
|
98
|
+
message.sellExpiredOp = (object.sellExpiredOp !== undefined && object.sellExpiredOp !== null)
|
|
99
|
+
? outstanding_position_1.OutstandingPosition.fromPartial(object.sellExpiredOp)
|
|
100
|
+
: undefined;
|
|
101
|
+
return message;
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
if (minimal_1.default.util.Long !== long_1.default) {
|
|
105
|
+
minimal_1.default.util.Long = long_1.default;
|
|
106
|
+
minimal_1.default.configure();
|
|
107
|
+
}
|
|
108
|
+
function isSet(value) {
|
|
109
|
+
return value !== null && value !== undefined;
|
|
110
|
+
}
|
|
@@ -1,6 +1,84 @@
|
|
|
1
|
+
import Long from "long";
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { OutstandingPosition } from "../liquidation/outstanding_position";
|
|
1
4
|
export declare const protobufPackage = "Switcheo.carbon.adl";
|
|
5
|
+
export interface ApiAggregatedAdlBadDebt {
|
|
6
|
+
market: string;
|
|
7
|
+
amount: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ApiAdlBadDebt {
|
|
10
|
+
market: string;
|
|
11
|
+
blockHeight: Long;
|
|
12
|
+
amount: string;
|
|
13
|
+
markPrice: string;
|
|
14
|
+
buyExpiredOp?: OutstandingPosition;
|
|
15
|
+
sellExpiredOp?: OutstandingPosition;
|
|
16
|
+
}
|
|
17
|
+
/** this line is used by starport scaffolding # 3 */
|
|
18
|
+
export interface AllAdlBadDebtRequest {
|
|
19
|
+
}
|
|
20
|
+
export interface AllAdlBadDebtResponse {
|
|
21
|
+
aggregatedBadDebts: ApiAggregatedAdlBadDebt[];
|
|
22
|
+
}
|
|
23
|
+
export interface AdlBadDebtRequest {
|
|
24
|
+
market: string;
|
|
25
|
+
}
|
|
26
|
+
export interface AdlBadDebtResponse {
|
|
27
|
+
badDebts: ApiAdlBadDebt[];
|
|
28
|
+
}
|
|
29
|
+
export declare const ApiAggregatedAdlBadDebt: {
|
|
30
|
+
encode(message: ApiAggregatedAdlBadDebt, writer?: _m0.Writer): _m0.Writer;
|
|
31
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ApiAggregatedAdlBadDebt;
|
|
32
|
+
fromJSON(object: any): ApiAggregatedAdlBadDebt;
|
|
33
|
+
toJSON(message: ApiAggregatedAdlBadDebt): unknown;
|
|
34
|
+
create(base?: DeepPartial<ApiAggregatedAdlBadDebt>): ApiAggregatedAdlBadDebt;
|
|
35
|
+
fromPartial(object: DeepPartial<ApiAggregatedAdlBadDebt>): ApiAggregatedAdlBadDebt;
|
|
36
|
+
};
|
|
37
|
+
export declare const ApiAdlBadDebt: {
|
|
38
|
+
encode(message: ApiAdlBadDebt, writer?: _m0.Writer): _m0.Writer;
|
|
39
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ApiAdlBadDebt;
|
|
40
|
+
fromJSON(object: any): ApiAdlBadDebt;
|
|
41
|
+
toJSON(message: ApiAdlBadDebt): unknown;
|
|
42
|
+
create(base?: DeepPartial<ApiAdlBadDebt>): ApiAdlBadDebt;
|
|
43
|
+
fromPartial(object: DeepPartial<ApiAdlBadDebt>): ApiAdlBadDebt;
|
|
44
|
+
};
|
|
45
|
+
export declare const AllAdlBadDebtRequest: {
|
|
46
|
+
encode(_: AllAdlBadDebtRequest, writer?: _m0.Writer): _m0.Writer;
|
|
47
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AllAdlBadDebtRequest;
|
|
48
|
+
fromJSON(_: any): AllAdlBadDebtRequest;
|
|
49
|
+
toJSON(_: AllAdlBadDebtRequest): unknown;
|
|
50
|
+
create(base?: DeepPartial<AllAdlBadDebtRequest>): AllAdlBadDebtRequest;
|
|
51
|
+
fromPartial(_: DeepPartial<AllAdlBadDebtRequest>): AllAdlBadDebtRequest;
|
|
52
|
+
};
|
|
53
|
+
export declare const AllAdlBadDebtResponse: {
|
|
54
|
+
encode(message: AllAdlBadDebtResponse, writer?: _m0.Writer): _m0.Writer;
|
|
55
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AllAdlBadDebtResponse;
|
|
56
|
+
fromJSON(object: any): AllAdlBadDebtResponse;
|
|
57
|
+
toJSON(message: AllAdlBadDebtResponse): unknown;
|
|
58
|
+
create(base?: DeepPartial<AllAdlBadDebtResponse>): AllAdlBadDebtResponse;
|
|
59
|
+
fromPartial(object: DeepPartial<AllAdlBadDebtResponse>): AllAdlBadDebtResponse;
|
|
60
|
+
};
|
|
61
|
+
export declare const AdlBadDebtRequest: {
|
|
62
|
+
encode(message: AdlBadDebtRequest, writer?: _m0.Writer): _m0.Writer;
|
|
63
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AdlBadDebtRequest;
|
|
64
|
+
fromJSON(object: any): AdlBadDebtRequest;
|
|
65
|
+
toJSON(message: AdlBadDebtRequest): unknown;
|
|
66
|
+
create(base?: DeepPartial<AdlBadDebtRequest>): AdlBadDebtRequest;
|
|
67
|
+
fromPartial(object: DeepPartial<AdlBadDebtRequest>): AdlBadDebtRequest;
|
|
68
|
+
};
|
|
69
|
+
export declare const AdlBadDebtResponse: {
|
|
70
|
+
encode(message: AdlBadDebtResponse, writer?: _m0.Writer): _m0.Writer;
|
|
71
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AdlBadDebtResponse;
|
|
72
|
+
fromJSON(object: any): AdlBadDebtResponse;
|
|
73
|
+
toJSON(message: AdlBadDebtResponse): unknown;
|
|
74
|
+
create(base?: DeepPartial<AdlBadDebtResponse>): AdlBadDebtResponse;
|
|
75
|
+
fromPartial(object: DeepPartial<AdlBadDebtResponse>): AdlBadDebtResponse;
|
|
76
|
+
};
|
|
2
77
|
/** Query defines the gRPC querier service. */
|
|
3
78
|
export interface Query {
|
|
79
|
+
/** this line is used by starport scaffolding # 2 */
|
|
80
|
+
AllAdlBadDebt(request: AllAdlBadDebtRequest): Promise<AllAdlBadDebtResponse>;
|
|
81
|
+
AdlBadDebt(request: AdlBadDebtRequest): Promise<AdlBadDebtResponse>;
|
|
4
82
|
}
|
|
5
83
|
export declare class QueryClientImpl implements Query {
|
|
6
84
|
private readonly rpc;
|
|
@@ -8,8 +86,14 @@ export declare class QueryClientImpl implements Query {
|
|
|
8
86
|
constructor(rpc: Rpc, opts?: {
|
|
9
87
|
service?: string;
|
|
10
88
|
});
|
|
89
|
+
AllAdlBadDebt(request: AllAdlBadDebtRequest): Promise<AllAdlBadDebtResponse>;
|
|
90
|
+
AdlBadDebt(request: AdlBadDebtRequest): Promise<AdlBadDebtResponse>;
|
|
11
91
|
}
|
|
12
92
|
interface Rpc {
|
|
13
93
|
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
14
94
|
}
|
|
95
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
96
|
+
export 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 {} ? {
|
|
97
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
98
|
+
} : Partial<T>;
|
|
15
99
|
export {};
|