datai-sdk 1.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/@graphprotocol/graph-ts/README.md +13 -0
- package/@graphprotocol/graph-ts/chain/arweave.ts +82 -0
- package/@graphprotocol/graph-ts/chain/cosmos.ts +426 -0
- package/@graphprotocol/graph-ts/chain/ethereum.ts +727 -0
- package/@graphprotocol/graph-ts/chain/near.ts +420 -0
- package/@graphprotocol/graph-ts/chain/starknet.ts +39 -0
- package/@graphprotocol/graph-ts/common/collections.ts +495 -0
- package/@graphprotocol/graph-ts/common/conversion.ts +3 -0
- package/@graphprotocol/graph-ts/common/datasource.ts +41 -0
- package/@graphprotocol/graph-ts/common/eager_offset.ts +42 -0
- package/@graphprotocol/graph-ts/common/json.ts +28 -0
- package/@graphprotocol/graph-ts/common/numbers.ts +407 -0
- package/@graphprotocol/graph-ts/common/value.ts +585 -0
- package/@graphprotocol/graph-ts/global/global.ts +4 -0
- package/@graphprotocol/graph-ts/helper-functions.ts +79 -0
- package/@graphprotocol/graph-ts/index.ts +156 -0
- package/@graphprotocol/graph-ts/package.json +3 -0
- package/@graphprotocol/graph-ts/tsconfig.json +4 -0
- package/@graphprotocol/graph-ts/types/tsconfig.base.json +3 -0
- package/API/index.ts +1 -0
- package/API/v1/activePositions/ActivePositionsResult.ts +147 -0
- package/API/v1/activePositions/TokenBalance.ts +25 -0
- package/API/v1/activePositions/activePositions.ts +37 -0
- package/API/v1/bigDecimal/BigDecimalPb.ts +40 -0
- package/API/v1/bigDecimal/bigDecimal.ts +75 -0
- package/API/v1/bigInt/bigInt.ts +123 -0
- package/API/v1/crypto/crypto.ts +16 -0
- package/API/v1/ethereum/SmartContractCallPb.ts +84 -0
- package/API/v1/ethereum/ValuePb.ts +113 -0
- package/API/v1/ethereum/ValuesPb.ts +39 -0
- package/API/v1/ethereum/ethereum.ts +76 -0
- package/API/v1/index.ts +10 -0
- package/API/v1/log/log.ts +18 -0
- package/API/v1/proto/activePositions/ActivePositionsResultPb.ts +139 -0
- package/API/v1/proto/activePositions/TokenBalancePb.ts +69 -0
- package/API/v1/proto/bigDecimal/BigDecimalPb.ts +56 -0
- package/API/v1/proto/ethereum/SmartContractCallPb.ts +102 -0
- package/API/v1/proto/ethereum/ValueKindPb.ts +17 -0
- package/API/v1/proto/ethereum/ValuePb.ts +96 -0
- package/API/v1/proto/ethereum/ValuesPb.ts +53 -0
- package/API/v1/proto/google/protobuf/Any.ts +56 -0
- package/API/v1/proto/google/protobuf/Timestamp.ts +56 -0
- package/API/v1/proto/store/EntitiesPb.ts +53 -0
- package/API/v1/proto/store/EntityPb.ts +99 -0
- package/API/v1/proto/store/EntityWithMetaPb.ts +75 -0
- package/API/v1/proto/store/ValueKindPb.ts +17 -0
- package/API/v1/proto/store/ValuePb.ts +132 -0
- package/API/v1/proto/store/ValuesPb.ts +53 -0
- package/API/v1/proto/watcher/WatcherResultPb.ts +62 -0
- package/API/v1/store/EntitiesPb.ts +39 -0
- package/API/v1/store/EntityPb.ts +75 -0
- package/API/v1/store/ValuePb.ts +154 -0
- package/API/v1/store/ValuesPb.ts +39 -0
- package/API/v1/store/store.ts +78 -0
- package/API/v1/typeConversion/typeConversion.ts +57 -0
- package/API/v1/watcher/WatcherInput.ts +9 -0
- package/API/v1/watcher/watcher.ts +33 -0
- package/index.ts +5 -0
- package/package.json +11 -0
- package/utils/constants.ts +16 -0
- package/utils/mathUtils.ts +77 -0
- package/utils/pdk.ts +171 -0
- package/utils/subgraphUtils.ts +27 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Code generated by protoc-gen-as. DO NOT EDIT.
|
|
2
|
+
// Versions:
|
|
3
|
+
// protoc-gen-as v1.3.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
|
|
6
|
+
import { Writer, Reader, Protobuf } from 'as-proto/assembly'
|
|
7
|
+
import { ValuesPb } from './ValuesPb'
|
|
8
|
+
|
|
9
|
+
export class SmartContractCallPb {
|
|
10
|
+
static encode(message: SmartContractCallPb, writer: Writer): void {
|
|
11
|
+
writer.uint32(10)
|
|
12
|
+
writer.string(message.contractName)
|
|
13
|
+
|
|
14
|
+
writer.uint32(18)
|
|
15
|
+
writer.bytes(message.contractAddress)
|
|
16
|
+
|
|
17
|
+
writer.uint32(26)
|
|
18
|
+
writer.string(message.functionName)
|
|
19
|
+
|
|
20
|
+
writer.uint32(34)
|
|
21
|
+
writer.string(message.functionSignature)
|
|
22
|
+
|
|
23
|
+
const functionParams = message.functionParams
|
|
24
|
+
if (functionParams !== null) {
|
|
25
|
+
writer.uint32(42)
|
|
26
|
+
writer.fork()
|
|
27
|
+
ValuesPb.encode(functionParams, writer)
|
|
28
|
+
writer.ldelim()
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static decode(reader: Reader, length: i32): SmartContractCallPb {
|
|
33
|
+
const end: usize = length < 0 ? reader.end : reader.ptr + length
|
|
34
|
+
const message = new SmartContractCallPb()
|
|
35
|
+
|
|
36
|
+
while (reader.ptr < end) {
|
|
37
|
+
const tag = reader.uint32()
|
|
38
|
+
switch (tag >>> 3) {
|
|
39
|
+
case 1:
|
|
40
|
+
message.contractName = reader.string()
|
|
41
|
+
break
|
|
42
|
+
|
|
43
|
+
case 2:
|
|
44
|
+
message.contractAddress = reader.bytes()
|
|
45
|
+
break
|
|
46
|
+
|
|
47
|
+
case 3:
|
|
48
|
+
message.functionName = reader.string()
|
|
49
|
+
break
|
|
50
|
+
|
|
51
|
+
case 4:
|
|
52
|
+
message.functionSignature = reader.string()
|
|
53
|
+
break
|
|
54
|
+
|
|
55
|
+
case 5:
|
|
56
|
+
message.functionParams = ValuesPb.decode(reader, reader.uint32())
|
|
57
|
+
break
|
|
58
|
+
|
|
59
|
+
default:
|
|
60
|
+
reader.skipType(tag & 7)
|
|
61
|
+
break
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return message
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
contractName: string
|
|
69
|
+
contractAddress: Uint8Array
|
|
70
|
+
functionName: string
|
|
71
|
+
functionSignature: string
|
|
72
|
+
functionParams: ValuesPb | null
|
|
73
|
+
|
|
74
|
+
constructor(
|
|
75
|
+
contractName: string = '',
|
|
76
|
+
contractAddress: Uint8Array = new Uint8Array(0),
|
|
77
|
+
functionName: string = '',
|
|
78
|
+
functionSignature: string = '',
|
|
79
|
+
functionParams: ValuesPb | null = null
|
|
80
|
+
) {
|
|
81
|
+
this.contractName = contractName
|
|
82
|
+
this.contractAddress = contractAddress
|
|
83
|
+
this.functionName = functionName
|
|
84
|
+
this.functionSignature = functionSignature
|
|
85
|
+
this.functionParams = functionParams
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function encodeSmartContractCallPb(
|
|
90
|
+
message: SmartContractCallPb
|
|
91
|
+
): Uint8Array {
|
|
92
|
+
return Protobuf.encode(message, SmartContractCallPb.encode)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function decodeSmartContractCallPb(
|
|
96
|
+
buffer: Uint8Array
|
|
97
|
+
): SmartContractCallPb {
|
|
98
|
+
return Protobuf.decode<SmartContractCallPb>(
|
|
99
|
+
buffer,
|
|
100
|
+
SmartContractCallPb.decode
|
|
101
|
+
)
|
|
102
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Code generated by protoc-gen-as. DO NOT EDIT.
|
|
2
|
+
// Versions:
|
|
3
|
+
// protoc-gen-as v1.3.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
|
|
6
|
+
export enum ValueKindPb {
|
|
7
|
+
ADDRESS = 0,
|
|
8
|
+
FIXED_BYTES = 1,
|
|
9
|
+
BYTES = 2,
|
|
10
|
+
INT = 3,
|
|
11
|
+
UINT = 4,
|
|
12
|
+
BOOL = 5,
|
|
13
|
+
STRING = 6,
|
|
14
|
+
FIXED_ARRAY = 7,
|
|
15
|
+
ARRAY = 8,
|
|
16
|
+
TUPLE = 9
|
|
17
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Code generated by protoc-gen-as. DO NOT EDIT.
|
|
2
|
+
// Versions:
|
|
3
|
+
// protoc-gen-as v1.3.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
|
|
6
|
+
import { Writer, Reader, Protobuf } from 'as-proto/assembly'
|
|
7
|
+
import { ValuesPb } from './ValuesPb'
|
|
8
|
+
import { ValueKindPb } from './ValueKindPb'
|
|
9
|
+
|
|
10
|
+
export class ValuePb {
|
|
11
|
+
static encode(message: ValuePb, writer: Writer): void {
|
|
12
|
+
writer.uint32(8)
|
|
13
|
+
writer.int32(message.kind)
|
|
14
|
+
|
|
15
|
+
writer.uint32(818)
|
|
16
|
+
writer.bytes(message.bytesData)
|
|
17
|
+
|
|
18
|
+
writer.uint32(840)
|
|
19
|
+
writer.bool(message.boolData)
|
|
20
|
+
|
|
21
|
+
writer.uint32(850)
|
|
22
|
+
writer.string(message.stringData)
|
|
23
|
+
|
|
24
|
+
const arrayData = message.arrayData
|
|
25
|
+
if (arrayData !== null) {
|
|
26
|
+
writer.uint32(866)
|
|
27
|
+
writer.fork()
|
|
28
|
+
ValuesPb.encode(arrayData, writer)
|
|
29
|
+
writer.ldelim()
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static decode(reader: Reader, length: i32): ValuePb {
|
|
34
|
+
const end: usize = length < 0 ? reader.end : reader.ptr + length
|
|
35
|
+
const message = new ValuePb()
|
|
36
|
+
|
|
37
|
+
while (reader.ptr < end) {
|
|
38
|
+
const tag = reader.uint32()
|
|
39
|
+
switch (tag >>> 3) {
|
|
40
|
+
case 1:
|
|
41
|
+
message.kind = reader.int32()
|
|
42
|
+
break
|
|
43
|
+
|
|
44
|
+
case 102:
|
|
45
|
+
message.bytesData = reader.bytes()
|
|
46
|
+
break
|
|
47
|
+
|
|
48
|
+
case 105:
|
|
49
|
+
message.boolData = reader.bool()
|
|
50
|
+
break
|
|
51
|
+
|
|
52
|
+
case 106:
|
|
53
|
+
message.stringData = reader.string()
|
|
54
|
+
break
|
|
55
|
+
|
|
56
|
+
case 108:
|
|
57
|
+
message.arrayData = ValuesPb.decode(reader, reader.uint32())
|
|
58
|
+
break
|
|
59
|
+
|
|
60
|
+
default:
|
|
61
|
+
reader.skipType(tag & 7)
|
|
62
|
+
break
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return message
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
kind: ValueKindPb
|
|
70
|
+
bytesData: Uint8Array
|
|
71
|
+
boolData: bool
|
|
72
|
+
stringData: string
|
|
73
|
+
arrayData: ValuesPb | null
|
|
74
|
+
|
|
75
|
+
constructor(
|
|
76
|
+
kind: ValueKindPb = 0,
|
|
77
|
+
bytesData: Uint8Array = new Uint8Array(0),
|
|
78
|
+
boolData: bool = false,
|
|
79
|
+
stringData: string = '',
|
|
80
|
+
arrayData: ValuesPb | null = null
|
|
81
|
+
) {
|
|
82
|
+
this.kind = kind
|
|
83
|
+
this.bytesData = bytesData
|
|
84
|
+
this.boolData = boolData
|
|
85
|
+
this.stringData = stringData
|
|
86
|
+
this.arrayData = arrayData
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function encodeValuePb(message: ValuePb): Uint8Array {
|
|
91
|
+
return Protobuf.encode(message, ValuePb.encode)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function decodeValuePb(buffer: Uint8Array): ValuePb {
|
|
95
|
+
return Protobuf.decode<ValuePb>(buffer, ValuePb.decode)
|
|
96
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Code generated by protoc-gen-as. DO NOT EDIT.
|
|
2
|
+
// Versions:
|
|
3
|
+
// protoc-gen-as v1.3.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
|
|
6
|
+
import { Writer, Reader, Protobuf } from 'as-proto/assembly'
|
|
7
|
+
import { ValuePb } from './ValuePb'
|
|
8
|
+
|
|
9
|
+
export class ValuesPb {
|
|
10
|
+
static encode(message: ValuesPb, writer: Writer): void {
|
|
11
|
+
const values = message.values
|
|
12
|
+
for (let i: i32 = 0; i < values.length; ++i) {
|
|
13
|
+
writer.uint32(10)
|
|
14
|
+
writer.fork()
|
|
15
|
+
ValuePb.encode(values[i], writer)
|
|
16
|
+
writer.ldelim()
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static decode(reader: Reader, length: i32): ValuesPb {
|
|
21
|
+
const end: usize = length < 0 ? reader.end : reader.ptr + length
|
|
22
|
+
const message = new ValuesPb()
|
|
23
|
+
|
|
24
|
+
while (reader.ptr < end) {
|
|
25
|
+
const tag = reader.uint32()
|
|
26
|
+
switch (tag >>> 3) {
|
|
27
|
+
case 1:
|
|
28
|
+
message.values.push(ValuePb.decode(reader, reader.uint32()))
|
|
29
|
+
break
|
|
30
|
+
|
|
31
|
+
default:
|
|
32
|
+
reader.skipType(tag & 7)
|
|
33
|
+
break
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return message
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
values: Array<ValuePb>
|
|
41
|
+
|
|
42
|
+
constructor(values: Array<ValuePb> = []) {
|
|
43
|
+
this.values = values
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function encodeValuesPb(message: ValuesPb): Uint8Array {
|
|
48
|
+
return Protobuf.encode(message, ValuesPb.encode)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function decodeValuesPb(buffer: Uint8Array): ValuesPb {
|
|
52
|
+
return Protobuf.decode<ValuesPb>(buffer, ValuesPb.decode)
|
|
53
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Code generated by protoc-gen-as. DO NOT EDIT.
|
|
2
|
+
// Versions:
|
|
3
|
+
// protoc-gen-as v1.3.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
|
|
6
|
+
import { Writer, Reader, Protobuf } from 'as-proto/assembly'
|
|
7
|
+
|
|
8
|
+
export class Any {
|
|
9
|
+
static encode(message: Any, writer: Writer): void {
|
|
10
|
+
writer.uint32(10)
|
|
11
|
+
writer.string(message.typeUrl)
|
|
12
|
+
|
|
13
|
+
writer.uint32(18)
|
|
14
|
+
writer.bytes(message.value)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static decode(reader: Reader, length: i32): Any {
|
|
18
|
+
const end: usize = length < 0 ? reader.end : reader.ptr + length
|
|
19
|
+
const message = new Any()
|
|
20
|
+
|
|
21
|
+
while (reader.ptr < end) {
|
|
22
|
+
const tag = reader.uint32()
|
|
23
|
+
switch (tag >>> 3) {
|
|
24
|
+
case 1:
|
|
25
|
+
message.typeUrl = reader.string()
|
|
26
|
+
break
|
|
27
|
+
|
|
28
|
+
case 2:
|
|
29
|
+
message.value = reader.bytes()
|
|
30
|
+
break
|
|
31
|
+
|
|
32
|
+
default:
|
|
33
|
+
reader.skipType(tag & 7)
|
|
34
|
+
break
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return message
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
typeUrl: string
|
|
42
|
+
value: Uint8Array
|
|
43
|
+
|
|
44
|
+
constructor(typeUrl: string = '', value: Uint8Array = new Uint8Array(0)) {
|
|
45
|
+
this.typeUrl = typeUrl
|
|
46
|
+
this.value = value
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function encodeAny(message: Any): Uint8Array {
|
|
51
|
+
return Protobuf.encode(message, Any.encode)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function decodeAny(buffer: Uint8Array): Any {
|
|
55
|
+
return Protobuf.decode<Any>(buffer, Any.decode)
|
|
56
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Code generated by protoc-gen-as. DO NOT EDIT.
|
|
2
|
+
// Versions:
|
|
3
|
+
// protoc-gen-as v1.3.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
|
|
6
|
+
import { Writer, Reader, Protobuf } from 'as-proto/assembly'
|
|
7
|
+
|
|
8
|
+
export class Timestamp {
|
|
9
|
+
static encode(message: Timestamp, writer: Writer): void {
|
|
10
|
+
writer.uint32(8)
|
|
11
|
+
writer.int64(message.seconds)
|
|
12
|
+
|
|
13
|
+
writer.uint32(16)
|
|
14
|
+
writer.int32(message.nanos)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static decode(reader: Reader, length: i32): Timestamp {
|
|
18
|
+
const end: usize = length < 0 ? reader.end : reader.ptr + length
|
|
19
|
+
const message = new Timestamp()
|
|
20
|
+
|
|
21
|
+
while (reader.ptr < end) {
|
|
22
|
+
const tag = reader.uint32()
|
|
23
|
+
switch (tag >>> 3) {
|
|
24
|
+
case 1:
|
|
25
|
+
message.seconds = reader.int64()
|
|
26
|
+
break
|
|
27
|
+
|
|
28
|
+
case 2:
|
|
29
|
+
message.nanos = reader.int32()
|
|
30
|
+
break
|
|
31
|
+
|
|
32
|
+
default:
|
|
33
|
+
reader.skipType(tag & 7)
|
|
34
|
+
break
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return message
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
seconds: i64
|
|
42
|
+
nanos: i32
|
|
43
|
+
|
|
44
|
+
constructor(seconds: i64 = 0, nanos: i32 = 0) {
|
|
45
|
+
this.seconds = seconds
|
|
46
|
+
this.nanos = nanos
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function encodeTimestamp(message: Timestamp): Uint8Array {
|
|
51
|
+
return Protobuf.encode(message, Timestamp.encode)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function decodeTimestamp(buffer: Uint8Array): Timestamp {
|
|
55
|
+
return Protobuf.decode<Timestamp>(buffer, Timestamp.decode)
|
|
56
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Code generated by protoc-gen-as. DO NOT EDIT.
|
|
2
|
+
// Versions:
|
|
3
|
+
// protoc-gen-as v1.3.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
|
|
6
|
+
import { Writer, Reader, Protobuf } from 'as-proto/assembly'
|
|
7
|
+
import { EntityPb } from './EntityPb'
|
|
8
|
+
|
|
9
|
+
export class EntitiesPb {
|
|
10
|
+
static encode(message: EntitiesPb, writer: Writer): void {
|
|
11
|
+
const items = message.items
|
|
12
|
+
for (let i: i32 = 0; i < items.length; ++i) {
|
|
13
|
+
writer.uint32(10)
|
|
14
|
+
writer.fork()
|
|
15
|
+
EntityPb.encode(items[i], writer)
|
|
16
|
+
writer.ldelim()
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static decode(reader: Reader, length: i32): EntitiesPb {
|
|
21
|
+
const end: usize = length < 0 ? reader.end : reader.ptr + length
|
|
22
|
+
const message = new EntitiesPb()
|
|
23
|
+
|
|
24
|
+
while (reader.ptr < end) {
|
|
25
|
+
const tag = reader.uint32()
|
|
26
|
+
switch (tag >>> 3) {
|
|
27
|
+
case 1:
|
|
28
|
+
message.items.push(EntityPb.decode(reader, reader.uint32()))
|
|
29
|
+
break
|
|
30
|
+
|
|
31
|
+
default:
|
|
32
|
+
reader.skipType(tag & 7)
|
|
33
|
+
break
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return message
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
items: Array<EntityPb>
|
|
41
|
+
|
|
42
|
+
constructor(items: Array<EntityPb> = []) {
|
|
43
|
+
this.items = items
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function encodeEntitiesPb(message: EntitiesPb): Uint8Array {
|
|
48
|
+
return Protobuf.encode(message, EntitiesPb.encode)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function decodeEntitiesPb(buffer: Uint8Array): EntitiesPb {
|
|
52
|
+
return Protobuf.decode<EntitiesPb>(buffer, EntitiesPb.decode)
|
|
53
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Code generated by protoc-gen-as. DO NOT EDIT.
|
|
2
|
+
// Versions:
|
|
3
|
+
// protoc-gen-as v1.3.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
|
|
6
|
+
import { Writer, Reader, Protobuf } from 'as-proto/assembly'
|
|
7
|
+
import { ValuePb } from './ValuePb'
|
|
8
|
+
|
|
9
|
+
export class EntityPb {
|
|
10
|
+
static encode(message: EntityPb, writer: Writer): void {
|
|
11
|
+
const entries = message.entries
|
|
12
|
+
if (entries !== null) {
|
|
13
|
+
const entriesKeys = entries.keys()
|
|
14
|
+
for (let i: i32 = 0; i < entriesKeys.length; ++i) {
|
|
15
|
+
const entriesKey = entriesKeys[i]
|
|
16
|
+
writer.uint32(10)
|
|
17
|
+
writer.fork()
|
|
18
|
+
writer.uint32(10)
|
|
19
|
+
writer.string(entriesKey)
|
|
20
|
+
writer.uint32(18)
|
|
21
|
+
writer.fork()
|
|
22
|
+
ValuePb.encode(entries.get(entriesKey), writer)
|
|
23
|
+
writer.ldelim()
|
|
24
|
+
writer.ldelim()
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static decode(reader: Reader, length: i32): EntityPb {
|
|
30
|
+
const end: usize = length < 0 ? reader.end : reader.ptr + length
|
|
31
|
+
const message = new EntityPb()
|
|
32
|
+
|
|
33
|
+
while (reader.ptr < end) {
|
|
34
|
+
const tag = reader.uint32()
|
|
35
|
+
switch (tag >>> 3) {
|
|
36
|
+
case 1:
|
|
37
|
+
let entriesKey: string = ''
|
|
38
|
+
let entriesValue: ValuePb | null = null
|
|
39
|
+
let entriesHasKey: bool = false
|
|
40
|
+
let entriesHasValue: bool = false
|
|
41
|
+
for (
|
|
42
|
+
const end: usize = reader.ptr + reader.uint32();
|
|
43
|
+
reader.ptr < end;
|
|
44
|
+
|
|
45
|
+
) {
|
|
46
|
+
const tag = reader.uint32()
|
|
47
|
+
switch (tag >>> 3) {
|
|
48
|
+
case 1:
|
|
49
|
+
entriesKey = reader.string()
|
|
50
|
+
entriesHasKey = true
|
|
51
|
+
break
|
|
52
|
+
|
|
53
|
+
case 2:
|
|
54
|
+
entriesValue = ValuePb.decode(reader, reader.uint32())
|
|
55
|
+
entriesHasValue = true
|
|
56
|
+
break
|
|
57
|
+
|
|
58
|
+
default:
|
|
59
|
+
reader.skipType(tag & 7)
|
|
60
|
+
break
|
|
61
|
+
}
|
|
62
|
+
if (message.entries === null) {
|
|
63
|
+
message.entries = new Map<string, ValuePb>()
|
|
64
|
+
}
|
|
65
|
+
const entries = message.entries
|
|
66
|
+
if (
|
|
67
|
+
entries !== null &&
|
|
68
|
+
entriesHasKey &&
|
|
69
|
+
entriesHasValue &&
|
|
70
|
+
entriesValue !== null
|
|
71
|
+
) {
|
|
72
|
+
entries.set(entriesKey, entriesValue)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
break
|
|
76
|
+
|
|
77
|
+
default:
|
|
78
|
+
reader.skipType(tag & 7)
|
|
79
|
+
break
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return message
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
entries: Map<string, ValuePb>
|
|
87
|
+
|
|
88
|
+
constructor(entries: Map<string, ValuePb> = new Map()) {
|
|
89
|
+
this.entries = entries
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function encodeEntityPb(message: EntityPb): Uint8Array {
|
|
94
|
+
return Protobuf.encode(message, EntityPb.encode)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function decodeEntityPb(buffer: Uint8Array): EntityPb {
|
|
98
|
+
return Protobuf.decode<EntityPb>(buffer, EntityPb.decode)
|
|
99
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Code generated by protoc-gen-as. DO NOT EDIT.
|
|
2
|
+
// Versions:
|
|
3
|
+
// protoc-gen-as v1.3.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
|
|
6
|
+
import { Writer, Reader, Protobuf } from 'as-proto/assembly'
|
|
7
|
+
import { EntityPb } from './EntityPb'
|
|
8
|
+
|
|
9
|
+
export class EntityWithMetaPb {
|
|
10
|
+
static encode(message: EntityWithMetaPb, writer: Writer): void {
|
|
11
|
+
const entity = message.entity
|
|
12
|
+
if (entity !== null) {
|
|
13
|
+
writer.uint32(10)
|
|
14
|
+
writer.fork()
|
|
15
|
+
EntityPb.encode(entity, writer)
|
|
16
|
+
writer.ldelim()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
writer.uint32(18)
|
|
20
|
+
writer.string(message.idField)
|
|
21
|
+
|
|
22
|
+
writer.uint32(24)
|
|
23
|
+
writer.bool(message.isImmutable)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static decode(reader: Reader, length: i32): EntityWithMetaPb {
|
|
27
|
+
const end: usize = length < 0 ? reader.end : reader.ptr + length
|
|
28
|
+
const message = new EntityWithMetaPb()
|
|
29
|
+
|
|
30
|
+
while (reader.ptr < end) {
|
|
31
|
+
const tag = reader.uint32()
|
|
32
|
+
switch (tag >>> 3) {
|
|
33
|
+
case 1:
|
|
34
|
+
message.entity = EntityPb.decode(reader, reader.uint32())
|
|
35
|
+
break
|
|
36
|
+
|
|
37
|
+
case 2:
|
|
38
|
+
message.idField = reader.string()
|
|
39
|
+
break
|
|
40
|
+
|
|
41
|
+
case 3:
|
|
42
|
+
message.isImmutable = reader.bool()
|
|
43
|
+
break
|
|
44
|
+
|
|
45
|
+
default:
|
|
46
|
+
reader.skipType(tag & 7)
|
|
47
|
+
break
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return message
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
entity: EntityPb | null
|
|
55
|
+
idField: string
|
|
56
|
+
isImmutable: bool
|
|
57
|
+
|
|
58
|
+
constructor(
|
|
59
|
+
entity: EntityPb | null = null,
|
|
60
|
+
idField: string = '',
|
|
61
|
+
isImmutable: bool = false
|
|
62
|
+
) {
|
|
63
|
+
this.entity = entity
|
|
64
|
+
this.idField = idField
|
|
65
|
+
this.isImmutable = isImmutable
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function encodeEntityWithMetaPb(message: EntityWithMetaPb): Uint8Array {
|
|
70
|
+
return Protobuf.encode(message, EntityWithMetaPb.encode)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function decodeEntityWithMetaPb(buffer: Uint8Array): EntityWithMetaPb {
|
|
74
|
+
return Protobuf.decode<EntityWithMetaPb>(buffer, EntityWithMetaPb.decode)
|
|
75
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Code generated by protoc-gen-as. DO NOT EDIT.
|
|
2
|
+
// Versions:
|
|
3
|
+
// protoc-gen-as v1.3.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
|
|
6
|
+
export enum ValueKindPb {
|
|
7
|
+
STRING = 0,
|
|
8
|
+
INT = 1,
|
|
9
|
+
BIGDECIMAL = 2,
|
|
10
|
+
BOOL = 3,
|
|
11
|
+
ARRAY = 4,
|
|
12
|
+
NULL = 5,
|
|
13
|
+
BYTES = 6,
|
|
14
|
+
BIGINT = 7,
|
|
15
|
+
INT8 = 8,
|
|
16
|
+
TIMESTAMP = 9
|
|
17
|
+
}
|