datai-sdk 1.0.0 → 1.0.1
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/API/v1/activePositions/ActivePositionsResult.ts +1 -1
- package/API/v1/activePositions/TokenBalance.ts +1 -1
- package/API/v1/proto/activePositions/ActivePositionsResultPb.ts +65 -62
- package/API/v1/proto/activePositions/TokenBalancePb.ts +27 -27
- package/API/v1/proto/bigDecimal/BigDecimalPb.ts +21 -21
- package/API/v1/proto/ethereum/SmartContractCallPb.ts +46 -46
- package/API/v1/proto/ethereum/ValueKindPb.ts +1 -1
- package/API/v1/proto/ethereum/ValuePb.ts +45 -45
- package/API/v1/proto/ethereum/ValuesPb.ts +19 -19
- package/API/v1/proto/google/protobuf/Any.ts +22 -22
- package/API/v1/proto/google/protobuf/Timestamp.ts +21 -21
- package/API/v1/proto/store/EntitiesPb.ts +19 -19
- package/API/v1/proto/store/EntityPb.ts +41 -41
- package/API/v1/proto/store/EntityWithMetaPb.ts +32 -32
- package/API/v1/proto/store/ValueKindPb.ts +1 -1
- package/API/v1/proto/store/ValuePb.ts +67 -67
- package/API/v1/proto/store/ValuesPb.ts +19 -19
- package/API/v1/proto/watcher/WatcherResultPb.ts +26 -26
- package/API/v1/watcher/WatcherInput.ts +1 -1
- package/API/v1/watcher/watcher.ts +1 -1
- package/package.json +1 -1
- package/utils/constants.ts +1 -1
- package/utils/mathUtils.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, BigInt } from '
|
|
1
|
+
import { Address, BigInt } from '@graphprotocol/graph-ts'
|
|
2
2
|
import { Timestamp } from '../proto/google/protobuf/Timestamp'
|
|
3
3
|
import { ActivePositionsResultPb } from '../proto/activePositions/ActivePositionsResultPb'
|
|
4
4
|
import { TokenBalancePb } from '../proto/activePositions/TokenBalancePb'
|
|
@@ -3,108 +3,111 @@
|
|
|
3
3
|
// protoc-gen-as v1.3.0
|
|
4
4
|
// protoc v3.21.12
|
|
5
5
|
|
|
6
|
-
import { Writer, Reader, Protobuf } from
|
|
7
|
-
import { TokenBalancePb } from
|
|
8
|
-
import { Timestamp } from
|
|
6
|
+
import { Writer, Reader, Protobuf } from "as-proto/assembly";
|
|
7
|
+
import { TokenBalancePb } from "./TokenBalancePb";
|
|
8
|
+
import { Timestamp } from "../google/protobuf/Timestamp";
|
|
9
9
|
|
|
10
10
|
export class ActivePositionsResultPb {
|
|
11
11
|
static encode(message: ActivePositionsResultPb, writer: Writer): void {
|
|
12
|
-
const supplyTokens = message.supplyTokens
|
|
12
|
+
const supplyTokens = message.supplyTokens;
|
|
13
13
|
for (let i: i32 = 0; i < supplyTokens.length; ++i) {
|
|
14
|
-
writer.uint32(10)
|
|
15
|
-
writer.fork()
|
|
16
|
-
TokenBalancePb.encode(supplyTokens[i], writer)
|
|
17
|
-
writer.ldelim()
|
|
14
|
+
writer.uint32(10);
|
|
15
|
+
writer.fork();
|
|
16
|
+
TokenBalancePb.encode(supplyTokens[i], writer);
|
|
17
|
+
writer.ldelim();
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const borrowTokens = message.borrowTokens
|
|
20
|
+
const borrowTokens = message.borrowTokens;
|
|
21
21
|
for (let i: i32 = 0; i < borrowTokens.length; ++i) {
|
|
22
|
-
writer.uint32(18)
|
|
23
|
-
writer.fork()
|
|
24
|
-
TokenBalancePb.encode(borrowTokens[i], writer)
|
|
25
|
-
writer.ldelim()
|
|
22
|
+
writer.uint32(18);
|
|
23
|
+
writer.fork();
|
|
24
|
+
TokenBalancePb.encode(borrowTokens[i], writer);
|
|
25
|
+
writer.ldelim();
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const rewardTokens = message.rewardTokens
|
|
28
|
+
const rewardTokens = message.rewardTokens;
|
|
29
29
|
for (let i: i32 = 0; i < rewardTokens.length; ++i) {
|
|
30
|
-
writer.uint32(26)
|
|
31
|
-
writer.fork()
|
|
32
|
-
TokenBalancePb.encode(rewardTokens[i], writer)
|
|
33
|
-
writer.ldelim()
|
|
30
|
+
writer.uint32(26);
|
|
31
|
+
writer.fork();
|
|
32
|
+
TokenBalancePb.encode(rewardTokens[i], writer);
|
|
33
|
+
writer.ldelim();
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const positionToken = message.positionToken
|
|
36
|
+
const positionToken = message.positionToken;
|
|
37
37
|
if (positionToken !== null) {
|
|
38
|
-
writer.uint32(34)
|
|
39
|
-
writer.fork()
|
|
40
|
-
TokenBalancePb.encode(positionToken, writer)
|
|
41
|
-
writer.ldelim()
|
|
38
|
+
writer.uint32(34);
|
|
39
|
+
writer.fork();
|
|
40
|
+
TokenBalancePb.encode(positionToken, writer);
|
|
41
|
+
writer.ldelim();
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
const unlockTimestamp = message.unlockTimestamp
|
|
44
|
+
const unlockTimestamp = message.unlockTimestamp;
|
|
45
45
|
if (unlockTimestamp !== null) {
|
|
46
|
-
writer.uint32(42)
|
|
47
|
-
writer.fork()
|
|
48
|
-
Timestamp.encode(unlockTimestamp, writer)
|
|
49
|
-
writer.ldelim()
|
|
46
|
+
writer.uint32(42);
|
|
47
|
+
writer.fork();
|
|
48
|
+
Timestamp.encode(unlockTimestamp, writer);
|
|
49
|
+
writer.ldelim();
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
writer.uint32(50)
|
|
53
|
-
writer.bytes(message.poolAddressBytes)
|
|
52
|
+
writer.uint32(50);
|
|
53
|
+
writer.bytes(message.poolAddressBytes);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
static decode(reader: Reader, length: i32): ActivePositionsResultPb {
|
|
57
|
-
const end: usize = length < 0 ? reader.end : reader.ptr + length
|
|
58
|
-
const message = new ActivePositionsResultPb()
|
|
57
|
+
const end: usize = length < 0 ? reader.end : reader.ptr + length;
|
|
58
|
+
const message = new ActivePositionsResultPb();
|
|
59
59
|
|
|
60
60
|
while (reader.ptr < end) {
|
|
61
|
-
const tag = reader.uint32()
|
|
61
|
+
const tag = reader.uint32();
|
|
62
62
|
switch (tag >>> 3) {
|
|
63
63
|
case 1:
|
|
64
64
|
message.supplyTokens.push(
|
|
65
65
|
TokenBalancePb.decode(reader, reader.uint32())
|
|
66
|
-
)
|
|
67
|
-
break
|
|
66
|
+
);
|
|
67
|
+
break;
|
|
68
68
|
|
|
69
69
|
case 2:
|
|
70
70
|
message.borrowTokens.push(
|
|
71
71
|
TokenBalancePb.decode(reader, reader.uint32())
|
|
72
|
-
)
|
|
73
|
-
break
|
|
72
|
+
);
|
|
73
|
+
break;
|
|
74
74
|
|
|
75
75
|
case 3:
|
|
76
76
|
message.rewardTokens.push(
|
|
77
77
|
TokenBalancePb.decode(reader, reader.uint32())
|
|
78
|
-
)
|
|
79
|
-
break
|
|
78
|
+
);
|
|
79
|
+
break;
|
|
80
80
|
|
|
81
81
|
case 4:
|
|
82
|
-
message.positionToken = TokenBalancePb.decode(
|
|
83
|
-
|
|
82
|
+
message.positionToken = TokenBalancePb.decode(
|
|
83
|
+
reader,
|
|
84
|
+
reader.uint32()
|
|
85
|
+
);
|
|
86
|
+
break;
|
|
84
87
|
|
|
85
88
|
case 5:
|
|
86
|
-
message.unlockTimestamp = Timestamp.decode(reader, reader.uint32())
|
|
87
|
-
break
|
|
89
|
+
message.unlockTimestamp = Timestamp.decode(reader, reader.uint32());
|
|
90
|
+
break;
|
|
88
91
|
|
|
89
92
|
case 6:
|
|
90
|
-
message.poolAddressBytes = reader.bytes()
|
|
91
|
-
break
|
|
93
|
+
message.poolAddressBytes = reader.bytes();
|
|
94
|
+
break;
|
|
92
95
|
|
|
93
96
|
default:
|
|
94
|
-
reader.skipType(tag & 7)
|
|
95
|
-
break
|
|
97
|
+
reader.skipType(tag & 7);
|
|
98
|
+
break;
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
|
|
99
|
-
return message
|
|
102
|
+
return message;
|
|
100
103
|
}
|
|
101
104
|
|
|
102
|
-
supplyTokens: Array<TokenBalancePb
|
|
103
|
-
borrowTokens: Array<TokenBalancePb
|
|
104
|
-
rewardTokens: Array<TokenBalancePb
|
|
105
|
-
positionToken: TokenBalancePb | null
|
|
106
|
-
unlockTimestamp: Timestamp | null
|
|
107
|
-
poolAddressBytes: Uint8Array
|
|
105
|
+
supplyTokens: Array<TokenBalancePb>;
|
|
106
|
+
borrowTokens: Array<TokenBalancePb>;
|
|
107
|
+
rewardTokens: Array<TokenBalancePb>;
|
|
108
|
+
positionToken: TokenBalancePb | null;
|
|
109
|
+
unlockTimestamp: Timestamp | null;
|
|
110
|
+
poolAddressBytes: Uint8Array;
|
|
108
111
|
|
|
109
112
|
constructor(
|
|
110
113
|
supplyTokens: Array<TokenBalancePb> = [],
|
|
@@ -114,19 +117,19 @@ export class ActivePositionsResultPb {
|
|
|
114
117
|
unlockTimestamp: Timestamp | null = null,
|
|
115
118
|
poolAddressBytes: Uint8Array = new Uint8Array(0)
|
|
116
119
|
) {
|
|
117
|
-
this.supplyTokens = supplyTokens
|
|
118
|
-
this.borrowTokens = borrowTokens
|
|
119
|
-
this.rewardTokens = rewardTokens
|
|
120
|
-
this.positionToken = positionToken
|
|
121
|
-
this.unlockTimestamp = unlockTimestamp
|
|
122
|
-
this.poolAddressBytes = poolAddressBytes
|
|
120
|
+
this.supplyTokens = supplyTokens;
|
|
121
|
+
this.borrowTokens = borrowTokens;
|
|
122
|
+
this.rewardTokens = rewardTokens;
|
|
123
|
+
this.positionToken = positionToken;
|
|
124
|
+
this.unlockTimestamp = unlockTimestamp;
|
|
125
|
+
this.poolAddressBytes = poolAddressBytes;
|
|
123
126
|
}
|
|
124
127
|
}
|
|
125
128
|
|
|
126
129
|
export function encodeActivePositionsResultPb(
|
|
127
130
|
message: ActivePositionsResultPb
|
|
128
131
|
): Uint8Array {
|
|
129
|
-
return Protobuf.encode(message, ActivePositionsResultPb.encode)
|
|
132
|
+
return Protobuf.encode(message, ActivePositionsResultPb.encode);
|
|
130
133
|
}
|
|
131
134
|
|
|
132
135
|
export function decodeActivePositionsResultPb(
|
|
@@ -135,5 +138,5 @@ export function decodeActivePositionsResultPb(
|
|
|
135
138
|
return Protobuf.decode<ActivePositionsResultPb>(
|
|
136
139
|
buffer,
|
|
137
140
|
ActivePositionsResultPb.decode
|
|
138
|
-
)
|
|
141
|
+
);
|
|
139
142
|
}
|
|
@@ -3,67 +3,67 @@
|
|
|
3
3
|
// protoc-gen-as v1.3.0
|
|
4
4
|
// protoc v3.21.12
|
|
5
5
|
|
|
6
|
-
import { Writer, Reader, Protobuf } from
|
|
6
|
+
import { Writer, Reader, Protobuf } from "as-proto/assembly";
|
|
7
7
|
|
|
8
8
|
export class TokenBalancePb {
|
|
9
9
|
static encode(message: TokenBalancePb, writer: Writer): void {
|
|
10
|
-
writer.uint32(10)
|
|
11
|
-
writer.bytes(message.tokenAddressBytes)
|
|
10
|
+
writer.uint32(10);
|
|
11
|
+
writer.bytes(message.tokenAddressBytes);
|
|
12
12
|
|
|
13
|
-
writer.uint32(18)
|
|
14
|
-
writer.bytes(message.tokenIdBytes)
|
|
13
|
+
writer.uint32(18);
|
|
14
|
+
writer.bytes(message.tokenIdBytes);
|
|
15
15
|
|
|
16
|
-
writer.uint32(26)
|
|
17
|
-
writer.bytes(message.balanceBytes)
|
|
16
|
+
writer.uint32(26);
|
|
17
|
+
writer.bytes(message.balanceBytes);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
static decode(reader: Reader, length: i32): TokenBalancePb {
|
|
21
|
-
const end: usize = length < 0 ? reader.end : reader.ptr + length
|
|
22
|
-
const message = new TokenBalancePb()
|
|
21
|
+
const end: usize = length < 0 ? reader.end : reader.ptr + length;
|
|
22
|
+
const message = new TokenBalancePb();
|
|
23
23
|
|
|
24
24
|
while (reader.ptr < end) {
|
|
25
|
-
const tag = reader.uint32()
|
|
25
|
+
const tag = reader.uint32();
|
|
26
26
|
switch (tag >>> 3) {
|
|
27
27
|
case 1:
|
|
28
|
-
message.tokenAddressBytes = reader.bytes()
|
|
29
|
-
break
|
|
28
|
+
message.tokenAddressBytes = reader.bytes();
|
|
29
|
+
break;
|
|
30
30
|
|
|
31
31
|
case 2:
|
|
32
|
-
message.tokenIdBytes = reader.bytes()
|
|
33
|
-
break
|
|
32
|
+
message.tokenIdBytes = reader.bytes();
|
|
33
|
+
break;
|
|
34
34
|
|
|
35
35
|
case 3:
|
|
36
|
-
message.balanceBytes = reader.bytes()
|
|
37
|
-
break
|
|
36
|
+
message.balanceBytes = reader.bytes();
|
|
37
|
+
break;
|
|
38
38
|
|
|
39
39
|
default:
|
|
40
|
-
reader.skipType(tag & 7)
|
|
41
|
-
break
|
|
40
|
+
reader.skipType(tag & 7);
|
|
41
|
+
break;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
return message
|
|
45
|
+
return message;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
tokenAddressBytes: Uint8Array
|
|
49
|
-
tokenIdBytes: Uint8Array
|
|
50
|
-
balanceBytes: Uint8Array
|
|
48
|
+
tokenAddressBytes: Uint8Array;
|
|
49
|
+
tokenIdBytes: Uint8Array;
|
|
50
|
+
balanceBytes: Uint8Array;
|
|
51
51
|
|
|
52
52
|
constructor(
|
|
53
53
|
tokenAddressBytes: Uint8Array = new Uint8Array(0),
|
|
54
54
|
tokenIdBytes: Uint8Array = new Uint8Array(0),
|
|
55
55
|
balanceBytes: Uint8Array = new Uint8Array(0)
|
|
56
56
|
) {
|
|
57
|
-
this.tokenAddressBytes = tokenAddressBytes
|
|
58
|
-
this.tokenIdBytes = tokenIdBytes
|
|
59
|
-
this.balanceBytes = balanceBytes
|
|
57
|
+
this.tokenAddressBytes = tokenAddressBytes;
|
|
58
|
+
this.tokenIdBytes = tokenIdBytes;
|
|
59
|
+
this.balanceBytes = balanceBytes;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export function encodeTokenBalancePb(message: TokenBalancePb): Uint8Array {
|
|
64
|
-
return Protobuf.encode(message, TokenBalancePb.encode)
|
|
64
|
+
return Protobuf.encode(message, TokenBalancePb.encode);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
export function decodeTokenBalancePb(buffer: Uint8Array): TokenBalancePb {
|
|
68
|
-
return Protobuf.decode<TokenBalancePb>(buffer, TokenBalancePb.decode)
|
|
68
|
+
return Protobuf.decode<TokenBalancePb>(buffer, TokenBalancePb.decode);
|
|
69
69
|
}
|
|
@@ -3,54 +3,54 @@
|
|
|
3
3
|
// protoc-gen-as v1.3.0
|
|
4
4
|
// protoc v3.21.12
|
|
5
5
|
|
|
6
|
-
import { Writer, Reader, Protobuf } from
|
|
6
|
+
import { Writer, Reader, Protobuf } from "as-proto/assembly";
|
|
7
7
|
|
|
8
8
|
export class BigDecimalPb {
|
|
9
9
|
static encode(message: BigDecimalPb, writer: Writer): void {
|
|
10
|
-
writer.uint32(10)
|
|
11
|
-
writer.bytes(message.digits)
|
|
10
|
+
writer.uint32(10);
|
|
11
|
+
writer.bytes(message.digits);
|
|
12
12
|
|
|
13
|
-
writer.uint32(16)
|
|
14
|
-
writer.int32(message.exp)
|
|
13
|
+
writer.uint32(16);
|
|
14
|
+
writer.int32(message.exp);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
static decode(reader: Reader, length: i32): BigDecimalPb {
|
|
18
|
-
const end: usize = length < 0 ? reader.end : reader.ptr + length
|
|
19
|
-
const message = new BigDecimalPb()
|
|
18
|
+
const end: usize = length < 0 ? reader.end : reader.ptr + length;
|
|
19
|
+
const message = new BigDecimalPb();
|
|
20
20
|
|
|
21
21
|
while (reader.ptr < end) {
|
|
22
|
-
const tag = reader.uint32()
|
|
22
|
+
const tag = reader.uint32();
|
|
23
23
|
switch (tag >>> 3) {
|
|
24
24
|
case 1:
|
|
25
|
-
message.digits = reader.bytes()
|
|
26
|
-
break
|
|
25
|
+
message.digits = reader.bytes();
|
|
26
|
+
break;
|
|
27
27
|
|
|
28
28
|
case 2:
|
|
29
|
-
message.exp = reader.int32()
|
|
30
|
-
break
|
|
29
|
+
message.exp = reader.int32();
|
|
30
|
+
break;
|
|
31
31
|
|
|
32
32
|
default:
|
|
33
|
-
reader.skipType(tag & 7)
|
|
34
|
-
break
|
|
33
|
+
reader.skipType(tag & 7);
|
|
34
|
+
break;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
return message
|
|
38
|
+
return message;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
digits: Uint8Array
|
|
42
|
-
exp: i32
|
|
41
|
+
digits: Uint8Array;
|
|
42
|
+
exp: i32;
|
|
43
43
|
|
|
44
44
|
constructor(digits: Uint8Array = new Uint8Array(0), exp: i32 = 0) {
|
|
45
|
-
this.digits = digits
|
|
46
|
-
this.exp = exp
|
|
45
|
+
this.digits = digits;
|
|
46
|
+
this.exp = exp;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export function encodeBigDecimalPb(message: BigDecimalPb): Uint8Array {
|
|
51
|
-
return Protobuf.encode(message, BigDecimalPb.encode)
|
|
51
|
+
return Protobuf.encode(message, BigDecimalPb.encode);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
export function decodeBigDecimalPb(buffer: Uint8Array): BigDecimalPb {
|
|
55
|
-
return Protobuf.decode<BigDecimalPb>(buffer, BigDecimalPb.decode)
|
|
55
|
+
return Protobuf.decode<BigDecimalPb>(buffer, BigDecimalPb.decode);
|
|
56
56
|
}
|
|
@@ -3,93 +3,93 @@
|
|
|
3
3
|
// protoc-gen-as v1.3.0
|
|
4
4
|
// protoc v3.21.12
|
|
5
5
|
|
|
6
|
-
import { Writer, Reader, Protobuf } from
|
|
7
|
-
import { ValuesPb } from
|
|
6
|
+
import { Writer, Reader, Protobuf } from "as-proto/assembly";
|
|
7
|
+
import { ValuesPb } from "./ValuesPb";
|
|
8
8
|
|
|
9
9
|
export class SmartContractCallPb {
|
|
10
10
|
static encode(message: SmartContractCallPb, writer: Writer): void {
|
|
11
|
-
writer.uint32(10)
|
|
12
|
-
writer.string(message.contractName)
|
|
11
|
+
writer.uint32(10);
|
|
12
|
+
writer.string(message.contractName);
|
|
13
13
|
|
|
14
|
-
writer.uint32(18)
|
|
15
|
-
writer.bytes(message.contractAddress)
|
|
14
|
+
writer.uint32(18);
|
|
15
|
+
writer.bytes(message.contractAddress);
|
|
16
16
|
|
|
17
|
-
writer.uint32(26)
|
|
18
|
-
writer.string(message.functionName)
|
|
17
|
+
writer.uint32(26);
|
|
18
|
+
writer.string(message.functionName);
|
|
19
19
|
|
|
20
|
-
writer.uint32(34)
|
|
21
|
-
writer.string(message.functionSignature)
|
|
20
|
+
writer.uint32(34);
|
|
21
|
+
writer.string(message.functionSignature);
|
|
22
22
|
|
|
23
|
-
const functionParams = message.functionParams
|
|
23
|
+
const functionParams = message.functionParams;
|
|
24
24
|
if (functionParams !== null) {
|
|
25
|
-
writer.uint32(42)
|
|
26
|
-
writer.fork()
|
|
27
|
-
ValuesPb.encode(functionParams, writer)
|
|
28
|
-
writer.ldelim()
|
|
25
|
+
writer.uint32(42);
|
|
26
|
+
writer.fork();
|
|
27
|
+
ValuesPb.encode(functionParams, writer);
|
|
28
|
+
writer.ldelim();
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
static decode(reader: Reader, length: i32): SmartContractCallPb {
|
|
33
|
-
const end: usize = length < 0 ? reader.end : reader.ptr + length
|
|
34
|
-
const message = new SmartContractCallPb()
|
|
33
|
+
const end: usize = length < 0 ? reader.end : reader.ptr + length;
|
|
34
|
+
const message = new SmartContractCallPb();
|
|
35
35
|
|
|
36
36
|
while (reader.ptr < end) {
|
|
37
|
-
const tag = reader.uint32()
|
|
37
|
+
const tag = reader.uint32();
|
|
38
38
|
switch (tag >>> 3) {
|
|
39
39
|
case 1:
|
|
40
|
-
message.contractName = reader.string()
|
|
41
|
-
break
|
|
40
|
+
message.contractName = reader.string();
|
|
41
|
+
break;
|
|
42
42
|
|
|
43
43
|
case 2:
|
|
44
|
-
message.contractAddress = reader.bytes()
|
|
45
|
-
break
|
|
44
|
+
message.contractAddress = reader.bytes();
|
|
45
|
+
break;
|
|
46
46
|
|
|
47
47
|
case 3:
|
|
48
|
-
message.functionName = reader.string()
|
|
49
|
-
break
|
|
48
|
+
message.functionName = reader.string();
|
|
49
|
+
break;
|
|
50
50
|
|
|
51
51
|
case 4:
|
|
52
|
-
message.functionSignature = reader.string()
|
|
53
|
-
break
|
|
52
|
+
message.functionSignature = reader.string();
|
|
53
|
+
break;
|
|
54
54
|
|
|
55
55
|
case 5:
|
|
56
|
-
message.functionParams = ValuesPb.decode(reader, reader.uint32())
|
|
57
|
-
break
|
|
56
|
+
message.functionParams = ValuesPb.decode(reader, reader.uint32());
|
|
57
|
+
break;
|
|
58
58
|
|
|
59
59
|
default:
|
|
60
|
-
reader.skipType(tag & 7)
|
|
61
|
-
break
|
|
60
|
+
reader.skipType(tag & 7);
|
|
61
|
+
break;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
return message
|
|
65
|
+
return message;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
contractName: string
|
|
69
|
-
contractAddress: Uint8Array
|
|
70
|
-
functionName: string
|
|
71
|
-
functionSignature: string
|
|
72
|
-
functionParams: ValuesPb | null
|
|
68
|
+
contractName: string;
|
|
69
|
+
contractAddress: Uint8Array;
|
|
70
|
+
functionName: string;
|
|
71
|
+
functionSignature: string;
|
|
72
|
+
functionParams: ValuesPb | null;
|
|
73
73
|
|
|
74
74
|
constructor(
|
|
75
|
-
contractName: string =
|
|
75
|
+
contractName: string = "",
|
|
76
76
|
contractAddress: Uint8Array = new Uint8Array(0),
|
|
77
|
-
functionName: string =
|
|
78
|
-
functionSignature: string =
|
|
77
|
+
functionName: string = "",
|
|
78
|
+
functionSignature: string = "",
|
|
79
79
|
functionParams: ValuesPb | null = null
|
|
80
80
|
) {
|
|
81
|
-
this.contractName = contractName
|
|
82
|
-
this.contractAddress = contractAddress
|
|
83
|
-
this.functionName = functionName
|
|
84
|
-
this.functionSignature = functionSignature
|
|
85
|
-
this.functionParams = functionParams
|
|
81
|
+
this.contractName = contractName;
|
|
82
|
+
this.contractAddress = contractAddress;
|
|
83
|
+
this.functionName = functionName;
|
|
84
|
+
this.functionSignature = functionSignature;
|
|
85
|
+
this.functionParams = functionParams;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
export function encodeSmartContractCallPb(
|
|
90
90
|
message: SmartContractCallPb
|
|
91
91
|
): Uint8Array {
|
|
92
|
-
return Protobuf.encode(message, SmartContractCallPb.encode)
|
|
92
|
+
return Protobuf.encode(message, SmartContractCallPb.encode);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
export function decodeSmartContractCallPb(
|
|
@@ -98,5 +98,5 @@ export function decodeSmartContractCallPb(
|
|
|
98
98
|
return Protobuf.decode<SmartContractCallPb>(
|
|
99
99
|
buffer,
|
|
100
100
|
SmartContractCallPb.decode
|
|
101
|
-
)
|
|
101
|
+
);
|
|
102
102
|
}
|
|
@@ -3,94 +3,94 @@
|
|
|
3
3
|
// protoc-gen-as v1.3.0
|
|
4
4
|
// protoc v3.21.12
|
|
5
5
|
|
|
6
|
-
import { Writer, Reader, Protobuf } from
|
|
7
|
-
import { ValuesPb } from
|
|
8
|
-
import { ValueKindPb } from
|
|
6
|
+
import { Writer, Reader, Protobuf } from "as-proto/assembly";
|
|
7
|
+
import { ValuesPb } from "./ValuesPb";
|
|
8
|
+
import { ValueKindPb } from "./ValueKindPb";
|
|
9
9
|
|
|
10
10
|
export class ValuePb {
|
|
11
11
|
static encode(message: ValuePb, writer: Writer): void {
|
|
12
|
-
writer.uint32(8)
|
|
13
|
-
writer.int32(message.kind)
|
|
12
|
+
writer.uint32(8);
|
|
13
|
+
writer.int32(message.kind);
|
|
14
14
|
|
|
15
|
-
writer.uint32(818)
|
|
16
|
-
writer.bytes(message.bytesData)
|
|
15
|
+
writer.uint32(818);
|
|
16
|
+
writer.bytes(message.bytesData);
|
|
17
17
|
|
|
18
|
-
writer.uint32(840)
|
|
19
|
-
writer.bool(message.boolData)
|
|
18
|
+
writer.uint32(840);
|
|
19
|
+
writer.bool(message.boolData);
|
|
20
20
|
|
|
21
|
-
writer.uint32(850)
|
|
22
|
-
writer.string(message.stringData)
|
|
21
|
+
writer.uint32(850);
|
|
22
|
+
writer.string(message.stringData);
|
|
23
23
|
|
|
24
|
-
const arrayData = message.arrayData
|
|
24
|
+
const arrayData = message.arrayData;
|
|
25
25
|
if (arrayData !== null) {
|
|
26
|
-
writer.uint32(866)
|
|
27
|
-
writer.fork()
|
|
28
|
-
ValuesPb.encode(arrayData, writer)
|
|
29
|
-
writer.ldelim()
|
|
26
|
+
writer.uint32(866);
|
|
27
|
+
writer.fork();
|
|
28
|
+
ValuesPb.encode(arrayData, writer);
|
|
29
|
+
writer.ldelim();
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
static decode(reader: Reader, length: i32): ValuePb {
|
|
34
|
-
const end: usize = length < 0 ? reader.end : reader.ptr + length
|
|
35
|
-
const message = new ValuePb()
|
|
34
|
+
const end: usize = length < 0 ? reader.end : reader.ptr + length;
|
|
35
|
+
const message = new ValuePb();
|
|
36
36
|
|
|
37
37
|
while (reader.ptr < end) {
|
|
38
|
-
const tag = reader.uint32()
|
|
38
|
+
const tag = reader.uint32();
|
|
39
39
|
switch (tag >>> 3) {
|
|
40
40
|
case 1:
|
|
41
|
-
message.kind = reader.int32()
|
|
42
|
-
break
|
|
41
|
+
message.kind = reader.int32();
|
|
42
|
+
break;
|
|
43
43
|
|
|
44
44
|
case 102:
|
|
45
|
-
message.bytesData = reader.bytes()
|
|
46
|
-
break
|
|
45
|
+
message.bytesData = reader.bytes();
|
|
46
|
+
break;
|
|
47
47
|
|
|
48
48
|
case 105:
|
|
49
|
-
message.boolData = reader.bool()
|
|
50
|
-
break
|
|
49
|
+
message.boolData = reader.bool();
|
|
50
|
+
break;
|
|
51
51
|
|
|
52
52
|
case 106:
|
|
53
|
-
message.stringData = reader.string()
|
|
54
|
-
break
|
|
53
|
+
message.stringData = reader.string();
|
|
54
|
+
break;
|
|
55
55
|
|
|
56
56
|
case 108:
|
|
57
|
-
message.arrayData = ValuesPb.decode(reader, reader.uint32())
|
|
58
|
-
break
|
|
57
|
+
message.arrayData = ValuesPb.decode(reader, reader.uint32());
|
|
58
|
+
break;
|
|
59
59
|
|
|
60
60
|
default:
|
|
61
|
-
reader.skipType(tag & 7)
|
|
62
|
-
break
|
|
61
|
+
reader.skipType(tag & 7);
|
|
62
|
+
break;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
return message
|
|
66
|
+
return message;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
kind: ValueKindPb
|
|
70
|
-
bytesData: Uint8Array
|
|
71
|
-
boolData: bool
|
|
72
|
-
stringData: string
|
|
73
|
-
arrayData: ValuesPb | null
|
|
69
|
+
kind: ValueKindPb;
|
|
70
|
+
bytesData: Uint8Array;
|
|
71
|
+
boolData: bool;
|
|
72
|
+
stringData: string;
|
|
73
|
+
arrayData: ValuesPb | null;
|
|
74
74
|
|
|
75
75
|
constructor(
|
|
76
76
|
kind: ValueKindPb = 0,
|
|
77
77
|
bytesData: Uint8Array = new Uint8Array(0),
|
|
78
78
|
boolData: bool = false,
|
|
79
|
-
stringData: string =
|
|
79
|
+
stringData: string = "",
|
|
80
80
|
arrayData: ValuesPb | null = null
|
|
81
81
|
) {
|
|
82
|
-
this.kind = kind
|
|
83
|
-
this.bytesData = bytesData
|
|
84
|
-
this.boolData = boolData
|
|
85
|
-
this.stringData = stringData
|
|
86
|
-
this.arrayData = arrayData
|
|
82
|
+
this.kind = kind;
|
|
83
|
+
this.bytesData = bytesData;
|
|
84
|
+
this.boolData = boolData;
|
|
85
|
+
this.stringData = stringData;
|
|
86
|
+
this.arrayData = arrayData;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
export function encodeValuePb(message: ValuePb): Uint8Array {
|
|
91
|
-
return Protobuf.encode(message, ValuePb.encode)
|
|
91
|
+
return Protobuf.encode(message, ValuePb.encode);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export function decodeValuePb(buffer: Uint8Array): ValuePb {
|
|
95
|
-
return Protobuf.decode<ValuePb>(buffer, ValuePb.decode)
|
|
95
|
+
return Protobuf.decode<ValuePb>(buffer, ValuePb.decode);
|
|
96
96
|
}
|