@firmachain/firma-js 0.2.27 → 0.2.28
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/dist/index.d.ts +4 -0
- package/dist/index.js +16 -0
- package/dist/sdk/FirmaBankService.d.ts +16 -0
- package/dist/sdk/FirmaBankService.js +233 -0
- package/dist/sdk/FirmaChainService.d.ts +8 -0
- package/dist/sdk/FirmaChainService.js +86 -0
- package/dist/sdk/FirmaConfig.d.ts +18 -0
- package/dist/sdk/FirmaConfig.js +63 -0
- package/dist/sdk/FirmaContractService.d.ts +31 -0
- package/dist/sdk/FirmaContractService.js +413 -0
- package/dist/sdk/FirmaDistributionService.d.ts +31 -0
- package/dist/sdk/FirmaDistributionService.js +524 -0
- package/dist/sdk/FirmaFeeGrantService.d.ts +21 -0
- package/dist/sdk/FirmaFeeGrantService.js +341 -0
- package/dist/sdk/FirmaGovService.d.ts +35 -0
- package/dist/sdk/FirmaGovService.js +775 -0
- package/dist/sdk/FirmaIpfsService.d.ts +12 -0
- package/dist/sdk/FirmaIpfsService.js +185 -0
- package/dist/sdk/FirmaMobileSDK.d.ts +27 -0
- package/dist/sdk/FirmaMobileSDK.js +45 -0
- package/dist/sdk/FirmaNftService.d.ts +31 -0
- package/dist/sdk/FirmaNftService.js +372 -0
- package/dist/sdk/FirmaSDK.d.ts +29 -0
- package/dist/sdk/FirmaSDK.js +48 -0
- package/dist/sdk/FirmaSlashingService.d.ts +9 -0
- package/dist/sdk/FirmaSlashingService.js +105 -0
- package/dist/sdk/FirmaStakingService.d.ts +34 -0
- package/dist/sdk/FirmaStakingService.js +604 -0
- package/dist/sdk/FirmaTokenService.d.ts +26 -0
- package/dist/sdk/FirmaTokenService.js +416 -0
- package/dist/sdk/FirmaUtil.d.ts +37 -0
- package/dist/sdk/FirmaUtil.js +230 -0
- package/dist/sdk/FirmaWalletService.d.ts +36 -0
- package/dist/sdk/FirmaWalletService.js +309 -0
- package/dist/sdk/firmachain/amino/addresses.d.ts +5 -0
- package/dist/sdk/firmachain/amino/addresses.js +46 -0
- package/dist/sdk/firmachain/amino/aminomsgs.d.ts +281 -0
- package/dist/sdk/firmachain/amino/aminomsgs.js +77 -0
- package/dist/sdk/firmachain/amino/aminotypes.d.ts +22 -0
- package/dist/sdk/firmachain/amino/aminotypes.js +521 -0
- package/dist/sdk/firmachain/amino/coins.d.ts +30 -0
- package/dist/sdk/firmachain/amino/coins.js +69 -0
- package/dist/sdk/firmachain/amino/encoding.d.ts +24 -0
- package/dist/sdk/firmachain/amino/encoding.js +234 -0
- package/dist/sdk/firmachain/amino/multisig.d.ts +10 -0
- package/dist/sdk/firmachain/amino/multisig.js +42 -0
- package/dist/sdk/firmachain/amino/paths.d.ts +6 -0
- package/dist/sdk/firmachain/amino/paths.js +18 -0
- package/dist/sdk/firmachain/amino/pubkeys.d.ts +47 -0
- package/dist/sdk/firmachain/amino/pubkeys.js +29 -0
- package/dist/sdk/firmachain/amino/secp256k1hdwallet.d.ts +94 -0
- package/dist/sdk/firmachain/amino/secp256k1hdwallet.js +437 -0
- package/dist/sdk/firmachain/amino/secp256k1wallet.d.ts +23 -0
- package/dist/sdk/firmachain/amino/secp256k1wallet.js +141 -0
- package/dist/sdk/firmachain/amino/signature.d.ts +16 -0
- package/dist/sdk/firmachain/amino/signature.js +36 -0
- package/dist/sdk/firmachain/amino/signdoc.d.ts +26 -0
- package/dist/sdk/firmachain/amino/signdoc.js +42 -0
- package/dist/sdk/firmachain/amino/signer.d.ts +33 -0
- package/dist/sdk/firmachain/amino/signer.js +2 -0
- package/dist/sdk/firmachain/amino/stdtx.d.ts +15 -0
- package/dist/sdk/firmachain/amino/stdtx.js +17 -0
- package/dist/sdk/firmachain/amino/wallet.d.ts +32 -0
- package/dist/sdk/firmachain/amino/wallet.js +132 -0
- package/dist/sdk/firmachain/bank/BankQueryClient.d.ts +12 -0
- package/dist/sdk/firmachain/bank/BankQueryClient.js +116 -0
- package/dist/sdk/firmachain/bank/BankTxClient.d.ts +17 -0
- package/dist/sdk/firmachain/bank/BankTxClient.js +40 -0
- package/dist/sdk/firmachain/bank/index.d.ts +3 -0
- package/dist/sdk/firmachain/bank/index.js +15 -0
- package/dist/sdk/firmachain/common/ITxClient.d.ts +15 -0
- package/dist/sdk/firmachain/common/ITxClient.js +102 -0
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.d.ts +27 -0
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +165 -0
- package/dist/sdk/firmachain/common/LedgerWallet.d.ts +14 -0
- package/dist/sdk/firmachain/common/LedgerWallet.js +147 -0
- package/dist/sdk/firmachain/common/QueryCommon.d.ts +4 -0
- package/dist/sdk/firmachain/common/QueryCommon.js +2 -0
- package/dist/sdk/firmachain/common/TendermintQueryClient.d.ts +42 -0
- package/dist/sdk/firmachain/common/TendermintQueryClient.js +111 -0
- package/dist/sdk/firmachain/common/TxCommon.d.ts +87 -0
- package/dist/sdk/firmachain/common/TxCommon.js +18 -0
- package/dist/sdk/firmachain/common/accounts.d.ts +16 -0
- package/dist/sdk/firmachain/common/accounts.js +64 -0
- package/dist/sdk/firmachain/common/index.d.ts +2 -0
- package/dist/sdk/firmachain/common/index.js +14 -0
- package/dist/sdk/firmachain/common/signing.d.ts +10 -0
- package/dist/sdk/firmachain/common/signing.js +75 -0
- package/dist/sdk/firmachain/common/signingstargateclient.d.ts +37 -0
- package/dist/sdk/firmachain/common/signingstargateclient.js +298 -0
- package/dist/sdk/firmachain/common/stargateclient.d.ts +46 -0
- package/dist/sdk/firmachain/common/stargateclient.js +211 -0
- package/dist/sdk/firmachain/contract/ContractQueryClient.d.ts +32 -0
- package/dist/sdk/firmachain/contract/ContractQueryClient.js +156 -0
- package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +17 -0
- package/dist/sdk/firmachain/contract/ContractTxClient.js +40 -0
- package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +69 -0
- package/dist/sdk/firmachain/contract/ContractTxTypes.js +483 -0
- package/dist/sdk/firmachain/contract/index.d.ts +3 -0
- package/dist/sdk/firmachain/contract/index.js +15 -0
- package/dist/sdk/firmachain/distribution/DistributionQueryClient.d.ts +18 -0
- package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +167 -0
- package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +27 -0
- package/dist/sdk/firmachain/distribution/DistributionTxClient.js +48 -0
- package/dist/sdk/firmachain/distribution/index.d.ts +3 -0
- package/dist/sdk/firmachain/distribution/index.js +15 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.d.ts +17 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +86 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +17 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +40 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.d.ts +76 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +194 -0
- package/dist/sdk/firmachain/feegrant/index.d.ts +2 -0
- package/dist/sdk/firmachain/feegrant/index.js +15 -0
- package/dist/sdk/firmachain/google/protobuf/any.d.ts +128 -0
- package/dist/sdk/firmachain/google/protobuf/any.js +106 -0
- package/dist/sdk/firmachain/google/protobuf/descriptor.d.ts +996 -0
- package/dist/sdk/firmachain/google/protobuf/descriptor.js +5329 -0
- package/dist/sdk/firmachain/google/protobuf/duration.d.ts +91 -0
- package/dist/sdk/firmachain/google/protobuf/duration.js +107 -0
- package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +109 -0
- package/dist/sdk/firmachain/google/protobuf/timestamp.js +107 -0
- package/dist/sdk/firmachain/gov/GovQueryClient.d.ts +61 -0
- package/dist/sdk/firmachain/gov/GovQueryClient.js +152 -0
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +22 -0
- package/dist/sdk/firmachain/gov/GovTxClient.js +44 -0
- package/dist/sdk/firmachain/gov/index.d.ts +3 -0
- package/dist/sdk/firmachain/gov/index.js +15 -0
- package/dist/sdk/firmachain/nft/NftQueryClient.d.ts +20 -0
- package/dist/sdk/firmachain/nft/NftQueryClient.js +125 -0
- package/dist/sdk/firmachain/nft/NftTxClient.d.ts +22 -0
- package/dist/sdk/firmachain/nft/NftTxClient.js +44 -0
- package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +86 -0
- package/dist/sdk/firmachain/nft/NftTxTypes.js +424 -0
- package/dist/sdk/firmachain/nft/index.d.ts +3 -0
- package/dist/sdk/firmachain/nft/index.js +15 -0
- package/dist/sdk/firmachain/slashing/SlashingQueryClient.d.ts +22 -0
- package/dist/sdk/firmachain/slashing/SlashingQueryClient.js +101 -0
- package/dist/sdk/firmachain/slashing/index.d.ts +2 -0
- package/dist/sdk/firmachain/slashing/index.js +14 -0
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +93 -0
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +223 -0
- package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +32 -0
- package/dist/sdk/firmachain/staking/StakingTxClient.js +52 -0
- package/dist/sdk/firmachain/staking/index.d.ts +3 -0
- package/dist/sdk/firmachain/staking/index.js +15 -0
- package/dist/sdk/firmachain/token/TokenQueryClient.d.ts +24 -0
- package/dist/sdk/firmachain/token/TokenQueryClient.js +106 -0
- package/dist/sdk/firmachain/token/TokenTxClient.d.ts +27 -0
- package/dist/sdk/firmachain/token/TokenTxClient.js +48 -0
- package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +116 -0
- package/dist/sdk/firmachain/token/TokenTxTypes.js +685 -0
- package/dist/sdk/firmachain/token/index.d.ts +3 -0
- package/dist/sdk/firmachain/token/index.js +15 -0
- package/package.json +1 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Writer, Reader } from "protobufjs/minimal";
|
|
2
|
+
export declare const protobufPackage = "google.protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* A Duration represents a signed, fixed-length span of time represented
|
|
5
|
+
* as a count of seconds and fractions of seconds at nanosecond
|
|
6
|
+
* resolution. It is independent of any calendar and concepts like "day"
|
|
7
|
+
* or "month". It is related to Timestamp in that the difference between
|
|
8
|
+
* two Timestamp values is a Duration and it can be added or subtracted
|
|
9
|
+
* from a Timestamp. Range is approximately +-10,000 years.
|
|
10
|
+
*
|
|
11
|
+
* # Examples
|
|
12
|
+
*
|
|
13
|
+
* Example 1: Compute Duration from two Timestamps in pseudo code.
|
|
14
|
+
*
|
|
15
|
+
* Timestamp start = ...;
|
|
16
|
+
* Timestamp end = ...;
|
|
17
|
+
* Duration duration = ...;
|
|
18
|
+
*
|
|
19
|
+
* duration.seconds = end.seconds - start.seconds;
|
|
20
|
+
* duration.nanos = end.nanos - start.nanos;
|
|
21
|
+
*
|
|
22
|
+
* if (duration.seconds < 0 && duration.nanos > 0) {
|
|
23
|
+
* duration.seconds += 1;
|
|
24
|
+
* duration.nanos -= 1000000000;
|
|
25
|
+
* } else if (durations.seconds > 0 && duration.nanos < 0) {
|
|
26
|
+
* duration.seconds -= 1;
|
|
27
|
+
* duration.nanos += 1000000000;
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
|
31
|
+
*
|
|
32
|
+
* Timestamp start = ...;
|
|
33
|
+
* Duration duration = ...;
|
|
34
|
+
* Timestamp end = ...;
|
|
35
|
+
*
|
|
36
|
+
* end.seconds = start.seconds + duration.seconds;
|
|
37
|
+
* end.nanos = start.nanos + duration.nanos;
|
|
38
|
+
*
|
|
39
|
+
* if (end.nanos < 0) {
|
|
40
|
+
* end.seconds -= 1;
|
|
41
|
+
* end.nanos += 1000000000;
|
|
42
|
+
* } else if (end.nanos >= 1000000000) {
|
|
43
|
+
* end.seconds += 1;
|
|
44
|
+
* end.nanos -= 1000000000;
|
|
45
|
+
* }
|
|
46
|
+
*
|
|
47
|
+
* Example 3: Compute Duration from datetime.timedelta in Python.
|
|
48
|
+
*
|
|
49
|
+
* td = datetime.timedelta(days=3, minutes=10)
|
|
50
|
+
* duration = Duration()
|
|
51
|
+
* duration.FromTimedelta(td)
|
|
52
|
+
*
|
|
53
|
+
* # JSON Mapping
|
|
54
|
+
*
|
|
55
|
+
* In JSON format, the Duration type is encoded as a string rather than an
|
|
56
|
+
* object, where the string ends in the suffix "s" (indicating seconds) and
|
|
57
|
+
* is preceded by the number of seconds, with nanoseconds expressed as
|
|
58
|
+
* fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
|
59
|
+
* encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
|
60
|
+
* be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
|
61
|
+
* microsecond should be expressed in JSON format as "3.000001s".
|
|
62
|
+
*/
|
|
63
|
+
export interface Duration {
|
|
64
|
+
/**
|
|
65
|
+
* Signed seconds of the span of time. Must be from -315,576,000,000
|
|
66
|
+
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
|
67
|
+
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
|
68
|
+
*/
|
|
69
|
+
seconds: number;
|
|
70
|
+
/**
|
|
71
|
+
* Signed fractions of a second at nanosecond resolution of the span
|
|
72
|
+
* of time. Durations less than one second are represented with a 0
|
|
73
|
+
* `seconds` field and a positive or negative `nanos` field. For durations
|
|
74
|
+
* of one second or more, a non-zero value for the `nanos` field must be
|
|
75
|
+
* of the same sign as the `seconds` field. Must be from -999,999,999
|
|
76
|
+
* to +999,999,999 inclusive.
|
|
77
|
+
*/
|
|
78
|
+
nanos: number;
|
|
79
|
+
}
|
|
80
|
+
export declare const Duration: {
|
|
81
|
+
encode(message: Duration, writer?: Writer): Writer;
|
|
82
|
+
decode(input: Reader | Uint8Array, length?: number | undefined): Duration;
|
|
83
|
+
fromJSON(object: any): Duration;
|
|
84
|
+
toJSON(message: Duration): unknown;
|
|
85
|
+
fromPartial(object: DeepPartial<Duration>): Duration;
|
|
86
|
+
};
|
|
87
|
+
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
88
|
+
export declare type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
89
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
90
|
+
} : Partial<T>;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.Duration = exports.protobufPackage = void 0;
|
|
15
|
+
/* eslint-disable */
|
|
16
|
+
var minimal_1 = require("protobufjs/minimal");
|
|
17
|
+
exports.protobufPackage = "google.protobuf";
|
|
18
|
+
var baseDuration = { seconds: 0, nanos: 0 };
|
|
19
|
+
exports.Duration = {
|
|
20
|
+
encode: function (message, writer) {
|
|
21
|
+
if (writer === void 0) { writer = minimal_1.Writer.create(); }
|
|
22
|
+
if (message.seconds !== 0) {
|
|
23
|
+
writer.uint32(8).int64(message.seconds);
|
|
24
|
+
}
|
|
25
|
+
if (message.nanos !== 0) {
|
|
26
|
+
writer.uint32(16).int32(message.nanos);
|
|
27
|
+
}
|
|
28
|
+
return writer;
|
|
29
|
+
},
|
|
30
|
+
decode: function (input, length) {
|
|
31
|
+
var reader = input instanceof minimal_1.Reader ? input : new minimal_1.Reader(input);
|
|
32
|
+
var end = length === undefined ? reader.len : reader.pos + length;
|
|
33
|
+
var message = __assign({}, baseDuration);
|
|
34
|
+
while (reader.pos < end) {
|
|
35
|
+
var tag = reader.uint32();
|
|
36
|
+
switch (tag >>> 3) {
|
|
37
|
+
case 1:
|
|
38
|
+
message.seconds = longToNumber(reader.int64());
|
|
39
|
+
break;
|
|
40
|
+
case 2:
|
|
41
|
+
message.nanos = reader.int32();
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
reader.skipType(tag & 7);
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return message;
|
|
49
|
+
},
|
|
50
|
+
fromJSON: function (object) {
|
|
51
|
+
var message = __assign({}, baseDuration);
|
|
52
|
+
if (object.seconds !== undefined && object.seconds !== null) {
|
|
53
|
+
message.seconds = Number(object.seconds);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
message.seconds = 0;
|
|
57
|
+
}
|
|
58
|
+
if (object.nanos !== undefined && object.nanos !== null) {
|
|
59
|
+
message.nanos = Number(object.nanos);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
message.nanos = 0;
|
|
63
|
+
}
|
|
64
|
+
return message;
|
|
65
|
+
},
|
|
66
|
+
toJSON: function (message) {
|
|
67
|
+
var obj = {};
|
|
68
|
+
message.seconds !== undefined && (obj.seconds = message.seconds);
|
|
69
|
+
message.nanos !== undefined && (obj.nanos = message.nanos);
|
|
70
|
+
return obj;
|
|
71
|
+
},
|
|
72
|
+
fromPartial: function (object) {
|
|
73
|
+
var message = __assign({}, baseDuration);
|
|
74
|
+
if (object.seconds !== undefined && object.seconds !== null) {
|
|
75
|
+
message.seconds = object.seconds;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
message.seconds = 0;
|
|
79
|
+
}
|
|
80
|
+
if (object.nanos !== undefined && object.nanos !== null) {
|
|
81
|
+
message.nanos = object.nanos;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
message.nanos = 0;
|
|
85
|
+
}
|
|
86
|
+
return message;
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
var globalThis = (function () {
|
|
90
|
+
if (typeof globalThis !== "undefined")
|
|
91
|
+
return globalThis;
|
|
92
|
+
if (typeof self !== "undefined")
|
|
93
|
+
return self;
|
|
94
|
+
if (typeof window !== "undefined")
|
|
95
|
+
return window;
|
|
96
|
+
if (typeof global !== "undefined")
|
|
97
|
+
return global;
|
|
98
|
+
throw "Unable to locate global object";
|
|
99
|
+
})();
|
|
100
|
+
function longToNumber(long) {
|
|
101
|
+
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
|
102
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
103
|
+
}
|
|
104
|
+
return long.toNumber();
|
|
105
|
+
}
|
|
106
|
+
// If you get a compile-error about 'Constructor<Long> and ... have no overlap',
|
|
107
|
+
// add '--ts_proto_opt=esModuleInterop=true' as a flag when calling 'protoc'.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Writer, Reader } from "protobufjs/minimal";
|
|
2
|
+
export declare const protobufPackage = "google.protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* A Timestamp represents a point in time independent of any time zone
|
|
5
|
+
* or calendar, represented as seconds and fractions of seconds at
|
|
6
|
+
* nanosecond resolution in UTC Epoch time. It is encoded using the
|
|
7
|
+
* Proleptic Gregorian Calendar which extends the Gregorian calendar
|
|
8
|
+
* backwards to year one. It is encoded assuming all minutes are 60
|
|
9
|
+
* seconds long, i.e. leap seconds are "smeared" so that no leap second
|
|
10
|
+
* table is needed for interpretation. Range is from
|
|
11
|
+
* 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
|
|
12
|
+
* By restricting to that range, we ensure that we can convert to
|
|
13
|
+
* and from RFC 3339 date strings.
|
|
14
|
+
* See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
|
|
15
|
+
*
|
|
16
|
+
* # Examples
|
|
17
|
+
*
|
|
18
|
+
* Example 1: Compute Timestamp from POSIX `time()`.
|
|
19
|
+
*
|
|
20
|
+
* Timestamp timestamp;
|
|
21
|
+
* timestamp.set_seconds(time(NULL));
|
|
22
|
+
* timestamp.set_nanos(0);
|
|
23
|
+
*
|
|
24
|
+
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
25
|
+
*
|
|
26
|
+
* struct timeval tv;
|
|
27
|
+
* gettimeofday(&tv, NULL);
|
|
28
|
+
*
|
|
29
|
+
* Timestamp timestamp;
|
|
30
|
+
* timestamp.set_seconds(tv.tv_sec);
|
|
31
|
+
* timestamp.set_nanos(tv.tv_usec * 1000);
|
|
32
|
+
*
|
|
33
|
+
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
34
|
+
*
|
|
35
|
+
* FILETIME ft;
|
|
36
|
+
* GetSystemTimeAsFileTime(&ft);
|
|
37
|
+
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
38
|
+
*
|
|
39
|
+
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
40
|
+
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
41
|
+
* Timestamp timestamp;
|
|
42
|
+
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
43
|
+
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
44
|
+
*
|
|
45
|
+
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
46
|
+
*
|
|
47
|
+
* long millis = System.currentTimeMillis();
|
|
48
|
+
*
|
|
49
|
+
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
50
|
+
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
51
|
+
*
|
|
52
|
+
*
|
|
53
|
+
* Example 5: Compute Timestamp from current time in Python.
|
|
54
|
+
*
|
|
55
|
+
* timestamp = Timestamp()
|
|
56
|
+
* timestamp.GetCurrentTime()
|
|
57
|
+
*
|
|
58
|
+
* # JSON Mapping
|
|
59
|
+
*
|
|
60
|
+
* In JSON format, the Timestamp type is encoded as a string in the
|
|
61
|
+
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
|
62
|
+
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
|
63
|
+
* where {year} is always expressed using four digits while {month}, {day},
|
|
64
|
+
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
65
|
+
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
66
|
+
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
67
|
+
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
|
68
|
+
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
69
|
+
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
70
|
+
*
|
|
71
|
+
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
72
|
+
* 01:30 UTC on January 15, 2017.
|
|
73
|
+
*
|
|
74
|
+
* In JavaScript, one can convert a Date object to this format using the
|
|
75
|
+
* standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
|
|
76
|
+
* method. In Python, a standard `datetime.datetime` object can be converted
|
|
77
|
+
* to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime)
|
|
78
|
+
* with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
|
79
|
+
* can use the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
80
|
+
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--
|
|
81
|
+
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
82
|
+
*/
|
|
83
|
+
export interface Timestamp {
|
|
84
|
+
/**
|
|
85
|
+
* Represents seconds of UTC time since Unix epoch
|
|
86
|
+
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
|
87
|
+
* 9999-12-31T23:59:59Z inclusive.
|
|
88
|
+
*/
|
|
89
|
+
seconds: number;
|
|
90
|
+
/**
|
|
91
|
+
* Non-negative fractions of a second at nanosecond resolution. Negative
|
|
92
|
+
* second values with fractions must still have non-negative nanos values
|
|
93
|
+
* that count forward in time. Must be from 0 to 999,999,999
|
|
94
|
+
* inclusive.
|
|
95
|
+
*/
|
|
96
|
+
nanos: number;
|
|
97
|
+
}
|
|
98
|
+
export declare const Timestamp: {
|
|
99
|
+
encode(message: Timestamp, writer?: Writer): Writer;
|
|
100
|
+
decode(input: Reader | Uint8Array, length?: number | undefined): Timestamp;
|
|
101
|
+
fromJSON(object: any): Timestamp;
|
|
102
|
+
toJSON(message: Timestamp): unknown;
|
|
103
|
+
fromPartial(object: DeepPartial<Timestamp>): Timestamp;
|
|
104
|
+
};
|
|
105
|
+
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
106
|
+
export declare type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
107
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
108
|
+
} : Partial<T>;
|
|
109
|
+
export {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.Timestamp = exports.protobufPackage = void 0;
|
|
15
|
+
/* eslint-disable */
|
|
16
|
+
var minimal_1 = require("protobufjs/minimal");
|
|
17
|
+
exports.protobufPackage = "google.protobuf";
|
|
18
|
+
var baseTimestamp = { seconds: 0, nanos: 0 };
|
|
19
|
+
exports.Timestamp = {
|
|
20
|
+
encode: function (message, writer) {
|
|
21
|
+
if (writer === void 0) { writer = minimal_1.Writer.create(); }
|
|
22
|
+
if (message.seconds !== 0) {
|
|
23
|
+
writer.uint32(8).int64(message.seconds);
|
|
24
|
+
}
|
|
25
|
+
if (message.nanos !== 0) {
|
|
26
|
+
writer.uint32(16).int32(message.nanos);
|
|
27
|
+
}
|
|
28
|
+
return writer;
|
|
29
|
+
},
|
|
30
|
+
decode: function (input, length) {
|
|
31
|
+
var reader = input instanceof minimal_1.Reader ? input : new minimal_1.Reader(input);
|
|
32
|
+
var end = length === undefined ? reader.len : reader.pos + length;
|
|
33
|
+
var message = __assign({}, baseTimestamp);
|
|
34
|
+
while (reader.pos < end) {
|
|
35
|
+
var tag = reader.uint32();
|
|
36
|
+
switch (tag >>> 3) {
|
|
37
|
+
case 1:
|
|
38
|
+
message.seconds = longToNumber(reader.int64());
|
|
39
|
+
break;
|
|
40
|
+
case 2:
|
|
41
|
+
message.nanos = reader.int32();
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
reader.skipType(tag & 7);
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return message;
|
|
49
|
+
},
|
|
50
|
+
fromJSON: function (object) {
|
|
51
|
+
var message = __assign({}, baseTimestamp);
|
|
52
|
+
if (object.seconds !== undefined && object.seconds !== null) {
|
|
53
|
+
message.seconds = Number(object.seconds);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
message.seconds = 0;
|
|
57
|
+
}
|
|
58
|
+
if (object.nanos !== undefined && object.nanos !== null) {
|
|
59
|
+
message.nanos = Number(object.nanos);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
message.nanos = 0;
|
|
63
|
+
}
|
|
64
|
+
return message;
|
|
65
|
+
},
|
|
66
|
+
toJSON: function (message) {
|
|
67
|
+
var obj = {};
|
|
68
|
+
message.seconds !== undefined && (obj.seconds = message.seconds);
|
|
69
|
+
message.nanos !== undefined && (obj.nanos = message.nanos);
|
|
70
|
+
return obj;
|
|
71
|
+
},
|
|
72
|
+
fromPartial: function (object) {
|
|
73
|
+
var message = __assign({}, baseTimestamp);
|
|
74
|
+
if (object.seconds !== undefined && object.seconds !== null) {
|
|
75
|
+
message.seconds = object.seconds;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
message.seconds = 0;
|
|
79
|
+
}
|
|
80
|
+
if (object.nanos !== undefined && object.nanos !== null) {
|
|
81
|
+
message.nanos = object.nanos;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
message.nanos = 0;
|
|
85
|
+
}
|
|
86
|
+
return message;
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
var globalThis = (function () {
|
|
90
|
+
if (typeof globalThis !== "undefined")
|
|
91
|
+
return globalThis;
|
|
92
|
+
if (typeof self !== "undefined")
|
|
93
|
+
return self;
|
|
94
|
+
if (typeof window !== "undefined")
|
|
95
|
+
return window;
|
|
96
|
+
if (typeof global !== "undefined")
|
|
97
|
+
return global;
|
|
98
|
+
throw "Unable to locate global object";
|
|
99
|
+
})();
|
|
100
|
+
function longToNumber(long) {
|
|
101
|
+
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
|
102
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
103
|
+
}
|
|
104
|
+
return long.toNumber();
|
|
105
|
+
}
|
|
106
|
+
// If you get a compile-error about 'Constructor<Long> and ... have no overlap',
|
|
107
|
+
// add '--ts_proto_opt=esModuleInterop=true' as a flag when calling 'protoc'.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export declare enum ProposalStatus {
|
|
2
|
+
PROPOSAL_STATUS_UNSPECIFIED = 0,
|
|
3
|
+
PROPOSAL_STATUS_DEPOSIT_PERIOD = 1,
|
|
4
|
+
PROPOSAL_STATUS_VOTING_PERIOD = 2,
|
|
5
|
+
PROPOSAL_STATUS_PASSED = 3,
|
|
6
|
+
PROPOSAL_STATUS_REJECTED = 4,
|
|
7
|
+
PROPOSAL_STATUS_FAILED = 5
|
|
8
|
+
}
|
|
9
|
+
export interface ProposalParam {
|
|
10
|
+
voting_period: string;
|
|
11
|
+
deposit_params: {
|
|
12
|
+
min_deposit: {
|
|
13
|
+
denom: string;
|
|
14
|
+
amount: string;
|
|
15
|
+
}[];
|
|
16
|
+
max_deposit_period: string;
|
|
17
|
+
};
|
|
18
|
+
tally_params: {
|
|
19
|
+
quorum: string;
|
|
20
|
+
threshold: string;
|
|
21
|
+
veto_threshold: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface CurrentVoteInfo {
|
|
25
|
+
yes: string;
|
|
26
|
+
abstain: string;
|
|
27
|
+
no: string;
|
|
28
|
+
no_with_veto: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ProposalInfo {
|
|
31
|
+
proposal_id: string;
|
|
32
|
+
content: {
|
|
33
|
+
"@type": string;
|
|
34
|
+
title: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
status: string;
|
|
38
|
+
final_tally_result: {
|
|
39
|
+
yes: string;
|
|
40
|
+
abstain: string;
|
|
41
|
+
no: string;
|
|
42
|
+
no_with_veto: string;
|
|
43
|
+
};
|
|
44
|
+
submit_time: string;
|
|
45
|
+
deposit_end_time: string;
|
|
46
|
+
total_deposit: {
|
|
47
|
+
denom: string;
|
|
48
|
+
amount: string;
|
|
49
|
+
}[];
|
|
50
|
+
voting_start_time: string;
|
|
51
|
+
voting_end_time: string;
|
|
52
|
+
}
|
|
53
|
+
export declare class GovQueryClient {
|
|
54
|
+
private readonly axios;
|
|
55
|
+
constructor(baseUrl: string);
|
|
56
|
+
queryGetCurrentVoteInfo(id: string): Promise<CurrentVoteInfo>;
|
|
57
|
+
queryGetParam(): Promise<ProposalParam>;
|
|
58
|
+
queryGetProposal(id: string): Promise<ProposalInfo>;
|
|
59
|
+
queryGetProposalListByStatus(status: ProposalStatus): Promise<ProposalInfo[]>;
|
|
60
|
+
queryGetProposalList(): Promise<ProposalInfo[]>;
|
|
61
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.GovQueryClient = exports.ProposalStatus = void 0;
|
|
43
|
+
var axios_1 = __importDefault(require("axios"));
|
|
44
|
+
var ProposalStatus;
|
|
45
|
+
(function (ProposalStatus) {
|
|
46
|
+
ProposalStatus[ProposalStatus["PROPOSAL_STATUS_UNSPECIFIED"] = 0] = "PROPOSAL_STATUS_UNSPECIFIED";
|
|
47
|
+
ProposalStatus[ProposalStatus["PROPOSAL_STATUS_DEPOSIT_PERIOD"] = 1] = "PROPOSAL_STATUS_DEPOSIT_PERIOD";
|
|
48
|
+
ProposalStatus[ProposalStatus["PROPOSAL_STATUS_VOTING_PERIOD"] = 2] = "PROPOSAL_STATUS_VOTING_PERIOD";
|
|
49
|
+
ProposalStatus[ProposalStatus["PROPOSAL_STATUS_PASSED"] = 3] = "PROPOSAL_STATUS_PASSED";
|
|
50
|
+
ProposalStatus[ProposalStatus["PROPOSAL_STATUS_REJECTED"] = 4] = "PROPOSAL_STATUS_REJECTED";
|
|
51
|
+
ProposalStatus[ProposalStatus["PROPOSAL_STATUS_FAILED"] = 5] = "PROPOSAL_STATUS_FAILED";
|
|
52
|
+
})(ProposalStatus = exports.ProposalStatus || (exports.ProposalStatus = {}));
|
|
53
|
+
var GovQueryClient = /** @class */ (function () {
|
|
54
|
+
function GovQueryClient(baseUrl) {
|
|
55
|
+
this.axios = axios_1.default.create({
|
|
56
|
+
baseURL: baseUrl,
|
|
57
|
+
headers: {
|
|
58
|
+
Accept: "application/json",
|
|
59
|
+
},
|
|
60
|
+
timeout: 15000,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
GovQueryClient.prototype.queryGetCurrentVoteInfo = function (id) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
var path, result;
|
|
66
|
+
return __generator(this, function (_a) {
|
|
67
|
+
switch (_a.label) {
|
|
68
|
+
case 0:
|
|
69
|
+
path = "/cosmos/gov/v1beta1/proposals/" + id + "/tally";
|
|
70
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
71
|
+
case 1:
|
|
72
|
+
result = _a.sent();
|
|
73
|
+
return [2 /*return*/, result.data.tally];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
GovQueryClient.prototype.queryGetParam = function () {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
80
|
+
var path, votingResult, depositResult, tallyingResult;
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
switch (_a.label) {
|
|
83
|
+
case 0:
|
|
84
|
+
path = "/cosmos/gov/v1beta1/params/voting";
|
|
85
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
86
|
+
case 1:
|
|
87
|
+
votingResult = _a.sent();
|
|
88
|
+
path = "/cosmos/gov/v1beta1/params/deposit";
|
|
89
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
90
|
+
case 2:
|
|
91
|
+
depositResult = _a.sent();
|
|
92
|
+
path = "/cosmos/gov/v1beta1/params/tallying";
|
|
93
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
94
|
+
case 3:
|
|
95
|
+
tallyingResult = _a.sent();
|
|
96
|
+
return [2 /*return*/, {
|
|
97
|
+
voting_period: votingResult.data.voting_params.voting_period,
|
|
98
|
+
deposit_params: depositResult.data.deposit_params,
|
|
99
|
+
tally_params: tallyingResult.data.tally_params
|
|
100
|
+
}];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
GovQueryClient.prototype.queryGetProposal = function (id) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
107
|
+
var path, result;
|
|
108
|
+
return __generator(this, function (_a) {
|
|
109
|
+
switch (_a.label) {
|
|
110
|
+
case 0:
|
|
111
|
+
path = "/cosmos/gov/v1beta1/proposals/" + id;
|
|
112
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
113
|
+
case 1:
|
|
114
|
+
result = _a.sent();
|
|
115
|
+
return [2 /*return*/, result.data.proposal];
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
GovQueryClient.prototype.queryGetProposalListByStatus = function (status) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
+
var path, result;
|
|
123
|
+
return __generator(this, function (_a) {
|
|
124
|
+
switch (_a.label) {
|
|
125
|
+
case 0:
|
|
126
|
+
path = "/cosmos/gov/v1beta1/proposals";
|
|
127
|
+
return [4 /*yield*/, this.axios.get(path, { params: { proposalStatus: status } })];
|
|
128
|
+
case 1:
|
|
129
|
+
result = _a.sent();
|
|
130
|
+
return [2 /*return*/, result.data.proposals];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
GovQueryClient.prototype.queryGetProposalList = function () {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
137
|
+
var path, result;
|
|
138
|
+
return __generator(this, function (_a) {
|
|
139
|
+
switch (_a.label) {
|
|
140
|
+
case 0:
|
|
141
|
+
path = "/cosmos/gov/v1beta1/proposals";
|
|
142
|
+
return [4 /*yield*/, this.axios.get(path)];
|
|
143
|
+
case 1:
|
|
144
|
+
result = _a.sent();
|
|
145
|
+
return [2 /*return*/, result.data.proposals];
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
return GovQueryClient;
|
|
151
|
+
}());
|
|
152
|
+
exports.GovQueryClient = GovQueryClient;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
2
|
+
import { MsgDeposit, MsgSubmitProposal, MsgVote } from "cosmjs-types/cosmos/gov/v1beta1/tx";
|
|
3
|
+
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
4
|
+
import { ITxClient } from "../common/ITxClient";
|
|
5
|
+
export interface MsgDepositEncodeObject extends EncodeObject {
|
|
6
|
+
readonly typeUrl: "/cosmos.gov.v1beta1.MsgDeposit";
|
|
7
|
+
readonly value: Partial<MsgDeposit>;
|
|
8
|
+
}
|
|
9
|
+
export interface MsgSubmitProposalEncodeObject extends EncodeObject {
|
|
10
|
+
readonly typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal";
|
|
11
|
+
readonly value: Partial<MsgSubmitProposal>;
|
|
12
|
+
}
|
|
13
|
+
export interface MsgVoteEncodeObject extends EncodeObject {
|
|
14
|
+
readonly typeUrl: "/cosmos.gov.v1beta1.MsgVote";
|
|
15
|
+
readonly value: Partial<MsgVote>;
|
|
16
|
+
}
|
|
17
|
+
export declare class GovTxClient extends ITxClient {
|
|
18
|
+
constructor(wallet: FirmaWalletService, serverUrl: string);
|
|
19
|
+
msgDeposit(data: MsgDeposit): MsgDepositEncodeObject;
|
|
20
|
+
msgSubmitProposal(data: MsgSubmitProposal): MsgSubmitProposalEncodeObject;
|
|
21
|
+
msgVote(data: MsgVote): MsgVoteEncodeObject;
|
|
22
|
+
}
|