carbon-js-sdk 0.3.51 → 0.3.53-dev.1
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.js +1 -1
- package/lib/clients/ETHClient.d.ts +11 -4
- package/lib/clients/ETHClient.js +20 -6
- package/lib/clients/HydrogenClient.d.ts +16 -7
- package/lib/clients/HydrogenClient.js +55 -9
- package/lib/clients/NEOClient.d.ts +1 -1
- package/lib/clients/NEOClient.js +9 -4
- package/lib/clients/TokenClient.d.ts +17 -4
- package/lib/clients/TokenClient.js +121 -8
- package/lib/clients/ZILClient.d.ts +1 -1
- package/lib/clients/ZILClient.js +9 -4
- package/lib/codec/cosmos/app/module/v1alpha1/module.d.ts +18 -0
- package/lib/codec/cosmos/app/module/v1alpha1/module.js +46 -0
- package/lib/codec/cosmos/app/v1alpha1/config.d.ts +57 -0
- package/lib/codec/cosmos/app/v1alpha1/config.js +125 -0
- package/lib/codec/cosmos/app/v1alpha1/export.d.ts +3 -0
- package/lib/codec/cosmos/app/v1alpha1/export.js +13 -0
- package/lib/codec/cosmos/app/v1alpha1/module.d.ts +109 -0
- package/lib/codec/cosmos/app/v1alpha1/module.js +192 -0
- package/lib/codec/cosmos/app/v1alpha1/query.d.ts +44 -0
- package/lib/codec/cosmos/app/v1alpha1/query.js +107 -0
- package/lib/codec/cosmos/authz/v1beta1/export.d.ts +4 -0
- package/lib/codec/cosmos/authz/v1beta1/export.js +25 -0
- package/lib/codec/cosmos/base/node/v1beta1/query.d.ts +42 -0
- package/lib/codec/cosmos/base/node/v1beta1/query.js +104 -0
- package/lib/codec/cosmos/base/tendermint/v1beta1/types.d.ts +67 -0
- package/lib/codec/cosmos/base/tendermint/v1beta1/types.js +423 -0
- package/lib/codec/cosmos/capability/v1beta1/export.d.ts +2 -0
- package/lib/codec/cosmos/capability/v1beta1/export.js +9 -0
- package/lib/codec/cosmos/crisis/v1beta1/export.d.ts +1 -0
- package/lib/codec/cosmos/crisis/v1beta1/export.js +6 -0
- package/lib/codec/cosmos/crypto/hd/v1/hd.d.ts +32 -0
- package/lib/codec/cosmos/crypto/hd/v1/hd.js +114 -0
- package/lib/codec/cosmos/crypto/keyring/v1/record.d.ts +78 -0
- package/lib/codec/cosmos/crypto/keyring/v1/record.js +309 -0
- package/lib/codec/cosmos/evidence/v1beta1/export.d.ts +3 -0
- package/lib/codec/cosmos/evidence/v1beta1/export.js +13 -0
- package/lib/codec/cosmos/feegrant/v1beta1/export.d.ts +3 -0
- package/lib/codec/cosmos/feegrant/v1beta1/export.js +20 -0
- package/lib/codec/cosmos/gov/v1/export.d.ts +3 -0
- package/lib/codec/cosmos/gov/v1/export.js +46 -0
- package/lib/codec/cosmos/gov/v1/genesis.d.ts +34 -0
- package/lib/codec/cosmos/gov/v1/genesis.js +166 -0
- package/lib/codec/cosmos/gov/v1/gov.d.ts +198 -0
- package/lib/codec/cosmos/gov/v1/gov.js +855 -0
- package/lib/codec/cosmos/gov/v1/query.d.ts +264 -0
- package/lib/codec/cosmos/gov/v1/query.js +1045 -0
- package/lib/codec/cosmos/gov/v1/tx.d.ts +167 -0
- package/lib/codec/cosmos/gov/v1/tx.js +639 -0
- package/lib/codec/cosmos/group/v1/events.d.ts +124 -0
- package/lib/codec/cosmos/group/v1/events.js +480 -0
- package/lib/codec/cosmos/group/v1/export.d.ts +4 -0
- package/lib/codec/cosmos/group/v1/export.js +94 -0
- package/lib/codec/cosmos/group/v1/genesis.d.ts +45 -0
- package/lib/codec/cosmos/group/v1/genesis.js +176 -0
- package/lib/codec/cosmos/group/v1/query.d.ts +412 -0
- package/lib/codec/cosmos/group/v1/query.js +1648 -0
- package/lib/codec/cosmos/group/v1/tx.d.ts +483 -0
- package/lib/codec/cosmos/group/v1/tx.js +1840 -0
- package/lib/codec/cosmos/group/v1/types.d.ts +356 -0
- package/lib/codec/cosmos/group/v1/types.js +1306 -0
- package/lib/codec/cosmos/msg/v1/msg.d.ts +1 -0
- package/lib/codec/cosmos/msg/v1/msg.js +14 -0
- package/lib/codec/cosmos/nft/v1beta1/event.d.ts +48 -0
- package/lib/codec/cosmos/nft/v1beta1/event.js +227 -0
- package/lib/codec/cosmos/nft/v1beta1/export.d.ts +5 -0
- package/lib/codec/cosmos/nft/v1beta1/export.js +30 -0
- package/lib/codec/cosmos/nft/v1beta1/genesis.d.ts +36 -0
- package/lib/codec/cosmos/nft/v1beta1/genesis.js +140 -0
- package/lib/codec/cosmos/nft/v1beta1/nft.d.ts +53 -0
- package/lib/codec/cosmos/nft/v1beta1/nft.js +233 -0
- package/lib/codec/cosmos/nft/v1beta1/query.d.ts +206 -0
- package/lib/codec/cosmos/nft/v1beta1/query.js +817 -0
- package/lib/codec/cosmos/nft/v1beta1/tx.d.ts +49 -0
- package/lib/codec/cosmos/nft/v1beta1/tx.js +137 -0
- package/lib/codec/cosmos/orm/module/v1alpha1/module.d.ts +22 -0
- package/lib/codec/cosmos/orm/module/v1alpha1/module.js +46 -0
- package/lib/codec/cosmos/orm/v1/export.d.ts +1 -0
- package/lib/codec/cosmos/orm/v1/export.js +8 -0
- package/lib/codec/cosmos/orm/v1/orm.d.ts +123 -0
- package/lib/codec/cosmos/orm/v1/orm.js +263 -0
- package/lib/codec/cosmos/orm/v1alpha1/export.d.ts +1 -0
- package/lib/codec/cosmos/orm/v1alpha1/export.js +9 -0
- package/lib/codec/cosmos/orm/v1alpha1/schema.d.ts +96 -0
- package/lib/codec/cosmos/orm/v1alpha1/schema.js +265 -0
- package/lib/codec/cosmos/upgrade/v1beta1/export.d.ts +3 -0
- package/lib/codec/cosmos/upgrade/v1beta1/export.js +24 -0
- package/lib/codec/cosmos/upgrade/v1beta1/tx.d.ts +97 -0
- package/lib/codec/cosmos/upgrade/v1beta1/tx.js +203 -0
- package/lib/codec/ibc/applications/fee/v1/ack.d.ts +24 -0
- package/lib/codec/ibc/applications/fee/v1/ack.js +125 -0
- package/lib/codec/ibc/applications/fee/v1/export.d.ts +6 -0
- package/lib/codec/ibc/applications/fee/v1/export.js +47 -0
- package/lib/codec/ibc/applications/fee/v1/fee.d.ts +68 -0
- package/lib/codec/ibc/applications/fee/v1/fee.js +289 -0
- package/lib/codec/ibc/applications/fee/v1/genesis.d.ts +93 -0
- package/lib/codec/ibc/applications/fee/v1/genesis.js +390 -0
- package/lib/codec/ibc/applications/fee/v1/metadata.d.ts +25 -0
- package/lib/codec/ibc/applications/fee/v1/metadata.js +71 -0
- package/lib/codec/ibc/applications/fee/v1/query.d.ts +312 -0
- package/lib/codec/ibc/applications/fee/v1/query.js +1187 -0
- package/lib/codec/ibc/applications/fee/v1/tx.d.ts +171 -0
- package/lib/codec/ibc/applications/fee/v1/tx.js +524 -0
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.d.ts +78 -0
- package/lib/codec/ibc/applications/interchain_accounts/controller/v1/tx.js +296 -0
- package/lib/codec/ibc/applications/interchain_accounts/genesis/v1/genesis.d.ts +80 -0
- package/lib/codec/ibc/applications/interchain_accounts/genesis/v1/genesis.js +439 -0
- package/lib/hydrogen/transfer.d.ts +5 -5
- package/lib/insights/competition.d.ts +2 -0
- package/lib/provider/metamask/MetaMask.d.ts +5 -5
- package/lib/provider/metamask/MetaMask.js +35 -35
- package/lib/util/blockchain.d.ts +9 -0
- package/lib/util/blockchain.js +143 -1
- package/lib/util/ibc.d.ts +4 -4
- package/lib/util/ibc.js +17 -18
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgRevokeResponse = exports.MsgRevoke = exports.MsgGrantResponse = exports.MsgExec = exports.MsgExecResponse = exports.MsgGrant = exports.QueryGranteeGrantsResponse = exports.QueryGranteeGrantsRequest = exports.QueryGranterGrantsResponse = exports.QueryGranterGrantsRequest = exports.QueryGrantsResponse = exports.QueryGrantsRequest = exports.EventRevoke = exports.EventGrant = exports.GrantQueueItem = exports.GrantAuthorization = exports.Grant = exports.GenericAuthorization = void 0;
|
|
4
|
+
var authz_1 = require("./authz");
|
|
5
|
+
Object.defineProperty(exports, "GenericAuthorization", { enumerable: true, get: function () { return authz_1.GenericAuthorization; } });
|
|
6
|
+
Object.defineProperty(exports, "Grant", { enumerable: true, get: function () { return authz_1.Grant; } });
|
|
7
|
+
Object.defineProperty(exports, "GrantAuthorization", { enumerable: true, get: function () { return authz_1.GrantAuthorization; } });
|
|
8
|
+
Object.defineProperty(exports, "GrantQueueItem", { enumerable: true, get: function () { return authz_1.GrantQueueItem; } });
|
|
9
|
+
var event_1 = require("./event");
|
|
10
|
+
Object.defineProperty(exports, "EventGrant", { enumerable: true, get: function () { return event_1.EventGrant; } });
|
|
11
|
+
Object.defineProperty(exports, "EventRevoke", { enumerable: true, get: function () { return event_1.EventRevoke; } });
|
|
12
|
+
var query_1 = require("./query");
|
|
13
|
+
Object.defineProperty(exports, "QueryGrantsRequest", { enumerable: true, get: function () { return query_1.QueryGrantsRequest; } });
|
|
14
|
+
Object.defineProperty(exports, "QueryGrantsResponse", { enumerable: true, get: function () { return query_1.QueryGrantsResponse; } });
|
|
15
|
+
Object.defineProperty(exports, "QueryGranterGrantsRequest", { enumerable: true, get: function () { return query_1.QueryGranterGrantsRequest; } });
|
|
16
|
+
Object.defineProperty(exports, "QueryGranterGrantsResponse", { enumerable: true, get: function () { return query_1.QueryGranterGrantsResponse; } });
|
|
17
|
+
Object.defineProperty(exports, "QueryGranteeGrantsRequest", { enumerable: true, get: function () { return query_1.QueryGranteeGrantsRequest; } });
|
|
18
|
+
Object.defineProperty(exports, "QueryGranteeGrantsResponse", { enumerable: true, get: function () { return query_1.QueryGranteeGrantsResponse; } });
|
|
19
|
+
var tx_1 = require("./tx");
|
|
20
|
+
Object.defineProperty(exports, "MsgGrant", { enumerable: true, get: function () { return tx_1.MsgGrant; } });
|
|
21
|
+
Object.defineProperty(exports, "MsgExecResponse", { enumerable: true, get: function () { return tx_1.MsgExecResponse; } });
|
|
22
|
+
Object.defineProperty(exports, "MsgExec", { enumerable: true, get: function () { return tx_1.MsgExec; } });
|
|
23
|
+
Object.defineProperty(exports, "MsgGrantResponse", { enumerable: true, get: function () { return tx_1.MsgGrantResponse; } });
|
|
24
|
+
Object.defineProperty(exports, "MsgRevoke", { enumerable: true, get: function () { return tx_1.MsgRevoke; } });
|
|
25
|
+
Object.defineProperty(exports, "MsgRevokeResponse", { enumerable: true, get: function () { return tx_1.MsgRevokeResponse; } });
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import Long from "long";
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
export declare const protobufPackage = "cosmos.base.node.v1beta1";
|
|
4
|
+
/** ConfigRequest defines the request structure for the Config gRPC query. */
|
|
5
|
+
export interface ConfigRequest {
|
|
6
|
+
}
|
|
7
|
+
/** ConfigResponse defines the response structure for the Config gRPC query. */
|
|
8
|
+
export interface ConfigResponse {
|
|
9
|
+
minimumGasPrice: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const ConfigRequest: {
|
|
12
|
+
encode(_: ConfigRequest, writer?: _m0.Writer): _m0.Writer;
|
|
13
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ConfigRequest;
|
|
14
|
+
fromJSON(_: any): ConfigRequest;
|
|
15
|
+
toJSON(_: ConfigRequest): unknown;
|
|
16
|
+
fromPartial(_: DeepPartial<ConfigRequest>): ConfigRequest;
|
|
17
|
+
};
|
|
18
|
+
export declare const ConfigResponse: {
|
|
19
|
+
encode(message: ConfigResponse, writer?: _m0.Writer): _m0.Writer;
|
|
20
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ConfigResponse;
|
|
21
|
+
fromJSON(object: any): ConfigResponse;
|
|
22
|
+
toJSON(message: ConfigResponse): unknown;
|
|
23
|
+
fromPartial(object: DeepPartial<ConfigResponse>): ConfigResponse;
|
|
24
|
+
};
|
|
25
|
+
/** Service defines the gRPC querier service for node related queries. */
|
|
26
|
+
export interface Service {
|
|
27
|
+
/** Config queries for the operator configuration. */
|
|
28
|
+
Config(request: ConfigRequest): Promise<ConfigResponse>;
|
|
29
|
+
}
|
|
30
|
+
export declare class ServiceClientImpl implements Service {
|
|
31
|
+
private readonly rpc;
|
|
32
|
+
constructor(rpc: Rpc);
|
|
33
|
+
Config(request: ConfigRequest): Promise<ConfigResponse>;
|
|
34
|
+
}
|
|
35
|
+
interface Rpc {
|
|
36
|
+
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
37
|
+
}
|
|
38
|
+
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
39
|
+
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 {} ? {
|
|
40
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
41
|
+
} : Partial<T>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
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.ServiceClientImpl = exports.ConfigResponse = exports.ConfigRequest = 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 = "cosmos.base.node.v1beta1";
|
|
11
|
+
const baseConfigRequest = {};
|
|
12
|
+
exports.ConfigRequest = {
|
|
13
|
+
encode(_, writer = minimal_1.default.Writer.create()) {
|
|
14
|
+
return writer;
|
|
15
|
+
},
|
|
16
|
+
decode(input, length) {
|
|
17
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
18
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
19
|
+
const message = Object.assign({}, baseConfigRequest);
|
|
20
|
+
while (reader.pos < end) {
|
|
21
|
+
const tag = reader.uint32();
|
|
22
|
+
switch (tag >>> 3) {
|
|
23
|
+
default:
|
|
24
|
+
reader.skipType(tag & 7);
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return message;
|
|
29
|
+
},
|
|
30
|
+
fromJSON(_) {
|
|
31
|
+
const message = Object.assign({}, baseConfigRequest);
|
|
32
|
+
return message;
|
|
33
|
+
},
|
|
34
|
+
toJSON(_) {
|
|
35
|
+
const obj = {};
|
|
36
|
+
return obj;
|
|
37
|
+
},
|
|
38
|
+
fromPartial(_) {
|
|
39
|
+
const message = Object.assign({}, baseConfigRequest);
|
|
40
|
+
return message;
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
const baseConfigResponse = { minimumGasPrice: "" };
|
|
44
|
+
exports.ConfigResponse = {
|
|
45
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
46
|
+
if (message.minimumGasPrice !== "") {
|
|
47
|
+
writer.uint32(10).string(message.minimumGasPrice);
|
|
48
|
+
}
|
|
49
|
+
return writer;
|
|
50
|
+
},
|
|
51
|
+
decode(input, length) {
|
|
52
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
53
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
54
|
+
const message = Object.assign({}, baseConfigResponse);
|
|
55
|
+
while (reader.pos < end) {
|
|
56
|
+
const tag = reader.uint32();
|
|
57
|
+
switch (tag >>> 3) {
|
|
58
|
+
case 1:
|
|
59
|
+
message.minimumGasPrice = reader.string();
|
|
60
|
+
break;
|
|
61
|
+
default:
|
|
62
|
+
reader.skipType(tag & 7);
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return message;
|
|
67
|
+
},
|
|
68
|
+
fromJSON(object) {
|
|
69
|
+
const message = Object.assign({}, baseConfigResponse);
|
|
70
|
+
message.minimumGasPrice =
|
|
71
|
+
object.minimumGasPrice !== undefined && object.minimumGasPrice !== null
|
|
72
|
+
? String(object.minimumGasPrice)
|
|
73
|
+
: "";
|
|
74
|
+
return message;
|
|
75
|
+
},
|
|
76
|
+
toJSON(message) {
|
|
77
|
+
const obj = {};
|
|
78
|
+
message.minimumGasPrice !== undefined &&
|
|
79
|
+
(obj.minimumGasPrice = message.minimumGasPrice);
|
|
80
|
+
return obj;
|
|
81
|
+
},
|
|
82
|
+
fromPartial(object) {
|
|
83
|
+
var _a;
|
|
84
|
+
const message = Object.assign({}, baseConfigResponse);
|
|
85
|
+
message.minimumGasPrice = (_a = object.minimumGasPrice) !== null && _a !== void 0 ? _a : "";
|
|
86
|
+
return message;
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
class ServiceClientImpl {
|
|
90
|
+
constructor(rpc) {
|
|
91
|
+
this.rpc = rpc;
|
|
92
|
+
this.Config = this.Config.bind(this);
|
|
93
|
+
}
|
|
94
|
+
Config(request) {
|
|
95
|
+
const data = exports.ConfigRequest.encode(request).finish();
|
|
96
|
+
const promise = this.rpc.request("cosmos.base.node.v1beta1.Service", "Config", data);
|
|
97
|
+
return promise.then((data) => exports.ConfigResponse.decode(new minimal_1.default.Reader(data)));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.ServiceClientImpl = ServiceClientImpl;
|
|
101
|
+
if (minimal_1.default.util.Long !== long_1.default) {
|
|
102
|
+
minimal_1.default.util.Long = long_1.default;
|
|
103
|
+
minimal_1.default.configure();
|
|
104
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import Long from "long";
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { Data, Commit, BlockID } from "../../../../tendermint/types/types";
|
|
4
|
+
import { EvidenceList } from "../../../../tendermint/types/evidence";
|
|
5
|
+
import { Consensus } from "../../../../tendermint/version/types";
|
|
6
|
+
export declare const protobufPackage = "cosmos.base.tendermint.v1beta1";
|
|
7
|
+
/**
|
|
8
|
+
* Block is tendermint type Block, with the Header proposer address
|
|
9
|
+
* field converted to bech32 string.
|
|
10
|
+
*/
|
|
11
|
+
export interface Block {
|
|
12
|
+
header?: Header;
|
|
13
|
+
data?: Data;
|
|
14
|
+
evidence?: EvidenceList;
|
|
15
|
+
lastCommit?: Commit;
|
|
16
|
+
}
|
|
17
|
+
/** Header defines the structure of a Tendermint block header. */
|
|
18
|
+
export interface Header {
|
|
19
|
+
/** basic block info */
|
|
20
|
+
version?: Consensus;
|
|
21
|
+
chainId: string;
|
|
22
|
+
height: Long;
|
|
23
|
+
time?: Date;
|
|
24
|
+
/** prev block info */
|
|
25
|
+
lastBlockId?: BlockID;
|
|
26
|
+
/** hashes of block data */
|
|
27
|
+
lastCommitHash: Uint8Array;
|
|
28
|
+
/** transactions */
|
|
29
|
+
dataHash: Uint8Array;
|
|
30
|
+
/** hashes from the app output from the prev block */
|
|
31
|
+
validatorsHash: Uint8Array;
|
|
32
|
+
/** validators for the next block */
|
|
33
|
+
nextValidatorsHash: Uint8Array;
|
|
34
|
+
/** consensus params for current block */
|
|
35
|
+
consensusHash: Uint8Array;
|
|
36
|
+
/** state after txs from the previous block */
|
|
37
|
+
appHash: Uint8Array;
|
|
38
|
+
/** root hash of all results from the txs from the previous block */
|
|
39
|
+
lastResultsHash: Uint8Array;
|
|
40
|
+
/** consensus info */
|
|
41
|
+
evidenceHash: Uint8Array;
|
|
42
|
+
/**
|
|
43
|
+
* proposer_address is the original block proposer address, formatted as a Bech32 string.
|
|
44
|
+
* In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string
|
|
45
|
+
* for better UX.
|
|
46
|
+
*/
|
|
47
|
+
proposerAddress: string;
|
|
48
|
+
}
|
|
49
|
+
export declare const Block: {
|
|
50
|
+
encode(message: Block, writer?: _m0.Writer): _m0.Writer;
|
|
51
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Block;
|
|
52
|
+
fromJSON(object: any): Block;
|
|
53
|
+
toJSON(message: Block): unknown;
|
|
54
|
+
fromPartial(object: DeepPartial<Block>): Block;
|
|
55
|
+
};
|
|
56
|
+
export declare const Header: {
|
|
57
|
+
encode(message: Header, writer?: _m0.Writer): _m0.Writer;
|
|
58
|
+
decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Header;
|
|
59
|
+
fromJSON(object: any): Header;
|
|
60
|
+
toJSON(message: Header): unknown;
|
|
61
|
+
fromPartial(object: DeepPartial<Header>): Header;
|
|
62
|
+
};
|
|
63
|
+
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
64
|
+
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 {} ? {
|
|
65
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
66
|
+
} : Partial<T>;
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,423 @@
|
|
|
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.Header = exports.Block = exports.protobufPackage = void 0;
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
const long_1 = __importDefault(require("long"));
|
|
9
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
+
const types_1 = require("../../../../tendermint/types/types");
|
|
11
|
+
const evidence_1 = require("../../../../tendermint/types/evidence");
|
|
12
|
+
const types_2 = require("../../../../tendermint/version/types");
|
|
13
|
+
const timestamp_1 = require("../../../../google/protobuf/timestamp");
|
|
14
|
+
exports.protobufPackage = "cosmos.base.tendermint.v1beta1";
|
|
15
|
+
const baseBlock = {};
|
|
16
|
+
exports.Block = {
|
|
17
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
18
|
+
if (message.header !== undefined) {
|
|
19
|
+
exports.Header.encode(message.header, writer.uint32(10).fork()).ldelim();
|
|
20
|
+
}
|
|
21
|
+
if (message.data !== undefined) {
|
|
22
|
+
types_1.Data.encode(message.data, writer.uint32(18).fork()).ldelim();
|
|
23
|
+
}
|
|
24
|
+
if (message.evidence !== undefined) {
|
|
25
|
+
evidence_1.EvidenceList.encode(message.evidence, writer.uint32(26).fork()).ldelim();
|
|
26
|
+
}
|
|
27
|
+
if (message.lastCommit !== undefined) {
|
|
28
|
+
types_1.Commit.encode(message.lastCommit, writer.uint32(34).fork()).ldelim();
|
|
29
|
+
}
|
|
30
|
+
return writer;
|
|
31
|
+
},
|
|
32
|
+
decode(input, length) {
|
|
33
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
34
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
35
|
+
const message = Object.assign({}, baseBlock);
|
|
36
|
+
while (reader.pos < end) {
|
|
37
|
+
const tag = reader.uint32();
|
|
38
|
+
switch (tag >>> 3) {
|
|
39
|
+
case 1:
|
|
40
|
+
message.header = exports.Header.decode(reader, reader.uint32());
|
|
41
|
+
break;
|
|
42
|
+
case 2:
|
|
43
|
+
message.data = types_1.Data.decode(reader, reader.uint32());
|
|
44
|
+
break;
|
|
45
|
+
case 3:
|
|
46
|
+
message.evidence = evidence_1.EvidenceList.decode(reader, reader.uint32());
|
|
47
|
+
break;
|
|
48
|
+
case 4:
|
|
49
|
+
message.lastCommit = types_1.Commit.decode(reader, reader.uint32());
|
|
50
|
+
break;
|
|
51
|
+
default:
|
|
52
|
+
reader.skipType(tag & 7);
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return message;
|
|
57
|
+
},
|
|
58
|
+
fromJSON(object) {
|
|
59
|
+
const message = Object.assign({}, baseBlock);
|
|
60
|
+
message.header =
|
|
61
|
+
object.header !== undefined && object.header !== null
|
|
62
|
+
? exports.Header.fromJSON(object.header)
|
|
63
|
+
: undefined;
|
|
64
|
+
message.data =
|
|
65
|
+
object.data !== undefined && object.data !== null
|
|
66
|
+
? types_1.Data.fromJSON(object.data)
|
|
67
|
+
: undefined;
|
|
68
|
+
message.evidence =
|
|
69
|
+
object.evidence !== undefined && object.evidence !== null
|
|
70
|
+
? evidence_1.EvidenceList.fromJSON(object.evidence)
|
|
71
|
+
: undefined;
|
|
72
|
+
message.lastCommit =
|
|
73
|
+
object.lastCommit !== undefined && object.lastCommit !== null
|
|
74
|
+
? types_1.Commit.fromJSON(object.lastCommit)
|
|
75
|
+
: undefined;
|
|
76
|
+
return message;
|
|
77
|
+
},
|
|
78
|
+
toJSON(message) {
|
|
79
|
+
const obj = {};
|
|
80
|
+
message.header !== undefined &&
|
|
81
|
+
(obj.header = message.header ? exports.Header.toJSON(message.header) : undefined);
|
|
82
|
+
message.data !== undefined &&
|
|
83
|
+
(obj.data = message.data ? types_1.Data.toJSON(message.data) : undefined);
|
|
84
|
+
message.evidence !== undefined &&
|
|
85
|
+
(obj.evidence = message.evidence
|
|
86
|
+
? evidence_1.EvidenceList.toJSON(message.evidence)
|
|
87
|
+
: undefined);
|
|
88
|
+
message.lastCommit !== undefined &&
|
|
89
|
+
(obj.lastCommit = message.lastCommit
|
|
90
|
+
? types_1.Commit.toJSON(message.lastCommit)
|
|
91
|
+
: undefined);
|
|
92
|
+
return obj;
|
|
93
|
+
},
|
|
94
|
+
fromPartial(object) {
|
|
95
|
+
const message = Object.assign({}, baseBlock);
|
|
96
|
+
message.header =
|
|
97
|
+
object.header !== undefined && object.header !== null
|
|
98
|
+
? exports.Header.fromPartial(object.header)
|
|
99
|
+
: undefined;
|
|
100
|
+
message.data =
|
|
101
|
+
object.data !== undefined && object.data !== null
|
|
102
|
+
? types_1.Data.fromPartial(object.data)
|
|
103
|
+
: undefined;
|
|
104
|
+
message.evidence =
|
|
105
|
+
object.evidence !== undefined && object.evidence !== null
|
|
106
|
+
? evidence_1.EvidenceList.fromPartial(object.evidence)
|
|
107
|
+
: undefined;
|
|
108
|
+
message.lastCommit =
|
|
109
|
+
object.lastCommit !== undefined && object.lastCommit !== null
|
|
110
|
+
? types_1.Commit.fromPartial(object.lastCommit)
|
|
111
|
+
: undefined;
|
|
112
|
+
return message;
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
const baseHeader = {
|
|
116
|
+
chainId: "",
|
|
117
|
+
height: long_1.default.ZERO,
|
|
118
|
+
proposerAddress: "",
|
|
119
|
+
};
|
|
120
|
+
exports.Header = {
|
|
121
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
122
|
+
if (message.version !== undefined) {
|
|
123
|
+
types_2.Consensus.encode(message.version, writer.uint32(10).fork()).ldelim();
|
|
124
|
+
}
|
|
125
|
+
if (message.chainId !== "") {
|
|
126
|
+
writer.uint32(18).string(message.chainId);
|
|
127
|
+
}
|
|
128
|
+
if (!message.height.isZero()) {
|
|
129
|
+
writer.uint32(24).int64(message.height);
|
|
130
|
+
}
|
|
131
|
+
if (message.time !== undefined) {
|
|
132
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim();
|
|
133
|
+
}
|
|
134
|
+
if (message.lastBlockId !== undefined) {
|
|
135
|
+
types_1.BlockID.encode(message.lastBlockId, writer.uint32(42).fork()).ldelim();
|
|
136
|
+
}
|
|
137
|
+
if (message.lastCommitHash.length !== 0) {
|
|
138
|
+
writer.uint32(50).bytes(message.lastCommitHash);
|
|
139
|
+
}
|
|
140
|
+
if (message.dataHash.length !== 0) {
|
|
141
|
+
writer.uint32(58).bytes(message.dataHash);
|
|
142
|
+
}
|
|
143
|
+
if (message.validatorsHash.length !== 0) {
|
|
144
|
+
writer.uint32(66).bytes(message.validatorsHash);
|
|
145
|
+
}
|
|
146
|
+
if (message.nextValidatorsHash.length !== 0) {
|
|
147
|
+
writer.uint32(74).bytes(message.nextValidatorsHash);
|
|
148
|
+
}
|
|
149
|
+
if (message.consensusHash.length !== 0) {
|
|
150
|
+
writer.uint32(82).bytes(message.consensusHash);
|
|
151
|
+
}
|
|
152
|
+
if (message.appHash.length !== 0) {
|
|
153
|
+
writer.uint32(90).bytes(message.appHash);
|
|
154
|
+
}
|
|
155
|
+
if (message.lastResultsHash.length !== 0) {
|
|
156
|
+
writer.uint32(98).bytes(message.lastResultsHash);
|
|
157
|
+
}
|
|
158
|
+
if (message.evidenceHash.length !== 0) {
|
|
159
|
+
writer.uint32(106).bytes(message.evidenceHash);
|
|
160
|
+
}
|
|
161
|
+
if (message.proposerAddress !== "") {
|
|
162
|
+
writer.uint32(114).string(message.proposerAddress);
|
|
163
|
+
}
|
|
164
|
+
return writer;
|
|
165
|
+
},
|
|
166
|
+
decode(input, length) {
|
|
167
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
|
168
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
169
|
+
const message = Object.assign({}, baseHeader);
|
|
170
|
+
message.lastCommitHash = new Uint8Array();
|
|
171
|
+
message.dataHash = new Uint8Array();
|
|
172
|
+
message.validatorsHash = new Uint8Array();
|
|
173
|
+
message.nextValidatorsHash = new Uint8Array();
|
|
174
|
+
message.consensusHash = new Uint8Array();
|
|
175
|
+
message.appHash = new Uint8Array();
|
|
176
|
+
message.lastResultsHash = new Uint8Array();
|
|
177
|
+
message.evidenceHash = new Uint8Array();
|
|
178
|
+
while (reader.pos < end) {
|
|
179
|
+
const tag = reader.uint32();
|
|
180
|
+
switch (tag >>> 3) {
|
|
181
|
+
case 1:
|
|
182
|
+
message.version = types_2.Consensus.decode(reader, reader.uint32());
|
|
183
|
+
break;
|
|
184
|
+
case 2:
|
|
185
|
+
message.chainId = reader.string();
|
|
186
|
+
break;
|
|
187
|
+
case 3:
|
|
188
|
+
message.height = reader.int64();
|
|
189
|
+
break;
|
|
190
|
+
case 4:
|
|
191
|
+
message.time = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
192
|
+
break;
|
|
193
|
+
case 5:
|
|
194
|
+
message.lastBlockId = types_1.BlockID.decode(reader, reader.uint32());
|
|
195
|
+
break;
|
|
196
|
+
case 6:
|
|
197
|
+
message.lastCommitHash = reader.bytes();
|
|
198
|
+
break;
|
|
199
|
+
case 7:
|
|
200
|
+
message.dataHash = reader.bytes();
|
|
201
|
+
break;
|
|
202
|
+
case 8:
|
|
203
|
+
message.validatorsHash = reader.bytes();
|
|
204
|
+
break;
|
|
205
|
+
case 9:
|
|
206
|
+
message.nextValidatorsHash = reader.bytes();
|
|
207
|
+
break;
|
|
208
|
+
case 10:
|
|
209
|
+
message.consensusHash = reader.bytes();
|
|
210
|
+
break;
|
|
211
|
+
case 11:
|
|
212
|
+
message.appHash = reader.bytes();
|
|
213
|
+
break;
|
|
214
|
+
case 12:
|
|
215
|
+
message.lastResultsHash = reader.bytes();
|
|
216
|
+
break;
|
|
217
|
+
case 13:
|
|
218
|
+
message.evidenceHash = reader.bytes();
|
|
219
|
+
break;
|
|
220
|
+
case 14:
|
|
221
|
+
message.proposerAddress = reader.string();
|
|
222
|
+
break;
|
|
223
|
+
default:
|
|
224
|
+
reader.skipType(tag & 7);
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return message;
|
|
229
|
+
},
|
|
230
|
+
fromJSON(object) {
|
|
231
|
+
const message = Object.assign({}, baseHeader);
|
|
232
|
+
message.version =
|
|
233
|
+
object.version !== undefined && object.version !== null
|
|
234
|
+
? types_2.Consensus.fromJSON(object.version)
|
|
235
|
+
: undefined;
|
|
236
|
+
message.chainId =
|
|
237
|
+
object.chainId !== undefined && object.chainId !== null
|
|
238
|
+
? String(object.chainId)
|
|
239
|
+
: "";
|
|
240
|
+
message.height =
|
|
241
|
+
object.height !== undefined && object.height !== null
|
|
242
|
+
? long_1.default.fromString(object.height)
|
|
243
|
+
: long_1.default.ZERO;
|
|
244
|
+
message.time =
|
|
245
|
+
object.time !== undefined && object.time !== null
|
|
246
|
+
? fromJsonTimestamp(object.time)
|
|
247
|
+
: undefined;
|
|
248
|
+
message.lastBlockId =
|
|
249
|
+
object.lastBlockId !== undefined && object.lastBlockId !== null
|
|
250
|
+
? types_1.BlockID.fromJSON(object.lastBlockId)
|
|
251
|
+
: undefined;
|
|
252
|
+
message.lastCommitHash =
|
|
253
|
+
object.lastCommitHash !== undefined && object.lastCommitHash !== null
|
|
254
|
+
? bytesFromBase64(object.lastCommitHash)
|
|
255
|
+
: new Uint8Array();
|
|
256
|
+
message.dataHash =
|
|
257
|
+
object.dataHash !== undefined && object.dataHash !== null
|
|
258
|
+
? bytesFromBase64(object.dataHash)
|
|
259
|
+
: new Uint8Array();
|
|
260
|
+
message.validatorsHash =
|
|
261
|
+
object.validatorsHash !== undefined && object.validatorsHash !== null
|
|
262
|
+
? bytesFromBase64(object.validatorsHash)
|
|
263
|
+
: new Uint8Array();
|
|
264
|
+
message.nextValidatorsHash =
|
|
265
|
+
object.nextValidatorsHash !== undefined &&
|
|
266
|
+
object.nextValidatorsHash !== null
|
|
267
|
+
? bytesFromBase64(object.nextValidatorsHash)
|
|
268
|
+
: new Uint8Array();
|
|
269
|
+
message.consensusHash =
|
|
270
|
+
object.consensusHash !== undefined && object.consensusHash !== null
|
|
271
|
+
? bytesFromBase64(object.consensusHash)
|
|
272
|
+
: new Uint8Array();
|
|
273
|
+
message.appHash =
|
|
274
|
+
object.appHash !== undefined && object.appHash !== null
|
|
275
|
+
? bytesFromBase64(object.appHash)
|
|
276
|
+
: new Uint8Array();
|
|
277
|
+
message.lastResultsHash =
|
|
278
|
+
object.lastResultsHash !== undefined && object.lastResultsHash !== null
|
|
279
|
+
? bytesFromBase64(object.lastResultsHash)
|
|
280
|
+
: new Uint8Array();
|
|
281
|
+
message.evidenceHash =
|
|
282
|
+
object.evidenceHash !== undefined && object.evidenceHash !== null
|
|
283
|
+
? bytesFromBase64(object.evidenceHash)
|
|
284
|
+
: new Uint8Array();
|
|
285
|
+
message.proposerAddress =
|
|
286
|
+
object.proposerAddress !== undefined && object.proposerAddress !== null
|
|
287
|
+
? String(object.proposerAddress)
|
|
288
|
+
: "";
|
|
289
|
+
return message;
|
|
290
|
+
},
|
|
291
|
+
toJSON(message) {
|
|
292
|
+
const obj = {};
|
|
293
|
+
message.version !== undefined &&
|
|
294
|
+
(obj.version = message.version
|
|
295
|
+
? types_2.Consensus.toJSON(message.version)
|
|
296
|
+
: undefined);
|
|
297
|
+
message.chainId !== undefined && (obj.chainId = message.chainId);
|
|
298
|
+
message.height !== undefined &&
|
|
299
|
+
(obj.height = (message.height || long_1.default.ZERO).toString());
|
|
300
|
+
message.time !== undefined && (obj.time = message.time.toISOString());
|
|
301
|
+
message.lastBlockId !== undefined &&
|
|
302
|
+
(obj.lastBlockId = message.lastBlockId
|
|
303
|
+
? types_1.BlockID.toJSON(message.lastBlockId)
|
|
304
|
+
: undefined);
|
|
305
|
+
message.lastCommitHash !== undefined &&
|
|
306
|
+
(obj.lastCommitHash = base64FromBytes(message.lastCommitHash !== undefined
|
|
307
|
+
? message.lastCommitHash
|
|
308
|
+
: new Uint8Array()));
|
|
309
|
+
message.dataHash !== undefined &&
|
|
310
|
+
(obj.dataHash = base64FromBytes(message.dataHash !== undefined ? message.dataHash : new Uint8Array()));
|
|
311
|
+
message.validatorsHash !== undefined &&
|
|
312
|
+
(obj.validatorsHash = base64FromBytes(message.validatorsHash !== undefined
|
|
313
|
+
? message.validatorsHash
|
|
314
|
+
: new Uint8Array()));
|
|
315
|
+
message.nextValidatorsHash !== undefined &&
|
|
316
|
+
(obj.nextValidatorsHash = base64FromBytes(message.nextValidatorsHash !== undefined
|
|
317
|
+
? message.nextValidatorsHash
|
|
318
|
+
: new Uint8Array()));
|
|
319
|
+
message.consensusHash !== undefined &&
|
|
320
|
+
(obj.consensusHash = base64FromBytes(message.consensusHash !== undefined
|
|
321
|
+
? message.consensusHash
|
|
322
|
+
: new Uint8Array()));
|
|
323
|
+
message.appHash !== undefined &&
|
|
324
|
+
(obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array()));
|
|
325
|
+
message.lastResultsHash !== undefined &&
|
|
326
|
+
(obj.lastResultsHash = base64FromBytes(message.lastResultsHash !== undefined
|
|
327
|
+
? message.lastResultsHash
|
|
328
|
+
: new Uint8Array()));
|
|
329
|
+
message.evidenceHash !== undefined &&
|
|
330
|
+
(obj.evidenceHash = base64FromBytes(message.evidenceHash !== undefined
|
|
331
|
+
? message.evidenceHash
|
|
332
|
+
: new Uint8Array()));
|
|
333
|
+
message.proposerAddress !== undefined &&
|
|
334
|
+
(obj.proposerAddress = message.proposerAddress);
|
|
335
|
+
return obj;
|
|
336
|
+
},
|
|
337
|
+
fromPartial(object) {
|
|
338
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
339
|
+
const message = Object.assign({}, baseHeader);
|
|
340
|
+
message.version =
|
|
341
|
+
object.version !== undefined && object.version !== null
|
|
342
|
+
? types_2.Consensus.fromPartial(object.version)
|
|
343
|
+
: undefined;
|
|
344
|
+
message.chainId = (_a = object.chainId) !== null && _a !== void 0 ? _a : "";
|
|
345
|
+
message.height =
|
|
346
|
+
object.height !== undefined && object.height !== null
|
|
347
|
+
? long_1.default.fromValue(object.height)
|
|
348
|
+
: long_1.default.ZERO;
|
|
349
|
+
message.time = (_b = object.time) !== null && _b !== void 0 ? _b : undefined;
|
|
350
|
+
message.lastBlockId =
|
|
351
|
+
object.lastBlockId !== undefined && object.lastBlockId !== null
|
|
352
|
+
? types_1.BlockID.fromPartial(object.lastBlockId)
|
|
353
|
+
: undefined;
|
|
354
|
+
message.lastCommitHash = (_c = object.lastCommitHash) !== null && _c !== void 0 ? _c : new Uint8Array();
|
|
355
|
+
message.dataHash = (_d = object.dataHash) !== null && _d !== void 0 ? _d : new Uint8Array();
|
|
356
|
+
message.validatorsHash = (_e = object.validatorsHash) !== null && _e !== void 0 ? _e : new Uint8Array();
|
|
357
|
+
message.nextValidatorsHash = (_f = object.nextValidatorsHash) !== null && _f !== void 0 ? _f : new Uint8Array();
|
|
358
|
+
message.consensusHash = (_g = object.consensusHash) !== null && _g !== void 0 ? _g : new Uint8Array();
|
|
359
|
+
message.appHash = (_h = object.appHash) !== null && _h !== void 0 ? _h : new Uint8Array();
|
|
360
|
+
message.lastResultsHash = (_j = object.lastResultsHash) !== null && _j !== void 0 ? _j : new Uint8Array();
|
|
361
|
+
message.evidenceHash = (_k = object.evidenceHash) !== null && _k !== void 0 ? _k : new Uint8Array();
|
|
362
|
+
message.proposerAddress = (_l = object.proposerAddress) !== null && _l !== void 0 ? _l : "";
|
|
363
|
+
return message;
|
|
364
|
+
},
|
|
365
|
+
};
|
|
366
|
+
var globalThis = (() => {
|
|
367
|
+
if (typeof globalThis !== "undefined")
|
|
368
|
+
return globalThis;
|
|
369
|
+
if (typeof self !== "undefined")
|
|
370
|
+
return self;
|
|
371
|
+
if (typeof window !== "undefined")
|
|
372
|
+
return window;
|
|
373
|
+
if (typeof global !== "undefined")
|
|
374
|
+
return global;
|
|
375
|
+
throw "Unable to locate global object";
|
|
376
|
+
})();
|
|
377
|
+
const atob = globalThis.atob ||
|
|
378
|
+
((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
|
|
379
|
+
function bytesFromBase64(b64) {
|
|
380
|
+
const bin = atob(b64);
|
|
381
|
+
const arr = new Uint8Array(bin.length);
|
|
382
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
383
|
+
arr[i] = bin.charCodeAt(i);
|
|
384
|
+
}
|
|
385
|
+
return arr;
|
|
386
|
+
}
|
|
387
|
+
const btoa = globalThis.btoa ||
|
|
388
|
+
((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
|
|
389
|
+
function base64FromBytes(arr) {
|
|
390
|
+
const bin = [];
|
|
391
|
+
for (const byte of arr) {
|
|
392
|
+
bin.push(String.fromCharCode(byte));
|
|
393
|
+
}
|
|
394
|
+
return btoa(bin.join(""));
|
|
395
|
+
}
|
|
396
|
+
function toTimestamp(date) {
|
|
397
|
+
const seconds = numberToLong(date.getTime() / 1000);
|
|
398
|
+
const nanos = (date.getTime() % 1000) * 1000000;
|
|
399
|
+
return { seconds, nanos };
|
|
400
|
+
}
|
|
401
|
+
function fromTimestamp(t) {
|
|
402
|
+
let millis = t.seconds.toNumber() * 1000;
|
|
403
|
+
millis += t.nanos / 1000000;
|
|
404
|
+
return new Date(millis);
|
|
405
|
+
}
|
|
406
|
+
function fromJsonTimestamp(o) {
|
|
407
|
+
if (o instanceof Date) {
|
|
408
|
+
return o;
|
|
409
|
+
}
|
|
410
|
+
else if (typeof o === "string") {
|
|
411
|
+
return new Date(o);
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function numberToLong(number) {
|
|
418
|
+
return long_1.default.fromNumber(number);
|
|
419
|
+
}
|
|
420
|
+
if (minimal_1.default.util.Long !== long_1.default) {
|
|
421
|
+
minimal_1.default.util.Long = long_1.default;
|
|
422
|
+
minimal_1.default.configure();
|
|
423
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenesisOwners = exports.CapabilityOwners = exports.Owner = exports.Capability = void 0;
|
|
4
|
+
var capability_1 = require("./capability");
|
|
5
|
+
Object.defineProperty(exports, "Capability", { enumerable: true, get: function () { return capability_1.Capability; } });
|
|
6
|
+
Object.defineProperty(exports, "Owner", { enumerable: true, get: function () { return capability_1.Owner; } });
|
|
7
|
+
Object.defineProperty(exports, "CapabilityOwners", { enumerable: true, get: function () { return capability_1.CapabilityOwners; } });
|
|
8
|
+
var genesis_1 = require("./genesis");
|
|
9
|
+
Object.defineProperty(exports, "GenesisOwners", { enumerable: true, get: function () { return genesis_1.GenesisOwners; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MsgVerifyInvariant, MsgVerifyInvariantResponse } from "./tx";
|