@gnolang/tm2-js-client 1.3.3 → 2.0.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/README.md +1 -1
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.cjs +12 -0
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/defineProperty.mjs +12 -0
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPrimitive.cjs +14 -0
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPrimitive.mjs +14 -0
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPropertyKey.cjs +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/toPropertyKey.mjs +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/typeof.cjs +16 -0
- package/dist/_virtual/_@oxc-project_runtime@0.122.0/helpers/typeof.mjs +11 -0
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/index.cjs +92 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +23 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +23 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +22 -0
- package/dist/index.mjs.map +1 -0
- package/dist/proto/google/protobuf/any.cjs +84 -0
- package/dist/proto/google/protobuf/any.cjs.map +1 -0
- package/dist/proto/google/protobuf/any.d.cts +141 -0
- package/dist/proto/google/protobuf/any.d.cts.map +1 -0
- package/dist/proto/google/protobuf/any.d.mts +141 -0
- package/dist/proto/google/protobuf/any.d.mts.map +1 -0
- package/dist/proto/google/protobuf/any.mjs +83 -0
- package/dist/proto/google/protobuf/any.mjs.map +1 -0
- package/dist/proto/index.cjs +2 -0
- package/dist/proto/index.d.cts +2 -0
- package/dist/proto/index.d.mts +2 -0
- package/dist/proto/index.mjs +3 -0
- package/dist/proto/tm2/abci.cjs +182 -0
- package/dist/proto/tm2/abci.cjs.map +1 -0
- package/dist/proto/tm2/abci.d.cts +33 -0
- package/dist/proto/tm2/abci.d.cts.map +1 -0
- package/dist/proto/tm2/abci.d.mts +33 -0
- package/dist/proto/tm2/abci.d.mts.map +1 -0
- package/dist/proto/tm2/abci.mjs +181 -0
- package/dist/proto/tm2/abci.mjs.map +1 -0
- package/dist/proto/tm2/tx.cjs +263 -0
- package/dist/proto/tm2/tx.cjs.map +1 -0
- package/dist/proto/tm2/tx.d.cts +49 -0
- package/dist/proto/tm2/tx.d.cts.map +1 -0
- package/dist/proto/tm2/tx.d.mts +49 -0
- package/dist/proto/tm2/tx.d.mts.map +1 -0
- package/dist/proto/tm2/tx.mjs +258 -0
- package/dist/proto/tm2/tx.mjs.map +1 -0
- package/dist/provider/endpoints.cjs +43 -0
- package/dist/provider/endpoints.cjs.map +1 -0
- package/dist/provider/endpoints.d.cts +33 -0
- package/dist/provider/endpoints.d.cts.map +1 -0
- package/dist/provider/endpoints.d.mts +33 -0
- package/dist/provider/endpoints.d.mts.map +1 -0
- package/dist/provider/endpoints.mjs +39 -0
- package/dist/provider/endpoints.mjs.map +1 -0
- package/dist/provider/errors/errors.cjs +122 -0
- package/dist/provider/errors/errors.cjs.map +1 -0
- package/dist/provider/errors/errors.d.cts +62 -0
- package/dist/provider/errors/errors.d.cts.map +1 -0
- package/dist/provider/errors/errors.d.mts +62 -0
- package/dist/provider/errors/errors.d.mts.map +1 -0
- package/dist/provider/errors/errors.mjs +104 -0
- package/dist/provider/errors/errors.mjs.map +1 -0
- package/dist/provider/errors/messages.cjs +40 -0
- package/dist/provider/errors/messages.cjs.map +1 -0
- package/dist/provider/errors/messages.mjs +23 -0
- package/dist/provider/errors/messages.mjs.map +1 -0
- package/dist/provider/index.cjs +12 -0
- package/dist/provider/index.d.cts +11 -0
- package/dist/provider/index.d.mts +11 -0
- package/dist/provider/index.mjs +13 -0
- package/dist/provider/jsonrpc/index.cjs +1 -0
- package/dist/provider/jsonrpc/index.d.cts +1 -0
- package/dist/provider/jsonrpc/index.d.mts +1 -0
- package/dist/provider/jsonrpc/index.mjs +2 -0
- package/dist/provider/jsonrpc/jsonrpc.cjs +20 -0
- package/dist/provider/jsonrpc/jsonrpc.cjs.map +1 -0
- package/dist/provider/jsonrpc/jsonrpc.d.cts +16 -0
- package/dist/provider/jsonrpc/jsonrpc.d.cts.map +1 -0
- package/dist/provider/jsonrpc/jsonrpc.d.mts +16 -0
- package/dist/provider/jsonrpc/jsonrpc.d.mts.map +1 -0
- package/dist/provider/jsonrpc/jsonrpc.mjs +19 -0
- package/dist/provider/jsonrpc/jsonrpc.mjs.map +1 -0
- package/dist/provider/provider.cjs +130 -0
- package/dist/provider/provider.cjs.map +1 -0
- package/dist/provider/provider.d.cts +130 -0
- package/dist/provider/provider.d.cts.map +1 -0
- package/dist/provider/provider.d.mts +130 -0
- package/dist/provider/provider.d.mts.map +1 -0
- package/dist/provider/provider.mjs +130 -0
- package/dist/provider/provider.mjs.map +1 -0
- package/dist/provider/types/abci.cjs +6 -0
- package/dist/provider/types/abci.cjs.map +1 -0
- package/dist/provider/types/abci.d.cts +42 -0
- package/dist/provider/types/abci.d.cts.map +1 -0
- package/dist/provider/types/abci.d.mts +42 -0
- package/dist/provider/types/abci.d.mts.map +1 -0
- package/dist/provider/types/abci.mjs +6 -0
- package/dist/provider/types/abci.mjs.map +1 -0
- package/dist/provider/types/common.d.cts +186 -0
- package/dist/provider/types/common.d.cts.map +1 -0
- package/dist/provider/types/common.d.mts +186 -0
- package/dist/provider/types/common.d.mts.map +1 -0
- package/dist/provider/types/jsonrpc.d.cts +30 -0
- package/dist/provider/types/jsonrpc.d.cts.map +1 -0
- package/dist/provider/types/jsonrpc.d.mts +30 -0
- package/dist/provider/types/jsonrpc.d.mts.map +1 -0
- package/dist/provider/utility/adapters.cjs +241 -0
- package/dist/provider/utility/adapters.cjs.map +1 -0
- package/dist/provider/utility/adapters.d.cts +19 -0
- package/dist/provider/utility/adapters.d.cts.map +1 -0
- package/dist/provider/utility/adapters.d.mts +19 -0
- package/dist/provider/utility/adapters.d.mts.map +1 -0
- package/dist/provider/utility/adapters.mjs +231 -0
- package/dist/provider/utility/adapters.mjs.map +1 -0
- package/dist/provider/utility/errors.utility.cjs +38 -0
- package/dist/provider/utility/errors.utility.cjs.map +1 -0
- package/dist/provider/utility/errors.utility.mjs +38 -0
- package/dist/provider/utility/errors.utility.mjs.map +1 -0
- package/dist/provider/utility/index.cjs +3 -0
- package/dist/provider/utility/index.d.cts +3 -0
- package/dist/provider/utility/index.d.mts +3 -0
- package/dist/provider/utility/index.mjs +4 -0
- package/dist/provider/utility/provider.utility.cjs +122 -0
- package/dist/provider/utility/provider.utility.cjs.map +1 -0
- package/{bin/provider/utility/provider.utility.d.ts → dist/provider/utility/provider.utility.d.cts} +15 -10
- package/dist/provider/utility/provider.utility.d.cts.map +1 -0
- package/dist/provider/utility/provider.utility.d.mts +45 -0
- package/dist/provider/utility/provider.utility.d.mts.map +1 -0
- package/dist/provider/utility/provider.utility.mjs +116 -0
- package/dist/provider/utility/provider.utility.mjs.map +1 -0
- package/dist/provider/utility/requests.utility.cjs +75 -0
- package/dist/provider/utility/requests.utility.cjs.map +1 -0
- package/dist/provider/utility/requests.utility.d.cts +40 -0
- package/dist/provider/utility/requests.utility.d.cts.map +1 -0
- package/dist/provider/utility/requests.utility.d.mts +40 -0
- package/dist/provider/utility/requests.utility.d.mts.map +1 -0
- package/dist/provider/utility/requests.utility.mjs +68 -0
- package/dist/provider/utility/requests.utility.mjs.map +1 -0
- package/dist/provider/websocket/index.cjs +1 -0
- package/dist/provider/websocket/index.d.cts +1 -0
- package/dist/provider/websocket/index.d.mts +1 -0
- package/dist/provider/websocket/index.mjs +2 -0
- package/dist/provider/websocket/ws.cjs +27 -0
- package/dist/provider/websocket/ws.cjs.map +1 -0
- package/dist/provider/websocket/ws.d.cts +21 -0
- package/dist/provider/websocket/ws.d.cts.map +1 -0
- package/dist/provider/websocket/ws.d.mts +21 -0
- package/dist/provider/websocket/ws.d.mts.map +1 -0
- package/dist/provider/websocket/ws.mjs +26 -0
- package/dist/provider/websocket/ws.mjs.map +1 -0
- package/dist/services/index.cjs +1 -0
- package/dist/services/index.d.cts +2 -0
- package/dist/services/index.d.mts +2 -0
- package/dist/services/index.mjs +2 -0
- package/dist/services/rest/restService.cjs +16 -0
- package/dist/services/rest/restService.cjs.map +1 -0
- package/dist/services/rest/restService.d.cts +9 -0
- package/dist/services/rest/restService.d.cts.map +1 -0
- package/dist/services/rest/restService.d.mts +9 -0
- package/dist/services/rest/restService.d.mts.map +1 -0
- package/dist/services/rest/restService.mjs +14 -0
- package/dist/services/rest/restService.mjs.map +1 -0
- package/dist/services/rest/restService.types.d.cts +11 -0
- package/dist/services/rest/restService.types.d.cts.map +1 -0
- package/dist/services/rest/restService.types.d.mts +11 -0
- package/dist/services/rest/restService.types.d.mts.map +1 -0
- package/dist/wallet/index.cjs +8 -0
- package/dist/wallet/index.d.cts +7 -0
- package/dist/wallet/index.d.mts +7 -0
- package/dist/wallet/index.mjs +9 -0
- package/dist/wallet/key/index.cjs +1 -0
- package/dist/wallet/key/index.mjs +2 -0
- package/dist/wallet/key/key.cjs +46 -0
- package/dist/wallet/key/key.cjs.map +1 -0
- package/dist/wallet/key/key.d.cts +26 -0
- package/dist/wallet/key/key.d.cts.map +1 -0
- package/dist/wallet/key/key.d.mts +26 -0
- package/dist/wallet/key/key.d.mts.map +1 -0
- package/dist/wallet/key/key.mjs +45 -0
- package/dist/wallet/key/key.mjs.map +1 -0
- package/dist/wallet/ledger/index.cjs +1 -0
- package/dist/wallet/ledger/index.d.cts +1 -0
- package/dist/wallet/ledger/index.d.mts +1 -0
- package/dist/wallet/ledger/index.mjs +2 -0
- package/dist/wallet/ledger/ledger.cjs +49 -0
- package/dist/wallet/ledger/ledger.cjs.map +1 -0
- package/dist/wallet/ledger/ledger.d.cts +27 -0
- package/dist/wallet/ledger/ledger.d.cts.map +1 -0
- package/dist/wallet/ledger/ledger.d.mts +27 -0
- package/dist/wallet/ledger/ledger.d.mts.map +1 -0
- package/dist/wallet/ledger/ledger.mjs +48 -0
- package/dist/wallet/ledger/ledger.mjs.map +1 -0
- package/dist/wallet/signer.d.cts +33 -0
- package/dist/wallet/signer.d.cts.map +1 -0
- package/dist/wallet/signer.d.mts +33 -0
- package/dist/wallet/signer.d.mts.map +1 -0
- package/dist/wallet/types/sign.cjs +6 -0
- package/dist/wallet/types/sign.cjs.map +1 -0
- package/dist/wallet/types/sign.d.cts +20 -0
- package/dist/wallet/types/sign.d.cts.map +1 -0
- package/dist/wallet/types/sign.d.mts +20 -0
- package/dist/wallet/types/sign.d.mts.map +1 -0
- package/dist/wallet/types/sign.mjs +6 -0
- package/dist/wallet/types/sign.mjs.map +1 -0
- package/dist/wallet/types/wallet.d.cts +9 -0
- package/dist/wallet/types/wallet.d.cts.map +1 -0
- package/dist/wallet/types/wallet.d.mts +9 -0
- package/dist/wallet/types/wallet.d.mts.map +1 -0
- package/dist/wallet/utility/index.cjs +1 -0
- package/dist/wallet/utility/index.d.cts +1 -0
- package/dist/wallet/utility/index.d.mts +1 -0
- package/dist/wallet/utility/index.mjs +2 -0
- package/dist/wallet/utility/utility.cjs +83 -0
- package/dist/wallet/utility/utility.cjs.map +1 -0
- package/dist/wallet/utility/utility.d.cts +42 -0
- package/dist/wallet/utility/utility.d.cts.map +1 -0
- package/dist/wallet/utility/utility.d.mts +42 -0
- package/dist/wallet/utility/utility.d.mts.map +1 -0
- package/dist/wallet/utility/utility.mjs +75 -0
- package/dist/wallet/utility/utility.mjs.map +1 -0
- package/dist/wallet/wallet.cjs +223 -0
- package/dist/wallet/wallet.cjs.map +1 -0
- package/dist/wallet/wallet.d.cts +113 -0
- package/dist/wallet/wallet.d.cts.map +1 -0
- package/dist/wallet/wallet.d.mts +113 -0
- package/dist/wallet/wallet.d.mts.map +1 -0
- package/dist/wallet/wallet.mjs +222 -0
- package/dist/wallet/wallet.mjs.map +1 -0
- package/package.json +57 -38
- package/bin/index.d.ts +0 -4
- package/bin/index.js +0 -20
- package/bin/proto/google/protobuf/any.d.ts +0 -145
- package/bin/proto/google/protobuf/any.js +0 -113
- package/bin/proto/index.d.ts +0 -2
- package/bin/proto/index.js +0 -20
- package/bin/proto/tm2/abci.d.ts +0 -37
- package/bin/proto/tm2/abci.js +0 -277
- package/bin/proto/tm2/multisig.d.ts +0 -43
- package/bin/proto/tm2/multisig.js +0 -322
- package/bin/proto/tm2/multisig.test.d.ts +0 -1
- package/bin/proto/tm2/multisig.test.js +0 -63
- package/bin/proto/tm2/tx.d.ts +0 -52
- package/bin/proto/tm2/tx.js +0 -360
- package/bin/provider/endpoints.d.ts +0 -29
- package/bin/provider/endpoints.js +0 -37
- package/bin/provider/errors/errors.d.ts +0 -59
- package/bin/provider/errors/errors.js +0 -173
- package/bin/provider/errors/index.d.ts +0 -1
- package/bin/provider/errors/index.js +0 -17
- package/bin/provider/errors/messages.d.ts +0 -19
- package/bin/provider/errors/messages.js +0 -41
- package/bin/provider/index.d.ts +0 -7
- package/bin/provider/index.js +0 -23
- package/bin/provider/jsonrpc/index.d.ts +0 -1
- package/bin/provider/jsonrpc/index.js +0 -17
- package/bin/provider/jsonrpc/jsonrpc.d.ts +0 -31
- package/bin/provider/jsonrpc/jsonrpc.js +0 -327
- package/bin/provider/jsonrpc/jsonrpc.test.d.ts +0 -1
- package/bin/provider/jsonrpc/jsonrpc.test.js +0 -488
- package/bin/provider/provider.d.ts +0 -98
- package/bin/provider/provider.js +0 -2
- package/bin/provider/types/abci.d.ts +0 -39
- package/bin/provider/types/abci.js +0 -4
- package/bin/provider/types/common.d.ts +0 -184
- package/bin/provider/types/common.js +0 -3
- package/bin/provider/types/index.d.ts +0 -3
- package/bin/provider/types/index.js +0 -19
- package/bin/provider/types/jsonrpc.d.ts +0 -26
- package/bin/provider/types/jsonrpc.js +0 -2
- package/bin/provider/utility/errors.utility.d.ts +0 -11
- package/bin/provider/utility/errors.utility.js +0 -56
- package/bin/provider/utility/index.d.ts +0 -2
- package/bin/provider/utility/index.js +0 -18
- package/bin/provider/utility/provider.utility.js +0 -244
- package/bin/provider/utility/requests.utility.d.ts +0 -35
- package/bin/provider/utility/requests.utility.js +0 -80
- package/bin/provider/websocket/index.d.ts +0 -1
- package/bin/provider/websocket/index.js +0 -17
- package/bin/provider/websocket/ws.d.ts +0 -58
- package/bin/provider/websocket/ws.js +0 -415
- package/bin/provider/websocket/ws.test.d.ts +0 -1
- package/bin/provider/websocket/ws.test.js +0 -648
- package/bin/services/index.d.ts +0 -2
- package/bin/services/index.js +0 -18
- package/bin/services/rest/restService.d.ts +0 -4
- package/bin/services/rest/restService.js +0 -72
- package/bin/services/rest/restService.types.d.ts +0 -6
- package/bin/services/rest/restService.types.js +0 -2
- package/bin/wallet/index.d.ts +0 -6
- package/bin/wallet/index.js +0 -22
- package/bin/wallet/key/index.d.ts +0 -1
- package/bin/wallet/key/index.js +0 -17
- package/bin/wallet/key/key.d.ts +0 -21
- package/bin/wallet/key/key.js +0 -102
- package/bin/wallet/key/key.test.d.ts +0 -1
- package/bin/wallet/key/key.test.js +0 -121
- package/bin/wallet/ledger/index.d.ts +0 -1
- package/bin/wallet/ledger/index.js +0 -17
- package/bin/wallet/ledger/ledger.d.ts +0 -22
- package/bin/wallet/ledger/ledger.js +0 -109
- package/bin/wallet/signer.d.ts +0 -29
- package/bin/wallet/signer.js +0 -2
- package/bin/wallet/types/index.d.ts +0 -2
- package/bin/wallet/types/index.js +0 -18
- package/bin/wallet/types/sign.d.ts +0 -16
- package/bin/wallet/types/sign.js +0 -4
- package/bin/wallet/types/wallet.d.ts +0 -5
- package/bin/wallet/types/wallet.js +0 -2
- package/bin/wallet/utility/index.d.ts +0 -1
- package/bin/wallet/utility/index.js +0 -17
- package/bin/wallet/utility/utility.d.ts +0 -36
- package/bin/wallet/utility/utility.js +0 -117
- package/bin/wallet/wallet.d.ts +0 -106
- package/bin/wallet/wallet.js +0 -361
- package/bin/wallet/wallet.test.d.ts +0 -1
- package/bin/wallet/wallet.test.js +0 -423
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
-
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v2.7.7
|
|
5
|
-
// protoc v5.29.3
|
|
6
|
-
// source: tm2/multisig.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.CompactBitArray = exports.Multisignature = exports.PubKeyMultisig = exports.protobufPackage = void 0;
|
|
12
|
-
exports.createCompactBitArray = createCompactBitArray;
|
|
13
|
-
exports.compactBitArraySize = compactBitArraySize;
|
|
14
|
-
exports.compactBitArraySetIndex = compactBitArraySetIndex;
|
|
15
|
-
/* eslint-disable */
|
|
16
|
-
var wire_1 = require("@bufbuild/protobuf/wire");
|
|
17
|
-
var long_1 = __importDefault(require("long"));
|
|
18
|
-
var any_1 = require("../google/protobuf/any");
|
|
19
|
-
exports.protobufPackage = 'tm';
|
|
20
|
-
function createBasePubKeyMultisig() {
|
|
21
|
-
return { k: long_1.default.UZERO, pub_keys: [] };
|
|
22
|
-
}
|
|
23
|
-
exports.PubKeyMultisig = {
|
|
24
|
-
encode: function (message, writer) {
|
|
25
|
-
if (writer === void 0) { writer = new wire_1.BinaryWriter(); }
|
|
26
|
-
if (!message.k.equals(long_1.default.UZERO)) {
|
|
27
|
-
writer.uint32(8).uint64(message.k.toString());
|
|
28
|
-
}
|
|
29
|
-
for (var _i = 0, _a = message.pub_keys; _i < _a.length; _i++) {
|
|
30
|
-
var v = _a[_i];
|
|
31
|
-
any_1.Any.encode(v, writer.uint32(18).fork()).join();
|
|
32
|
-
}
|
|
33
|
-
return writer;
|
|
34
|
-
},
|
|
35
|
-
decode: function (input, length) {
|
|
36
|
-
var reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
37
|
-
var end = length === undefined ? reader.len : reader.pos + length;
|
|
38
|
-
var message = createBasePubKeyMultisig();
|
|
39
|
-
while (reader.pos < end) {
|
|
40
|
-
var tag = reader.uint32();
|
|
41
|
-
switch (tag >>> 3) {
|
|
42
|
-
case 1: {
|
|
43
|
-
if (tag !== 8) {
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
message.k = long_1.default.fromString(reader.uint64().toString(), true);
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
case 2: {
|
|
50
|
-
if (tag !== 18) {
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
message.pub_keys.push(any_1.Any.decode(reader, reader.uint32()));
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
reader.skip(tag & 7);
|
|
61
|
-
}
|
|
62
|
-
return message;
|
|
63
|
-
},
|
|
64
|
-
fromJSON: function (object) {
|
|
65
|
-
return {
|
|
66
|
-
k: isSet(object.threshold)
|
|
67
|
-
? long_1.default.fromValue(object.threshold)
|
|
68
|
-
: long_1.default.UZERO,
|
|
69
|
-
pub_keys: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.pubkeys)
|
|
70
|
-
? object.pubkeys.map(function (e) { return any_1.Any.fromJSON(e); })
|
|
71
|
-
: [],
|
|
72
|
-
};
|
|
73
|
-
},
|
|
74
|
-
toJSON: function (message) {
|
|
75
|
-
var _a;
|
|
76
|
-
var obj = {};
|
|
77
|
-
if (message.k !== undefined) {
|
|
78
|
-
obj.threshold = (message.k || long_1.default.UZERO).toString();
|
|
79
|
-
}
|
|
80
|
-
if ((_a = message.pub_keys) === null || _a === void 0 ? void 0 : _a.length) {
|
|
81
|
-
obj.pubkeys = message.pub_keys.map(function (e) { return any_1.Any.toJSON(e); });
|
|
82
|
-
}
|
|
83
|
-
return obj;
|
|
84
|
-
},
|
|
85
|
-
create: function (base) {
|
|
86
|
-
return exports.PubKeyMultisig.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
87
|
-
},
|
|
88
|
-
fromPartial: function (object) {
|
|
89
|
-
var _a;
|
|
90
|
-
var message = createBasePubKeyMultisig();
|
|
91
|
-
message.k =
|
|
92
|
-
object.k !== undefined && object.k !== null
|
|
93
|
-
? long_1.default.fromValue(object.k)
|
|
94
|
-
: long_1.default.UZERO;
|
|
95
|
-
message.pub_keys = ((_a = object.pub_keys) === null || _a === void 0 ? void 0 : _a.map(function (e) { return any_1.Any.fromPartial(e); })) || [];
|
|
96
|
-
return message;
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
function createBaseMultisignature() {
|
|
100
|
-
return { bit_array: undefined, sigs: [] };
|
|
101
|
-
}
|
|
102
|
-
exports.Multisignature = {
|
|
103
|
-
encode: function (message, writer) {
|
|
104
|
-
if (writer === void 0) { writer = new wire_1.BinaryWriter(); }
|
|
105
|
-
if (message.bit_array !== undefined) {
|
|
106
|
-
exports.CompactBitArray.encode(message.bit_array, writer.uint32(10).fork()).join();
|
|
107
|
-
}
|
|
108
|
-
for (var _i = 0, _a = message.sigs; _i < _a.length; _i++) {
|
|
109
|
-
var v = _a[_i];
|
|
110
|
-
writer.uint32(18).bytes(v);
|
|
111
|
-
}
|
|
112
|
-
return writer;
|
|
113
|
-
},
|
|
114
|
-
decode: function (input, length) {
|
|
115
|
-
var reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
116
|
-
var end = length === undefined ? reader.len : reader.pos + length;
|
|
117
|
-
var message = createBaseMultisignature();
|
|
118
|
-
while (reader.pos < end) {
|
|
119
|
-
var tag = reader.uint32();
|
|
120
|
-
switch (tag >>> 3) {
|
|
121
|
-
case 1: {
|
|
122
|
-
if (tag !== 10) {
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
message.bit_array = exports.CompactBitArray.decode(reader, reader.uint32());
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
case 2: {
|
|
129
|
-
if (tag !== 18) {
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
message.sigs.push(reader.bytes());
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
reader.skip(tag & 7);
|
|
140
|
-
}
|
|
141
|
-
return message;
|
|
142
|
-
},
|
|
143
|
-
fromJSON: function (object) {
|
|
144
|
-
return {
|
|
145
|
-
bit_array: isSet(object.bit_array)
|
|
146
|
-
? exports.CompactBitArray.fromJSON(object.bit_array)
|
|
147
|
-
: undefined,
|
|
148
|
-
sigs: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.sigs)
|
|
149
|
-
? object.sigs.map(function (e) { return bytesFromBase64(e); })
|
|
150
|
-
: [],
|
|
151
|
-
};
|
|
152
|
-
},
|
|
153
|
-
toJSON: function (message) {
|
|
154
|
-
var _a;
|
|
155
|
-
var obj = {};
|
|
156
|
-
if (message.bit_array !== undefined) {
|
|
157
|
-
obj.bit_array = exports.CompactBitArray.toJSON(message.bit_array);
|
|
158
|
-
}
|
|
159
|
-
if ((_a = message.sigs) === null || _a === void 0 ? void 0 : _a.length) {
|
|
160
|
-
obj.sigs = message.sigs.map(function (e) { return base64FromBytes(e); });
|
|
161
|
-
}
|
|
162
|
-
return obj;
|
|
163
|
-
},
|
|
164
|
-
create: function (base) {
|
|
165
|
-
return exports.Multisignature.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
166
|
-
},
|
|
167
|
-
fromPartial: function (object) {
|
|
168
|
-
var _a;
|
|
169
|
-
var message = createBaseMultisignature();
|
|
170
|
-
message.bit_array =
|
|
171
|
-
object.bit_array !== undefined && object.bit_array !== null
|
|
172
|
-
? exports.CompactBitArray.fromPartial(object.bit_array)
|
|
173
|
-
: undefined;
|
|
174
|
-
message.sigs = ((_a = object.sigs) === null || _a === void 0 ? void 0 : _a.map(function (e) { return e; })) || [];
|
|
175
|
-
return message;
|
|
176
|
-
},
|
|
177
|
-
};
|
|
178
|
-
function createBaseCompactBitArray() {
|
|
179
|
-
return { extra_bits_stored: 0, elems: new Uint8Array(0) };
|
|
180
|
-
}
|
|
181
|
-
exports.CompactBitArray = {
|
|
182
|
-
encode: function (message, writer) {
|
|
183
|
-
if (writer === void 0) { writer = new wire_1.BinaryWriter(); }
|
|
184
|
-
if (message.extra_bits_stored !== 0) {
|
|
185
|
-
writer.uint32(8).uint32(message.extra_bits_stored);
|
|
186
|
-
}
|
|
187
|
-
if (message.elems.length !== 0) {
|
|
188
|
-
writer.uint32(18).bytes(message.elems);
|
|
189
|
-
}
|
|
190
|
-
return writer;
|
|
191
|
-
},
|
|
192
|
-
decode: function (input, length) {
|
|
193
|
-
var reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
194
|
-
var end = length === undefined ? reader.len : reader.pos + length;
|
|
195
|
-
var message = createBaseCompactBitArray();
|
|
196
|
-
while (reader.pos < end) {
|
|
197
|
-
var tag = reader.uint32();
|
|
198
|
-
switch (tag >>> 3) {
|
|
199
|
-
case 1: {
|
|
200
|
-
if (tag !== 8) {
|
|
201
|
-
break;
|
|
202
|
-
}
|
|
203
|
-
message.extra_bits_stored = reader.uint32();
|
|
204
|
-
continue;
|
|
205
|
-
}
|
|
206
|
-
case 2: {
|
|
207
|
-
if (tag !== 18) {
|
|
208
|
-
break;
|
|
209
|
-
}
|
|
210
|
-
message.elems = reader.bytes();
|
|
211
|
-
continue;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
215
|
-
break;
|
|
216
|
-
}
|
|
217
|
-
reader.skip(tag & 7);
|
|
218
|
-
}
|
|
219
|
-
return message;
|
|
220
|
-
},
|
|
221
|
-
fromJSON: function (json) {
|
|
222
|
-
if (json === null) {
|
|
223
|
-
// Handle null case
|
|
224
|
-
return createBaseCompactBitArray();
|
|
225
|
-
}
|
|
226
|
-
if (typeof json !== 'string') {
|
|
227
|
-
throw new Error("CompactBitArray in JSON should be a string or null but got ".concat(typeof json));
|
|
228
|
-
}
|
|
229
|
-
var bits = json;
|
|
230
|
-
var numBits = bits.length;
|
|
231
|
-
// Create a new CompactBitArray
|
|
232
|
-
var numBytes = Math.ceil(numBits / 8);
|
|
233
|
-
var elems = new Uint8Array(numBytes);
|
|
234
|
-
var extraBitsStored = numBits % 8;
|
|
235
|
-
var bitArray = { extra_bits_stored: extraBitsStored, elems: elems };
|
|
236
|
-
// Set bits based on the string representation
|
|
237
|
-
for (var i = 0; i < numBits; i++) {
|
|
238
|
-
if (bits[i] === 'x') {
|
|
239
|
-
compactBitArraySetIndex(bitArray, i, true);
|
|
240
|
-
}
|
|
241
|
-
// For '_', we don't need to do anything as bits are initialized to 0
|
|
242
|
-
}
|
|
243
|
-
return bitArray;
|
|
244
|
-
},
|
|
245
|
-
toJSON: function (message) {
|
|
246
|
-
throw new Error('not implemented');
|
|
247
|
-
},
|
|
248
|
-
create: function (base) {
|
|
249
|
-
return exports.CompactBitArray.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
250
|
-
},
|
|
251
|
-
fromPartial: function (object) {
|
|
252
|
-
var _a, _b;
|
|
253
|
-
var message = createBaseCompactBitArray();
|
|
254
|
-
message.extra_bits_stored = (_a = object.extra_bits_stored) !== null && _a !== void 0 ? _a : 0;
|
|
255
|
-
message.elems = (_b = object.elems) !== null && _b !== void 0 ? _b : new Uint8Array(0);
|
|
256
|
-
return message;
|
|
257
|
-
},
|
|
258
|
-
};
|
|
259
|
-
function createCompactBitArray(bits) {
|
|
260
|
-
if (bits <= 0) {
|
|
261
|
-
throw new Error('empty');
|
|
262
|
-
}
|
|
263
|
-
var extraBitsStored = bits % 8;
|
|
264
|
-
var elems = new Uint8Array(Math.ceil(bits / 8));
|
|
265
|
-
return { extra_bits_stored: extraBitsStored, elems: elems };
|
|
266
|
-
}
|
|
267
|
-
function compactBitArraySize(bA) {
|
|
268
|
-
if (bA.elems === null) {
|
|
269
|
-
return 0;
|
|
270
|
-
}
|
|
271
|
-
else if (bA.extra_bits_stored === 0) {
|
|
272
|
-
return bA.elems.length * 8;
|
|
273
|
-
}
|
|
274
|
-
return (bA.elems.length - 1) * 8 + bA.extra_bits_stored;
|
|
275
|
-
}
|
|
276
|
-
// SetIndex sets the bit at index i within the bit array
|
|
277
|
-
// Returns true if successful, false if out of bounds or array is null
|
|
278
|
-
function compactBitArraySetIndex(bA, i, v) {
|
|
279
|
-
if (bA.elems === null) {
|
|
280
|
-
return false;
|
|
281
|
-
}
|
|
282
|
-
if (i >= compactBitArraySize(bA)) {
|
|
283
|
-
return false;
|
|
284
|
-
}
|
|
285
|
-
if (v) {
|
|
286
|
-
// Set the bit (most significant bit first)
|
|
287
|
-
bA.elems[i >> 3] |= 1 << (7 - (i % 8));
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
// Clear the bit
|
|
291
|
-
bA.elems[i >> 3] &= ~(1 << (7 - (i % 8)));
|
|
292
|
-
}
|
|
293
|
-
return true;
|
|
294
|
-
}
|
|
295
|
-
function bytesFromBase64(b64) {
|
|
296
|
-
if (globalThis.Buffer) {
|
|
297
|
-
return Uint8Array.from(globalThis.Buffer.from(b64, 'base64'));
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
var bin = globalThis.atob(b64);
|
|
301
|
-
var arr = new Uint8Array(bin.length);
|
|
302
|
-
for (var i = 0; i < bin.length; ++i) {
|
|
303
|
-
arr[i] = bin.charCodeAt(i);
|
|
304
|
-
}
|
|
305
|
-
return arr;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
function base64FromBytes(arr) {
|
|
309
|
-
if (globalThis.Buffer) {
|
|
310
|
-
return globalThis.Buffer.from(arr).toString('base64');
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
var bin_1 = [];
|
|
314
|
-
arr.forEach(function (byte) {
|
|
315
|
-
bin_1.push(globalThis.String.fromCharCode(byte));
|
|
316
|
-
});
|
|
317
|
-
return globalThis.btoa(bin_1.join(''));
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
function isSet(value) {
|
|
321
|
-
return value !== null && value !== undefined;
|
|
322
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
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 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
-
return g.next = verb(0), g["throw"] = verb(1), g["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 (g && (g = 0, op[0] && (_ = 0)), _) 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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var utils_1 = require("@noble/hashes/utils");
|
|
40
|
-
var multisig_1 = require("./multisig");
|
|
41
|
-
describe('TestMarshalCompactBitArrayAmino', function () {
|
|
42
|
-
var testCases = [
|
|
43
|
-
{ marshalledBA: "null", hexOutput: '' },
|
|
44
|
-
{ marshalledBA: "null", hexOutput: '' },
|
|
45
|
-
{ marshalledBA: "\"_\"", hexOutput: '0801120100' },
|
|
46
|
-
{ marshalledBA: "\"x\"", hexOutput: '0801120180' },
|
|
47
|
-
{ marshalledBA: "\"xx___\"", hexOutput: '08051201c0' },
|
|
48
|
-
{ marshalledBA: "\"xx______x\"", hexOutput: '08011202c080' },
|
|
49
|
-
{ marshalledBA: "\"xx_____________x\"", hexOutput: '1202c001' },
|
|
50
|
-
];
|
|
51
|
-
test.each(testCases)('$marshalledBA', function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
52
|
-
var jsonData, bA, bz, actualHex;
|
|
53
|
-
var marshalledBA = _b.marshalledBA, hexOutput = _b.hexOutput;
|
|
54
|
-
return __generator(this, function (_c) {
|
|
55
|
-
jsonData = JSON.parse(marshalledBA);
|
|
56
|
-
bA = multisig_1.CompactBitArray.fromJSON(jsonData);
|
|
57
|
-
bz = multisig_1.CompactBitArray.encode(bA).finish();
|
|
58
|
-
actualHex = (0, utils_1.bytesToHex)(bz);
|
|
59
|
-
expect(actualHex).toBe(hexOutput);
|
|
60
|
-
return [2 /*return*/];
|
|
61
|
-
});
|
|
62
|
-
}); });
|
|
63
|
-
});
|
package/bin/proto/tm2/tx.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
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.tx";
|
|
5
|
-
export interface Tx {
|
|
6
|
-
/** specific message types */
|
|
7
|
-
messages: Any[];
|
|
8
|
-
/** transaction costs (fee) */
|
|
9
|
-
fee?: TxFee | undefined;
|
|
10
|
-
/** the signatures for the transaction */
|
|
11
|
-
signatures: TxSignature[];
|
|
12
|
-
/** memo attached to the transaction */
|
|
13
|
-
memo: string;
|
|
14
|
-
}
|
|
15
|
-
export interface TxFee {
|
|
16
|
-
/** gas limit */
|
|
17
|
-
gas_wanted: Long;
|
|
18
|
-
/** gas fee details (<value><denomination>) */
|
|
19
|
-
gas_fee: string;
|
|
20
|
-
}
|
|
21
|
-
export interface TxSignature {
|
|
22
|
-
/** public key associated with the signature */
|
|
23
|
-
pub_key?: Any | undefined;
|
|
24
|
-
/** the signature */
|
|
25
|
-
signature: Uint8Array;
|
|
26
|
-
}
|
|
27
|
-
export interface PubKeySecp256k1 {
|
|
28
|
-
key: Uint8Array;
|
|
29
|
-
}
|
|
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>;
|
|
34
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
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 {} ? {
|
|
36
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
37
|
-
} : Partial<T>;
|
|
38
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
39
|
-
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
40
|
-
[K in keyof P]: Exact<P[K], I[K]>;
|
|
41
|
-
} & {
|
|
42
|
-
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
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
|
-
}
|
|
52
|
-
export {};
|