carbon-js-sdk 0.2.13 → 0.2.14
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/codec/cdp/asset_params.d.ts +0 -11
- package/lib/codec/cdp/asset_params.js +1 -69
- package/lib/codec/coin/query.d.ts +0 -3
- package/lib/codec/coin/query.js +0 -6
- package/lib/codec/coin/token.d.ts +11 -0
- package/lib/codec/coin/token.js +65 -1
- package/lib/codec/cosmos/authz/v1beta1/authz.d.ts +19 -0
- package/lib/codec/cosmos/authz/v1beta1/authz.js +89 -1
- package/lib/codec/cosmos/authz/v1beta1/genesis.d.ts +1 -15
- package/lib/codec/cosmos/authz/v1beta1/genesis.js +7 -120
- package/lib/codec/cosmos/authz/v1beta1/query.d.ts +69 -1
- package/lib/codec/cosmos/authz/v1beta1/query.js +273 -1
- package/lib/codec/cosmos/bank/v1beta1/export.d.ts +1 -1
- package/lib/codec/cosmos/bank/v1beta1/export.js +3 -1
- package/lib/codec/cosmos/bank/v1beta1/query.d.ts +40 -0
- package/lib/codec/cosmos/bank/v1beta1/query.js +137 -1
- package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.d.ts +64 -0
- package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.js +343 -1
- package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +33 -0
- package/lib/codec/cosmos/feegrant/v1beta1/query.js +137 -1
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +13 -0
- package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +18 -0
- package/lib/codec/cosmos/tx/v1beta1/export.d.ts +1 -1
- package/lib/codec/cosmos/tx/v1beta1/export.js +3 -1
- package/lib/codec/cosmos/tx/v1beta1/service.d.ts +50 -2
- package/lib/codec/cosmos/tx/v1beta1/service.js +176 -1
- package/lib/codec/index.d.ts +1 -6
- package/lib/codec/index.js +334 -347
- package/lib/codec/market/genesis.d.ts +1 -0
- package/lib/codec/market/genesis.js +19 -1
- package/lib/codec/misc/trade.d.ts +1 -0
- package/lib/codec/misc/trade.js +17 -0
- package/lib/util/tx.d.ts +0 -4
- package/lib/wallet/CarbonSigningClient.js +27 -2
- package/lib/websocket/models.d.ts +37 -21
- package/package.json +1 -1
|
@@ -18,10 +18,6 @@ export interface AssetUtilization {
|
|
|
18
18
|
totalAmount: string;
|
|
19
19
|
utilizationRate: string;
|
|
20
20
|
}
|
|
21
|
-
export interface AssetData {
|
|
22
|
-
assetParams?: AssetParams;
|
|
23
|
-
assetUtilization?: AssetUtilization;
|
|
24
|
-
}
|
|
25
21
|
export declare const AssetParams: {
|
|
26
22
|
encode(message: AssetParams, writer?: _m0.Writer): _m0.Writer;
|
|
27
23
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AssetParams;
|
|
@@ -36,13 +32,6 @@ export declare const AssetUtilization: {
|
|
|
36
32
|
toJSON(message: AssetUtilization): unknown;
|
|
37
33
|
fromPartial(object: DeepPartial<AssetUtilization>): AssetUtilization;
|
|
38
34
|
};
|
|
39
|
-
export declare const AssetData: {
|
|
40
|
-
encode(message: AssetData, writer?: _m0.Writer): _m0.Writer;
|
|
41
|
-
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AssetData;
|
|
42
|
-
fromJSON(object: any): AssetData;
|
|
43
|
-
toJSON(message: AssetData): unknown;
|
|
44
|
-
fromPartial(object: DeepPartial<AssetData>): AssetData;
|
|
45
|
-
};
|
|
46
35
|
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
47
36
|
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 {} ? {
|
|
48
37
|
[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.
|
|
6
|
+
exports.AssetUtilization = exports.AssetParams = 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"));
|
|
@@ -256,74 +256,6 @@ exports.AssetUtilization = {
|
|
|
256
256
|
return message;
|
|
257
257
|
},
|
|
258
258
|
};
|
|
259
|
-
const baseAssetData = {};
|
|
260
|
-
exports.AssetData = {
|
|
261
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
262
|
-
if (message.assetParams !== undefined) {
|
|
263
|
-
exports.AssetParams.encode(message.assetParams, writer.uint32(10).fork()).ldelim();
|
|
264
|
-
}
|
|
265
|
-
if (message.assetUtilization !== undefined) {
|
|
266
|
-
exports.AssetUtilization.encode(message.assetUtilization, writer.uint32(18).fork()).ldelim();
|
|
267
|
-
}
|
|
268
|
-
return writer;
|
|
269
|
-
},
|
|
270
|
-
decode(input, length) {
|
|
271
|
-
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
272
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
273
|
-
const message = Object.assign({}, baseAssetData);
|
|
274
|
-
while (reader.pos < end) {
|
|
275
|
-
const tag = reader.uint32();
|
|
276
|
-
switch (tag >>> 3) {
|
|
277
|
-
case 1:
|
|
278
|
-
message.assetParams = exports.AssetParams.decode(reader, reader.uint32());
|
|
279
|
-
break;
|
|
280
|
-
case 2:
|
|
281
|
-
message.assetUtilization = exports.AssetUtilization.decode(reader, reader.uint32());
|
|
282
|
-
break;
|
|
283
|
-
default:
|
|
284
|
-
reader.skipType(tag & 7);
|
|
285
|
-
break;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return message;
|
|
289
|
-
},
|
|
290
|
-
fromJSON(object) {
|
|
291
|
-
const message = Object.assign({}, baseAssetData);
|
|
292
|
-
message.assetParams =
|
|
293
|
-
object.assetParams !== undefined && object.assetParams !== null
|
|
294
|
-
? exports.AssetParams.fromJSON(object.assetParams)
|
|
295
|
-
: undefined;
|
|
296
|
-
message.assetUtilization =
|
|
297
|
-
object.assetUtilization !== undefined && object.assetUtilization !== null
|
|
298
|
-
? exports.AssetUtilization.fromJSON(object.assetUtilization)
|
|
299
|
-
: undefined;
|
|
300
|
-
return message;
|
|
301
|
-
},
|
|
302
|
-
toJSON(message) {
|
|
303
|
-
const obj = {};
|
|
304
|
-
message.assetParams !== undefined &&
|
|
305
|
-
(obj.assetParams = message.assetParams
|
|
306
|
-
? exports.AssetParams.toJSON(message.assetParams)
|
|
307
|
-
: undefined);
|
|
308
|
-
message.assetUtilization !== undefined &&
|
|
309
|
-
(obj.assetUtilization = message.assetUtilization
|
|
310
|
-
? exports.AssetUtilization.toJSON(message.assetUtilization)
|
|
311
|
-
: undefined);
|
|
312
|
-
return obj;
|
|
313
|
-
},
|
|
314
|
-
fromPartial(object) {
|
|
315
|
-
const message = Object.assign({}, baseAssetData);
|
|
316
|
-
message.assetParams =
|
|
317
|
-
object.assetParams !== undefined && object.assetParams !== null
|
|
318
|
-
? exports.AssetParams.fromPartial(object.assetParams)
|
|
319
|
-
: undefined;
|
|
320
|
-
message.assetUtilization =
|
|
321
|
-
object.assetUtilization !== undefined && object.assetUtilization !== null
|
|
322
|
-
? exports.AssetUtilization.fromPartial(object.assetUtilization)
|
|
323
|
-
: undefined;
|
|
324
|
-
return message;
|
|
325
|
-
},
|
|
326
|
-
};
|
|
327
259
|
if (minimal_1.default.util.Long !== long_1.default) {
|
|
328
260
|
minimal_1.default.util.Long = long_1.default;
|
|
329
261
|
minimal_1.default.configure();
|
|
@@ -188,8 +188,6 @@ export declare const QueryAllBridgeResponse: {
|
|
|
188
188
|
export interface Query {
|
|
189
189
|
/** Get token details for a denom */
|
|
190
190
|
Token(request: QueryGetTokenRequest): Promise<QueryGetTokenResponse>;
|
|
191
|
-
/** Get token details for a denom(as string) */
|
|
192
|
-
TokenQueryParams(request: QueryGetTokenRequest): Promise<QueryGetTokenResponse>;
|
|
193
191
|
/** Get all token details */
|
|
194
192
|
TokenAll(request: QueryAllTokenRequest): Promise<QueryAllTokenResponse>;
|
|
195
193
|
/** Get locked coins for an address */
|
|
@@ -209,7 +207,6 @@ export declare class QueryClientImpl implements Query {
|
|
|
209
207
|
private readonly rpc;
|
|
210
208
|
constructor(rpc: Rpc);
|
|
211
209
|
Token(request: QueryGetTokenRequest): Promise<QueryGetTokenResponse>;
|
|
212
|
-
TokenQueryParams(request: QueryGetTokenRequest): Promise<QueryGetTokenResponse>;
|
|
213
210
|
TokenAll(request: QueryAllTokenRequest): Promise<QueryAllTokenResponse>;
|
|
214
211
|
LockedCoins(request: QueryGetLockedCoinsRequest): Promise<QueryGetLockedCoinsResponse>;
|
|
215
212
|
WrapperMappings(request: QueryAllWrapperMappingsRequest): Promise<QueryAllWrapperMappingsResponse>;
|
package/lib/codec/coin/query.js
CHANGED
|
@@ -962,7 +962,6 @@ class QueryClientImpl {
|
|
|
962
962
|
constructor(rpc) {
|
|
963
963
|
this.rpc = rpc;
|
|
964
964
|
this.Token = this.Token.bind(this);
|
|
965
|
-
this.TokenQueryParams = this.TokenQueryParams.bind(this);
|
|
966
965
|
this.TokenAll = this.TokenAll.bind(this);
|
|
967
966
|
this.LockedCoins = this.LockedCoins.bind(this);
|
|
968
967
|
this.WrapperMappings = this.WrapperMappings.bind(this);
|
|
@@ -976,11 +975,6 @@ class QueryClientImpl {
|
|
|
976
975
|
const promise = this.rpc.request("Switcheo.carbon.coin.Query", "Token", data);
|
|
977
976
|
return promise.then((data) => exports.QueryGetTokenResponse.decode(new minimal_1.default.Reader(data)));
|
|
978
977
|
}
|
|
979
|
-
TokenQueryParams(request) {
|
|
980
|
-
const data = exports.QueryGetTokenRequest.encode(request).finish();
|
|
981
|
-
const promise = this.rpc.request("Switcheo.carbon.coin.Query", "TokenQueryParams", data);
|
|
982
|
-
return promise.then((data) => exports.QueryGetTokenResponse.decode(new minimal_1.default.Reader(data)));
|
|
983
|
-
}
|
|
984
978
|
TokenAll(request) {
|
|
985
979
|
const data = exports.QueryAllTokenRequest.encode(request).finish();
|
|
986
980
|
const promise = this.rpc.request("Switcheo.carbon.coin.Query", "TokenAll", data);
|
|
@@ -23,6 +23,10 @@ export interface BalanceChange {
|
|
|
23
23
|
amount: string;
|
|
24
24
|
type: string;
|
|
25
25
|
location: string;
|
|
26
|
+
metadata?: Metadata;
|
|
27
|
+
}
|
|
28
|
+
export interface Metadata {
|
|
29
|
+
orderId?: string;
|
|
26
30
|
}
|
|
27
31
|
export interface LockedCoins {
|
|
28
32
|
denom: string;
|
|
@@ -59,6 +63,13 @@ export declare const BalanceChange: {
|
|
|
59
63
|
toJSON(message: BalanceChange): unknown;
|
|
60
64
|
fromPartial(object: DeepPartial<BalanceChange>): BalanceChange;
|
|
61
65
|
};
|
|
66
|
+
export declare const Metadata: {
|
|
67
|
+
encode(message: Metadata, writer?: _m0.Writer): _m0.Writer;
|
|
68
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Metadata;
|
|
69
|
+
fromJSON(object: any): Metadata;
|
|
70
|
+
toJSON(message: Metadata): unknown;
|
|
71
|
+
fromPartial(object: DeepPartial<Metadata>): Metadata;
|
|
72
|
+
};
|
|
62
73
|
export declare const LockedCoins: {
|
|
63
74
|
encode(message: LockedCoins, writer?: _m0.Writer): _m0.Writer;
|
|
64
75
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): LockedCoins;
|
package/lib/codec/coin/token.js
CHANGED
|
@@ -3,11 +3,12 @@ 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.TokenBalance = exports.PositionPool = exports.LockedCoinsRecord = exports.LockedCoins = exports.BalanceChange = exports.Token = exports.protobufPackage = void 0;
|
|
6
|
+
exports.TokenBalance = exports.PositionPool = exports.LockedCoinsRecord = exports.LockedCoins = exports.Metadata = exports.BalanceChange = exports.Token = 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
10
|
const coin_1 = require("../cosmos/base/v1beta1/coin");
|
|
11
|
+
const wrappers_1 = require("../google/protobuf/wrappers");
|
|
11
12
|
exports.protobufPackage = "Switcheo.carbon.coin";
|
|
12
13
|
const baseToken = {
|
|
13
14
|
id: "",
|
|
@@ -240,6 +241,9 @@ exports.BalanceChange = {
|
|
|
240
241
|
if (message.location !== "") {
|
|
241
242
|
writer.uint32(50).string(message.location);
|
|
242
243
|
}
|
|
244
|
+
if (message.metadata !== undefined) {
|
|
245
|
+
exports.Metadata.encode(message.metadata, writer.uint32(58).fork()).ldelim();
|
|
246
|
+
}
|
|
243
247
|
return writer;
|
|
244
248
|
},
|
|
245
249
|
decode(input, length) {
|
|
@@ -267,6 +271,9 @@ exports.BalanceChange = {
|
|
|
267
271
|
case 6:
|
|
268
272
|
message.location = reader.string();
|
|
269
273
|
break;
|
|
274
|
+
case 7:
|
|
275
|
+
message.metadata = exports.Metadata.decode(reader, reader.uint32());
|
|
276
|
+
break;
|
|
270
277
|
default:
|
|
271
278
|
reader.skipType(tag & 7);
|
|
272
279
|
break;
|
|
@@ -300,6 +307,10 @@ exports.BalanceChange = {
|
|
|
300
307
|
object.location !== undefined && object.location !== null
|
|
301
308
|
? String(object.location)
|
|
302
309
|
: "";
|
|
310
|
+
message.metadata =
|
|
311
|
+
object.metadata !== undefined && object.metadata !== null
|
|
312
|
+
? exports.Metadata.fromJSON(object.metadata)
|
|
313
|
+
: undefined;
|
|
303
314
|
return message;
|
|
304
315
|
},
|
|
305
316
|
toJSON(message) {
|
|
@@ -311,6 +322,10 @@ exports.BalanceChange = {
|
|
|
311
322
|
message.amount !== undefined && (obj.amount = message.amount);
|
|
312
323
|
message.type !== undefined && (obj.type = message.type);
|
|
313
324
|
message.location !== undefined && (obj.location = message.location);
|
|
325
|
+
message.metadata !== undefined &&
|
|
326
|
+
(obj.metadata = message.metadata
|
|
327
|
+
? exports.Metadata.toJSON(message.metadata)
|
|
328
|
+
: undefined);
|
|
314
329
|
return obj;
|
|
315
330
|
},
|
|
316
331
|
fromPartial(object) {
|
|
@@ -325,6 +340,55 @@ exports.BalanceChange = {
|
|
|
325
340
|
message.amount = (_c = object.amount) !== null && _c !== void 0 ? _c : "";
|
|
326
341
|
message.type = (_d = object.type) !== null && _d !== void 0 ? _d : "";
|
|
327
342
|
message.location = (_e = object.location) !== null && _e !== void 0 ? _e : "";
|
|
343
|
+
message.metadata =
|
|
344
|
+
object.metadata !== undefined && object.metadata !== null
|
|
345
|
+
? exports.Metadata.fromPartial(object.metadata)
|
|
346
|
+
: undefined;
|
|
347
|
+
return message;
|
|
348
|
+
},
|
|
349
|
+
};
|
|
350
|
+
const baseMetadata = {};
|
|
351
|
+
exports.Metadata = {
|
|
352
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
353
|
+
if (message.orderId !== undefined) {
|
|
354
|
+
wrappers_1.StringValue.encode({ value: message.orderId }, writer.uint32(10).fork()).ldelim();
|
|
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({}, baseMetadata);
|
|
362
|
+
while (reader.pos < end) {
|
|
363
|
+
const tag = reader.uint32();
|
|
364
|
+
switch (tag >>> 3) {
|
|
365
|
+
case 1:
|
|
366
|
+
message.orderId = wrappers_1.StringValue.decode(reader, reader.uint32()).value;
|
|
367
|
+
break;
|
|
368
|
+
default:
|
|
369
|
+
reader.skipType(tag & 7);
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return message;
|
|
374
|
+
},
|
|
375
|
+
fromJSON(object) {
|
|
376
|
+
const message = Object.assign({}, baseMetadata);
|
|
377
|
+
message.orderId =
|
|
378
|
+
object.orderId !== undefined && object.orderId !== null
|
|
379
|
+
? String(object.orderId)
|
|
380
|
+
: undefined;
|
|
381
|
+
return message;
|
|
382
|
+
},
|
|
383
|
+
toJSON(message) {
|
|
384
|
+
const obj = {};
|
|
385
|
+
message.orderId !== undefined && (obj.orderId = message.orderId);
|
|
386
|
+
return obj;
|
|
387
|
+
},
|
|
388
|
+
fromPartial(object) {
|
|
389
|
+
var _a;
|
|
390
|
+
const message = Object.assign({}, baseMetadata);
|
|
391
|
+
message.orderId = (_a = object.orderId) !== null && _a !== void 0 ? _a : undefined;
|
|
328
392
|
return message;
|
|
329
393
|
},
|
|
330
394
|
};
|
|
@@ -19,6 +19,18 @@ export interface Grant {
|
|
|
19
19
|
authorization?: Any;
|
|
20
20
|
expiration?: Date;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* GrantAuthorization extends a grant with both the addresses of the grantee and granter.
|
|
24
|
+
* It is used in genesis.proto and query.proto
|
|
25
|
+
*
|
|
26
|
+
* Since: cosmos-sdk 0.45.2
|
|
27
|
+
*/
|
|
28
|
+
export interface GrantAuthorization {
|
|
29
|
+
granter: string;
|
|
30
|
+
grantee: string;
|
|
31
|
+
authorization?: Any;
|
|
32
|
+
expiration?: Date;
|
|
33
|
+
}
|
|
22
34
|
export declare const GenericAuthorization: {
|
|
23
35
|
encode(message: GenericAuthorization, writer?: _m0.Writer): _m0.Writer;
|
|
24
36
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): GenericAuthorization;
|
|
@@ -33,6 +45,13 @@ export declare const Grant: {
|
|
|
33
45
|
toJSON(message: Grant): unknown;
|
|
34
46
|
fromPartial(object: DeepPartial<Grant>): Grant;
|
|
35
47
|
};
|
|
48
|
+
export declare const GrantAuthorization: {
|
|
49
|
+
encode(message: GrantAuthorization, writer?: _m0.Writer): _m0.Writer;
|
|
50
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): GrantAuthorization;
|
|
51
|
+
fromJSON(object: any): GrantAuthorization;
|
|
52
|
+
toJSON(message: GrantAuthorization): unknown;
|
|
53
|
+
fromPartial(object: DeepPartial<GrantAuthorization>): GrantAuthorization;
|
|
54
|
+
};
|
|
36
55
|
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
37
56
|
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 {} ? {
|
|
38
57
|
[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.Grant = exports.GenericAuthorization = exports.protobufPackage = void 0;
|
|
6
|
+
exports.GrantAuthorization = exports.Grant = exports.GenericAuthorization = 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"));
|
|
@@ -117,6 +117,94 @@ exports.Grant = {
|
|
|
117
117
|
return message;
|
|
118
118
|
},
|
|
119
119
|
};
|
|
120
|
+
const baseGrantAuthorization = { granter: "", grantee: "" };
|
|
121
|
+
exports.GrantAuthorization = {
|
|
122
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
123
|
+
if (message.granter !== "") {
|
|
124
|
+
writer.uint32(10).string(message.granter);
|
|
125
|
+
}
|
|
126
|
+
if (message.grantee !== "") {
|
|
127
|
+
writer.uint32(18).string(message.grantee);
|
|
128
|
+
}
|
|
129
|
+
if (message.authorization !== undefined) {
|
|
130
|
+
any_1.Any.encode(message.authorization, writer.uint32(26).fork()).ldelim();
|
|
131
|
+
}
|
|
132
|
+
if (message.expiration !== undefined) {
|
|
133
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.expiration), writer.uint32(34).fork()).ldelim();
|
|
134
|
+
}
|
|
135
|
+
return writer;
|
|
136
|
+
},
|
|
137
|
+
decode(input, length) {
|
|
138
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
139
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
140
|
+
const message = Object.assign({}, baseGrantAuthorization);
|
|
141
|
+
while (reader.pos < end) {
|
|
142
|
+
const tag = reader.uint32();
|
|
143
|
+
switch (tag >>> 3) {
|
|
144
|
+
case 1:
|
|
145
|
+
message.granter = reader.string();
|
|
146
|
+
break;
|
|
147
|
+
case 2:
|
|
148
|
+
message.grantee = reader.string();
|
|
149
|
+
break;
|
|
150
|
+
case 3:
|
|
151
|
+
message.authorization = any_1.Any.decode(reader, reader.uint32());
|
|
152
|
+
break;
|
|
153
|
+
case 4:
|
|
154
|
+
message.expiration = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
155
|
+
break;
|
|
156
|
+
default:
|
|
157
|
+
reader.skipType(tag & 7);
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return message;
|
|
162
|
+
},
|
|
163
|
+
fromJSON(object) {
|
|
164
|
+
const message = Object.assign({}, baseGrantAuthorization);
|
|
165
|
+
message.granter =
|
|
166
|
+
object.granter !== undefined && object.granter !== null
|
|
167
|
+
? String(object.granter)
|
|
168
|
+
: "";
|
|
169
|
+
message.grantee =
|
|
170
|
+
object.grantee !== undefined && object.grantee !== null
|
|
171
|
+
? String(object.grantee)
|
|
172
|
+
: "";
|
|
173
|
+
message.authorization =
|
|
174
|
+
object.authorization !== undefined && object.authorization !== null
|
|
175
|
+
? any_1.Any.fromJSON(object.authorization)
|
|
176
|
+
: undefined;
|
|
177
|
+
message.expiration =
|
|
178
|
+
object.expiration !== undefined && object.expiration !== null
|
|
179
|
+
? fromJsonTimestamp(object.expiration)
|
|
180
|
+
: undefined;
|
|
181
|
+
return message;
|
|
182
|
+
},
|
|
183
|
+
toJSON(message) {
|
|
184
|
+
const obj = {};
|
|
185
|
+
message.granter !== undefined && (obj.granter = message.granter);
|
|
186
|
+
message.grantee !== undefined && (obj.grantee = message.grantee);
|
|
187
|
+
message.authorization !== undefined &&
|
|
188
|
+
(obj.authorization = message.authorization
|
|
189
|
+
? any_1.Any.toJSON(message.authorization)
|
|
190
|
+
: undefined);
|
|
191
|
+
message.expiration !== undefined &&
|
|
192
|
+
(obj.expiration = message.expiration.toISOString());
|
|
193
|
+
return obj;
|
|
194
|
+
},
|
|
195
|
+
fromPartial(object) {
|
|
196
|
+
var _a, _b, _c;
|
|
197
|
+
const message = Object.assign({}, baseGrantAuthorization);
|
|
198
|
+
message.granter = (_a = object.granter) !== null && _a !== void 0 ? _a : "";
|
|
199
|
+
message.grantee = (_b = object.grantee) !== null && _b !== void 0 ? _b : "";
|
|
200
|
+
message.authorization =
|
|
201
|
+
object.authorization !== undefined && object.authorization !== null
|
|
202
|
+
? any_1.Any.fromPartial(object.authorization)
|
|
203
|
+
: undefined;
|
|
204
|
+
message.expiration = (_c = object.expiration) !== null && _c !== void 0 ? _c : undefined;
|
|
205
|
+
return message;
|
|
206
|
+
},
|
|
207
|
+
};
|
|
120
208
|
function toTimestamp(date) {
|
|
121
209
|
const seconds = numberToLong(date.getTime() / 1000);
|
|
122
210
|
const nanos = (date.getTime() % 1000) * 1000000;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import Long from "long";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
|
-
import {
|
|
3
|
+
import { GrantAuthorization } from "../../../cosmos/authz/v1beta1/authz";
|
|
4
4
|
export declare const protobufPackage = "cosmos.authz.v1beta1";
|
|
5
5
|
/** Since: cosmos-sdk 0.43 */
|
|
6
6
|
/** GenesisState defines the authz module's genesis state. */
|
|
7
7
|
export interface GenesisState {
|
|
8
8
|
authorization: GrantAuthorization[];
|
|
9
9
|
}
|
|
10
|
-
/** GrantAuthorization defines the GenesisState/GrantAuthorization type. */
|
|
11
|
-
export interface GrantAuthorization {
|
|
12
|
-
granter: string;
|
|
13
|
-
grantee: string;
|
|
14
|
-
authorization?: Any;
|
|
15
|
-
expiration?: Date;
|
|
16
|
-
}
|
|
17
10
|
export declare const GenesisState: {
|
|
18
11
|
encode(message: GenesisState, writer?: _m0.Writer): _m0.Writer;
|
|
19
12
|
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): GenesisState;
|
|
@@ -21,13 +14,6 @@ export declare const GenesisState: {
|
|
|
21
14
|
toJSON(message: GenesisState): unknown;
|
|
22
15
|
fromPartial(object: DeepPartial<GenesisState>): GenesisState;
|
|
23
16
|
};
|
|
24
|
-
export declare const GrantAuthorization: {
|
|
25
|
-
encode(message: GrantAuthorization, writer?: _m0.Writer): _m0.Writer;
|
|
26
|
-
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): GrantAuthorization;
|
|
27
|
-
fromJSON(object: any): GrantAuthorization;
|
|
28
|
-
toJSON(message: GrantAuthorization): unknown;
|
|
29
|
-
fromPartial(object: DeepPartial<GrantAuthorization>): GrantAuthorization;
|
|
30
|
-
};
|
|
31
17
|
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
32
18
|
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 {} ? {
|
|
33
19
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
@@ -3,18 +3,17 @@ 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.
|
|
6
|
+
exports.GenesisState = 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
|
|
11
|
-
const timestamp_1 = require("../../../google/protobuf/timestamp");
|
|
10
|
+
const authz_1 = require("../../../cosmos/authz/v1beta1/authz");
|
|
12
11
|
exports.protobufPackage = "cosmos.authz.v1beta1";
|
|
13
12
|
const baseGenesisState = {};
|
|
14
13
|
exports.GenesisState = {
|
|
15
14
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
16
15
|
for (const v of message.authorization) {
|
|
17
|
-
|
|
16
|
+
authz_1.GrantAuthorization.encode(v, writer.uint32(10).fork()).ldelim();
|
|
18
17
|
}
|
|
19
18
|
return writer;
|
|
20
19
|
},
|
|
@@ -27,7 +26,7 @@ exports.GenesisState = {
|
|
|
27
26
|
const tag = reader.uint32();
|
|
28
27
|
switch (tag >>> 3) {
|
|
29
28
|
case 1:
|
|
30
|
-
message.authorization.push(
|
|
29
|
+
message.authorization.push(authz_1.GrantAuthorization.decode(reader, reader.uint32()));
|
|
31
30
|
break;
|
|
32
31
|
default:
|
|
33
32
|
reader.skipType(tag & 7);
|
|
@@ -39,13 +38,13 @@ exports.GenesisState = {
|
|
|
39
38
|
fromJSON(object) {
|
|
40
39
|
var _a;
|
|
41
40
|
const message = Object.assign({}, baseGenesisState);
|
|
42
|
-
message.authorization = ((_a = object.authorization) !== null && _a !== void 0 ? _a : []).map((e) =>
|
|
41
|
+
message.authorization = ((_a = object.authorization) !== null && _a !== void 0 ? _a : []).map((e) => authz_1.GrantAuthorization.fromJSON(e));
|
|
43
42
|
return message;
|
|
44
43
|
},
|
|
45
44
|
toJSON(message) {
|
|
46
45
|
const obj = {};
|
|
47
46
|
if (message.authorization) {
|
|
48
|
-
obj.authorization = message.authorization.map((e) => e ?
|
|
47
|
+
obj.authorization = message.authorization.map((e) => e ? authz_1.GrantAuthorization.toJSON(e) : undefined);
|
|
49
48
|
}
|
|
50
49
|
else {
|
|
51
50
|
obj.authorization = [];
|
|
@@ -55,122 +54,10 @@ exports.GenesisState = {
|
|
|
55
54
|
fromPartial(object) {
|
|
56
55
|
var _a;
|
|
57
56
|
const message = Object.assign({}, baseGenesisState);
|
|
58
|
-
message.authorization = ((_a = object.authorization) !== null && _a !== void 0 ? _a : []).map((e) =>
|
|
57
|
+
message.authorization = ((_a = object.authorization) !== null && _a !== void 0 ? _a : []).map((e) => authz_1.GrantAuthorization.fromPartial(e));
|
|
59
58
|
return message;
|
|
60
59
|
},
|
|
61
60
|
};
|
|
62
|
-
const baseGrantAuthorization = { granter: "", grantee: "" };
|
|
63
|
-
exports.GrantAuthorization = {
|
|
64
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
65
|
-
if (message.granter !== "") {
|
|
66
|
-
writer.uint32(10).string(message.granter);
|
|
67
|
-
}
|
|
68
|
-
if (message.grantee !== "") {
|
|
69
|
-
writer.uint32(18).string(message.grantee);
|
|
70
|
-
}
|
|
71
|
-
if (message.authorization !== undefined) {
|
|
72
|
-
any_1.Any.encode(message.authorization, writer.uint32(26).fork()).ldelim();
|
|
73
|
-
}
|
|
74
|
-
if (message.expiration !== undefined) {
|
|
75
|
-
timestamp_1.Timestamp.encode(toTimestamp(message.expiration), writer.uint32(34).fork()).ldelim();
|
|
76
|
-
}
|
|
77
|
-
return writer;
|
|
78
|
-
},
|
|
79
|
-
decode(input, length) {
|
|
80
|
-
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
81
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
82
|
-
const message = Object.assign({}, baseGrantAuthorization);
|
|
83
|
-
while (reader.pos < end) {
|
|
84
|
-
const tag = reader.uint32();
|
|
85
|
-
switch (tag >>> 3) {
|
|
86
|
-
case 1:
|
|
87
|
-
message.granter = reader.string();
|
|
88
|
-
break;
|
|
89
|
-
case 2:
|
|
90
|
-
message.grantee = reader.string();
|
|
91
|
-
break;
|
|
92
|
-
case 3:
|
|
93
|
-
message.authorization = any_1.Any.decode(reader, reader.uint32());
|
|
94
|
-
break;
|
|
95
|
-
case 4:
|
|
96
|
-
message.expiration = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
97
|
-
break;
|
|
98
|
-
default:
|
|
99
|
-
reader.skipType(tag & 7);
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return message;
|
|
104
|
-
},
|
|
105
|
-
fromJSON(object) {
|
|
106
|
-
const message = Object.assign({}, baseGrantAuthorization);
|
|
107
|
-
message.granter =
|
|
108
|
-
object.granter !== undefined && object.granter !== null
|
|
109
|
-
? String(object.granter)
|
|
110
|
-
: "";
|
|
111
|
-
message.grantee =
|
|
112
|
-
object.grantee !== undefined && object.grantee !== null
|
|
113
|
-
? String(object.grantee)
|
|
114
|
-
: "";
|
|
115
|
-
message.authorization =
|
|
116
|
-
object.authorization !== undefined && object.authorization !== null
|
|
117
|
-
? any_1.Any.fromJSON(object.authorization)
|
|
118
|
-
: undefined;
|
|
119
|
-
message.expiration =
|
|
120
|
-
object.expiration !== undefined && object.expiration !== null
|
|
121
|
-
? fromJsonTimestamp(object.expiration)
|
|
122
|
-
: undefined;
|
|
123
|
-
return message;
|
|
124
|
-
},
|
|
125
|
-
toJSON(message) {
|
|
126
|
-
const obj = {};
|
|
127
|
-
message.granter !== undefined && (obj.granter = message.granter);
|
|
128
|
-
message.grantee !== undefined && (obj.grantee = message.grantee);
|
|
129
|
-
message.authorization !== undefined &&
|
|
130
|
-
(obj.authorization = message.authorization
|
|
131
|
-
? any_1.Any.toJSON(message.authorization)
|
|
132
|
-
: undefined);
|
|
133
|
-
message.expiration !== undefined &&
|
|
134
|
-
(obj.expiration = message.expiration.toISOString());
|
|
135
|
-
return obj;
|
|
136
|
-
},
|
|
137
|
-
fromPartial(object) {
|
|
138
|
-
var _a, _b, _c;
|
|
139
|
-
const message = Object.assign({}, baseGrantAuthorization);
|
|
140
|
-
message.granter = (_a = object.granter) !== null && _a !== void 0 ? _a : "";
|
|
141
|
-
message.grantee = (_b = object.grantee) !== null && _b !== void 0 ? _b : "";
|
|
142
|
-
message.authorization =
|
|
143
|
-
object.authorization !== undefined && object.authorization !== null
|
|
144
|
-
? any_1.Any.fromPartial(object.authorization)
|
|
145
|
-
: undefined;
|
|
146
|
-
message.expiration = (_c = object.expiration) !== null && _c !== void 0 ? _c : undefined;
|
|
147
|
-
return message;
|
|
148
|
-
},
|
|
149
|
-
};
|
|
150
|
-
function toTimestamp(date) {
|
|
151
|
-
const seconds = numberToLong(date.getTime() / 1000);
|
|
152
|
-
const nanos = (date.getTime() % 1000) * 1000000;
|
|
153
|
-
return { seconds, nanos };
|
|
154
|
-
}
|
|
155
|
-
function fromTimestamp(t) {
|
|
156
|
-
let millis = t.seconds.toNumber() * 1000;
|
|
157
|
-
millis += t.nanos / 1000000;
|
|
158
|
-
return new Date(millis);
|
|
159
|
-
}
|
|
160
|
-
function fromJsonTimestamp(o) {
|
|
161
|
-
if (o instanceof Date) {
|
|
162
|
-
return o;
|
|
163
|
-
}
|
|
164
|
-
else if (typeof o === "string") {
|
|
165
|
-
return new Date(o);
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
function numberToLong(number) {
|
|
172
|
-
return long_1.default.fromNumber(number);
|
|
173
|
-
}
|
|
174
61
|
if (minimal_1.default.util.Long !== long_1.default) {
|
|
175
62
|
minimal_1.default.util.Long = long_1.default;
|
|
176
63
|
minimal_1.default.configure();
|