atlas.js-protos 0.1.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/LICENSE +21 -0
- package/README.md +85 -0
- package/dist/filetree/index.d.ts +2 -0
- package/dist/filetree/index.js +8 -0
- package/dist/filetree/index.mjs +3 -0
- package/dist/filetree/query.d.ts +1 -0
- package/dist/filetree/query.js +13 -0
- package/dist/filetree/query.mjs +2 -0
- package/dist/filetree/tx.d.ts +1 -0
- package/dist/filetree/tx.js +11 -0
- package/dist/filetree/tx.mjs +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -0
- package/dist/index.mjs +1 -0
- package/dist/storage/index.d.ts +5 -0
- package/dist/storage/index.js +16 -0
- package/dist/storage/index.mjs +6 -0
- package/dist/storage/query.d.ts +1 -0
- package/dist/storage/query.js +27 -0
- package/dist/storage/query.mjs +2 -0
- package/dist/storage/tx.d.ts +1 -0
- package/dist/storage/tx.js +21 -0
- package/dist/storage/tx.mjs +2 -0
- package/dist/types/amino/amino.d.ts +1 -0
- package/dist/types/amino/amino.js +2 -0
- package/dist/types/amino/amino.mjs +1 -0
- package/dist/types/amino/bundle.d.ts +1 -0
- package/dist/types/amino/bundle.js +41 -0
- package/dist/types/amino/bundle.mjs +5 -0
- package/dist/types/atlas/bundle.d.ts +905 -0
- package/dist/types/atlas/bundle.js +98 -0
- package/dist/types/atlas/bundle.mjs +62 -0
- package/dist/types/atlas/filetree/v1/genesis.d.ts +45 -0
- package/dist/types/atlas/filetree/v1/genesis.js +107 -0
- package/dist/types/atlas/filetree/v1/genesis.mjs +71 -0
- package/dist/types/atlas/filetree/v1/params.d.ts +40 -0
- package/dist/types/atlas/filetree/v1/params.js +94 -0
- package/dist/types/atlas/filetree/v1/params.mjs +58 -0
- package/dist/types/atlas/filetree/v1/query.d.ts +330 -0
- package/dist/types/atlas/filetree/v1/query.js +567 -0
- package/dist/types/atlas/filetree/v1/query.mjs +531 -0
- package/dist/types/atlas/filetree/v1/query.rpc.Query.d.ts +28 -0
- package/dist/types/atlas/filetree/v1/query.rpc.Query.js +89 -0
- package/dist/types/atlas/filetree/v1/query.rpc.Query.mjs +51 -0
- package/dist/types/atlas/filetree/v1/query.rpc.func.d.ts +29 -0
- package/dist/types/atlas/filetree/v1/query.rpc.func.js +58 -0
- package/dist/types/atlas/filetree/v1/query.rpc.func.mjs +55 -0
- package/dist/types/atlas/filetree/v1/tree.d.ts +44 -0
- package/dist/types/atlas/filetree/v1/tree.js +124 -0
- package/dist/types/atlas/filetree/v1/tree.mjs +88 -0
- package/dist/types/atlas/filetree/v1/tx.d.ts +260 -0
- package/dist/types/atlas/filetree/v1/tx.js +449 -0
- package/dist/types/atlas/filetree/v1/tx.mjs +413 -0
- package/dist/types/atlas/filetree/v1/tx.rpc.func.d.ts +23 -0
- package/dist/types/atlas/filetree/v1/tx.rpc.func.js +34 -0
- package/dist/types/atlas/filetree/v1/tx.rpc.func.mjs +31 -0
- package/dist/types/atlas/filetree/v1/tx.rpc.msg.d.ts +22 -0
- package/dist/types/atlas/filetree/v1/tx.rpc.msg.js +67 -0
- package/dist/types/atlas/filetree/v1/tx.rpc.msg.mjs +29 -0
- package/dist/types/atlas/rpc.query.d.ts +49 -0
- package/dist/types/atlas/rpc.query.js +59 -0
- package/dist/types/atlas/rpc.query.mjs +22 -0
- package/dist/types/atlas/rpc.tx.d.ts +18 -0
- package/dist/types/atlas/rpc.tx.js +52 -0
- package/dist/types/atlas/rpc.tx.mjs +15 -0
- package/dist/types/atlas/storage/v1/file.d.ts +59 -0
- package/dist/types/atlas/storage/v1/file.js +173 -0
- package/dist/types/atlas/storage/v1/file.mjs +137 -0
- package/dist/types/atlas/storage/v1/genesis.d.ts +45 -0
- package/dist/types/atlas/storage/v1/genesis.js +107 -0
- package/dist/types/atlas/storage/v1/genesis.mjs +71 -0
- package/dist/types/atlas/storage/v1/params.d.ts +48 -0
- package/dist/types/atlas/storage/v1/params.js +127 -0
- package/dist/types/atlas/storage/v1/params.mjs +91 -0
- package/dist/types/atlas/storage/v1/proof.d.ts +145 -0
- package/dist/types/atlas/storage/v1/proof.js +318 -0
- package/dist/types/atlas/storage/v1/proof.mjs +282 -0
- package/dist/types/atlas/storage/v1/provider.d.ts +51 -0
- package/dist/types/atlas/storage/v1/provider.js +141 -0
- package/dist/types/atlas/storage/v1/provider.mjs +105 -0
- package/dist/types/atlas/storage/v1/query.d.ts +914 -0
- package/dist/types/atlas/storage/v1/query.js +1570 -0
- package/dist/types/atlas/storage/v1/query.mjs +1534 -0
- package/dist/types/atlas/storage/v1/query.rpc.Query.d.ts +56 -0
- package/dist/types/atlas/storage/v1/query.rpc.Query.js +154 -0
- package/dist/types/atlas/storage/v1/query.rpc.Query.mjs +116 -0
- package/dist/types/atlas/storage/v1/query.rpc.func.d.ts +78 -0
- package/dist/types/atlas/storage/v1/query.rpc.func.js +149 -0
- package/dist/types/atlas/storage/v1/query.rpc.func.mjs +146 -0
- package/dist/types/atlas/storage/v1/subscription.d.ts +55 -0
- package/dist/types/atlas/storage/v1/subscription.js +159 -0
- package/dist/types/atlas/storage/v1/subscription.mjs +123 -0
- package/dist/types/atlas/storage/v1/tx.d.ts +694 -0
- package/dist/types/atlas/storage/v1/tx.js +1203 -0
- package/dist/types/atlas/storage/v1/tx.mjs +1167 -0
- package/dist/types/atlas/storage/v1/tx.rpc.func.d.ts +56 -0
- package/dist/types/atlas/storage/v1/tx.rpc.func.js +77 -0
- package/dist/types/atlas/storage/v1/tx.rpc.func.mjs +74 -0
- package/dist/types/atlas/storage/v1/tx.rpc.msg.d.ts +35 -0
- package/dist/types/atlas/storage/v1/tx.rpc.msg.js +97 -0
- package/dist/types/atlas/storage/v1/tx.rpc.msg.mjs +59 -0
- package/dist/types/cosmos/bank/v1beta1/authz.d.ts +62 -0
- package/dist/types/cosmos/bank/v1beta1/authz.js +123 -0
- package/dist/types/cosmos/bank/v1beta1/authz.mjs +87 -0
- package/dist/types/cosmos/bank/v1beta1/bank.d.ts +391 -0
- package/dist/types/cosmos/bank/v1beta1/bank.js +626 -0
- package/dist/types/cosmos/bank/v1beta1/bank.mjs +590 -0
- package/dist/types/cosmos/bank/v1beta1/genesis.d.ts +122 -0
- package/dist/types/cosmos/bank/v1beta1/genesis.js +224 -0
- package/dist/types/cosmos/bank/v1beta1/genesis.mjs +188 -0
- package/dist/types/cosmos/bank/v1beta1/query.d.ts +1377 -0
- package/dist/types/cosmos/bank/v1beta1/query.js +2038 -0
- package/dist/types/cosmos/bank/v1beta1/query.mjs +2002 -0
- package/dist/types/cosmos/bank/v1beta1/query.rpc.Query.d.ts +119 -0
- package/dist/types/cosmos/bank/v1beta1/query.rpc.Query.js +174 -0
- package/dist/types/cosmos/bank/v1beta1/query.rpc.Query.mjs +136 -0
- package/dist/types/cosmos/bank/v1beta1/query.rpc.func.d.ts +129 -0
- package/dist/types/cosmos/bank/v1beta1/query.rpc.func.js +212 -0
- package/dist/types/cosmos/bank/v1beta1/query.rpc.func.mjs +209 -0
- package/dist/types/cosmos/bank/v1beta1/tx.d.ts +398 -0
- package/dist/types/cosmos/bank/v1beta1/tx.js +599 -0
- package/dist/types/cosmos/bank/v1beta1/tx.mjs +563 -0
- package/dist/types/cosmos/bank/v1beta1/tx.rpc.func.d.ts +37 -0
- package/dist/types/cosmos/bank/v1beta1/tx.rpc.func.js +50 -0
- package/dist/types/cosmos/bank/v1beta1/tx.rpc.func.mjs +47 -0
- package/dist/types/cosmos/bank/v1beta1/tx.rpc.msg.d.ts +34 -0
- package/dist/types/cosmos/bank/v1beta1/tx.rpc.msg.js +73 -0
- package/dist/types/cosmos/bank/v1beta1/tx.rpc.msg.mjs +35 -0
- package/dist/types/cosmos/base/query/v1beta1/pagination.d.ts +163 -0
- package/dist/types/cosmos/base/query/v1beta1/pagination.js +219 -0
- package/dist/types/cosmos/base/query/v1beta1/pagination.mjs +183 -0
- package/dist/types/cosmos/base/v1beta1/coin.d.ts +193 -0
- package/dist/types/cosmos/base/v1beta1/coin.js +320 -0
- package/dist/types/cosmos/base/v1beta1/coin.mjs +284 -0
- package/dist/types/cosmos/bundle.d.ts +761 -0
- package/dist/types/cosmos/bundle.js +97 -0
- package/dist/types/cosmos/bundle.mjs +61 -0
- package/dist/types/cosmos/msg/v1/msg.d.ts +1 -0
- package/dist/types/cosmos/msg/v1/msg.js +2 -0
- package/dist/types/cosmos/msg/v1/msg.mjs +1 -0
- package/dist/types/cosmos/query/v1/query.d.ts +1 -0
- package/dist/types/cosmos/query/v1/query.js +2 -0
- package/dist/types/cosmos/query/v1/query.mjs +1 -0
- package/dist/types/cosmos/rpc.query.d.ts +24 -0
- package/dist/types/cosmos/rpc.query.js +51 -0
- package/dist/types/cosmos/rpc.query.mjs +14 -0
- package/dist/types/cosmos/rpc.tx.d.ts +10 -0
- package/dist/types/cosmos/rpc.tx.js +44 -0
- package/dist/types/cosmos/rpc.tx.mjs +7 -0
- package/dist/types/cosmos_proto/bundle.d.ts +31 -0
- package/dist/types/cosmos_proto/bundle.js +41 -0
- package/dist/types/cosmos_proto/bundle.mjs +5 -0
- package/dist/types/cosmos_proto/cosmos.d.ts +144 -0
- package/dist/types/cosmos_proto/cosmos.js +244 -0
- package/dist/types/cosmos_proto/cosmos.mjs +206 -0
- package/dist/types/extern.d.ts +11 -0
- package/dist/types/extern.js +47 -0
- package/dist/types/extern.mjs +41 -0
- package/dist/types/gogoproto/bundle.d.ts +1 -0
- package/dist/types/gogoproto/bundle.js +41 -0
- package/dist/types/gogoproto/bundle.mjs +5 -0
- package/dist/types/gogoproto/gogo.d.ts +1 -0
- package/dist/types/gogoproto/gogo.js +2 -0
- package/dist/types/gogoproto/gogo.mjs +1 -0
- package/dist/types/google/api/annotations.d.ts +1 -0
- package/dist/types/google/api/annotations.js +2 -0
- package/dist/types/google/api/annotations.mjs +1 -0
- package/dist/types/google/api/http.d.ts +1006 -0
- package/dist/types/google/api/http.js +589 -0
- package/dist/types/google/api/http.mjs +553 -0
- package/dist/types/google/bundle.d.ts +545 -0
- package/dist/types/google/bundle.js +52 -0
- package/dist/types/google/bundle.mjs +16 -0
- package/dist/types/google/protobuf/descriptor.d.ts +2755 -0
- package/dist/types/google/protobuf/descriptor.js +4612 -0
- package/dist/types/google/protobuf/descriptor.mjs +4535 -0
- package/dist/types/google/protobuf/timestamp.d.ts +319 -0
- package/dist/types/google/protobuf/timestamp.js +197 -0
- package/dist/types/google/protobuf/timestamp.mjs +161 -0
- package/dist/types/helper-func-types.d.ts +40 -0
- package/dist/types/helper-func-types.js +57 -0
- package/dist/types/helper-func-types.mjs +53 -0
- package/dist/types/helpers.d.ts +56 -0
- package/dist/types/helpers.js +161 -0
- package/dist/types/helpers.mjs +110 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.js +32 -0
- package/dist/types/index.mjs +16 -0
- package/dist/types/registry.d.ts +35 -0
- package/dist/types/registry.js +200 -0
- package/dist/types/registry.mjs +163 -0
- package/dist/types/types.d.ts +74 -0
- package/dist/types/types.js +8 -0
- package/dist/types/types.mjs +7 -0
- package/package.json +97 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//@ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* This file and any referenced files were automatically generated by @ahm23/telescope@2.3.1
|
|
5
|
+
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
6
|
+
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.GlobalDecoderRegistry = void 0;
|
|
43
|
+
const _m0 = __importStar(require("protobufjs/minimal"));
|
|
44
|
+
const any_1 = require("cosmjs-types/google/protobuf/any");
|
|
45
|
+
class GlobalDecoderRegistry {
|
|
46
|
+
static registry = {};
|
|
47
|
+
static aminoProtoMapping = {};
|
|
48
|
+
static existingTypeUrls = [];
|
|
49
|
+
static registerExistingTypeUrl(typeUrl) {
|
|
50
|
+
if (GlobalDecoderRegistry.existingTypeUrls.includes(typeUrl)) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
GlobalDecoderRegistry.existingTypeUrls.push(typeUrl);
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
static registerAminoProtoMapping(aminoType, typeUrl) {
|
|
57
|
+
GlobalDecoderRegistry.aminoProtoMapping[aminoType] = typeUrl;
|
|
58
|
+
}
|
|
59
|
+
static register(key, decoder) {
|
|
60
|
+
GlobalDecoderRegistry.registry[key] = decoder;
|
|
61
|
+
}
|
|
62
|
+
static getDecoder(key) {
|
|
63
|
+
return GlobalDecoderRegistry.registry[key];
|
|
64
|
+
}
|
|
65
|
+
static getDecoderByInstance(obj) {
|
|
66
|
+
if (obj === undefined || obj === null) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
const protoType = obj;
|
|
70
|
+
if (protoType.$typeUrl) {
|
|
71
|
+
return GlobalDecoderRegistry.getDecoder(protoType.$typeUrl);
|
|
72
|
+
}
|
|
73
|
+
for (const key in GlobalDecoderRegistry.registry) {
|
|
74
|
+
if (Object.prototype.hasOwnProperty.call(GlobalDecoderRegistry.registry, key)) {
|
|
75
|
+
const element = GlobalDecoderRegistry.registry[key];
|
|
76
|
+
if (element.is(obj)) {
|
|
77
|
+
return element;
|
|
78
|
+
}
|
|
79
|
+
if (element.isSDK && element.isSDK(obj)) {
|
|
80
|
+
return element;
|
|
81
|
+
}
|
|
82
|
+
if (element.isAmino && element.isAmino(obj)) {
|
|
83
|
+
return element;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
static getDecoderByAminoType(type) {
|
|
90
|
+
if (type === undefined || type === null) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
const typeUrl = GlobalDecoderRegistry.aminoProtoMapping[type];
|
|
94
|
+
if (!typeUrl) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
return GlobalDecoderRegistry.getDecoder(typeUrl);
|
|
98
|
+
}
|
|
99
|
+
static wrapAny(obj) {
|
|
100
|
+
if (any_1.Any.is(obj)) {
|
|
101
|
+
return obj;
|
|
102
|
+
}
|
|
103
|
+
const decoder = getDecoderByInstance(obj);
|
|
104
|
+
return {
|
|
105
|
+
typeUrl: decoder.typeUrl,
|
|
106
|
+
value: decoder.encode(obj).finish(),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
static unwrapAny(input) {
|
|
110
|
+
let data;
|
|
111
|
+
if (any_1.Any.is(input)) {
|
|
112
|
+
data = input;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
116
|
+
data = any_1.Any.decode(reader, reader.uint32());
|
|
117
|
+
}
|
|
118
|
+
const decoder = GlobalDecoderRegistry.getDecoder(data.typeUrl);
|
|
119
|
+
if (!decoder) {
|
|
120
|
+
return data;
|
|
121
|
+
}
|
|
122
|
+
return decoder.decode(data.value);
|
|
123
|
+
}
|
|
124
|
+
static fromJSON(object) {
|
|
125
|
+
const decoder = getDecoderByInstance(object);
|
|
126
|
+
return decoder.fromJSON(object);
|
|
127
|
+
}
|
|
128
|
+
static toJSON(message) {
|
|
129
|
+
const decoder = getDecoderByInstance(message);
|
|
130
|
+
return decoder.toJSON(message);
|
|
131
|
+
}
|
|
132
|
+
static fromPartial(object) {
|
|
133
|
+
const decoder = getDecoderByInstance(object);
|
|
134
|
+
return decoder ? decoder.fromPartial(object) : object;
|
|
135
|
+
}
|
|
136
|
+
static fromSDK(object) {
|
|
137
|
+
const decoder = getDecoderByInstance(object);
|
|
138
|
+
return decoder.fromSDK(object);
|
|
139
|
+
}
|
|
140
|
+
static fromSDKJSON(object) {
|
|
141
|
+
const decoder = getDecoderByInstance(object);
|
|
142
|
+
return decoder.fromSDKJSON(object);
|
|
143
|
+
}
|
|
144
|
+
static toSDK(object) {
|
|
145
|
+
const decoder = getDecoderByInstance(object);
|
|
146
|
+
return decoder.toSDK(object);
|
|
147
|
+
}
|
|
148
|
+
static fromAmino(object) {
|
|
149
|
+
const decoder = getDecoderByInstance(object);
|
|
150
|
+
return decoder.fromAmino(object);
|
|
151
|
+
}
|
|
152
|
+
static fromAminoMsg(object) {
|
|
153
|
+
const decoder = GlobalDecoderRegistry.getDecoderByAminoType(object.type);
|
|
154
|
+
if (!decoder) {
|
|
155
|
+
throw new Error(`There's no decoder for the amino type ${object.type}`);
|
|
156
|
+
}
|
|
157
|
+
return decoder.fromAminoMsg(object);
|
|
158
|
+
}
|
|
159
|
+
static toAmino(object) {
|
|
160
|
+
let data;
|
|
161
|
+
let decoder;
|
|
162
|
+
if (any_1.Any.is(object)) {
|
|
163
|
+
data = GlobalDecoderRegistry.unwrapAny(object);
|
|
164
|
+
decoder = GlobalDecoderRegistry.getDecoder(object.typeUrl);
|
|
165
|
+
if (!decoder) {
|
|
166
|
+
decoder = any_1.Any;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
data = object;
|
|
171
|
+
decoder = getDecoderByInstance(object);
|
|
172
|
+
}
|
|
173
|
+
return decoder.toAmino(data);
|
|
174
|
+
}
|
|
175
|
+
static toAminoMsg(object) {
|
|
176
|
+
let data;
|
|
177
|
+
let decoder;
|
|
178
|
+
if (any_1.Any.is(object)) {
|
|
179
|
+
data = GlobalDecoderRegistry.unwrapAny(object);
|
|
180
|
+
decoder = GlobalDecoderRegistry.getDecoder(object.typeUrl);
|
|
181
|
+
if (!decoder) {
|
|
182
|
+
decoder = any_1.Any;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
data = object;
|
|
187
|
+
decoder = getDecoderByInstance(object);
|
|
188
|
+
}
|
|
189
|
+
return decoder.toAminoMsg(data);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
exports.GlobalDecoderRegistry = GlobalDecoderRegistry;
|
|
193
|
+
function getDecoderByInstance(obj) {
|
|
194
|
+
const decoder = GlobalDecoderRegistry.getDecoderByInstance(obj);
|
|
195
|
+
if (!decoder) {
|
|
196
|
+
throw new Error(`There's no decoder for the instance ${JSON.stringify(obj)}`);
|
|
197
|
+
}
|
|
198
|
+
return decoder;
|
|
199
|
+
}
|
|
200
|
+
GlobalDecoderRegistry.register(any_1.Any.typeUrl, any_1.Any);
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* This file and any referenced files were automatically generated by @ahm23/telescope@2.3.1
|
|
4
|
+
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
5
|
+
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
|
|
6
|
+
*/
|
|
7
|
+
import * as _m0 from "protobufjs/minimal";
|
|
8
|
+
import { Any } from "cosmjs-types/google/protobuf/any";
|
|
9
|
+
export class GlobalDecoderRegistry {
|
|
10
|
+
static registry = {};
|
|
11
|
+
static aminoProtoMapping = {};
|
|
12
|
+
static existingTypeUrls = [];
|
|
13
|
+
static registerExistingTypeUrl(typeUrl) {
|
|
14
|
+
if (GlobalDecoderRegistry.existingTypeUrls.includes(typeUrl)) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
GlobalDecoderRegistry.existingTypeUrls.push(typeUrl);
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
static registerAminoProtoMapping(aminoType, typeUrl) {
|
|
21
|
+
GlobalDecoderRegistry.aminoProtoMapping[aminoType] = typeUrl;
|
|
22
|
+
}
|
|
23
|
+
static register(key, decoder) {
|
|
24
|
+
GlobalDecoderRegistry.registry[key] = decoder;
|
|
25
|
+
}
|
|
26
|
+
static getDecoder(key) {
|
|
27
|
+
return GlobalDecoderRegistry.registry[key];
|
|
28
|
+
}
|
|
29
|
+
static getDecoderByInstance(obj) {
|
|
30
|
+
if (obj === undefined || obj === null) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const protoType = obj;
|
|
34
|
+
if (protoType.$typeUrl) {
|
|
35
|
+
return GlobalDecoderRegistry.getDecoder(protoType.$typeUrl);
|
|
36
|
+
}
|
|
37
|
+
for (const key in GlobalDecoderRegistry.registry) {
|
|
38
|
+
if (Object.prototype.hasOwnProperty.call(GlobalDecoderRegistry.registry, key)) {
|
|
39
|
+
const element = GlobalDecoderRegistry.registry[key];
|
|
40
|
+
if (element.is(obj)) {
|
|
41
|
+
return element;
|
|
42
|
+
}
|
|
43
|
+
if (element.isSDK && element.isSDK(obj)) {
|
|
44
|
+
return element;
|
|
45
|
+
}
|
|
46
|
+
if (element.isAmino && element.isAmino(obj)) {
|
|
47
|
+
return element;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
static getDecoderByAminoType(type) {
|
|
54
|
+
if (type === undefined || type === null) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
const typeUrl = GlobalDecoderRegistry.aminoProtoMapping[type];
|
|
58
|
+
if (!typeUrl) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return GlobalDecoderRegistry.getDecoder(typeUrl);
|
|
62
|
+
}
|
|
63
|
+
static wrapAny(obj) {
|
|
64
|
+
if (Any.is(obj)) {
|
|
65
|
+
return obj;
|
|
66
|
+
}
|
|
67
|
+
const decoder = getDecoderByInstance(obj);
|
|
68
|
+
return {
|
|
69
|
+
typeUrl: decoder.typeUrl,
|
|
70
|
+
value: decoder.encode(obj).finish(),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
static unwrapAny(input) {
|
|
74
|
+
let data;
|
|
75
|
+
if (Any.is(input)) {
|
|
76
|
+
data = input;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
80
|
+
data = Any.decode(reader, reader.uint32());
|
|
81
|
+
}
|
|
82
|
+
const decoder = GlobalDecoderRegistry.getDecoder(data.typeUrl);
|
|
83
|
+
if (!decoder) {
|
|
84
|
+
return data;
|
|
85
|
+
}
|
|
86
|
+
return decoder.decode(data.value);
|
|
87
|
+
}
|
|
88
|
+
static fromJSON(object) {
|
|
89
|
+
const decoder = getDecoderByInstance(object);
|
|
90
|
+
return decoder.fromJSON(object);
|
|
91
|
+
}
|
|
92
|
+
static toJSON(message) {
|
|
93
|
+
const decoder = getDecoderByInstance(message);
|
|
94
|
+
return decoder.toJSON(message);
|
|
95
|
+
}
|
|
96
|
+
static fromPartial(object) {
|
|
97
|
+
const decoder = getDecoderByInstance(object);
|
|
98
|
+
return decoder ? decoder.fromPartial(object) : object;
|
|
99
|
+
}
|
|
100
|
+
static fromSDK(object) {
|
|
101
|
+
const decoder = getDecoderByInstance(object);
|
|
102
|
+
return decoder.fromSDK(object);
|
|
103
|
+
}
|
|
104
|
+
static fromSDKJSON(object) {
|
|
105
|
+
const decoder = getDecoderByInstance(object);
|
|
106
|
+
return decoder.fromSDKJSON(object);
|
|
107
|
+
}
|
|
108
|
+
static toSDK(object) {
|
|
109
|
+
const decoder = getDecoderByInstance(object);
|
|
110
|
+
return decoder.toSDK(object);
|
|
111
|
+
}
|
|
112
|
+
static fromAmino(object) {
|
|
113
|
+
const decoder = getDecoderByInstance(object);
|
|
114
|
+
return decoder.fromAmino(object);
|
|
115
|
+
}
|
|
116
|
+
static fromAminoMsg(object) {
|
|
117
|
+
const decoder = GlobalDecoderRegistry.getDecoderByAminoType(object.type);
|
|
118
|
+
if (!decoder) {
|
|
119
|
+
throw new Error(`There's no decoder for the amino type ${object.type}`);
|
|
120
|
+
}
|
|
121
|
+
return decoder.fromAminoMsg(object);
|
|
122
|
+
}
|
|
123
|
+
static toAmino(object) {
|
|
124
|
+
let data;
|
|
125
|
+
let decoder;
|
|
126
|
+
if (Any.is(object)) {
|
|
127
|
+
data = GlobalDecoderRegistry.unwrapAny(object);
|
|
128
|
+
decoder = GlobalDecoderRegistry.getDecoder(object.typeUrl);
|
|
129
|
+
if (!decoder) {
|
|
130
|
+
decoder = Any;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
data = object;
|
|
135
|
+
decoder = getDecoderByInstance(object);
|
|
136
|
+
}
|
|
137
|
+
return decoder.toAmino(data);
|
|
138
|
+
}
|
|
139
|
+
static toAminoMsg(object) {
|
|
140
|
+
let data;
|
|
141
|
+
let decoder;
|
|
142
|
+
if (Any.is(object)) {
|
|
143
|
+
data = GlobalDecoderRegistry.unwrapAny(object);
|
|
144
|
+
decoder = GlobalDecoderRegistry.getDecoder(object.typeUrl);
|
|
145
|
+
if (!decoder) {
|
|
146
|
+
decoder = Any;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
data = object;
|
|
151
|
+
decoder = getDecoderByInstance(object);
|
|
152
|
+
}
|
|
153
|
+
return decoder.toAminoMsg(data);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function getDecoderByInstance(obj) {
|
|
157
|
+
const decoder = GlobalDecoderRegistry.getDecoderByInstance(obj);
|
|
158
|
+
if (!decoder) {
|
|
159
|
+
throw new Error(`There's no decoder for the instance ${JSON.stringify(obj)}`);
|
|
160
|
+
}
|
|
161
|
+
return decoder;
|
|
162
|
+
}
|
|
163
|
+
GlobalDecoderRegistry.register(Any.typeUrl, Any);
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file and any referenced files were automatically generated by @ahm23/telescope@2.3.1
|
|
3
|
+
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
4
|
+
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
|
|
5
|
+
*/
|
|
6
|
+
import * as _m0 from "protobufjs/minimal";
|
|
7
|
+
import { Any } from "cosmjs-types/google/protobuf/any";
|
|
8
|
+
import { DeliverTxResponse } from "@interchainjs/types";
|
|
9
|
+
export type { DeliverTxResponse };
|
|
10
|
+
export type ProtoMsg = Omit<Any, "typeUrl"> & {
|
|
11
|
+
typeUrl: any;
|
|
12
|
+
};
|
|
13
|
+
export interface IAminoMsg<Amino> {
|
|
14
|
+
type: any;
|
|
15
|
+
value: Amino;
|
|
16
|
+
}
|
|
17
|
+
export interface IProtoType {
|
|
18
|
+
$typeUrl?: any;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A type generated by Telescope 1.0.
|
|
22
|
+
*/
|
|
23
|
+
export interface TelescopeGeneratedCodec<T = unknown, SDK = unknown, Amino = unknown> {
|
|
24
|
+
readonly typeUrl: string;
|
|
25
|
+
readonly aminoType?: string;
|
|
26
|
+
is?(o: unknown): o is T;
|
|
27
|
+
isSDK?(o: unknown): o is SDK;
|
|
28
|
+
isAmino?(o: unknown): o is Amino;
|
|
29
|
+
encode: (message: T, writer?: _m0.Writer | any) => _m0.Writer | any;
|
|
30
|
+
decode: (input: _m0.Reader | Uint8Array | any, length?: number) => T;
|
|
31
|
+
fromPartial: (object: any) => T | any;
|
|
32
|
+
fromJSON?: (object: any) => T | any;
|
|
33
|
+
toJSON?: (message: T | any) => any;
|
|
34
|
+
fromSDK?: (sdk: SDK) => T;
|
|
35
|
+
fromSDKJSON?: (object: any) => SDK;
|
|
36
|
+
toSDK?: (message: T) => SDK;
|
|
37
|
+
fromAmino?: (amino: Amino) => T;
|
|
38
|
+
toAmino?: (message: T) => Amino;
|
|
39
|
+
fromAminoMsg?: (aminoMsg: IAminoMsg<Amino>) => T;
|
|
40
|
+
toAminoMsg?: (message: T) => IAminoMsg<Amino>;
|
|
41
|
+
toProto?: (message: T) => Uint8Array;
|
|
42
|
+
fromProtoMsg?: (message: ProtoMsg) => T;
|
|
43
|
+
toProtoMsg?: (message: T) => Any;
|
|
44
|
+
registerTypeUrl?: () => void;
|
|
45
|
+
}
|
|
46
|
+
export type TelescopeGeneratedType<T = unknown, SDK = unknown, Amino = unknown> = TelescopeGeneratedCodec<T, SDK, Amino>;
|
|
47
|
+
export type GeneratedType = TelescopeGeneratedCodec;
|
|
48
|
+
/**
|
|
49
|
+
* Coin defines a token with a denomination and an amount.
|
|
50
|
+
*
|
|
51
|
+
* NOTE: The amount field is an Int which implements the custom method
|
|
52
|
+
* signatures required by gogoproto.
|
|
53
|
+
*/
|
|
54
|
+
interface Coin {
|
|
55
|
+
denom: string;
|
|
56
|
+
amount: string;
|
|
57
|
+
}
|
|
58
|
+
export type EncodeObject = Message<any>;
|
|
59
|
+
export interface Message<T> {
|
|
60
|
+
typeUrl: string;
|
|
61
|
+
value: T;
|
|
62
|
+
}
|
|
63
|
+
export interface StdFee {
|
|
64
|
+
amount: Coin[];
|
|
65
|
+
gas: string;
|
|
66
|
+
/** The granter address that is used for paying with feegrants */
|
|
67
|
+
granter?: string;
|
|
68
|
+
/** The fee payer address. The payer must have signed the transaction. */
|
|
69
|
+
payer?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface TxRpc {
|
|
72
|
+
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
73
|
+
signAndBroadcast?(signerAddress: string, messages: EncodeObject[], fee: StdFee | "auto" | number, memo: string): Promise<DeliverTxResponse>;
|
|
74
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//@ts-nocheck
|
|
3
|
+
/**
|
|
4
|
+
* This file and any referenced files were automatically generated by @ahm23/telescope@2.3.1
|
|
5
|
+
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
6
|
+
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
/**
|
|
3
|
+
* This file and any referenced files were automatically generated by @ahm23/telescope@2.3.1
|
|
4
|
+
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
5
|
+
* and run the transpile command or npm scripts command that is used to regenerate this bundle.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "atlas.js-protos",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Protobuf type definitions and message helpers for Atlas Protocol.",
|
|
5
|
+
"author": "Ahmed Moussa",
|
|
6
|
+
"homepage": "https://github.com/Atlas-DePIN/atlas.js-protos",
|
|
7
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.mjs",
|
|
10
|
+
"typings": "dist/index.d.ts",
|
|
11
|
+
"typesVersions": {
|
|
12
|
+
"*": {
|
|
13
|
+
"storage": [
|
|
14
|
+
"./dist/storage/index.d.ts"
|
|
15
|
+
],
|
|
16
|
+
"storage/tx": [
|
|
17
|
+
"./dist/storage/tx.d.ts"
|
|
18
|
+
],
|
|
19
|
+
"storage/query": [
|
|
20
|
+
"./dist/storage/query.d.ts"
|
|
21
|
+
],
|
|
22
|
+
"filetree": [
|
|
23
|
+
"./dist/filetree/index.d.ts"
|
|
24
|
+
],
|
|
25
|
+
"filetree/tx": [
|
|
26
|
+
"./dist/filetree/tx.d.ts"
|
|
27
|
+
],
|
|
28
|
+
"filetree/query": [
|
|
29
|
+
"./dist/filetree/query.d.ts"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"directories": {
|
|
34
|
+
"lib": "src"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist",
|
|
38
|
+
"!CHANGELOG.md"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build:cjs": "yarn tsc -p tsconfig.json --outDir dist --module commonjs || true",
|
|
42
|
+
"build:mjs": "yarn tsc -p tsconfig.json --outDir mjs --module es2022 --declaration false || true",
|
|
43
|
+
"clean:mjs": "rimraf mjs",
|
|
44
|
+
"clean:dist": "rimraf dist",
|
|
45
|
+
"clean": "npm run clean:mjs && npm run clean:dist",
|
|
46
|
+
"build:rename": "publish-scripts --cmd rename --srcDir mjs --outDir dist --findExt js --replaceExt mjs --no-rmDir",
|
|
47
|
+
"build": "npm run clean && npm run build:cjs && npm run build:mjs && npm run build:rename",
|
|
48
|
+
"codegen": "node scripts/codegen.js",
|
|
49
|
+
"prepare": "npm run build",
|
|
50
|
+
"lint": "eslint src --fix",
|
|
51
|
+
"test": "jest",
|
|
52
|
+
"test:watch": "jest --watch",
|
|
53
|
+
"test:debug": "node --inspect node_modules/.bin/jest --runInBand"
|
|
54
|
+
},
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"repository": {
|
|
59
|
+
"type": "git",
|
|
60
|
+
"url": "https://github.com/Atlas-DePIN/atlas.js-protos"
|
|
61
|
+
},
|
|
62
|
+
"keywords": [],
|
|
63
|
+
"bugs": {
|
|
64
|
+
"url": "https://github.com/Atlas-DePIN/atlas.js-protos/issues"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@types/jest": "^29.5.0",
|
|
68
|
+
"eslint": "8.45.0",
|
|
69
|
+
"eslint-config-prettier": "^8.8.0",
|
|
70
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
71
|
+
"jest": "^29.5.0",
|
|
72
|
+
"jest-in-case": "^1.0.2",
|
|
73
|
+
"prettier": "^2.8.7",
|
|
74
|
+
"publish-scripts": "0.1.0",
|
|
75
|
+
"rimraf": "^5.0.0",
|
|
76
|
+
"ts-jest": "^29.1.0",
|
|
77
|
+
"typescript": "^5.0.4"
|
|
78
|
+
},
|
|
79
|
+
"dependencies": {
|
|
80
|
+
"@ahm23/telescope": "^2.3.1",
|
|
81
|
+
"@ahm23/telescope-ast": "^2.3.1",
|
|
82
|
+
"@ahm23/telescope-lcd": "^0.17.1",
|
|
83
|
+
"@ahm23/telescope-proto-parser": "^2.2.2",
|
|
84
|
+
"@cosmjs/amino": "0.29.4",
|
|
85
|
+
"@cosmjs/proto-signing": "^0.38.1",
|
|
86
|
+
"@cosmjs/stargate": "^0.38.1",
|
|
87
|
+
"@cosmjs/tendermint-rpc": "^0.38.1",
|
|
88
|
+
"@improbable-eng/grpc-web": "^0.15.0",
|
|
89
|
+
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
|
90
|
+
"@interchainjs/cosmos": "^1.19.3",
|
|
91
|
+
"@interchainjs/types": "^1.19.1",
|
|
92
|
+
"browser-headers": "^0.4.1",
|
|
93
|
+
"cosmjs-types": "^0.11.0",
|
|
94
|
+
"long": "^5.3.2",
|
|
95
|
+
"protobufjs": "^8.0.0"
|
|
96
|
+
}
|
|
97
|
+
}
|