@notifi-network/fusion-sdk 0.0.1-canary10

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.
Files changed (30) hide show
  1. package/LICENSE +21 -0
  2. package/dist/fusion_wrappers/blockchain_proxies.d.ts +24 -0
  3. package/dist/fusion_wrappers/blockchain_proxies.js +131 -0
  4. package/dist/fusion_wrappers/fetch_proxy.d.ts +9 -0
  5. package/dist/fusion_wrappers/fetch_proxy.js +31 -0
  6. package/dist/index.d.ts +5 -0
  7. package/dist/index.js +7 -0
  8. package/dist/protos_gen/google/protobuf/duration.d.ts +99 -0
  9. package/dist/protos_gen/google/protobuf/duration.js +89 -0
  10. package/dist/protos_gen/google/protobuf/empty.d.ts +33 -0
  11. package/dist/protos_gen/google/protobuf/empty.js +45 -0
  12. package/dist/protos_gen/google/protobuf/struct.d.ts +107 -0
  13. package/dist/protos_gen/google/protobuf/struct.js +451 -0
  14. package/dist/protos_gen/google/protobuf/timestamp.d.ts +128 -0
  15. package/dist/protos_gen/google/protobuf/timestamp.js +89 -0
  16. package/dist/protos_gen/google/protobuf/wrappers.d.ts +138 -0
  17. package/dist/protos_gen/google/protobuf/wrappers.js +505 -0
  18. package/dist/protos_gen/notifi/common/v1/types.d.ts +752 -0
  19. package/dist/protos_gen/notifi/common/v1/types.js +7300 -0
  20. package/dist/protos_gen/services/blockchain_manager/v1/blockchain_manager.d.ts +587 -0
  21. package/dist/protos_gen/services/blockchain_manager/v1/blockchain_manager.js +3482 -0
  22. package/dist/protos_gen/services/fetch_proxy/v1/fetch_proxy.d.ts +87 -0
  23. package/dist/protos_gen/services/fetch_proxy/v1/fetch_proxy.js +427 -0
  24. package/dist/protos_gen/services/scheduler/v1/scheduler.d.ts +398 -0
  25. package/dist/protos_gen/services/scheduler/v1/scheduler.js +2175 -0
  26. package/dist/protos_gen/services/storage_manager/v1/storage_manager.d.ts +342 -0
  27. package/dist/protos_gen/services/storage_manager/v1/storage_manager.js +1953 -0
  28. package/dist/protos_gen/services/subscription_manager/v1/subscription_manager.d.ts +62 -0
  29. package/dist/protos_gen/services/subscription_manager/v1/subscription_manager.js +233 -0
  30. package/package.json +48 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Notifi Network
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,24 @@
1
+ import { EthCallRequest, EthCallResponse, GetAccountBalanceRequest, GetAccountBalanceResponse, BcmGetSuiAccountBalanceRequest, BcmGetSuiAccountBalanceResponse, BcmRunSuiTransactionCallRequest, BcmRunSuiTransactionCallResponse, BcmGetSuiObjectRequest, BcmGetSuiObjectResponse, BcmGetSolanaBalanceRequest, BcmGetSolanaBalanceResponse, BcmGetSolanaAccountInfoRequest, BcmGetSolanaAccountInfoResponse, BcmGetSolanaSlotRequest, BcmGetSolanaSlotResponse } from "../protos_gen/services/blockchain_manager/v1/blockchain_manager.js";
2
+ export declare class FusionEvmRpcWrapper {
3
+ private client;
4
+ private contextId;
5
+ constructor(contextId: string);
6
+ runEthCall(request: EthCallRequest): Promise<EthCallResponse>;
7
+ getAccountBalance(request: GetAccountBalanceRequest): Promise<GetAccountBalanceResponse>;
8
+ }
9
+ export declare class FusionSuiRpcWrapper {
10
+ private client;
11
+ private contextId;
12
+ constructor(contextId: string);
13
+ getSuiAccountBalance(request: BcmGetSuiAccountBalanceRequest): Promise<BcmGetSuiAccountBalanceResponse>;
14
+ runSuiTransaction(request: BcmRunSuiTransactionCallRequest): Promise<BcmRunSuiTransactionCallResponse>;
15
+ getSuiObject(request: BcmGetSuiObjectRequest): Promise<BcmGetSuiObjectResponse>;
16
+ }
17
+ export declare class FusionSolanaRpcWrapper {
18
+ private client;
19
+ private contextId;
20
+ constructor(contextId: string);
21
+ getSolanaBalance(request: BcmGetSolanaBalanceRequest): Promise<BcmGetSolanaBalanceResponse>;
22
+ getSolanaAccountInfo(request: BcmGetSolanaAccountInfoRequest): Promise<BcmGetSolanaAccountInfoResponse>;
23
+ getSolanaSlot(request: BcmGetSolanaSlotRequest): Promise<BcmGetSolanaSlotResponse>;
24
+ }
@@ -0,0 +1,131 @@
1
+ import { FusionEvmRpcClient, FusionSuiRpcClient, FusionSolanaRpcClient } from "../protos_gen/services/blockchain_manager/v1/blockchain_manager.js";
2
+ import { Metadata, credentials } from "@grpc/grpc-js";
3
+ const DEFAULT_ADDRESS = process.env.BLOCKCHAIN_MANAGER_ADDRESS || "localhost:50051";
4
+ export class FusionEvmRpcWrapper {
5
+ client;
6
+ contextId;
7
+ constructor(contextId) {
8
+ this.contextId = contextId;
9
+ this.client = new FusionEvmRpcClient(DEFAULT_ADDRESS, credentials.createInsecure());
10
+ }
11
+ async runEthCall(request) {
12
+ request.contextId = this.contextId;
13
+ return new Promise((resolve, reject) => {
14
+ this.client.runEthCall(request, new Metadata(), (error, response) => {
15
+ if (error) {
16
+ reject(error);
17
+ }
18
+ else {
19
+ resolve(response);
20
+ }
21
+ });
22
+ });
23
+ }
24
+ async getAccountBalance(request) {
25
+ request.contextId = this.contextId;
26
+ return new Promise((resolve, reject) => {
27
+ this.client.getAccountBalance(request, new Metadata(), (error, response) => {
28
+ if (error) {
29
+ reject(error);
30
+ }
31
+ else {
32
+ resolve(response);
33
+ }
34
+ });
35
+ });
36
+ }
37
+ }
38
+ export class FusionSuiRpcWrapper {
39
+ client;
40
+ contextId;
41
+ constructor(contextId) {
42
+ this.contextId = contextId;
43
+ this.client = new FusionSuiRpcClient(DEFAULT_ADDRESS, credentials.createInsecure());
44
+ }
45
+ async getSuiAccountBalance(request) {
46
+ request.contextId = this.contextId;
47
+ return new Promise((resolve, reject) => {
48
+ this.client.getSuiAccountBalance(request, new Metadata(), (error, response) => {
49
+ if (error) {
50
+ reject(error);
51
+ }
52
+ else {
53
+ resolve(response);
54
+ }
55
+ });
56
+ });
57
+ }
58
+ async runSuiTransaction(request) {
59
+ request.contextId = this.contextId;
60
+ return new Promise((resolve, reject) => {
61
+ this.client.runSuiTransaction(request, new Metadata(), (error, response) => {
62
+ if (error) {
63
+ reject(error);
64
+ }
65
+ else {
66
+ resolve(response);
67
+ }
68
+ });
69
+ });
70
+ }
71
+ async getSuiObject(request) {
72
+ request.contextId = this.contextId;
73
+ return new Promise((resolve, reject) => {
74
+ this.client.getSuiObject(request, new Metadata(), (error, response) => {
75
+ if (error) {
76
+ reject(error);
77
+ }
78
+ else {
79
+ resolve(response);
80
+ }
81
+ });
82
+ });
83
+ }
84
+ }
85
+ export class FusionSolanaRpcWrapper {
86
+ client;
87
+ contextId;
88
+ constructor(contextId) {
89
+ this.contextId = contextId;
90
+ this.client = new FusionSolanaRpcClient(DEFAULT_ADDRESS, credentials.createInsecure());
91
+ }
92
+ async getSolanaBalance(request) {
93
+ request.contextId = this.contextId;
94
+ return new Promise((resolve, reject) => {
95
+ this.client.getSolanaBalance(request, new Metadata(), (error, response) => {
96
+ if (error) {
97
+ reject(error);
98
+ }
99
+ else {
100
+ resolve(response);
101
+ }
102
+ });
103
+ });
104
+ }
105
+ async getSolanaAccountInfo(request) {
106
+ request.contextId = this.contextId;
107
+ return new Promise((resolve, reject) => {
108
+ this.client.getSolanaAccountInfo(request, new Metadata(), (error, response) => {
109
+ if (error) {
110
+ reject(error);
111
+ }
112
+ else {
113
+ resolve(response);
114
+ }
115
+ });
116
+ });
117
+ }
118
+ async getSolanaSlot(request) {
119
+ request.contextId = this.contextId;
120
+ return new Promise((resolve, reject) => {
121
+ this.client.getSolanaSlot(request, new Metadata(), (error, response) => {
122
+ if (error) {
123
+ reject(error);
124
+ }
125
+ else {
126
+ resolve(response);
127
+ }
128
+ });
129
+ });
130
+ }
131
+ }
@@ -0,0 +1,9 @@
1
+ import { FetchResponse, HttpMethod, Region } from "../protos_gen/services/fetch_proxy/v1/fetch_proxy.js";
2
+ export declare class FetchProxyWrapper {
3
+ private client;
4
+ private contextId;
5
+ constructor(contextId: string);
6
+ fetch(url: string, headers: {
7
+ [key: string]: string;
8
+ }, httpMethod: HttpMethod, bodyJson?: Uint8Array, region?: Region): Promise<FetchResponse>;
9
+ }
@@ -0,0 +1,31 @@
1
+ import { FusionFetchProxyClient } from "../protos_gen/services/fetch_proxy/v1/fetch_proxy.js";
2
+ import { Metadata, credentials } from "@grpc/grpc-js";
3
+ export class FetchProxyWrapper {
4
+ client;
5
+ contextId;
6
+ constructor(contextId) {
7
+ this.contextId = contextId;
8
+ const address = process.env.FUSION_FETCH_PROXY_ADDRESS || "localhost:50051";
9
+ this.client = new FusionFetchProxyClient(address, credentials.createInsecure());
10
+ }
11
+ async fetch(url, headers, httpMethod, bodyJson, region) {
12
+ const request = {
13
+ url,
14
+ headers,
15
+ httpMethod,
16
+ bodyJson,
17
+ region,
18
+ contextId: this.contextId,
19
+ };
20
+ return new Promise((resolve, reject) => {
21
+ this.client.fetch(request, new Metadata(), (error, response) => {
22
+ if (error) {
23
+ reject(error);
24
+ }
25
+ else {
26
+ resolve(response);
27
+ }
28
+ });
29
+ });
30
+ }
31
+ }
@@ -0,0 +1,5 @@
1
+ export declare function test(arg: string): void;
2
+ export { FetchProxyWrapper as FetchProxy } from './fusion_wrappers/fetch_proxy.js';
3
+ export { FusionEvmRpcWrapper as EvmRpc } from './fusion_wrappers/blockchain_proxies.js';
4
+ export { FusionSuiRpcWrapper as SuiRpc } from './fusion_wrappers/blockchain_proxies.js';
5
+ export { FusionSolanaRpcWrapper as SolanaRpc } from './fusion_wrappers/blockchain_proxies.js';
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export function test(arg) {
2
+ console.log(arg);
3
+ }
4
+ export { FetchProxyWrapper as FetchProxy } from './fusion_wrappers/fetch_proxy.js';
5
+ export { FusionEvmRpcWrapper as EvmRpc } from './fusion_wrappers/blockchain_proxies.js';
6
+ export { FusionSuiRpcWrapper as SuiRpc } from './fusion_wrappers/blockchain_proxies.js';
7
+ export { FusionSolanaRpcWrapper as SolanaRpc } from './fusion_wrappers/blockchain_proxies.js';
@@ -0,0 +1,99 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "google.protobuf";
3
+ /**
4
+ * A Duration represents a signed, fixed-length span of time represented
5
+ * as a count of seconds and fractions of seconds at nanosecond
6
+ * resolution. It is independent of any calendar and concepts like "day"
7
+ * or "month". It is related to Timestamp in that the difference between
8
+ * two Timestamp values is a Duration and it can be added or subtracted
9
+ * from a Timestamp. Range is approximately +-10,000 years.
10
+ *
11
+ * # Examples
12
+ *
13
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
14
+ *
15
+ * Timestamp start = ...;
16
+ * Timestamp end = ...;
17
+ * Duration duration = ...;
18
+ *
19
+ * duration.seconds = end.seconds - start.seconds;
20
+ * duration.nanos = end.nanos - start.nanos;
21
+ *
22
+ * if (duration.seconds < 0 && duration.nanos > 0) {
23
+ * duration.seconds += 1;
24
+ * duration.nanos -= 1000000000;
25
+ * } else if (duration.seconds > 0 && duration.nanos < 0) {
26
+ * duration.seconds -= 1;
27
+ * duration.nanos += 1000000000;
28
+ * }
29
+ *
30
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
31
+ *
32
+ * Timestamp start = ...;
33
+ * Duration duration = ...;
34
+ * Timestamp end = ...;
35
+ *
36
+ * end.seconds = start.seconds + duration.seconds;
37
+ * end.nanos = start.nanos + duration.nanos;
38
+ *
39
+ * if (end.nanos < 0) {
40
+ * end.seconds -= 1;
41
+ * end.nanos += 1000000000;
42
+ * } else if (end.nanos >= 1000000000) {
43
+ * end.seconds += 1;
44
+ * end.nanos -= 1000000000;
45
+ * }
46
+ *
47
+ * Example 3: Compute Duration from datetime.timedelta in Python.
48
+ *
49
+ * td = datetime.timedelta(days=3, minutes=10)
50
+ * duration = Duration()
51
+ * duration.FromTimedelta(td)
52
+ *
53
+ * # JSON Mapping
54
+ *
55
+ * In JSON format, the Duration type is encoded as a string rather than an
56
+ * object, where the string ends in the suffix "s" (indicating seconds) and
57
+ * is preceded by the number of seconds, with nanoseconds expressed as
58
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
59
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
60
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
61
+ * microsecond should be expressed in JSON format as "3.000001s".
62
+ */
63
+ export interface Duration {
64
+ /**
65
+ * Signed seconds of the span of time. Must be from -315,576,000,000
66
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
67
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
68
+ */
69
+ seconds: number;
70
+ /**
71
+ * Signed fractions of a second at nanosecond resolution of the span
72
+ * of time. Durations less than one second are represented with a 0
73
+ * `seconds` field and a positive or negative `nanos` field. For durations
74
+ * of one second or more, a non-zero value for the `nanos` field must be
75
+ * of the same sign as the `seconds` field. Must be from -999,999,999
76
+ * to +999,999,999 inclusive.
77
+ */
78
+ nanos: number;
79
+ }
80
+ export declare const Duration: MessageFns<Duration>;
81
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
82
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
83
+ [K in keyof T]?: DeepPartial<T[K]>;
84
+ } : Partial<T>;
85
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
86
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
87
+ [K in keyof P]: Exact<P[K], I[K]>;
88
+ } & {
89
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
90
+ };
91
+ export interface MessageFns<T> {
92
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
93
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
94
+ fromJSON(object: any): T;
95
+ toJSON(message: T): unknown;
96
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
97
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
98
+ }
99
+ export {};
@@ -0,0 +1,89 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.7.0
4
+ // protoc unknown
5
+ // source: google/protobuf/duration.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ export const protobufPackage = "google.protobuf";
9
+ function createBaseDuration() {
10
+ return { seconds: 0, nanos: 0 };
11
+ }
12
+ export const Duration = {
13
+ encode(message, writer = new BinaryWriter()) {
14
+ if (message.seconds !== 0) {
15
+ writer.uint32(8).int64(message.seconds);
16
+ }
17
+ if (message.nanos !== 0) {
18
+ writer.uint32(16).int32(message.nanos);
19
+ }
20
+ return writer;
21
+ },
22
+ decode(input, length) {
23
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
24
+ let end = length === undefined ? reader.len : reader.pos + length;
25
+ const message = createBaseDuration();
26
+ while (reader.pos < end) {
27
+ const tag = reader.uint32();
28
+ switch (tag >>> 3) {
29
+ case 1: {
30
+ if (tag !== 8) {
31
+ break;
32
+ }
33
+ message.seconds = longToNumber(reader.int64());
34
+ continue;
35
+ }
36
+ case 2: {
37
+ if (tag !== 16) {
38
+ break;
39
+ }
40
+ message.nanos = reader.int32();
41
+ continue;
42
+ }
43
+ }
44
+ if ((tag & 7) === 4 || tag === 0) {
45
+ break;
46
+ }
47
+ reader.skip(tag & 7);
48
+ }
49
+ return message;
50
+ },
51
+ fromJSON(object) {
52
+ return {
53
+ seconds: isSet(object.seconds) ? globalThis.Number(object.seconds) : 0,
54
+ nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
55
+ };
56
+ },
57
+ toJSON(message) {
58
+ const obj = {};
59
+ if (message.seconds !== 0) {
60
+ obj.seconds = Math.round(message.seconds);
61
+ }
62
+ if (message.nanos !== 0) {
63
+ obj.nanos = Math.round(message.nanos);
64
+ }
65
+ return obj;
66
+ },
67
+ create(base) {
68
+ return Duration.fromPartial(base ?? {});
69
+ },
70
+ fromPartial(object) {
71
+ const message = createBaseDuration();
72
+ message.seconds = object.seconds ?? 0;
73
+ message.nanos = object.nanos ?? 0;
74
+ return message;
75
+ },
76
+ };
77
+ function longToNumber(int64) {
78
+ const num = globalThis.Number(int64.toString());
79
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
80
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
81
+ }
82
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
83
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
84
+ }
85
+ return num;
86
+ }
87
+ function isSet(value) {
88
+ return value !== null && value !== undefined;
89
+ }
@@ -0,0 +1,33 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "google.protobuf";
3
+ /**
4
+ * A generic empty message that you can re-use to avoid defining duplicated
5
+ * empty messages in your APIs. A typical example is to use it as the request
6
+ * or the response type of an API method. For instance:
7
+ *
8
+ * service Foo {
9
+ * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
10
+ * }
11
+ */
12
+ export interface Empty {
13
+ }
14
+ export declare const Empty: MessageFns<Empty>;
15
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
16
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
17
+ [K in keyof T]?: DeepPartial<T[K]>;
18
+ } : Partial<T>;
19
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
20
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
21
+ [K in keyof P]: Exact<P[K], I[K]>;
22
+ } & {
23
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
24
+ };
25
+ export interface MessageFns<T> {
26
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
27
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
28
+ fromJSON(object: any): T;
29
+ toJSON(message: T): unknown;
30
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
31
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
32
+ }
33
+ export {};
@@ -0,0 +1,45 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.7.0
4
+ // protoc unknown
5
+ // source: google/protobuf/empty.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ export const protobufPackage = "google.protobuf";
9
+ function createBaseEmpty() {
10
+ return {};
11
+ }
12
+ export const Empty = {
13
+ encode(_, writer = new BinaryWriter()) {
14
+ return writer;
15
+ },
16
+ decode(input, length) {
17
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
18
+ let end = length === undefined ? reader.len : reader.pos + length;
19
+ const message = createBaseEmpty();
20
+ while (reader.pos < end) {
21
+ const tag = reader.uint32();
22
+ switch (tag >>> 3) {
23
+ }
24
+ if ((tag & 7) === 4 || tag === 0) {
25
+ break;
26
+ }
27
+ reader.skip(tag & 7);
28
+ }
29
+ return message;
30
+ },
31
+ fromJSON(_) {
32
+ return {};
33
+ },
34
+ toJSON(_) {
35
+ const obj = {};
36
+ return obj;
37
+ },
38
+ create(base) {
39
+ return Empty.fromPartial(base ?? {});
40
+ },
41
+ fromPartial(_) {
42
+ const message = createBaseEmpty();
43
+ return message;
44
+ },
45
+ };
@@ -0,0 +1,107 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "google.protobuf";
3
+ /**
4
+ * `NullValue` is a singleton enumeration to represent the null value for the
5
+ * `Value` type union.
6
+ *
7
+ * The JSON representation for `NullValue` is JSON `null`.
8
+ */
9
+ export declare enum NullValue {
10
+ /** NULL_VALUE - Null value. */
11
+ NULL_VALUE = 0,
12
+ UNRECOGNIZED = -1
13
+ }
14
+ export declare function nullValueFromJSON(object: any): NullValue;
15
+ export declare function nullValueToJSON(object: NullValue): string;
16
+ /**
17
+ * `Struct` represents a structured data value, consisting of fields
18
+ * which map to dynamically typed values. In some languages, `Struct`
19
+ * might be supported by a native representation. For example, in
20
+ * scripting languages like JS a struct is represented as an
21
+ * object. The details of that representation are described together
22
+ * with the proto support for the language.
23
+ *
24
+ * The JSON representation for `Struct` is JSON object.
25
+ */
26
+ export interface Struct {
27
+ /** Unordered map of dynamically typed values. */
28
+ fields: {
29
+ [key: string]: any | undefined;
30
+ };
31
+ }
32
+ export interface Struct_FieldsEntry {
33
+ key: string;
34
+ value: any | undefined;
35
+ }
36
+ /**
37
+ * `Value` represents a dynamically typed value which can be either
38
+ * null, a number, a string, a boolean, a recursive struct value, or a
39
+ * list of values. A producer of value is expected to set one of these
40
+ * variants. Absence of any variant indicates an error.
41
+ *
42
+ * The JSON representation for `Value` is JSON value.
43
+ */
44
+ export interface Value {
45
+ /** Represents a null value. */
46
+ nullValue?: NullValue | undefined;
47
+ /** Represents a double value. */
48
+ numberValue?: number | undefined;
49
+ /** Represents a string value. */
50
+ stringValue?: string | undefined;
51
+ /** Represents a boolean value. */
52
+ boolValue?: boolean | undefined;
53
+ /** Represents a structured value. */
54
+ structValue?: {
55
+ [key: string]: any;
56
+ } | undefined;
57
+ /** Represents a repeated `Value`. */
58
+ listValue?: Array<any> | undefined;
59
+ }
60
+ /**
61
+ * `ListValue` is a wrapper around a repeated field of values.
62
+ *
63
+ * The JSON representation for `ListValue` is JSON array.
64
+ */
65
+ export interface ListValue {
66
+ /** Repeated field of dynamically typed values. */
67
+ values: any[];
68
+ }
69
+ export declare const Struct: MessageFns<Struct> & StructWrapperFns;
70
+ export declare const Struct_FieldsEntry: MessageFns<Struct_FieldsEntry>;
71
+ export declare const Value: MessageFns<Value> & AnyValueWrapperFns;
72
+ export declare const ListValue: MessageFns<ListValue> & ListValueWrapperFns;
73
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
74
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
75
+ [K in keyof T]?: DeepPartial<T[K]>;
76
+ } : Partial<T>;
77
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
78
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
79
+ [K in keyof P]: Exact<P[K], I[K]>;
80
+ } & {
81
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
82
+ };
83
+ export interface MessageFns<T> {
84
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
85
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
86
+ fromJSON(object: any): T;
87
+ toJSON(message: T): unknown;
88
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
89
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
90
+ }
91
+ export interface StructWrapperFns {
92
+ wrap(object: {
93
+ [key: string]: any;
94
+ } | undefined): Struct;
95
+ unwrap(message: Struct): {
96
+ [key: string]: any;
97
+ };
98
+ }
99
+ export interface AnyValueWrapperFns {
100
+ wrap(value: any): Value;
101
+ unwrap(message: any): string | number | boolean | Object | null | Array<any> | undefined;
102
+ }
103
+ export interface ListValueWrapperFns {
104
+ wrap(array: Array<any> | undefined): ListValue;
105
+ unwrap(message: ListValue): Array<any>;
106
+ }
107
+ export {};