@dc3-network/x-org-types 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 +7 -0
- package/README.md +19 -0
- package/helpers.d.ts +81 -0
- package/helpers.js +133 -0
- package/helpers.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +3 -0
- package/index.js.map +1 -0
- package/module/v1/module.d.ts +33 -0
- package/module/v1/module.js +73 -0
- package/module/v1/module.js.map +1 -0
- package/package.json +35 -0
- package/v1/org.d.ts +72 -0
- package/v1/org.js +396 -0
- package/v1/org.js.map +1 -0
- package/v1/query.d.ts +65 -0
- package/v1/query.js +181 -0
- package/v1/query.js.map +1 -0
- package/v1/tx.d.ts +213 -0
- package/v1/tx.js +1014 -0
- package/v1/tx.js.map +1 -0
- package/v1/types.d.ts +73 -0
- package/v1/types.js +290 -0
- package/v1/types.js.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2024 DC3 Network
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @dc3-network/x-org-types
|
|
2
|
+
|
|
3
|
+
## Maintenance
|
|
4
|
+
|
|
5
|
+
This section is for maintainers of this repo, not users.
|
|
6
|
+
|
|
7
|
+
To generate the ts files, you must run the following command from the root of the repository:
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
mage proto:gen
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This will generate all protocol buffer code and swagger api documentation.
|
|
14
|
+
|
|
15
|
+
## LICENSE
|
|
16
|
+
|
|
17
|
+
The license for this code is provided in the `LICENSE` file in this directory **AND ONLY APPLIES** to the code in this directory and subdirectories of this directory that do not contain their own `LICENSE` file.
|
|
18
|
+
|
|
19
|
+
The `LICENSE` file in this directory does not apply to any other content in this repository except as specified above.
|
package/helpers.d.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file and any referenced files were automatically generated by @cosmology/telescope@1.0.7
|
|
3
|
+
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
4
|
+
* and run the transpile command or yarn proto command to regenerate this bundle.
|
|
5
|
+
*/
|
|
6
|
+
export declare function bytesFromBase64(b64: string): Uint8Array;
|
|
7
|
+
export declare function base64FromBytes(arr: Uint8Array): string;
|
|
8
|
+
export interface AminoHeight {
|
|
9
|
+
readonly revision_number?: string;
|
|
10
|
+
readonly revision_height?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function omitDefault<T extends string | number | bigint>(input: T): T | undefined;
|
|
13
|
+
interface Duration {
|
|
14
|
+
/**
|
|
15
|
+
* Signed seconds of the span of time. Must be from -315,576,000,000
|
|
16
|
+
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
|
17
|
+
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
|
18
|
+
*/
|
|
19
|
+
seconds: bigint;
|
|
20
|
+
/**
|
|
21
|
+
* Signed fractions of a second at nanosecond resolution of the span
|
|
22
|
+
* of time. Durations less than one second are represented with a 0
|
|
23
|
+
* `seconds` field and a positive or negative `nanos` field. For durations
|
|
24
|
+
* of one second or more, a non-zero value for the `nanos` field must be
|
|
25
|
+
* of the same sign as the `seconds` field. Must be from -999,999,999
|
|
26
|
+
* to +999,999,999 inclusive.
|
|
27
|
+
*/
|
|
28
|
+
nanos: number;
|
|
29
|
+
}
|
|
30
|
+
export declare function toDuration(duration: string): Duration;
|
|
31
|
+
export declare function fromDuration(duration: Duration): string;
|
|
32
|
+
export declare function isSet(value: any): boolean;
|
|
33
|
+
export declare function isObject(value: any): boolean;
|
|
34
|
+
export interface PageRequest {
|
|
35
|
+
key: Uint8Array;
|
|
36
|
+
offset: bigint;
|
|
37
|
+
limit: bigint;
|
|
38
|
+
countTotal: boolean;
|
|
39
|
+
reverse: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface PageRequestParams {
|
|
42
|
+
"pagination.key"?: string;
|
|
43
|
+
"pagination.offset"?: string;
|
|
44
|
+
"pagination.limit"?: string;
|
|
45
|
+
"pagination.count_total"?: boolean;
|
|
46
|
+
"pagination.reverse"?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface Params {
|
|
49
|
+
params: PageRequestParams;
|
|
50
|
+
}
|
|
51
|
+
export declare const setPaginationParams: (options: Params, pagination?: PageRequest) => Params;
|
|
52
|
+
type Builtin = Date | Function | Uint8Array | string | number | bigint | boolean | undefined;
|
|
53
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
54
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
55
|
+
} : Partial<T>;
|
|
56
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
57
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
58
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
59
|
+
} & Record<Exclude<keyof I, KeysOfUnion<P>>, never>;
|
|
60
|
+
export interface Rpc {
|
|
61
|
+
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
62
|
+
}
|
|
63
|
+
interface Timestamp {
|
|
64
|
+
/**
|
|
65
|
+
* Represents seconds of UTC time since Unix epoch
|
|
66
|
+
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
|
67
|
+
* 9999-12-31T23:59:59Z inclusive.
|
|
68
|
+
*/
|
|
69
|
+
seconds: bigint;
|
|
70
|
+
/**
|
|
71
|
+
* Non-negative fractions of a second at nanosecond resolution. Negative
|
|
72
|
+
* second values with fractions must still have non-negative nanos values
|
|
73
|
+
* that count forward in time. Must be from 0 to 999,999,999
|
|
74
|
+
* inclusive.
|
|
75
|
+
*/
|
|
76
|
+
nanos: number;
|
|
77
|
+
}
|
|
78
|
+
export declare function toTimestamp(date: Date): Timestamp;
|
|
79
|
+
export declare function fromTimestamp(t: Timestamp): Date;
|
|
80
|
+
export declare function fromJsonTimestamp(o: any): Timestamp;
|
|
81
|
+
export {};
|
package/helpers.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* This file and any referenced files were automatically generated by @cosmology/telescope@1.0.7
|
|
5
|
+
* DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
|
|
6
|
+
* and run the transpile command or yarn proto command to regenerate this bundle.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.setPaginationParams = void 0;
|
|
10
|
+
exports.bytesFromBase64 = bytesFromBase64;
|
|
11
|
+
exports.base64FromBytes = base64FromBytes;
|
|
12
|
+
exports.omitDefault = omitDefault;
|
|
13
|
+
exports.toDuration = toDuration;
|
|
14
|
+
exports.fromDuration = fromDuration;
|
|
15
|
+
exports.isSet = isSet;
|
|
16
|
+
exports.isObject = isObject;
|
|
17
|
+
exports.toTimestamp = toTimestamp;
|
|
18
|
+
exports.fromTimestamp = fromTimestamp;
|
|
19
|
+
exports.fromJsonTimestamp = fromJsonTimestamp;
|
|
20
|
+
var globalThis = (() => {
|
|
21
|
+
if (typeof globalThis !== "undefined")
|
|
22
|
+
return globalThis;
|
|
23
|
+
if (typeof self !== "undefined")
|
|
24
|
+
return self;
|
|
25
|
+
if (typeof window !== "undefined")
|
|
26
|
+
return window;
|
|
27
|
+
if (typeof global !== "undefined")
|
|
28
|
+
return global;
|
|
29
|
+
throw "Unable to locate global object";
|
|
30
|
+
})();
|
|
31
|
+
const atob = globalThis.atob || ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary"));
|
|
32
|
+
function bytesFromBase64(b64) {
|
|
33
|
+
const bin = atob(b64);
|
|
34
|
+
const arr = new Uint8Array(bin.length);
|
|
35
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
36
|
+
arr[i] = bin.charCodeAt(i);
|
|
37
|
+
}
|
|
38
|
+
return arr;
|
|
39
|
+
}
|
|
40
|
+
const btoa = globalThis.btoa || ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64"));
|
|
41
|
+
function base64FromBytes(arr) {
|
|
42
|
+
const bin = [];
|
|
43
|
+
arr.forEach((byte) => {
|
|
44
|
+
bin.push(String.fromCharCode(byte));
|
|
45
|
+
});
|
|
46
|
+
return btoa(bin.join(""));
|
|
47
|
+
}
|
|
48
|
+
function omitDefault(input) {
|
|
49
|
+
if (typeof input === "string") {
|
|
50
|
+
return input === "" ? undefined : input;
|
|
51
|
+
}
|
|
52
|
+
if (typeof input === "number") {
|
|
53
|
+
return input === 0 ? undefined : input;
|
|
54
|
+
}
|
|
55
|
+
if (typeof input === "bigint") {
|
|
56
|
+
return input === BigInt(0) ? undefined : input;
|
|
57
|
+
}
|
|
58
|
+
throw new Error(`Got unsupported type ${typeof input}`);
|
|
59
|
+
}
|
|
60
|
+
function toDuration(duration) {
|
|
61
|
+
return {
|
|
62
|
+
seconds: BigInt(Math.floor(parseInt(duration) / 1000000000)),
|
|
63
|
+
nanos: parseInt(duration) % 1000000000,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function fromDuration(duration) {
|
|
67
|
+
return (parseInt(duration.seconds.toString()) * 1000000000 + duration.nanos).toString();
|
|
68
|
+
}
|
|
69
|
+
function isSet(value) {
|
|
70
|
+
return value !== null && value !== undefined;
|
|
71
|
+
}
|
|
72
|
+
function isObject(value) {
|
|
73
|
+
return typeof value === "object" && value !== null;
|
|
74
|
+
}
|
|
75
|
+
const setPaginationParams = (options, pagination) => {
|
|
76
|
+
if (!pagination) {
|
|
77
|
+
return options;
|
|
78
|
+
}
|
|
79
|
+
if (typeof pagination?.countTotal !== "undefined") {
|
|
80
|
+
options.params["pagination.count_total"] = pagination.countTotal;
|
|
81
|
+
}
|
|
82
|
+
if (typeof pagination?.key !== "undefined") {
|
|
83
|
+
// String to Uint8Array
|
|
84
|
+
// let uint8arr = new Uint8Array(Buffer.from(data,'base64'));
|
|
85
|
+
// Uint8Array to String
|
|
86
|
+
options.params["pagination.key"] = Buffer.from(pagination.key).toString("base64");
|
|
87
|
+
}
|
|
88
|
+
if (typeof pagination?.limit !== "undefined") {
|
|
89
|
+
options.params["pagination.limit"] = pagination.limit.toString();
|
|
90
|
+
}
|
|
91
|
+
if (typeof pagination?.offset !== "undefined") {
|
|
92
|
+
options.params["pagination.offset"] = pagination.offset.toString();
|
|
93
|
+
}
|
|
94
|
+
if (typeof pagination?.reverse !== "undefined") {
|
|
95
|
+
options.params["pagination.reverse"] = pagination.reverse;
|
|
96
|
+
}
|
|
97
|
+
return options;
|
|
98
|
+
};
|
|
99
|
+
exports.setPaginationParams = setPaginationParams;
|
|
100
|
+
function toTimestamp(date) {
|
|
101
|
+
const seconds = numberToLong(date.getTime() / 1000);
|
|
102
|
+
const nanos = (date.getTime() % 1000) * 1000000;
|
|
103
|
+
return {
|
|
104
|
+
seconds,
|
|
105
|
+
nanos,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function fromTimestamp(t) {
|
|
109
|
+
let millis = Number(t.seconds) * 1000;
|
|
110
|
+
millis += t.nanos / 1000000;
|
|
111
|
+
return new Date(millis);
|
|
112
|
+
}
|
|
113
|
+
const timestampFromJSON = (object) => {
|
|
114
|
+
return {
|
|
115
|
+
seconds: isSet(object.seconds) ? BigInt(object.seconds.toString()) : BigInt(0),
|
|
116
|
+
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
function fromJsonTimestamp(o) {
|
|
120
|
+
if (o instanceof Date) {
|
|
121
|
+
return toTimestamp(o);
|
|
122
|
+
}
|
|
123
|
+
else if (typeof o === "string") {
|
|
124
|
+
return toTimestamp(new Date(o));
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
return timestampFromJSON(o);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function numberToLong(number) {
|
|
131
|
+
return BigInt(Math.trunc(number));
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=helpers.js.map
|
package/helpers.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";AAAA,oBAAoB;AACpB;;;;GAIG;;;AAgBH,0CAOC;AAKD,0CAMC;AAOD,kCAcC;AAqBD,gCAKC;AAED,oCAEC;AAED,sBAEC;AAED,4BAEC;AAwFD,kCAOC;AAED,sCAIC;AASD,8CAQC;AA9MD,IAAI,UAAU,GAAQ,CAAC,GAAG,EAAE;IACxB,IAAI,OAAO,UAAU,KAAK,WAAW;QAAE,OAAO,UAAU,CAAC;IACzD,IAAI,OAAO,IAAI,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAC7C,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO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package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Long from "long";
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
export declare const protobufPackage = "dc3.chain.org.module.v1";
|
|
4
|
+
/**
|
|
5
|
+
* Module is the app config object of the module.
|
|
6
|
+
* Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
|
7
|
+
*/
|
|
8
|
+
export interface Module {
|
|
9
|
+
/**
|
|
10
|
+
* authority defines the custom module authority.
|
|
11
|
+
* if not set, defaults to the governance module.
|
|
12
|
+
*/
|
|
13
|
+
authority: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const Module: {
|
|
16
|
+
encode(message: Module, writer?: _m0.Writer): _m0.Writer;
|
|
17
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Module;
|
|
18
|
+
fromJSON(object: any): Module;
|
|
19
|
+
toJSON(message: Module): unknown;
|
|
20
|
+
create<I extends Exact<DeepPartial<Module>, I>>(base?: I): Module;
|
|
21
|
+
fromPartial<I extends Exact<DeepPartial<Module>, I>>(object: I): Module;
|
|
22
|
+
};
|
|
23
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
24
|
+
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 {} ? {
|
|
25
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
26
|
+
} : Partial<T>;
|
|
27
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
28
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
29
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
30
|
+
} & {
|
|
31
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v1.178.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: dc3/chain/org/module/v1/module.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.Module = exports.protobufPackage = void 0;
|
|
12
|
+
/* eslint-disable */
|
|
13
|
+
const long_1 = __importDefault(require("long"));
|
|
14
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
15
|
+
exports.protobufPackage = "dc3.chain.org.module.v1";
|
|
16
|
+
function createBaseModule() {
|
|
17
|
+
return { authority: "" };
|
|
18
|
+
}
|
|
19
|
+
exports.Module = {
|
|
20
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
21
|
+
if (message.authority !== "") {
|
|
22
|
+
writer.uint32(10).string(message.authority);
|
|
23
|
+
}
|
|
24
|
+
return writer;
|
|
25
|
+
},
|
|
26
|
+
decode(input, length) {
|
|
27
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
28
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
29
|
+
const message = createBaseModule();
|
|
30
|
+
while (reader.pos < end) {
|
|
31
|
+
const tag = reader.uint32();
|
|
32
|
+
switch (tag >>> 3) {
|
|
33
|
+
case 1:
|
|
34
|
+
if (tag !== 10) {
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
message.authority = reader.string();
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
reader.skipType(tag & 7);
|
|
44
|
+
}
|
|
45
|
+
return message;
|
|
46
|
+
},
|
|
47
|
+
fromJSON(object) {
|
|
48
|
+
return { authority: isSet(object.authority) ? globalThis.String(object.authority) : "" };
|
|
49
|
+
},
|
|
50
|
+
toJSON(message) {
|
|
51
|
+
const obj = {};
|
|
52
|
+
if (message.authority !== "") {
|
|
53
|
+
obj.authority = message.authority;
|
|
54
|
+
}
|
|
55
|
+
return obj;
|
|
56
|
+
},
|
|
57
|
+
create(base) {
|
|
58
|
+
return exports.Module.fromPartial(base ?? {});
|
|
59
|
+
},
|
|
60
|
+
fromPartial(object) {
|
|
61
|
+
const message = createBaseModule();
|
|
62
|
+
message.authority = object.authority ?? "";
|
|
63
|
+
return message;
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
if (minimal_1.default.util.Long !== long_1.default) {
|
|
67
|
+
minimal_1.default.util.Long = long_1.default;
|
|
68
|
+
minimal_1.default.configure();
|
|
69
|
+
}
|
|
70
|
+
function isSet(value) {
|
|
71
|
+
return value !== null && value !== undefined;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../../src/gen/dc3/chain/org/module/v1/module.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,YAAY;AACZ,kCAAkC;AAClC,iCAAiC;AACjC,+CAA+C;;;;;;AAE/C,oBAAoB;AACpB,gDAAwB;AACxB,iEAAqC;AAExB,QAAA,eAAe,GAAG,yBAAyB,CAAC;AAczD,SAAS,gBAAgB;IACvB,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;AAC3B,CAAC;AAEY,QAAA,MAAM,GAAG;IACpB,MAAM,CAAC,OAAe,EAAE,SAAqB,iBAAG,CAAC,MAAM,CAAC,MAAM,EAAE;QAC9D,IAAI,OAAO,CAAC,SAAS,KAAK,EAA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C,CAAC,EAAE,EAAE,CAAC;IAC3F,CAAC;IAED,MAAM,CAAC,OAAe;QACpB,MAAM,GAAG,GAAQ,EAAE,CAAC;QACpB,IAAI,OAAO,CAAC,SAAS,KAAK,EAAE,EAAE,CAAC;YAC7B,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,CAA0C,IAAQ;QACtD,OAAO,cAAM,CAAC,WAAW,CAAC,IAAI,IAAK,EAAU,CAAC,CAAC;IACjD,CAAC;IACD,WAAW,CAA0C,MAAS;QAC5D,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;QACnC,OAAO,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC;QAC3C,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAC;AAcF,IAAI,iBAAG,CAAC,IAAI,CAAC,IAAI,KAAK,cAAI,EAAE,CAAC;IAC3B,iBAAG,CAAC,IAAI,CAAC,IAAI,GAAG,cAAW,CAAC;IAC5B,iBAAG,CAAC,SAAS,EAAE,CAAC;AAClB,CAAC;AAED,SAAS,KAAK,CAAC,KAAU;IACvB,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dc3-network/x-org-types",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "JS and TS Protocol Buffer client library and types for the DC3 Network org module",
|
|
5
|
+
"files": [
|
|
6
|
+
"module/",
|
|
7
|
+
"v1",
|
|
8
|
+
"/helpers.*",
|
|
9
|
+
"/index.*",
|
|
10
|
+
"*.md"
|
|
11
|
+
],
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"prepare-publishing": "./scripts/prepare-publishing.sh",
|
|
17
|
+
"build": "rm -rf ./build && tsc && npm run prepare-publishing",
|
|
18
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/dc3-network/x-org"
|
|
23
|
+
},
|
|
24
|
+
"contributors": [
|
|
25
|
+
"Craig Thayer <cthayer@users.noreply.github.com>"
|
|
26
|
+
],
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"long": "^5.2.3",
|
|
30
|
+
"protobufjs": "^7.3.2"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"typescript": "^5.5.3"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/v1/org.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import Long from "long";
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { Coin } from "../../../../cosmos/base/v1beta1/coin";
|
|
4
|
+
export declare const protobufPackage = "dc3.chain.org.v1";
|
|
5
|
+
export interface Organization {
|
|
6
|
+
id: string;
|
|
7
|
+
parentId: string;
|
|
8
|
+
name: string;
|
|
9
|
+
owners: string[];
|
|
10
|
+
members: string[];
|
|
11
|
+
memberRoles: MemberRole[];
|
|
12
|
+
coins: Coin[];
|
|
13
|
+
withdrawAddress: string;
|
|
14
|
+
}
|
|
15
|
+
export interface MemberRole {
|
|
16
|
+
name: string;
|
|
17
|
+
members: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface AccountOrgMap {
|
|
20
|
+
account: string;
|
|
21
|
+
/** orgs<orgId,isOwner> */
|
|
22
|
+
orgs: {
|
|
23
|
+
[key: string]: boolean;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface AccountOrgMap_OrgsEntry {
|
|
27
|
+
key: string;
|
|
28
|
+
value: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare const Organization: {
|
|
31
|
+
encode(message: Organization, writer?: _m0.Writer): _m0.Writer;
|
|
32
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Organization;
|
|
33
|
+
fromJSON(object: any): Organization;
|
|
34
|
+
toJSON(message: Organization): unknown;
|
|
35
|
+
create<I extends Exact<DeepPartial<Organization>, I>>(base?: I): Organization;
|
|
36
|
+
fromPartial<I extends Exact<DeepPartial<Organization>, I>>(object: I): Organization;
|
|
37
|
+
};
|
|
38
|
+
export declare const MemberRole: {
|
|
39
|
+
encode(message: MemberRole, writer?: _m0.Writer): _m0.Writer;
|
|
40
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MemberRole;
|
|
41
|
+
fromJSON(object: any): MemberRole;
|
|
42
|
+
toJSON(message: MemberRole): unknown;
|
|
43
|
+
create<I extends Exact<DeepPartial<MemberRole>, I>>(base?: I): MemberRole;
|
|
44
|
+
fromPartial<I extends Exact<DeepPartial<MemberRole>, I>>(object: I): MemberRole;
|
|
45
|
+
};
|
|
46
|
+
export declare const AccountOrgMap: {
|
|
47
|
+
encode(message: AccountOrgMap, writer?: _m0.Writer): _m0.Writer;
|
|
48
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AccountOrgMap;
|
|
49
|
+
fromJSON(object: any): AccountOrgMap;
|
|
50
|
+
toJSON(message: AccountOrgMap): unknown;
|
|
51
|
+
create<I extends Exact<DeepPartial<AccountOrgMap>, I>>(base?: I): AccountOrgMap;
|
|
52
|
+
fromPartial<I extends Exact<DeepPartial<AccountOrgMap>, I>>(object: I): AccountOrgMap;
|
|
53
|
+
};
|
|
54
|
+
export declare const AccountOrgMap_OrgsEntry: {
|
|
55
|
+
encode(message: AccountOrgMap_OrgsEntry, writer?: _m0.Writer): _m0.Writer;
|
|
56
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AccountOrgMap_OrgsEntry;
|
|
57
|
+
fromJSON(object: any): AccountOrgMap_OrgsEntry;
|
|
58
|
+
toJSON(message: AccountOrgMap_OrgsEntry): unknown;
|
|
59
|
+
create<I extends Exact<DeepPartial<AccountOrgMap_OrgsEntry>, I>>(base?: I): AccountOrgMap_OrgsEntry;
|
|
60
|
+
fromPartial<I extends Exact<DeepPartial<AccountOrgMap_OrgsEntry>, I>>(object: I): AccountOrgMap_OrgsEntry;
|
|
61
|
+
};
|
|
62
|
+
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 globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
64
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
65
|
+
} : Partial<T>;
|
|
66
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
67
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
68
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
69
|
+
} & {
|
|
70
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
71
|
+
};
|
|
72
|
+
export {};
|