@gnolang/tm2-js-client 1.2.6 → 1.3.0
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/bin/proto/google/protobuf/any.d.ts +1 -1
- package/bin/proto/google/protobuf/any.js +16 -12
- package/bin/proto/tm2/abci.d.ts +3 -3
- package/bin/proto/tm2/abci.js +50 -38
- package/bin/proto/tm2/tx.d.ts +3 -3
- package/bin/proto/tm2/tx.js +48 -39
- package/bin/provider/jsonrpc/jsonrpc.js +1 -1
- package/bin/provider/websocket/ws.js +2 -2
- package/bin/wallet/wallet.js +4 -4
- package/bin/wallet/wallet.test.js +6 -6
- package/package.json +1 -1
|
@@ -119,7 +119,7 @@ export interface Any {
|
|
|
119
119
|
* Schemes other than `http`, `https` (or the empty scheme) might be
|
|
120
120
|
* used with implementation specific semantics.
|
|
121
121
|
*/
|
|
122
|
-
|
|
122
|
+
type_url: string;
|
|
123
123
|
/** Must be a valid serialized protocol buffer of the above specified type. */
|
|
124
124
|
value: Uint8Array;
|
|
125
125
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.
|
|
5
|
-
// protoc v5.29.
|
|
4
|
+
// protoc-gen-ts_proto v2.7.5
|
|
5
|
+
// protoc v5.29.3
|
|
6
6
|
// source: google/protobuf/any.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.Any = exports.protobufPackage = void 0;
|
|
@@ -10,13 +10,13 @@ exports.Any = exports.protobufPackage = void 0;
|
|
|
10
10
|
var wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
exports.protobufPackage = 'google.protobuf';
|
|
12
12
|
function createBaseAny() {
|
|
13
|
-
return {
|
|
13
|
+
return { type_url: '', value: new Uint8Array(0) };
|
|
14
14
|
}
|
|
15
15
|
exports.Any = {
|
|
16
16
|
encode: function (message, writer) {
|
|
17
17
|
if (writer === void 0) { writer = new wire_1.BinaryWriter(); }
|
|
18
|
-
if (message.
|
|
19
|
-
writer.uint32(10).string(message.
|
|
18
|
+
if (message.type_url !== '') {
|
|
19
|
+
writer.uint32(10).string(message.type_url);
|
|
20
20
|
}
|
|
21
21
|
if (message.value.length !== 0) {
|
|
22
22
|
writer.uint32(18).bytes(message.value);
|
|
@@ -30,18 +30,20 @@ exports.Any = {
|
|
|
30
30
|
while (reader.pos < end) {
|
|
31
31
|
var tag = reader.uint32();
|
|
32
32
|
switch (tag >>> 3) {
|
|
33
|
-
case 1:
|
|
33
|
+
case 1: {
|
|
34
34
|
if (tag !== 10) {
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
|
-
message.
|
|
37
|
+
message.type_url = reader.string();
|
|
38
38
|
continue;
|
|
39
|
-
|
|
39
|
+
}
|
|
40
|
+
case 2: {
|
|
40
41
|
if (tag !== 18) {
|
|
41
42
|
break;
|
|
42
43
|
}
|
|
43
44
|
message.value = reader.bytes();
|
|
44
45
|
continue;
|
|
46
|
+
}
|
|
45
47
|
}
|
|
46
48
|
if ((tag & 7) === 4 || tag === 0) {
|
|
47
49
|
break;
|
|
@@ -52,7 +54,9 @@ exports.Any = {
|
|
|
52
54
|
},
|
|
53
55
|
fromJSON: function (object) {
|
|
54
56
|
return {
|
|
55
|
-
|
|
57
|
+
type_url: isSet(object.type_url)
|
|
58
|
+
? globalThis.String(object.type_url)
|
|
59
|
+
: '',
|
|
56
60
|
value: isSet(object.value)
|
|
57
61
|
? bytesFromBase64(object.value)
|
|
58
62
|
: new Uint8Array(0),
|
|
@@ -60,8 +64,8 @@ exports.Any = {
|
|
|
60
64
|
},
|
|
61
65
|
toJSON: function (message) {
|
|
62
66
|
var obj = {};
|
|
63
|
-
if (message.
|
|
64
|
-
obj.
|
|
67
|
+
if (message.type_url !== undefined) {
|
|
68
|
+
obj.type_url = message.type_url;
|
|
65
69
|
}
|
|
66
70
|
if (message.value !== undefined) {
|
|
67
71
|
obj.value = base64FromBytes(message.value);
|
|
@@ -74,7 +78,7 @@ exports.Any = {
|
|
|
74
78
|
fromPartial: function (object) {
|
|
75
79
|
var _a, _b;
|
|
76
80
|
var message = createBaseAny();
|
|
77
|
-
message.
|
|
81
|
+
message.type_url = (_a = object.type_url) !== null && _a !== void 0 ? _a : '';
|
|
78
82
|
message.value = (_b = object.value) !== null && _b !== void 0 ? _b : new Uint8Array(0);
|
|
79
83
|
return message;
|
|
80
84
|
},
|
package/bin/proto/tm2/abci.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import Long from 'long';
|
|
|
3
3
|
import { Any } from '../google/protobuf/any';
|
|
4
4
|
export declare const protobufPackage = "tm2.abci";
|
|
5
5
|
export interface ResponseDeliverTx {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
response_base?: ResponseBase | undefined;
|
|
7
|
+
gas_wanted: Long;
|
|
8
|
+
gas_used: Long;
|
|
9
9
|
}
|
|
10
10
|
export interface ResponseBase {
|
|
11
11
|
error?: Any | undefined;
|
package/bin/proto/tm2/abci.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.
|
|
5
|
-
// protoc v5.29.
|
|
4
|
+
// protoc-gen-ts_proto v2.7.5
|
|
5
|
+
// protoc v5.29.3
|
|
6
6
|
// source: tm2/abci.proto
|
|
7
7
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
8
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -15,19 +15,23 @@ var long_1 = __importDefault(require("long"));
|
|
|
15
15
|
var any_1 = require("../google/protobuf/any");
|
|
16
16
|
exports.protobufPackage = 'tm2.abci';
|
|
17
17
|
function createBaseResponseDeliverTx() {
|
|
18
|
-
return {
|
|
18
|
+
return {
|
|
19
|
+
response_base: undefined,
|
|
20
|
+
gas_wanted: long_1.default.ZERO,
|
|
21
|
+
gas_used: long_1.default.ZERO,
|
|
22
|
+
};
|
|
19
23
|
}
|
|
20
24
|
exports.ResponseDeliverTx = {
|
|
21
25
|
encode: function (message, writer) {
|
|
22
26
|
if (writer === void 0) { writer = new wire_1.BinaryWriter(); }
|
|
23
|
-
if (message.
|
|
24
|
-
exports.ResponseBase.encode(message.
|
|
27
|
+
if (message.response_base !== undefined) {
|
|
28
|
+
exports.ResponseBase.encode(message.response_base, writer.uint32(10).fork()).join();
|
|
25
29
|
}
|
|
26
|
-
if (!message.
|
|
27
|
-
writer.uint32(16).sint64(message.
|
|
30
|
+
if (!message.gas_wanted.equals(long_1.default.ZERO)) {
|
|
31
|
+
writer.uint32(16).sint64(message.gas_wanted.toString());
|
|
28
32
|
}
|
|
29
|
-
if (!message.
|
|
30
|
-
writer.uint32(24).sint64(message.
|
|
33
|
+
if (!message.gas_used.equals(long_1.default.ZERO)) {
|
|
34
|
+
writer.uint32(24).sint64(message.gas_used.toString());
|
|
31
35
|
}
|
|
32
36
|
return writer;
|
|
33
37
|
},
|
|
@@ -38,24 +42,27 @@ exports.ResponseDeliverTx = {
|
|
|
38
42
|
while (reader.pos < end) {
|
|
39
43
|
var tag = reader.uint32();
|
|
40
44
|
switch (tag >>> 3) {
|
|
41
|
-
case 1:
|
|
45
|
+
case 1: {
|
|
42
46
|
if (tag !== 10) {
|
|
43
47
|
break;
|
|
44
48
|
}
|
|
45
|
-
message.
|
|
49
|
+
message.response_base = exports.ResponseBase.decode(reader, reader.uint32());
|
|
46
50
|
continue;
|
|
47
|
-
|
|
51
|
+
}
|
|
52
|
+
case 2: {
|
|
48
53
|
if (tag !== 16) {
|
|
49
54
|
break;
|
|
50
55
|
}
|
|
51
|
-
message.
|
|
56
|
+
message.gas_wanted = long_1.default.fromString(reader.sint64().toString());
|
|
52
57
|
continue;
|
|
53
|
-
|
|
58
|
+
}
|
|
59
|
+
case 3: {
|
|
54
60
|
if (tag !== 24) {
|
|
55
61
|
break;
|
|
56
62
|
}
|
|
57
|
-
message.
|
|
63
|
+
message.gas_used = long_1.default.fromString(reader.sint64().toString());
|
|
58
64
|
continue;
|
|
65
|
+
}
|
|
59
66
|
}
|
|
60
67
|
if ((tag & 7) === 4 || tag === 0) {
|
|
61
68
|
break;
|
|
@@ -66,27 +73,27 @@ exports.ResponseDeliverTx = {
|
|
|
66
73
|
},
|
|
67
74
|
fromJSON: function (object) {
|
|
68
75
|
return {
|
|
69
|
-
|
|
76
|
+
response_base: isSet(object.ResponseBase)
|
|
70
77
|
? exports.ResponseBase.fromJSON(object.ResponseBase)
|
|
71
78
|
: undefined,
|
|
72
|
-
|
|
79
|
+
gas_wanted: isSet(object.GasWanted)
|
|
73
80
|
? long_1.default.fromValue(object.GasWanted)
|
|
74
81
|
: long_1.default.ZERO,
|
|
75
|
-
|
|
82
|
+
gas_used: isSet(object.GasUsed)
|
|
76
83
|
? long_1.default.fromValue(object.GasUsed)
|
|
77
84
|
: long_1.default.ZERO,
|
|
78
85
|
};
|
|
79
86
|
},
|
|
80
87
|
toJSON: function (message) {
|
|
81
88
|
var obj = {};
|
|
82
|
-
if (message.
|
|
83
|
-
obj.ResponseBase = exports.ResponseBase.toJSON(message.
|
|
89
|
+
if (message.response_base !== undefined) {
|
|
90
|
+
obj.ResponseBase = exports.ResponseBase.toJSON(message.response_base);
|
|
84
91
|
}
|
|
85
|
-
if (message.
|
|
86
|
-
obj.GasWanted = (message.
|
|
92
|
+
if (message.gas_wanted !== undefined) {
|
|
93
|
+
obj.GasWanted = (message.gas_wanted || long_1.default.ZERO).toString();
|
|
87
94
|
}
|
|
88
|
-
if (message.
|
|
89
|
-
obj.GasUsed = (message.
|
|
95
|
+
if (message.gas_used !== undefined) {
|
|
96
|
+
obj.GasUsed = (message.gas_used || long_1.default.ZERO).toString();
|
|
90
97
|
}
|
|
91
98
|
return obj;
|
|
92
99
|
},
|
|
@@ -95,17 +102,17 @@ exports.ResponseDeliverTx = {
|
|
|
95
102
|
},
|
|
96
103
|
fromPartial: function (object) {
|
|
97
104
|
var message = createBaseResponseDeliverTx();
|
|
98
|
-
message.
|
|
99
|
-
object.
|
|
100
|
-
? exports.ResponseBase.fromPartial(object.
|
|
105
|
+
message.response_base =
|
|
106
|
+
object.response_base !== undefined && object.response_base !== null
|
|
107
|
+
? exports.ResponseBase.fromPartial(object.response_base)
|
|
101
108
|
: undefined;
|
|
102
|
-
message.
|
|
103
|
-
object.
|
|
104
|
-
? long_1.default.fromValue(object.
|
|
109
|
+
message.gas_wanted =
|
|
110
|
+
object.gas_wanted !== undefined && object.gas_wanted !== null
|
|
111
|
+
? long_1.default.fromValue(object.gas_wanted)
|
|
105
112
|
: long_1.default.ZERO;
|
|
106
|
-
message.
|
|
107
|
-
object.
|
|
108
|
-
? long_1.default.fromValue(object.
|
|
113
|
+
message.gas_used =
|
|
114
|
+
object.gas_used !== undefined && object.gas_used !== null
|
|
115
|
+
? long_1.default.fromValue(object.gas_used)
|
|
109
116
|
: long_1.default.ZERO;
|
|
110
117
|
return message;
|
|
111
118
|
},
|
|
@@ -147,36 +154,41 @@ exports.ResponseBase = {
|
|
|
147
154
|
while (reader.pos < end) {
|
|
148
155
|
var tag = reader.uint32();
|
|
149
156
|
switch (tag >>> 3) {
|
|
150
|
-
case 1:
|
|
157
|
+
case 1: {
|
|
151
158
|
if (tag !== 10) {
|
|
152
159
|
break;
|
|
153
160
|
}
|
|
154
161
|
message.error = any_1.Any.decode(reader, reader.uint32());
|
|
155
162
|
continue;
|
|
156
|
-
|
|
163
|
+
}
|
|
164
|
+
case 2: {
|
|
157
165
|
if (tag !== 18) {
|
|
158
166
|
break;
|
|
159
167
|
}
|
|
160
168
|
message.data = reader.bytes();
|
|
161
169
|
continue;
|
|
162
|
-
|
|
170
|
+
}
|
|
171
|
+
case 3: {
|
|
163
172
|
if (tag !== 26) {
|
|
164
173
|
break;
|
|
165
174
|
}
|
|
166
175
|
message.events.push(any_1.Any.decode(reader, reader.uint32()));
|
|
167
176
|
continue;
|
|
168
|
-
|
|
177
|
+
}
|
|
178
|
+
case 4: {
|
|
169
179
|
if (tag !== 34) {
|
|
170
180
|
break;
|
|
171
181
|
}
|
|
172
182
|
message.log = reader.string();
|
|
173
183
|
continue;
|
|
174
|
-
|
|
184
|
+
}
|
|
185
|
+
case 5: {
|
|
175
186
|
if (tag !== 42) {
|
|
176
187
|
break;
|
|
177
188
|
}
|
|
178
189
|
message.info = reader.string();
|
|
179
190
|
continue;
|
|
191
|
+
}
|
|
180
192
|
}
|
|
181
193
|
if ((tag & 7) === 4 || tag === 0) {
|
|
182
194
|
break;
|
package/bin/proto/tm2/tx.d.ts
CHANGED
|
@@ -14,13 +14,13 @@ export interface Tx {
|
|
|
14
14
|
}
|
|
15
15
|
export interface TxFee {
|
|
16
16
|
/** gas limit */
|
|
17
|
-
|
|
17
|
+
gas_wanted: Long;
|
|
18
18
|
/** gas fee details (<value><denomination>) */
|
|
19
|
-
|
|
19
|
+
gas_fee: string;
|
|
20
20
|
}
|
|
21
21
|
export interface TxSignature {
|
|
22
22
|
/** public key associated with the signature */
|
|
23
|
-
|
|
23
|
+
pub_key?: Any | undefined;
|
|
24
24
|
/** the signature */
|
|
25
25
|
signature: Uint8Array;
|
|
26
26
|
}
|
package/bin/proto/tm2/tx.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.
|
|
5
|
-
// protoc v5.29.
|
|
4
|
+
// protoc-gen-ts_proto v2.7.5
|
|
5
|
+
// protoc v5.29.3
|
|
6
6
|
// source: tm2/tx.proto
|
|
7
7
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
8
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -43,30 +43,34 @@ exports.Tx = {
|
|
|
43
43
|
while (reader.pos < end) {
|
|
44
44
|
var tag = reader.uint32();
|
|
45
45
|
switch (tag >>> 3) {
|
|
46
|
-
case 1:
|
|
46
|
+
case 1: {
|
|
47
47
|
if (tag !== 10) {
|
|
48
48
|
break;
|
|
49
49
|
}
|
|
50
50
|
message.messages.push(any_1.Any.decode(reader, reader.uint32()));
|
|
51
51
|
continue;
|
|
52
|
-
|
|
52
|
+
}
|
|
53
|
+
case 2: {
|
|
53
54
|
if (tag !== 18) {
|
|
54
55
|
break;
|
|
55
56
|
}
|
|
56
57
|
message.fee = exports.TxFee.decode(reader, reader.uint32());
|
|
57
58
|
continue;
|
|
58
|
-
|
|
59
|
+
}
|
|
60
|
+
case 3: {
|
|
59
61
|
if (tag !== 26) {
|
|
60
62
|
break;
|
|
61
63
|
}
|
|
62
64
|
message.signatures.push(exports.TxSignature.decode(reader, reader.uint32()));
|
|
63
65
|
continue;
|
|
64
|
-
|
|
66
|
+
}
|
|
67
|
+
case 4: {
|
|
65
68
|
if (tag !== 34) {
|
|
66
69
|
break;
|
|
67
70
|
}
|
|
68
71
|
message.memo = reader.string();
|
|
69
72
|
continue;
|
|
73
|
+
}
|
|
70
74
|
}
|
|
71
75
|
if ((tag & 7) === 4 || tag === 0) {
|
|
72
76
|
break;
|
|
@@ -122,16 +126,16 @@ exports.Tx = {
|
|
|
122
126
|
},
|
|
123
127
|
};
|
|
124
128
|
function createBaseTxFee() {
|
|
125
|
-
return {
|
|
129
|
+
return { gas_wanted: long_1.default.ZERO, gas_fee: '' };
|
|
126
130
|
}
|
|
127
131
|
exports.TxFee = {
|
|
128
132
|
encode: function (message, writer) {
|
|
129
133
|
if (writer === void 0) { writer = new wire_1.BinaryWriter(); }
|
|
130
|
-
if (!message.
|
|
131
|
-
writer.uint32(8).sint64(message.
|
|
134
|
+
if (!message.gas_wanted.equals(long_1.default.ZERO)) {
|
|
135
|
+
writer.uint32(8).sint64(message.gas_wanted.toString());
|
|
132
136
|
}
|
|
133
|
-
if (message.
|
|
134
|
-
writer.uint32(18).string(message.
|
|
137
|
+
if (message.gas_fee !== '') {
|
|
138
|
+
writer.uint32(18).string(message.gas_fee);
|
|
135
139
|
}
|
|
136
140
|
return writer;
|
|
137
141
|
},
|
|
@@ -142,18 +146,20 @@ exports.TxFee = {
|
|
|
142
146
|
while (reader.pos < end) {
|
|
143
147
|
var tag = reader.uint32();
|
|
144
148
|
switch (tag >>> 3) {
|
|
145
|
-
case 1:
|
|
149
|
+
case 1: {
|
|
146
150
|
if (tag !== 8) {
|
|
147
151
|
break;
|
|
148
152
|
}
|
|
149
|
-
message.
|
|
153
|
+
message.gas_wanted = long_1.default.fromString(reader.sint64().toString());
|
|
150
154
|
continue;
|
|
151
|
-
|
|
155
|
+
}
|
|
156
|
+
case 2: {
|
|
152
157
|
if (tag !== 18) {
|
|
153
158
|
break;
|
|
154
159
|
}
|
|
155
|
-
message.
|
|
160
|
+
message.gas_fee = reader.string();
|
|
156
161
|
continue;
|
|
162
|
+
}
|
|
157
163
|
}
|
|
158
164
|
if ((tag & 7) === 4 || tag === 0) {
|
|
159
165
|
break;
|
|
@@ -164,19 +170,19 @@ exports.TxFee = {
|
|
|
164
170
|
},
|
|
165
171
|
fromJSON: function (object) {
|
|
166
172
|
return {
|
|
167
|
-
|
|
168
|
-
? long_1.default.fromValue(object.
|
|
173
|
+
gas_wanted: isSet(object.gas_wanted)
|
|
174
|
+
? long_1.default.fromValue(object.gas_wanted)
|
|
169
175
|
: long_1.default.ZERO,
|
|
170
|
-
|
|
176
|
+
gas_fee: isSet(object.gas_fee) ? globalThis.String(object.gas_fee) : '',
|
|
171
177
|
};
|
|
172
178
|
},
|
|
173
179
|
toJSON: function (message) {
|
|
174
180
|
var obj = {};
|
|
175
|
-
if (message.
|
|
176
|
-
obj.
|
|
181
|
+
if (message.gas_wanted !== undefined) {
|
|
182
|
+
obj.gas_wanted = (message.gas_wanted || long_1.default.ZERO).toString();
|
|
177
183
|
}
|
|
178
|
-
if (message.
|
|
179
|
-
obj.
|
|
184
|
+
if (message.gas_fee !== undefined) {
|
|
185
|
+
obj.gas_fee = message.gas_fee;
|
|
180
186
|
}
|
|
181
187
|
return obj;
|
|
182
188
|
},
|
|
@@ -186,22 +192,22 @@ exports.TxFee = {
|
|
|
186
192
|
fromPartial: function (object) {
|
|
187
193
|
var _a;
|
|
188
194
|
var message = createBaseTxFee();
|
|
189
|
-
message.
|
|
190
|
-
object.
|
|
191
|
-
? long_1.default.fromValue(object.
|
|
195
|
+
message.gas_wanted =
|
|
196
|
+
object.gas_wanted !== undefined && object.gas_wanted !== null
|
|
197
|
+
? long_1.default.fromValue(object.gas_wanted)
|
|
192
198
|
: long_1.default.ZERO;
|
|
193
|
-
message.
|
|
199
|
+
message.gas_fee = (_a = object.gas_fee) !== null && _a !== void 0 ? _a : '';
|
|
194
200
|
return message;
|
|
195
201
|
},
|
|
196
202
|
};
|
|
197
203
|
function createBaseTxSignature() {
|
|
198
|
-
return {
|
|
204
|
+
return { pub_key: undefined, signature: new Uint8Array(0) };
|
|
199
205
|
}
|
|
200
206
|
exports.TxSignature = {
|
|
201
207
|
encode: function (message, writer) {
|
|
202
208
|
if (writer === void 0) { writer = new wire_1.BinaryWriter(); }
|
|
203
|
-
if (message.
|
|
204
|
-
any_1.Any.encode(message.
|
|
209
|
+
if (message.pub_key !== undefined) {
|
|
210
|
+
any_1.Any.encode(message.pub_key, writer.uint32(10).fork()).join();
|
|
205
211
|
}
|
|
206
212
|
if (message.signature.length !== 0) {
|
|
207
213
|
writer.uint32(18).bytes(message.signature);
|
|
@@ -215,18 +221,20 @@ exports.TxSignature = {
|
|
|
215
221
|
while (reader.pos < end) {
|
|
216
222
|
var tag = reader.uint32();
|
|
217
223
|
switch (tag >>> 3) {
|
|
218
|
-
case 1:
|
|
224
|
+
case 1: {
|
|
219
225
|
if (tag !== 10) {
|
|
220
226
|
break;
|
|
221
227
|
}
|
|
222
|
-
message.
|
|
228
|
+
message.pub_key = any_1.Any.decode(reader, reader.uint32());
|
|
223
229
|
continue;
|
|
224
|
-
|
|
230
|
+
}
|
|
231
|
+
case 2: {
|
|
225
232
|
if (tag !== 18) {
|
|
226
233
|
break;
|
|
227
234
|
}
|
|
228
235
|
message.signature = reader.bytes();
|
|
229
236
|
continue;
|
|
237
|
+
}
|
|
230
238
|
}
|
|
231
239
|
if ((tag & 7) === 4 || tag === 0) {
|
|
232
240
|
break;
|
|
@@ -237,7 +245,7 @@ exports.TxSignature = {
|
|
|
237
245
|
},
|
|
238
246
|
fromJSON: function (object) {
|
|
239
247
|
return {
|
|
240
|
-
|
|
248
|
+
pub_key: isSet(object.pub_key) ? any_1.Any.fromJSON(object.pub_key) : undefined,
|
|
241
249
|
signature: isSet(object.signature)
|
|
242
250
|
? bytesFromBase64(object.signature)
|
|
243
251
|
: new Uint8Array(0),
|
|
@@ -245,8 +253,8 @@ exports.TxSignature = {
|
|
|
245
253
|
},
|
|
246
254
|
toJSON: function (message) {
|
|
247
255
|
var obj = {};
|
|
248
|
-
if (message.
|
|
249
|
-
obj.
|
|
256
|
+
if (message.pub_key !== undefined) {
|
|
257
|
+
obj.pub_key = any_1.Any.toJSON(message.pub_key);
|
|
250
258
|
}
|
|
251
259
|
if (message.signature !== undefined) {
|
|
252
260
|
obj.signature = base64FromBytes(message.signature);
|
|
@@ -259,9 +267,9 @@ exports.TxSignature = {
|
|
|
259
267
|
fromPartial: function (object) {
|
|
260
268
|
var _a;
|
|
261
269
|
var message = createBaseTxSignature();
|
|
262
|
-
message.
|
|
263
|
-
object.
|
|
264
|
-
? any_1.Any.fromPartial(object.
|
|
270
|
+
message.pub_key =
|
|
271
|
+
object.pub_key !== undefined && object.pub_key !== null
|
|
272
|
+
? any_1.Any.fromPartial(object.pub_key)
|
|
265
273
|
: undefined;
|
|
266
274
|
message.signature = (_a = object.signature) !== null && _a !== void 0 ? _a : new Uint8Array(0);
|
|
267
275
|
return message;
|
|
@@ -285,12 +293,13 @@ exports.PubKeySecp256k1 = {
|
|
|
285
293
|
while (reader.pos < end) {
|
|
286
294
|
var tag = reader.uint32();
|
|
287
295
|
switch (tag >>> 3) {
|
|
288
|
-
case 1:
|
|
296
|
+
case 1: {
|
|
289
297
|
if (tag !== 10) {
|
|
290
298
|
break;
|
|
291
299
|
}
|
|
292
300
|
message.key = reader.bytes();
|
|
293
301
|
continue;
|
|
302
|
+
}
|
|
294
303
|
}
|
|
295
304
|
if ((tag & 7) === 4 || tag === 0) {
|
|
296
305
|
break;
|
|
@@ -72,7 +72,7 @@ var JSONRPCProvider = /** @class */ (function () {
|
|
|
72
72
|
case 1:
|
|
73
73
|
abciResponse = _a.sent();
|
|
74
74
|
simulateResult = (0, utility_1.extractSimulateFromResponse)(abciResponse);
|
|
75
|
-
return [2 /*return*/, simulateResult.
|
|
75
|
+
return [2 /*return*/, simulateResult.gas_used.toInt()];
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
});
|
|
@@ -162,11 +162,11 @@ var WSProvider = /** @class */ (function () {
|
|
|
162
162
|
response = _c.sent();
|
|
163
163
|
abciResponse = this.parseResponse(response);
|
|
164
164
|
simulateResult = (0, utility_1.extractSimulateFromResponse)(abciResponse);
|
|
165
|
-
resultErrorKey = (_b = (_a = simulateResult.
|
|
165
|
+
resultErrorKey = (_b = (_a = simulateResult.response_base) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.type_url;
|
|
166
166
|
if (resultErrorKey) {
|
|
167
167
|
throw (0, errors_utility_1.constructRequestError)(resultErrorKey);
|
|
168
168
|
}
|
|
169
|
-
return [2 /*return*/, simulateResult.
|
|
169
|
+
return [2 /*return*/, simulateResult.gas_used.toInt()];
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
});
|
package/bin/wallet/wallet.js
CHANGED
|
@@ -216,8 +216,8 @@ var Wallet = /** @class */ (function () {
|
|
|
216
216
|
account_number: accountNumber.toString(10),
|
|
217
217
|
sequence: accountSequence.toString(10),
|
|
218
218
|
fee: {
|
|
219
|
-
gas_fee: tx.fee.
|
|
220
|
-
gas_wanted: tx.fee.
|
|
219
|
+
gas_fee: tx.fee.gas_fee,
|
|
220
|
+
gas_wanted: tx.fee.gas_wanted.toString(10),
|
|
221
221
|
},
|
|
222
222
|
msgs: decodeTxMessages(tx.messages), // unrolled message objects
|
|
223
223
|
memo: tx.memo,
|
|
@@ -227,8 +227,8 @@ var Wallet = /** @class */ (function () {
|
|
|
227
227
|
key: publicKey,
|
|
228
228
|
};
|
|
229
229
|
_b = {
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
pub_key: {
|
|
231
|
+
type_url: types_1.Secp256k1PubKeyType,
|
|
232
232
|
value: proto_1.PubKeySecp256k1.encode(wrappedKey).finish(),
|
|
233
233
|
}
|
|
234
234
|
};
|
|
@@ -254,8 +254,8 @@ describe('Wallet', function () {
|
|
|
254
254
|
mockTx = (0, jest_mock_extended_1.mock)();
|
|
255
255
|
mockTx.signatures = [];
|
|
256
256
|
mockTx.fee = {
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
gas_fee: '10',
|
|
258
|
+
gas_wanted: new long_1.default(10),
|
|
259
259
|
};
|
|
260
260
|
mockTx.messages = [];
|
|
261
261
|
mockStatus = (0, jest_mock_extended_1.mock)();
|
|
@@ -291,8 +291,8 @@ describe('Wallet', function () {
|
|
|
291
291
|
expect(mockProvider.getAccountSequence).toHaveBeenCalled();
|
|
292
292
|
expect(signedTx.signatures).toHaveLength(1);
|
|
293
293
|
sig = signedTx.signatures[0];
|
|
294
|
-
expect((_a = sig.
|
|
295
|
-
expect((_b = sig.
|
|
294
|
+
expect((_a = sig.pub_key) === null || _a === void 0 ? void 0 : _a.type_url).toBe(types_1.Secp256k1PubKeyType);
|
|
295
|
+
expect((_b = sig.pub_key) === null || _b === void 0 ? void 0 : _b.value).not.toBeNull();
|
|
296
296
|
expect(sig.signature).not.toBeNull();
|
|
297
297
|
return [2 /*return*/];
|
|
298
298
|
}
|
|
@@ -306,8 +306,8 @@ describe('Wallet', function () {
|
|
|
306
306
|
mockTx = (0, jest_mock_extended_1.mock)();
|
|
307
307
|
mockTx.signatures = [];
|
|
308
308
|
mockTx.fee = {
|
|
309
|
-
|
|
310
|
-
|
|
309
|
+
gas_fee: '10',
|
|
310
|
+
gas_wanted: new long_1.default(10),
|
|
311
311
|
};
|
|
312
312
|
mockTx.messages = [];
|
|
313
313
|
mockTx.memo = '';
|