datai-sdk 1.0.1 → 1.0.3

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.
@@ -1,7 +1,7 @@
1
1
  import '../common/eager_offset';
2
2
  import { Bytes, Wrapped } from '../common/collections';
3
3
  import { Address, BigInt } from '../common/numbers';
4
- import * as API from '../../../API'
4
+ import * as API from '../../../../API'
5
5
 
6
6
  export namespace ethereum {
7
7
  export const call = API.ethereum.call
@@ -1,3 +1,3 @@
1
1
  import './eager_offset';
2
2
 
3
- export { typeConversion } from '../../../API';
3
+ export { typeConversion } from '../../../../API';
@@ -1,7 +1,7 @@
1
1
  import './eager_offset';
2
2
  import { ByteArray, Bytes } from './collections';
3
3
  import { typeConversion } from './conversion';
4
- import { bigInt, bigDecimal } from '../../../API'
4
+ import { bigInt, bigDecimal } from '../../../../API'
5
5
 
6
6
  export type Int8 = i64;
7
7
  export type Timestamp = i64;
@@ -20,8 +20,8 @@ export * from './common/datasource';
20
20
  export * from './common/json';
21
21
  export * from './common/numbers';
22
22
  export * from './common/value';
23
- import * as API from '../../API'
24
- export { store, crypto } from '../../API';
23
+ import * as API from '../../../API'
24
+ export { store, crypto } from '../../../API';
25
25
 
26
26
 
27
27
  // /** Host IPFS interface */
@@ -3,111 +3,108 @@
3
3
  // protoc-gen-as v1.3.0
4
4
  // protoc v3.21.12
5
5
 
6
- import { Writer, Reader, Protobuf } from "as-proto/assembly";
7
- import { TokenBalancePb } from "./TokenBalancePb";
8
- import { Timestamp } from "../google/protobuf/Timestamp";
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
- reader,
84
- reader.uint32()
85
- );
86
- break;
82
+ message.positionToken = TokenBalancePb.decode(reader, reader.uint32())
83
+ break
87
84
 
88
85
  case 5:
89
- message.unlockTimestamp = Timestamp.decode(reader, reader.uint32());
90
- break;
86
+ message.unlockTimestamp = Timestamp.decode(reader, reader.uint32())
87
+ break
91
88
 
92
89
  case 6:
93
- message.poolAddressBytes = reader.bytes();
94
- break;
90
+ message.poolAddressBytes = reader.bytes()
91
+ break
95
92
 
96
93
  default:
97
- reader.skipType(tag & 7);
98
- break;
94
+ reader.skipType(tag & 7)
95
+ break
99
96
  }
100
97
  }
101
98
 
102
- return message;
99
+ return message
103
100
  }
104
101
 
105
- supplyTokens: Array<TokenBalancePb>;
106
- borrowTokens: Array<TokenBalancePb>;
107
- rewardTokens: Array<TokenBalancePb>;
108
- positionToken: TokenBalancePb | null;
109
- unlockTimestamp: Timestamp | null;
110
- poolAddressBytes: Uint8Array;
102
+ supplyTokens: Array<TokenBalancePb>
103
+ borrowTokens: Array<TokenBalancePb>
104
+ rewardTokens: Array<TokenBalancePb>
105
+ positionToken: TokenBalancePb | null
106
+ unlockTimestamp: Timestamp | null
107
+ poolAddressBytes: Uint8Array
111
108
 
112
109
  constructor(
113
110
  supplyTokens: Array<TokenBalancePb> = [],
@@ -117,19 +114,19 @@ export class ActivePositionsResultPb {
117
114
  unlockTimestamp: Timestamp | null = null,
118
115
  poolAddressBytes: Uint8Array = new Uint8Array(0)
119
116
  ) {
120
- this.supplyTokens = supplyTokens;
121
- this.borrowTokens = borrowTokens;
122
- this.rewardTokens = rewardTokens;
123
- this.positionToken = positionToken;
124
- this.unlockTimestamp = unlockTimestamp;
125
- this.poolAddressBytes = poolAddressBytes;
117
+ this.supplyTokens = supplyTokens
118
+ this.borrowTokens = borrowTokens
119
+ this.rewardTokens = rewardTokens
120
+ this.positionToken = positionToken
121
+ this.unlockTimestamp = unlockTimestamp
122
+ this.poolAddressBytes = poolAddressBytes
126
123
  }
127
124
  }
128
125
 
129
126
  export function encodeActivePositionsResultPb(
130
127
  message: ActivePositionsResultPb
131
128
  ): Uint8Array {
132
- return Protobuf.encode(message, ActivePositionsResultPb.encode);
129
+ return Protobuf.encode(message, ActivePositionsResultPb.encode)
133
130
  }
134
131
 
135
132
  export function decodeActivePositionsResultPb(
@@ -138,5 +135,5 @@ export function decodeActivePositionsResultPb(
138
135
  return Protobuf.decode<ActivePositionsResultPb>(
139
136
  buffer,
140
137
  ActivePositionsResultPb.decode
141
- );
138
+ )
142
139
  }
@@ -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 "as-proto/assembly";
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 "as-proto/assembly";
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 "as-proto/assembly";
7
- import { ValuesPb } from "./ValuesPb";
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
  }
@@ -13,5 +13,5 @@ export enum ValueKindPb {
13
13
  STRING = 6,
14
14
  FIXED_ARRAY = 7,
15
15
  ARRAY = 8,
16
- TUPLE = 9,
16
+ TUPLE = 9
17
17
  }