@gnolang/tm2-js-client 1.2.2 → 1.2.3
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 +20 -14
- package/bin/proto/google/protobuf/any.js +29 -44
- package/bin/proto/tm2/abci.d.ts +37 -0
- package/bin/proto/tm2/abci.js +265 -0
- package/bin/proto/tm2/tx.d.ts +16 -36
- package/bin/proto/tm2/tx.js +79 -93
- package/bin/provider/jsonrpc/jsonrpc.d.ts +1 -1
- package/bin/provider/jsonrpc/jsonrpc.js +24 -3
- package/bin/provider/jsonrpc/jsonrpc.test.js +36 -4
- package/bin/provider/utility/provider.utility.d.ts +8 -1
- package/bin/provider/utility/provider.utility.js +32 -3
- package/bin/provider/utility/requests.utility.d.ts +2 -0
- package/bin/provider/utility/requests.utility.js +6 -1
- package/bin/provider/websocket/ws.d.ts +1 -1
- package/bin/provider/websocket/ws.js +27 -2
- package/bin/provider/websocket/ws.test.js +49 -4
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
|
1
2
|
import Long from 'long';
|
|
2
|
-
import _m0 from 'protobufjs/minimal';
|
|
3
3
|
export declare const protobufPackage = "google.protobuf";
|
|
4
4
|
/**
|
|
5
5
|
* `Any` contains an arbitrary serialized protocol buffer message along with a
|
|
@@ -26,8 +26,12 @@ export declare const protobufPackage = "google.protobuf";
|
|
|
26
26
|
* if (any.is(Foo.class)) {
|
|
27
27
|
* foo = any.unpack(Foo.class);
|
|
28
28
|
* }
|
|
29
|
+
* // or ...
|
|
30
|
+
* if (any.isSameTypeAs(Foo.getDefaultInstance())) {
|
|
31
|
+
* foo = any.unpack(Foo.getDefaultInstance());
|
|
32
|
+
* }
|
|
29
33
|
*
|
|
30
|
-
*
|
|
34
|
+
* Example 3: Pack and unpack a message in Python.
|
|
31
35
|
*
|
|
32
36
|
* foo = Foo(...)
|
|
33
37
|
* any = Any()
|
|
@@ -37,7 +41,7 @@ export declare const protobufPackage = "google.protobuf";
|
|
|
37
41
|
* any.Unpack(foo)
|
|
38
42
|
* ...
|
|
39
43
|
*
|
|
40
|
-
*
|
|
44
|
+
* Example 4: Pack and unpack a message in Go
|
|
41
45
|
*
|
|
42
46
|
* foo := &pb.Foo{...}
|
|
43
47
|
* any, err := anypb.New(foo)
|
|
@@ -57,7 +61,7 @@ export declare const protobufPackage = "google.protobuf";
|
|
|
57
61
|
* name "y.z".
|
|
58
62
|
*
|
|
59
63
|
* JSON
|
|
60
|
-
*
|
|
64
|
+
* ====
|
|
61
65
|
* The JSON representation of an `Any` value uses the regular
|
|
62
66
|
* representation of the deserialized, embedded message, with an
|
|
63
67
|
* additional field `@type` which contains the type URL. Example:
|
|
@@ -109,7 +113,8 @@ export interface Any {
|
|
|
109
113
|
*
|
|
110
114
|
* Note: this functionality is not currently available in the official
|
|
111
115
|
* protobuf release, and it is not used for type URLs beginning with
|
|
112
|
-
* type.googleapis.com.
|
|
116
|
+
* type.googleapis.com. As of May 2023, there are no widely used type server
|
|
117
|
+
* implementations and no plans to implement one.
|
|
113
118
|
*
|
|
114
119
|
* Schemes other than `http`, `https` (or the empty scheme) might be
|
|
115
120
|
* used with implementation specific semantics.
|
|
@@ -118,16 +123,9 @@ export interface Any {
|
|
|
118
123
|
/** Must be a valid serialized protocol buffer of the above specified type. */
|
|
119
124
|
value: Uint8Array;
|
|
120
125
|
}
|
|
121
|
-
export declare const Any:
|
|
122
|
-
encode(message: Any, writer?: _m0.Writer): _m0.Writer;
|
|
123
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): Any;
|
|
124
|
-
fromJSON(object: any): Any;
|
|
125
|
-
toJSON(message: Any): unknown;
|
|
126
|
-
create<I extends Exact<DeepPartial<Any>, I>>(base?: I): Any;
|
|
127
|
-
fromPartial<I extends Exact<DeepPartial<Any>, I>>(object: I): Any;
|
|
128
|
-
};
|
|
126
|
+
export declare const Any: MessageFns<Any>;
|
|
129
127
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
130
|
-
export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
128
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
131
129
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
132
130
|
} : Partial<T>;
|
|
133
131
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
@@ -136,4 +134,12 @@ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
|
136
134
|
} & {
|
|
137
135
|
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
138
136
|
};
|
|
137
|
+
export interface MessageFns<T> {
|
|
138
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
139
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
140
|
+
fromJSON(object: any): T;
|
|
141
|
+
toJSON(message: T): unknown;
|
|
142
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
143
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
144
|
+
}
|
|
139
145
|
export {};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.2.0
|
|
5
|
+
// protoc v5.29.0
|
|
6
|
+
// source: google/protobuf/any.proto
|
|
5
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
8
|
exports.Any = exports.protobufPackage = void 0;
|
|
7
9
|
/* eslint-disable */
|
|
8
|
-
var
|
|
9
|
-
var minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
10
|
+
var wire_1 = require("@bufbuild/protobuf/wire");
|
|
10
11
|
exports.protobufPackage = 'google.protobuf';
|
|
11
12
|
function createBaseAny() {
|
|
12
|
-
return { typeUrl: '', value: new Uint8Array() };
|
|
13
|
+
return { typeUrl: '', value: new Uint8Array(0) };
|
|
13
14
|
}
|
|
14
15
|
exports.Any = {
|
|
15
16
|
encode: function (message, writer) {
|
|
16
|
-
if (writer === void 0) { writer =
|
|
17
|
+
if (writer === void 0) { writer = new wire_1.BinaryWriter(); }
|
|
17
18
|
if (message.typeUrl !== '') {
|
|
18
19
|
writer.uint32(10).string(message.typeUrl);
|
|
19
20
|
}
|
|
@@ -23,45 +24,48 @@ exports.Any = {
|
|
|
23
24
|
return writer;
|
|
24
25
|
},
|
|
25
26
|
decode: function (input, length) {
|
|
26
|
-
var reader = input instanceof
|
|
27
|
+
var reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
27
28
|
var end = length === undefined ? reader.len : reader.pos + length;
|
|
28
29
|
var message = createBaseAny();
|
|
29
30
|
while (reader.pos < end) {
|
|
30
31
|
var tag = reader.uint32();
|
|
31
32
|
switch (tag >>> 3) {
|
|
32
33
|
case 1:
|
|
33
|
-
if (tag
|
|
34
|
+
if (tag !== 10) {
|
|
34
35
|
break;
|
|
35
36
|
}
|
|
36
37
|
message.typeUrl = reader.string();
|
|
37
38
|
continue;
|
|
38
39
|
case 2:
|
|
39
|
-
if (tag
|
|
40
|
+
if (tag !== 18) {
|
|
40
41
|
break;
|
|
41
42
|
}
|
|
42
43
|
message.value = reader.bytes();
|
|
43
44
|
continue;
|
|
44
45
|
}
|
|
45
|
-
if ((tag & 7)
|
|
46
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
46
47
|
break;
|
|
47
48
|
}
|
|
48
|
-
reader.
|
|
49
|
+
reader.skip(tag & 7);
|
|
49
50
|
}
|
|
50
51
|
return message;
|
|
51
52
|
},
|
|
52
53
|
fromJSON: function (object) {
|
|
53
54
|
return {
|
|
54
|
-
typeUrl: isSet(object.typeUrl) ? String(object.typeUrl) : '',
|
|
55
|
+
typeUrl: isSet(object.typeUrl) ? globalThis.String(object.typeUrl) : '',
|
|
55
56
|
value: isSet(object.value)
|
|
56
57
|
? bytesFromBase64(object.value)
|
|
57
|
-
: new Uint8Array(),
|
|
58
|
+
: new Uint8Array(0),
|
|
58
59
|
};
|
|
59
60
|
},
|
|
60
61
|
toJSON: function (message) {
|
|
61
62
|
var obj = {};
|
|
62
|
-
message.typeUrl !== undefined
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
if (message.typeUrl !== undefined) {
|
|
64
|
+
obj.typeUrl = message.typeUrl;
|
|
65
|
+
}
|
|
66
|
+
if (message.value !== undefined) {
|
|
67
|
+
obj.value = base64FromBytes(message.value);
|
|
68
|
+
}
|
|
65
69
|
return obj;
|
|
66
70
|
},
|
|
67
71
|
create: function (base) {
|
|
@@ -71,31 +75,16 @@ exports.Any = {
|
|
|
71
75
|
var _a, _b;
|
|
72
76
|
var message = createBaseAny();
|
|
73
77
|
message.typeUrl = (_a = object.typeUrl) !== null && _a !== void 0 ? _a : '';
|
|
74
|
-
message.value = (_b = object.value) !== null && _b !== void 0 ? _b : new Uint8Array();
|
|
78
|
+
message.value = (_b = object.value) !== null && _b !== void 0 ? _b : new Uint8Array(0);
|
|
75
79
|
return message;
|
|
76
80
|
},
|
|
77
81
|
};
|
|
78
|
-
var tsProtoGlobalThis = (function () {
|
|
79
|
-
if (typeof globalThis !== 'undefined') {
|
|
80
|
-
return globalThis;
|
|
81
|
-
}
|
|
82
|
-
if (typeof self !== 'undefined') {
|
|
83
|
-
return self;
|
|
84
|
-
}
|
|
85
|
-
if (typeof window !== 'undefined') {
|
|
86
|
-
return window;
|
|
87
|
-
}
|
|
88
|
-
if (typeof global !== 'undefined') {
|
|
89
|
-
return global;
|
|
90
|
-
}
|
|
91
|
-
throw 'Unable to locate global object';
|
|
92
|
-
})();
|
|
93
82
|
function bytesFromBase64(b64) {
|
|
94
|
-
if (
|
|
95
|
-
return Uint8Array.from(
|
|
83
|
+
if (globalThis.Buffer) {
|
|
84
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, 'base64'));
|
|
96
85
|
}
|
|
97
86
|
else {
|
|
98
|
-
var bin =
|
|
87
|
+
var bin = globalThis.atob(b64);
|
|
99
88
|
var arr = new Uint8Array(bin.length);
|
|
100
89
|
for (var i = 0; i < bin.length; ++i) {
|
|
101
90
|
arr[i] = bin.charCodeAt(i);
|
|
@@ -104,21 +93,17 @@ function bytesFromBase64(b64) {
|
|
|
104
93
|
}
|
|
105
94
|
}
|
|
106
95
|
function base64FromBytes(arr) {
|
|
107
|
-
if (
|
|
108
|
-
return
|
|
96
|
+
if (globalThis.Buffer) {
|
|
97
|
+
return globalThis.Buffer.from(arr).toString('base64');
|
|
109
98
|
}
|
|
110
99
|
else {
|
|
111
100
|
var bin_1 = [];
|
|
112
101
|
arr.forEach(function (byte) {
|
|
113
|
-
bin_1.push(String.fromCharCode(byte));
|
|
102
|
+
bin_1.push(globalThis.String.fromCharCode(byte));
|
|
114
103
|
});
|
|
115
|
-
return
|
|
104
|
+
return globalThis.btoa(bin_1.join(''));
|
|
116
105
|
}
|
|
117
106
|
}
|
|
118
|
-
if (minimal_1.default.util.Long !== long_1.default) {
|
|
119
|
-
minimal_1.default.util.Long = long_1.default;
|
|
120
|
-
minimal_1.default.configure();
|
|
121
|
-
}
|
|
122
107
|
function isSet(value) {
|
|
123
108
|
return value !== null && value !== undefined;
|
|
124
109
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
|
2
|
+
import Long from 'long';
|
|
3
|
+
import { Any } from '../google/protobuf/any';
|
|
4
|
+
export declare const protobufPackage = "tm2.abci";
|
|
5
|
+
export interface ResponseDeliverTx {
|
|
6
|
+
responseBase?: ResponseBase | undefined;
|
|
7
|
+
gasWanted: Long;
|
|
8
|
+
gasUsed: Long;
|
|
9
|
+
}
|
|
10
|
+
export interface ResponseBase {
|
|
11
|
+
error?: Any | undefined;
|
|
12
|
+
data: Uint8Array;
|
|
13
|
+
events: Any[];
|
|
14
|
+
log: string;
|
|
15
|
+
info: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const ResponseDeliverTx: MessageFns<ResponseDeliverTx>;
|
|
18
|
+
export declare const ResponseBase: MessageFns<ResponseBase>;
|
|
19
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
20
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
21
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
22
|
+
} : Partial<T>;
|
|
23
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
24
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
25
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
26
|
+
} & {
|
|
27
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
28
|
+
};
|
|
29
|
+
export interface MessageFns<T> {
|
|
30
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
31
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
32
|
+
fromJSON(object: any): T;
|
|
33
|
+
toJSON(message: T): unknown;
|
|
34
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
35
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.2.0
|
|
5
|
+
// protoc v5.29.0
|
|
6
|
+
// source: tm2/abci.proto
|
|
7
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.ResponseBase = exports.ResponseDeliverTx = exports.protobufPackage = void 0;
|
|
12
|
+
/* eslint-disable */
|
|
13
|
+
var wire_1 = require("@bufbuild/protobuf/wire");
|
|
14
|
+
var long_1 = __importDefault(require("long"));
|
|
15
|
+
var any_1 = require("../google/protobuf/any");
|
|
16
|
+
exports.protobufPackage = 'tm2.abci';
|
|
17
|
+
function createBaseResponseDeliverTx() {
|
|
18
|
+
return { responseBase: undefined, gasWanted: long_1.default.ZERO, gasUsed: long_1.default.ZERO };
|
|
19
|
+
}
|
|
20
|
+
exports.ResponseDeliverTx = {
|
|
21
|
+
encode: function (message, writer) {
|
|
22
|
+
if (writer === void 0) { writer = new wire_1.BinaryWriter(); }
|
|
23
|
+
if (message.responseBase !== undefined) {
|
|
24
|
+
exports.ResponseBase.encode(message.responseBase, writer.uint32(10).fork()).join();
|
|
25
|
+
}
|
|
26
|
+
if (!message.gasWanted.equals(long_1.default.ZERO)) {
|
|
27
|
+
writer.uint32(16).sint64(message.gasWanted.toString());
|
|
28
|
+
}
|
|
29
|
+
if (!message.gasUsed.equals(long_1.default.ZERO)) {
|
|
30
|
+
writer.uint32(24).sint64(message.gasUsed.toString());
|
|
31
|
+
}
|
|
32
|
+
return writer;
|
|
33
|
+
},
|
|
34
|
+
decode: function (input, length) {
|
|
35
|
+
var reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
36
|
+
var end = length === undefined ? reader.len : reader.pos + length;
|
|
37
|
+
var message = createBaseResponseDeliverTx();
|
|
38
|
+
while (reader.pos < end) {
|
|
39
|
+
var tag = reader.uint32();
|
|
40
|
+
switch (tag >>> 3) {
|
|
41
|
+
case 1:
|
|
42
|
+
if (tag !== 10) {
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
message.responseBase = exports.ResponseBase.decode(reader, reader.uint32());
|
|
46
|
+
continue;
|
|
47
|
+
case 2:
|
|
48
|
+
if (tag !== 16) {
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
message.gasWanted = long_1.default.fromString(reader.sint64().toString());
|
|
52
|
+
continue;
|
|
53
|
+
case 3:
|
|
54
|
+
if (tag !== 24) {
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
message.gasUsed = long_1.default.fromString(reader.sint64().toString());
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
reader.skip(tag & 7);
|
|
64
|
+
}
|
|
65
|
+
return message;
|
|
66
|
+
},
|
|
67
|
+
fromJSON: function (object) {
|
|
68
|
+
return {
|
|
69
|
+
responseBase: isSet(object.ResponseBase)
|
|
70
|
+
? exports.ResponseBase.fromJSON(object.ResponseBase)
|
|
71
|
+
: undefined,
|
|
72
|
+
gasWanted: isSet(object.GasWanted)
|
|
73
|
+
? long_1.default.fromValue(object.GasWanted)
|
|
74
|
+
: long_1.default.ZERO,
|
|
75
|
+
gasUsed: isSet(object.GasUsed)
|
|
76
|
+
? long_1.default.fromValue(object.GasUsed)
|
|
77
|
+
: long_1.default.ZERO,
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
toJSON: function (message) {
|
|
81
|
+
var obj = {};
|
|
82
|
+
if (message.responseBase !== undefined) {
|
|
83
|
+
obj.ResponseBase = exports.ResponseBase.toJSON(message.responseBase);
|
|
84
|
+
}
|
|
85
|
+
if (message.gasWanted !== undefined) {
|
|
86
|
+
obj.GasWanted = (message.gasWanted || long_1.default.ZERO).toString();
|
|
87
|
+
}
|
|
88
|
+
if (message.gasUsed !== undefined) {
|
|
89
|
+
obj.GasUsed = (message.gasUsed || long_1.default.ZERO).toString();
|
|
90
|
+
}
|
|
91
|
+
return obj;
|
|
92
|
+
},
|
|
93
|
+
create: function (base) {
|
|
94
|
+
return exports.ResponseDeliverTx.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
95
|
+
},
|
|
96
|
+
fromPartial: function (object) {
|
|
97
|
+
var message = createBaseResponseDeliverTx();
|
|
98
|
+
message.responseBase =
|
|
99
|
+
object.responseBase !== undefined && object.responseBase !== null
|
|
100
|
+
? exports.ResponseBase.fromPartial(object.responseBase)
|
|
101
|
+
: undefined;
|
|
102
|
+
message.gasWanted =
|
|
103
|
+
object.gasWanted !== undefined && object.gasWanted !== null
|
|
104
|
+
? long_1.default.fromValue(object.gasWanted)
|
|
105
|
+
: long_1.default.ZERO;
|
|
106
|
+
message.gasUsed =
|
|
107
|
+
object.gasUsed !== undefined && object.gasUsed !== null
|
|
108
|
+
? long_1.default.fromValue(object.gasUsed)
|
|
109
|
+
: long_1.default.ZERO;
|
|
110
|
+
return message;
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
function createBaseResponseBase() {
|
|
114
|
+
return {
|
|
115
|
+
error: undefined,
|
|
116
|
+
data: new Uint8Array(0),
|
|
117
|
+
events: [],
|
|
118
|
+
log: '',
|
|
119
|
+
info: '',
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
exports.ResponseBase = {
|
|
123
|
+
encode: function (message, writer) {
|
|
124
|
+
if (writer === void 0) { writer = new wire_1.BinaryWriter(); }
|
|
125
|
+
if (message.error !== undefined) {
|
|
126
|
+
any_1.Any.encode(message.error, writer.uint32(10).fork()).join();
|
|
127
|
+
}
|
|
128
|
+
if (message.data.length !== 0) {
|
|
129
|
+
writer.uint32(18).bytes(message.data);
|
|
130
|
+
}
|
|
131
|
+
for (var _i = 0, _a = message.events; _i < _a.length; _i++) {
|
|
132
|
+
var v = _a[_i];
|
|
133
|
+
any_1.Any.encode(v, writer.uint32(26).fork()).join();
|
|
134
|
+
}
|
|
135
|
+
if (message.log !== '') {
|
|
136
|
+
writer.uint32(34).string(message.log);
|
|
137
|
+
}
|
|
138
|
+
if (message.info !== '') {
|
|
139
|
+
writer.uint32(42).string(message.info);
|
|
140
|
+
}
|
|
141
|
+
return writer;
|
|
142
|
+
},
|
|
143
|
+
decode: function (input, length) {
|
|
144
|
+
var reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
145
|
+
var end = length === undefined ? reader.len : reader.pos + length;
|
|
146
|
+
var message = createBaseResponseBase();
|
|
147
|
+
while (reader.pos < end) {
|
|
148
|
+
var tag = reader.uint32();
|
|
149
|
+
switch (tag >>> 3) {
|
|
150
|
+
case 1:
|
|
151
|
+
if (tag !== 10) {
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
message.error = any_1.Any.decode(reader, reader.uint32());
|
|
155
|
+
continue;
|
|
156
|
+
case 2:
|
|
157
|
+
if (tag !== 18) {
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
message.data = reader.bytes();
|
|
161
|
+
continue;
|
|
162
|
+
case 3:
|
|
163
|
+
if (tag !== 26) {
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
message.events.push(any_1.Any.decode(reader, reader.uint32()));
|
|
167
|
+
continue;
|
|
168
|
+
case 4:
|
|
169
|
+
if (tag !== 34) {
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
message.log = reader.string();
|
|
173
|
+
continue;
|
|
174
|
+
case 5:
|
|
175
|
+
if (tag !== 42) {
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
message.info = reader.string();
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
reader.skip(tag & 7);
|
|
185
|
+
}
|
|
186
|
+
return message;
|
|
187
|
+
},
|
|
188
|
+
fromJSON: function (object) {
|
|
189
|
+
return {
|
|
190
|
+
error: isSet(object.Error) ? any_1.Any.fromJSON(object.Error) : undefined,
|
|
191
|
+
data: isSet(object.Data)
|
|
192
|
+
? bytesFromBase64(object.Data)
|
|
193
|
+
: new Uint8Array(0),
|
|
194
|
+
events: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.Events)
|
|
195
|
+
? object.Events.map(function (e) { return any_1.Any.fromJSON(e); })
|
|
196
|
+
: [],
|
|
197
|
+
log: isSet(object.Log) ? globalThis.String(object.Log) : '',
|
|
198
|
+
info: isSet(object.Info) ? globalThis.String(object.Info) : '',
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
toJSON: function (message) {
|
|
202
|
+
var _a;
|
|
203
|
+
var obj = {};
|
|
204
|
+
if (message.error !== undefined) {
|
|
205
|
+
obj.Error = any_1.Any.toJSON(message.error);
|
|
206
|
+
}
|
|
207
|
+
if (message.data !== undefined) {
|
|
208
|
+
obj.Data = base64FromBytes(message.data);
|
|
209
|
+
}
|
|
210
|
+
if ((_a = message.events) === null || _a === void 0 ? void 0 : _a.length) {
|
|
211
|
+
obj.Events = message.events.map(function (e) { return any_1.Any.toJSON(e); });
|
|
212
|
+
}
|
|
213
|
+
if (message.log !== undefined) {
|
|
214
|
+
obj.Log = message.log;
|
|
215
|
+
}
|
|
216
|
+
if (message.info !== undefined) {
|
|
217
|
+
obj.Info = message.info;
|
|
218
|
+
}
|
|
219
|
+
return obj;
|
|
220
|
+
},
|
|
221
|
+
create: function (base) {
|
|
222
|
+
return exports.ResponseBase.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
223
|
+
},
|
|
224
|
+
fromPartial: function (object) {
|
|
225
|
+
var _a, _b, _c, _d;
|
|
226
|
+
var message = createBaseResponseBase();
|
|
227
|
+
message.error =
|
|
228
|
+
object.error !== undefined && object.error !== null
|
|
229
|
+
? any_1.Any.fromPartial(object.error)
|
|
230
|
+
: undefined;
|
|
231
|
+
message.data = (_a = object.data) !== null && _a !== void 0 ? _a : new Uint8Array(0);
|
|
232
|
+
message.events = ((_b = object.events) === null || _b === void 0 ? void 0 : _b.map(function (e) { return any_1.Any.fromPartial(e); })) || [];
|
|
233
|
+
message.log = (_c = object.log) !== null && _c !== void 0 ? _c : '';
|
|
234
|
+
message.info = (_d = object.info) !== null && _d !== void 0 ? _d : '';
|
|
235
|
+
return message;
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
function bytesFromBase64(b64) {
|
|
239
|
+
if (globalThis.Buffer) {
|
|
240
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, 'base64'));
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
var bin = globalThis.atob(b64);
|
|
244
|
+
var arr = new Uint8Array(bin.length);
|
|
245
|
+
for (var i = 0; i < bin.length; ++i) {
|
|
246
|
+
arr[i] = bin.charCodeAt(i);
|
|
247
|
+
}
|
|
248
|
+
return arr;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
function base64FromBytes(arr) {
|
|
252
|
+
if (globalThis.Buffer) {
|
|
253
|
+
return globalThis.Buffer.from(arr).toString('base64');
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
var bin_1 = [];
|
|
257
|
+
arr.forEach(function (byte) {
|
|
258
|
+
bin_1.push(globalThis.String.fromCharCode(byte));
|
|
259
|
+
});
|
|
260
|
+
return globalThis.btoa(bin_1.join(''));
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function isSet(value) {
|
|
264
|
+
return value !== null && value !== undefined;
|
|
265
|
+
}
|
package/bin/proto/tm2/tx.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
|
1
2
|
import Long from 'long';
|
|
2
|
-
import _m0 from 'protobufjs/minimal';
|
|
3
3
|
import { Any } from '../google/protobuf/any';
|
|
4
4
|
export declare const protobufPackage = "tm2.tx";
|
|
5
5
|
export interface Tx {
|
|
6
6
|
/** specific message types */
|
|
7
7
|
messages: Any[];
|
|
8
8
|
/** transaction costs (fee) */
|
|
9
|
-
fee?: TxFee;
|
|
9
|
+
fee?: TxFee | undefined;
|
|
10
10
|
/** the signatures for the transaction */
|
|
11
11
|
signatures: TxSignature[];
|
|
12
12
|
/** memo attached to the transaction */
|
|
@@ -20,47 +20,19 @@ export interface TxFee {
|
|
|
20
20
|
}
|
|
21
21
|
export interface TxSignature {
|
|
22
22
|
/** public key associated with the signature */
|
|
23
|
-
pubKey?: Any;
|
|
23
|
+
pubKey?: Any | undefined;
|
|
24
24
|
/** the signature */
|
|
25
25
|
signature: Uint8Array;
|
|
26
26
|
}
|
|
27
27
|
export interface PubKeySecp256k1 {
|
|
28
28
|
key: Uint8Array;
|
|
29
29
|
}
|
|
30
|
-
export declare const Tx:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
toJSON(message: Tx): unknown;
|
|
35
|
-
create<I extends Exact<DeepPartial<Tx>, I>>(base?: I): Tx;
|
|
36
|
-
fromPartial<I extends Exact<DeepPartial<Tx>, I>>(object: I): Tx;
|
|
37
|
-
};
|
|
38
|
-
export declare const TxFee: {
|
|
39
|
-
encode(message: TxFee, writer?: _m0.Writer): _m0.Writer;
|
|
40
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): TxFee;
|
|
41
|
-
fromJSON(object: any): TxFee;
|
|
42
|
-
toJSON(message: TxFee): unknown;
|
|
43
|
-
create<I extends Exact<DeepPartial<TxFee>, I>>(base?: I): TxFee;
|
|
44
|
-
fromPartial<I extends Exact<DeepPartial<TxFee>, I>>(object: I): TxFee;
|
|
45
|
-
};
|
|
46
|
-
export declare const TxSignature: {
|
|
47
|
-
encode(message: TxSignature, writer?: _m0.Writer): _m0.Writer;
|
|
48
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): TxSignature;
|
|
49
|
-
fromJSON(object: any): TxSignature;
|
|
50
|
-
toJSON(message: TxSignature): unknown;
|
|
51
|
-
create<I extends Exact<DeepPartial<TxSignature>, I>>(base?: I): TxSignature;
|
|
52
|
-
fromPartial<I extends Exact<DeepPartial<TxSignature>, I>>(object: I): TxSignature;
|
|
53
|
-
};
|
|
54
|
-
export declare const PubKeySecp256k1: {
|
|
55
|
-
encode(message: PubKeySecp256k1, writer?: _m0.Writer): _m0.Writer;
|
|
56
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): PubKeySecp256k1;
|
|
57
|
-
fromJSON(object: any): PubKeySecp256k1;
|
|
58
|
-
toJSON(message: PubKeySecp256k1): unknown;
|
|
59
|
-
create<I extends Exact<DeepPartial<PubKeySecp256k1>, I>>(base?: I): PubKeySecp256k1;
|
|
60
|
-
fromPartial<I extends Exact<DeepPartial<PubKeySecp256k1>, I>>(object: I): PubKeySecp256k1;
|
|
61
|
-
};
|
|
30
|
+
export declare const Tx: MessageFns<Tx>;
|
|
31
|
+
export declare const TxFee: MessageFns<TxFee>;
|
|
32
|
+
export declare const TxSignature: MessageFns<TxSignature>;
|
|
33
|
+
export declare const PubKeySecp256k1: MessageFns<PubKeySecp256k1>;
|
|
62
34
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
63
|
-
export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
35
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
64
36
|
[K in keyof T]?: DeepPartial<T[K]>;
|
|
65
37
|
} : Partial<T>;
|
|
66
38
|
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
@@ -69,4 +41,12 @@ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
|
69
41
|
} & {
|
|
70
42
|
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
71
43
|
};
|
|
44
|
+
export interface MessageFns<T> {
|
|
45
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
46
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
47
|
+
fromJSON(object: any): T;
|
|
48
|
+
toJSON(message: T): unknown;
|
|
49
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
50
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
51
|
+
}
|
|
72
52
|
export {};
|