envio 3.6.0 → 3.6.1-subgraph
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/package.json +6 -6
- package/src/ChainState.res +10 -4
- package/src/ChainState.res.mjs +5 -1
- package/src/Config.res +12 -0
- package/src/Config.res.mjs +8 -2
- package/src/Core.res +15 -0
- package/src/Core.res.mjs +11 -0
- package/src/EventProcessing.res +6 -6
- package/src/EventProcessing.res.mjs +8 -6
- package/src/HandlerLoader.res +20 -8
- package/src/HandlerLoader.res.mjs +11 -2
- package/src/Metrics.res +5 -5
- package/src/Metrics.res.mjs +5 -1
- package/src/UserContext.res +358 -51
- package/src/UserContext.res.mjs +271 -35
- package/src/sources/SourceManager.res +6 -12
- package/src/sources/SourceManager.res.mjs +8 -5
- package/src/subgraph/blocks.ts +176 -0
- package/src/subgraph/calls.ts +213 -0
- package/src/subgraph/conformance.ts +99 -0
- package/src/subgraph/division.ts +100 -0
- package/src/subgraph/errors.ts +90 -0
- package/src/subgraph/graph-ts-types/VERSION +2 -0
- package/src/subgraph/graph-ts-types/chain/arweave.d.ts +70 -0
- package/src/subgraph/graph-ts-types/chain/cosmos.d.ts +327 -0
- package/src/subgraph/graph-ts-types/chain/ethereum.d.ts +233 -0
- package/src/subgraph/graph-ts-types/chain/near.d.ts +253 -0
- package/src/subgraph/graph-ts-types/chain/starknet.d.ts +32 -0
- package/src/subgraph/graph-ts-types/common/collections.d.ts +136 -0
- package/src/subgraph/graph-ts-types/common/conversion.d.ts +11 -0
- package/src/subgraph/graph-ts-types/common/datasource.d.ts +30 -0
- package/src/subgraph/graph-ts-types/common/eager-offset.d.ts +0 -0
- package/src/subgraph/graph-ts-types/common/json.d.ts +17 -0
- package/src/subgraph/graph-ts-types/common/numbers.d.ts +120 -0
- package/src/subgraph/graph-ts-types/common/value.d.ts +120 -0
- package/src/subgraph/graph-ts-types/common/yaml.d.ts +90 -0
- package/src/subgraph/graph-ts-types/global/global.d.ts +194 -0
- package/src/subgraph/graph-ts-types/helper-functions.d.ts +22 -0
- package/src/subgraph/graph-ts-types/index.d.ts +102 -0
- package/src/subgraph/graph-ts.ts +1695 -0
- package/src/subgraph/hosts.ts +148 -0
- package/src/subgraph/runtime.ts +827 -0
- package/src/subgraph/scope.ts +63 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import './eager-offset';
|
|
2
|
+
import { Bytes, TypedMap } from './collections';
|
|
3
|
+
import { Address, BigDecimal, BigInt } from './numbers';
|
|
4
|
+
/**
|
|
5
|
+
* Enum for supported value types.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ValueKind {
|
|
8
|
+
STRING = 0,
|
|
9
|
+
INT = 1,
|
|
10
|
+
BIGDECIMAL = 2,
|
|
11
|
+
BOOL = 3,
|
|
12
|
+
ARRAY = 4,
|
|
13
|
+
NULL = 5,
|
|
14
|
+
BYTES = 6,
|
|
15
|
+
BIGINT = 7,
|
|
16
|
+
INT8 = 8,
|
|
17
|
+
TIMESTAMP = 9
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Pointer type for Value data.
|
|
21
|
+
*
|
|
22
|
+
* Big enough to fit any pointer or native `this.data`.
|
|
23
|
+
*/
|
|
24
|
+
export type ValuePayload = bigint;
|
|
25
|
+
/**
|
|
26
|
+
* A dynamically typed value.
|
|
27
|
+
*/
|
|
28
|
+
export declare class Value {
|
|
29
|
+
kind: ValueKind;
|
|
30
|
+
data: ValuePayload;
|
|
31
|
+
constructor(kind: ValueKind, data: ValuePayload);
|
|
32
|
+
toAddress(): Address;
|
|
33
|
+
toBoolean(): boolean;
|
|
34
|
+
toBytes(): Bytes;
|
|
35
|
+
toI32(): number;
|
|
36
|
+
toI64(): bigint;
|
|
37
|
+
toTimestamp(): bigint;
|
|
38
|
+
toString(): string;
|
|
39
|
+
toBigInt(): BigInt;
|
|
40
|
+
toBigDecimal(): BigDecimal;
|
|
41
|
+
toArray(): Array<Value>;
|
|
42
|
+
toMatrix(): Array<Array<Value>>;
|
|
43
|
+
toBooleanArray(): Array<boolean>;
|
|
44
|
+
toBytesArray(): Array<Bytes>;
|
|
45
|
+
toStringArray(): Array<string>;
|
|
46
|
+
toI32Array(): Array<number>;
|
|
47
|
+
toI64Array(): Array<bigint>;
|
|
48
|
+
toTimestampArray(): Array<bigint>;
|
|
49
|
+
toBigIntArray(): Array<BigInt>;
|
|
50
|
+
toBigDecimalArray(): Array<BigDecimal>;
|
|
51
|
+
toBooleanMatrix(): Array<Array<boolean>>;
|
|
52
|
+
toBytesMatrix(): Array<Array<Bytes>>;
|
|
53
|
+
toAddressMatrix(): Array<Array<Address>>;
|
|
54
|
+
toStringMatrix(): Array<Array<string>>;
|
|
55
|
+
toI32Matrix(): Array<Array<number>>;
|
|
56
|
+
toI64Matrix(): Array<Array<bigint>>;
|
|
57
|
+
toBigIntMatrix(): Array<Array<BigInt>>;
|
|
58
|
+
/** Return a string that indicates the kind of value `this` contains for
|
|
59
|
+
* logging and error messages */
|
|
60
|
+
displayKind(): string;
|
|
61
|
+
/** Return a string representation of the value of `this` for logging and
|
|
62
|
+
* error messages */
|
|
63
|
+
displayData(): string;
|
|
64
|
+
static fromBooleanArray(input: Array<boolean>): Value;
|
|
65
|
+
static fromBytesArray(input: Array<Bytes>): Value;
|
|
66
|
+
static fromI32Array(input: Array<number>): Value;
|
|
67
|
+
static fromI64Array(input: Array<bigint>): Value;
|
|
68
|
+
static fromBigIntArray(input: Array<BigInt>): Value;
|
|
69
|
+
static fromBigDecimalArray(input: Array<BigDecimal>): Value;
|
|
70
|
+
static fromStringArray(input: Array<string>): Value;
|
|
71
|
+
static fromAddressArray(input: Array<Address>): Value;
|
|
72
|
+
static fromArray(input: Array<Value>): Value;
|
|
73
|
+
static fromBigInt(n: BigInt): Value;
|
|
74
|
+
static fromBoolean(b: boolean): Value;
|
|
75
|
+
static fromBytes(bytes: Bytes): Value;
|
|
76
|
+
static fromNull(): Value;
|
|
77
|
+
static fromI32(n: number): Value;
|
|
78
|
+
static fromI64(n: bigint): Value;
|
|
79
|
+
static fromTimestamp(n: bigint): Value;
|
|
80
|
+
static fromString(s: string): Value;
|
|
81
|
+
static fromAddress(s: Address): Value;
|
|
82
|
+
static fromBigDecimal(n: BigDecimal): Value;
|
|
83
|
+
static fromMatrix(values: Array<Array<Value>>): Value;
|
|
84
|
+
static fromBooleanMatrix(values: Array<Array<boolean>>): Value;
|
|
85
|
+
static fromBytesMatrix(values: Array<Array<Bytes>>): Value;
|
|
86
|
+
static fromAddressMatrix(values: Array<Array<Address>>): Value;
|
|
87
|
+
static fromStringMatrix(values: Array<Array<string>>): Value;
|
|
88
|
+
static fromI32Matrix(values: Array<Array<number>>): Value;
|
|
89
|
+
static fromI64Matrix(values: Array<Array<bigint>>): Value;
|
|
90
|
+
static fromTimestampMatrix(values: Array<Array<bigint>>): Value;
|
|
91
|
+
static fromBigIntMatrix(values: Array<Array<BigInt>>): Value;
|
|
92
|
+
}
|
|
93
|
+
/** Type hint for JSON values. */
|
|
94
|
+
export declare enum JSONValueKind {
|
|
95
|
+
NULL = 0,
|
|
96
|
+
BOOL = 1,
|
|
97
|
+
NUMBER = 2,
|
|
98
|
+
STRING = 3,
|
|
99
|
+
ARRAY = 4,
|
|
100
|
+
OBJECT = 5
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Pointer type for JSONValue data.
|
|
104
|
+
*
|
|
105
|
+
* Big enough to fit any pointer or native `this.data`.
|
|
106
|
+
*/
|
|
107
|
+
export type JSONValuePayload = bigint;
|
|
108
|
+
export declare class JSONValue {
|
|
109
|
+
kind: JSONValueKind;
|
|
110
|
+
data: JSONValuePayload;
|
|
111
|
+
isNull(): boolean;
|
|
112
|
+
toBool(): boolean;
|
|
113
|
+
toI64(): bigint;
|
|
114
|
+
toU64(): bigint;
|
|
115
|
+
toF64(): number;
|
|
116
|
+
toBigInt(): BigInt;
|
|
117
|
+
toString(): string;
|
|
118
|
+
toArray(): Array<JSONValue>;
|
|
119
|
+
toObject(): TypedMap<string, JSONValue>;
|
|
120
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import './eager-offset';
|
|
2
|
+
import { Bytes, Result, TypedMap } from './collections';
|
|
3
|
+
import { BigInt } from './numbers';
|
|
4
|
+
/**
|
|
5
|
+
* Host YAML interface.
|
|
6
|
+
*/
|
|
7
|
+
export declare namespace yaml {
|
|
8
|
+
/**
|
|
9
|
+
* Parses a YAML document from UTF-8 encoded bytes.
|
|
10
|
+
* Aborts mapping execution if the bytes cannot be parsed.
|
|
11
|
+
*/
|
|
12
|
+
function fromBytes(data: Bytes): YAMLValue;
|
|
13
|
+
/**
|
|
14
|
+
* Parses a YAML document from UTF-8 encoded bytes.
|
|
15
|
+
* Returns `Result.error == true` if the bytes cannot be parsed.
|
|
16
|
+
*/
|
|
17
|
+
function try_fromBytes(data: Bytes): Result<YAMLValue, boolean>;
|
|
18
|
+
}
|
|
19
|
+
export declare namespace yaml {
|
|
20
|
+
/**
|
|
21
|
+
* Parses a YAML document from a UTF-8 encoded string.
|
|
22
|
+
* Aborts mapping execution if the string cannot be parsed.
|
|
23
|
+
*/
|
|
24
|
+
function fromString(data: string): YAMLValue;
|
|
25
|
+
/**
|
|
26
|
+
* Parses a YAML document from a UTF-8 encoded string.
|
|
27
|
+
* Returns `Result.error == true` if the string cannot be parsed.
|
|
28
|
+
*/
|
|
29
|
+
function try_fromString(data: string): Result<YAMLValue, boolean>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* All possible YAML value types.
|
|
33
|
+
*/
|
|
34
|
+
export declare enum YAMLValueKind {
|
|
35
|
+
NULL = 0,
|
|
36
|
+
BOOL = 1,
|
|
37
|
+
NUMBER = 2,
|
|
38
|
+
STRING = 3,
|
|
39
|
+
ARRAY = 4,
|
|
40
|
+
OBJECT = 5,
|
|
41
|
+
TAGGED = 6
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Pointer type for `YAMLValue` data.
|
|
45
|
+
*
|
|
46
|
+
* Big enough to fit any pointer or native `YAMLValue.data`.
|
|
47
|
+
*/
|
|
48
|
+
export type YAMLValuePayload = bigint;
|
|
49
|
+
export declare class YAMLValue {
|
|
50
|
+
kind: YAMLValueKind;
|
|
51
|
+
data: YAMLValuePayload;
|
|
52
|
+
constructor(kind: YAMLValueKind, data: YAMLValuePayload);
|
|
53
|
+
static newNull(): YAMLValue;
|
|
54
|
+
static newBool(data: boolean): YAMLValue;
|
|
55
|
+
static newI64(data: bigint): YAMLValue;
|
|
56
|
+
static newU64(data: bigint): YAMLValue;
|
|
57
|
+
static newF64(data: number): YAMLValue;
|
|
58
|
+
static newBigInt(data: BigInt): YAMLValue;
|
|
59
|
+
static newString(data: string): YAMLValue;
|
|
60
|
+
static newArray(data: Array<YAMLValue>): YAMLValue;
|
|
61
|
+
static newObject(data: TypedMap<YAMLValue, YAMLValue>): YAMLValue;
|
|
62
|
+
static newTagged(tag: string, value: YAMLValue): YAMLValue;
|
|
63
|
+
isNull(): boolean;
|
|
64
|
+
isBool(): boolean;
|
|
65
|
+
isNumber(): boolean;
|
|
66
|
+
isString(): boolean;
|
|
67
|
+
isArray(): boolean;
|
|
68
|
+
isObject(): boolean;
|
|
69
|
+
isTagged(): boolean;
|
|
70
|
+
toBool(): boolean;
|
|
71
|
+
toNumber(): string;
|
|
72
|
+
toI64(): bigint;
|
|
73
|
+
toU64(): bigint;
|
|
74
|
+
toF64(): number;
|
|
75
|
+
toBigInt(): BigInt;
|
|
76
|
+
toString(): string;
|
|
77
|
+
toArray(): Array<YAMLValue>;
|
|
78
|
+
toObject(): TypedMap<YAMLValue, YAMLValue>;
|
|
79
|
+
toTagged(): YAMLTaggedValue;
|
|
80
|
+
static eq(a: YAMLValue, b: YAMLValue): boolean;
|
|
81
|
+
static ne(a: YAMLValue | null, b: YAMLValue | null): boolean;
|
|
82
|
+
get(index: string): YAMLValue;
|
|
83
|
+
}
|
|
84
|
+
export declare class YAMLTaggedValue {
|
|
85
|
+
tag: string;
|
|
86
|
+
value: YAMLValue;
|
|
87
|
+
constructor(tag: string, value: YAMLValue);
|
|
88
|
+
static eq(a: YAMLTaggedValue, b: YAMLTaggedValue): boolean;
|
|
89
|
+
static ne(a: YAMLTaggedValue | null, b: YAMLTaggedValue | null): boolean;
|
|
90
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contains type IDs and their discriminants for every blockchain supported by Graph-Node.
|
|
3
|
+
*
|
|
4
|
+
* Each variant corresponds to the unique ID of an AssemblyScript concrete class used by
|
|
5
|
+
* Graph-Node's runtime.
|
|
6
|
+
*
|
|
7
|
+
* # Rules for updating this enum
|
|
8
|
+
*
|
|
9
|
+
* 1. The discriminants must have the same value as their counterparts in `IndexForAscTypeId` enum
|
|
10
|
+
* from `graph-node`'s `graph::runtime` module. If not, the runtime will fail to determine the
|
|
11
|
+
* correct class during allocation.
|
|
12
|
+
* 2. Each supported blockchain has a reserved space of 1,000 * contiguous variants.
|
|
13
|
+
* 3. Once defined, items and their discriminants cannot be changed, as this would break running
|
|
14
|
+
* subgraphs compiled in previous versions of this representation.
|
|
15
|
+
*/
|
|
16
|
+
export declare enum TypeId {
|
|
17
|
+
String = 0,
|
|
18
|
+
ArrayBuffer = 1,
|
|
19
|
+
Int8Array = 2,
|
|
20
|
+
Int16Array = 3,
|
|
21
|
+
Int32Array = 4,
|
|
22
|
+
Int64Array = 5,
|
|
23
|
+
Uint8Array = 6,
|
|
24
|
+
Uint16Array = 7,
|
|
25
|
+
Uint32Array = 8,
|
|
26
|
+
Uint64Array = 9,
|
|
27
|
+
Float32Array = 10,
|
|
28
|
+
Float64Array = 11,
|
|
29
|
+
BigDecimal = 12,
|
|
30
|
+
ArrayBool = 13,
|
|
31
|
+
ArrayUint8Array = 14,
|
|
32
|
+
ArrayEthereumValue = 15,
|
|
33
|
+
ArrayStoreValue = 16,
|
|
34
|
+
ArrayJsonValue = 17,
|
|
35
|
+
ArrayString = 18,
|
|
36
|
+
ArrayEventParam = 19,
|
|
37
|
+
ArrayTypedMapEntryStringJsonValue = 20,
|
|
38
|
+
ArrayTypedMapEntryStringStoreValue = 21,
|
|
39
|
+
SmartContractCall = 22,
|
|
40
|
+
EventParam = 23,
|
|
41
|
+
EthereumTransaction = 24,
|
|
42
|
+
EthereumBlock = 25,
|
|
43
|
+
EthereumCall = 26,
|
|
44
|
+
WrappedTypedMapStringJsonValue = 27,
|
|
45
|
+
WrappedBool = 28,
|
|
46
|
+
WrappedJsonValue = 29,
|
|
47
|
+
EthereumValue = 30,
|
|
48
|
+
StoreValue = 31,
|
|
49
|
+
JsonValue = 32,
|
|
50
|
+
EthereumEvent = 33,
|
|
51
|
+
TypedMapEntryStringStoreValue = 34,
|
|
52
|
+
TypedMapEntryStringJsonValue = 35,
|
|
53
|
+
TypedMapStringStoreValue = 36,
|
|
54
|
+
TypedMapStringJsonValue = 37,
|
|
55
|
+
TypedMapStringTypedMapStringJsonValue = 38,
|
|
56
|
+
ResultTypedMapStringJsonValueBool = 39,
|
|
57
|
+
ResultJsonValueBool = 40,
|
|
58
|
+
ArrayU8 = 41,
|
|
59
|
+
ArrayU16 = 42,
|
|
60
|
+
ArrayU32 = 43,
|
|
61
|
+
ArrayU64 = 44,
|
|
62
|
+
ArrayI8 = 45,
|
|
63
|
+
ArrayI16 = 46,
|
|
64
|
+
ArrayI32 = 47,
|
|
65
|
+
ArrayI64 = 48,
|
|
66
|
+
ArrayF32 = 49,
|
|
67
|
+
ArrayF64 = 50,
|
|
68
|
+
ArrayBigDecimal = 51,
|
|
69
|
+
NearArrayDataReceiver = 52,
|
|
70
|
+
NearArrayCryptoHash = 53,
|
|
71
|
+
NearArrayActionValue = 54,
|
|
72
|
+
NearMerklePath = 55,// or NearArrayMerklePathItem
|
|
73
|
+
NearArrayValidatorStake = 56,
|
|
74
|
+
NearArraySlashedValidator = 57,
|
|
75
|
+
NearArraySignature = 58,
|
|
76
|
+
NearArrayChunkHeader = 59,
|
|
77
|
+
NearAccessKeyPermissionValue = 60,
|
|
78
|
+
NearActionValue = 61,
|
|
79
|
+
NearDirection = 62,// not used in graph-node anymore. Can be ignored.
|
|
80
|
+
NearPublicKey = 63,
|
|
81
|
+
NearSignature = 64,
|
|
82
|
+
NearFunctionCallPermission = 65,
|
|
83
|
+
NearFullAccessPermission = 66,
|
|
84
|
+
NearAccessKey = 67,
|
|
85
|
+
NearDataReceiver = 68,
|
|
86
|
+
NearCreateAccountAction = 69,
|
|
87
|
+
NearDeployContractAction = 70,
|
|
88
|
+
NearFunctionCallAction = 71,
|
|
89
|
+
NearTransferAction = 72,
|
|
90
|
+
NearStakeAction = 73,
|
|
91
|
+
NearAddKeyAction = 74,
|
|
92
|
+
NearDeleteKeyAction = 75,
|
|
93
|
+
NearDeleteAccountAction = 76,
|
|
94
|
+
NearActionReceipt = 77,
|
|
95
|
+
NearSuccessStatus = 78,
|
|
96
|
+
NearMerklePathItem = 79,
|
|
97
|
+
NearExecutionOutcome = 80,
|
|
98
|
+
NearSlashedValidator = 81,
|
|
99
|
+
NearBlockHeader = 82,
|
|
100
|
+
NearValidatorStake = 83,
|
|
101
|
+
NearChunkHeader = 84,
|
|
102
|
+
NearBlock = 85,
|
|
103
|
+
NearReceiptWithOutcome = 86,
|
|
104
|
+
TransactionReceipt = 1000,
|
|
105
|
+
Log = 1001,
|
|
106
|
+
ArrayH256 = 1002,
|
|
107
|
+
ArrayLog = 1003,
|
|
108
|
+
CosmosAny = 1500,
|
|
109
|
+
CosmosAnyArray = 1501,
|
|
110
|
+
CosmosBytesArray = 1502,
|
|
111
|
+
CosmosCoinArray = 1503,
|
|
112
|
+
CosmosCommitSigArray = 1504,
|
|
113
|
+
CosmosEventArray = 1505,
|
|
114
|
+
CosmosEventAttributeArray = 1506,
|
|
115
|
+
CosmosEvidenceArray = 1507,
|
|
116
|
+
CosmosModeInfoArray = 1508,
|
|
117
|
+
CosmosSignerInfoArray = 1509,
|
|
118
|
+
CosmosTxResultArray = 1510,
|
|
119
|
+
CosmosValidatorArray = 1511,
|
|
120
|
+
CosmosValidatorUpdateArray = 1512,
|
|
121
|
+
CosmosAuthInfo = 1513,
|
|
122
|
+
CosmosBlock = 1514,
|
|
123
|
+
CosmosBlockId = 1515,
|
|
124
|
+
CosmosBlockIdFlagEnum = 1516,
|
|
125
|
+
CosmosBlockParams = 1517,
|
|
126
|
+
CosmosCoin = 1518,
|
|
127
|
+
CosmosCommit = 1519,
|
|
128
|
+
CosmosCommitSig = 1520,
|
|
129
|
+
CosmosCompactBitArray = 1521,
|
|
130
|
+
CosmosConsensus = 1522,
|
|
131
|
+
CosmosConsensusParams = 1523,
|
|
132
|
+
CosmosDuplicateVoteEvidence = 1524,
|
|
133
|
+
CosmosDuration = 1525,
|
|
134
|
+
CosmosEvent = 1526,
|
|
135
|
+
CosmosEventAttribute = 1527,
|
|
136
|
+
CosmosEventData = 1528,
|
|
137
|
+
CosmosEventVote = 1529,
|
|
138
|
+
CosmosEvidence = 1530,
|
|
139
|
+
CosmosEvidenceList = 1531,
|
|
140
|
+
CosmosEvidenceParams = 1532,
|
|
141
|
+
CosmosFee = 1533,
|
|
142
|
+
CosmosHeader = 1534,
|
|
143
|
+
CosmosHeaderOnlyBlock = 1535,
|
|
144
|
+
CosmosLightBlock = 1536,
|
|
145
|
+
CosmosLightClientAttackEvidence = 1537,
|
|
146
|
+
CosmosModeInfo = 1538,
|
|
147
|
+
CosmosModeInfoMulti = 1539,
|
|
148
|
+
CosmosModeInfoSingle = 1540,
|
|
149
|
+
CosmosPartSetHeader = 1541,
|
|
150
|
+
CosmosPublicKey = 1542,
|
|
151
|
+
CosmosResponseBeginBlock = 1543,
|
|
152
|
+
CosmosResponseDeliverTx = 1544,
|
|
153
|
+
CosmosResponseEndBlock = 1545,
|
|
154
|
+
CosmosSignModeEnum = 1546,
|
|
155
|
+
CosmosSignedHeader = 1547,
|
|
156
|
+
CosmosSignedMsgTypeEnum = 1548,
|
|
157
|
+
CosmosSignerInfo = 1549,
|
|
158
|
+
CosmosTimestamp = 1550,
|
|
159
|
+
CosmosTip = 1551,
|
|
160
|
+
CosmosTransactionData = 1552,
|
|
161
|
+
CosmosTx = 1553,
|
|
162
|
+
CosmosTxBody = 1554,
|
|
163
|
+
CosmosTxResult = 1555,
|
|
164
|
+
CosmosValidator = 1556,
|
|
165
|
+
CosmosValidatorParams = 1557,
|
|
166
|
+
CosmosValidatorSet = 1558,
|
|
167
|
+
CosmosValidatorSetUpdates = 1559,
|
|
168
|
+
CosmosValidatorUpdate = 1560,
|
|
169
|
+
CosmosVersionParams = 1561,
|
|
170
|
+
CosmosMessageData = 1562,
|
|
171
|
+
CosmosTransactionContext = 1563,
|
|
172
|
+
ArweaveBlock = 2500,
|
|
173
|
+
ArweaveProofOfAccess = 2501,
|
|
174
|
+
ArweaveTag = 2502,
|
|
175
|
+
ArweaveTagArray = 2503,
|
|
176
|
+
ArweaveTransaction = 2504,
|
|
177
|
+
ArweaveTransactionArray = 2505,
|
|
178
|
+
ArweaveTransactionWithBlockPtr = 2506,
|
|
179
|
+
StarknetBlock = 3500,
|
|
180
|
+
StarknetTransaction = 3501,
|
|
181
|
+
StarknetTransactionTypeEnum = 3502,
|
|
182
|
+
StarknetEvent = 3503,
|
|
183
|
+
StarknetArrayBytes = 3504,
|
|
184
|
+
YamlValue = 5500,
|
|
185
|
+
YamlTaggedValue = 5501,
|
|
186
|
+
YamlTypedMapEntryValueValue = 5502,
|
|
187
|
+
YamlTypedMapValueValue = 5503,
|
|
188
|
+
YamlArrayValue = 5504,
|
|
189
|
+
YamlArrayTypedMapEntryValueValue = 5505,
|
|
190
|
+
YamlWrappedValue = 5506,
|
|
191
|
+
YamlResultValueBool = 5507
|
|
192
|
+
}
|
|
193
|
+
export declare function id_of_type(typeId: TypeId): number;
|
|
194
|
+
export declare function allocate(size: number): number;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ByteArray } from './index';
|
|
2
|
+
/**
|
|
3
|
+
* Takes 2 ByteArrays and concatenates them
|
|
4
|
+
* @param a - 1st ByteArray
|
|
5
|
+
* @param b - 2nd ByteArray
|
|
6
|
+
* @returns A concatenated ByteArray
|
|
7
|
+
*/
|
|
8
|
+
export declare function concat(a: ByteArray, b: ByteArray): ByteArray;
|
|
9
|
+
/**
|
|
10
|
+
* Parses a CSV string into an array of strings.
|
|
11
|
+
* @param csv CSV string.
|
|
12
|
+
* @returns Array of strings.
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseCSV(csv: string): Array<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Adds 0x1220 to the front of a ByteArray. This can be used when an IPFS hash is stored in an Ethereum Bytes32 type.
|
|
17
|
+
* The IPFS hash will fit in a Bytes32 when 0x1220 is removed. Since 0x1220 is currently in front of every single IPFS
|
|
18
|
+
* hash, this works. But it is possible in the future that IPFS will update their spec.
|
|
19
|
+
* @param a - The ByteArray without 0x1220 prefixed
|
|
20
|
+
* @returns - The ByteArray with 0x1220 prefixed
|
|
21
|
+
*/
|
|
22
|
+
export declare function addQm(a: ByteArray): ByteArray;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { ByteArray, Bytes, Entity } from './common/collections';
|
|
2
|
+
import { Value } from './common/value';
|
|
3
|
+
export * from './chain/arweave';
|
|
4
|
+
export * from './chain/ethereum';
|
|
5
|
+
export * from './chain/near';
|
|
6
|
+
export * from './chain/cosmos';
|
|
7
|
+
export * from './chain/starknet';
|
|
8
|
+
export * from './common/collections';
|
|
9
|
+
export * from './common/conversion';
|
|
10
|
+
export * from './common/datasource';
|
|
11
|
+
export * from './common/json';
|
|
12
|
+
export * from './common/numbers';
|
|
13
|
+
export * from './common/value';
|
|
14
|
+
export * from './common/yaml';
|
|
15
|
+
/**
|
|
16
|
+
* Host store interface.
|
|
17
|
+
*/
|
|
18
|
+
export declare namespace store {
|
|
19
|
+
function get(entity: string, id: string): Entity | null;
|
|
20
|
+
/** If the entity was not created in the block, this function will return null. */
|
|
21
|
+
function get_in_block(entity: string, id: string): Entity | null;
|
|
22
|
+
function loadRelated(entity: string, id: string, field: string): Array<Entity>;
|
|
23
|
+
function set(entity: string, id: string, data: Entity): void;
|
|
24
|
+
function remove(entity: string, id: string): void;
|
|
25
|
+
}
|
|
26
|
+
/** Host IPFS interface */
|
|
27
|
+
export declare namespace ipfs {
|
|
28
|
+
function cat(hash: string): Bytes | null;
|
|
29
|
+
function map(hash: string, callback: string, userData: Value, flags: string[]): void;
|
|
30
|
+
}
|
|
31
|
+
export declare namespace ipfs {
|
|
32
|
+
function mapJSON(hash: string, callback: string, userData: Value): void;
|
|
33
|
+
}
|
|
34
|
+
/** Host crypto utilities interface */
|
|
35
|
+
export declare namespace crypto {
|
|
36
|
+
function keccak256(input: ByteArray): ByteArray;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Special function for ENS name lookups, not meant for general purpose use.
|
|
40
|
+
* This function will only be useful if the graph-node instance has additional
|
|
41
|
+
* data loaded **
|
|
42
|
+
*/
|
|
43
|
+
export declare namespace ens {
|
|
44
|
+
function nameByHash(hash: string): string | null;
|
|
45
|
+
}
|
|
46
|
+
export declare namespace log {
|
|
47
|
+
function log(level: Level, msg: string): void;
|
|
48
|
+
}
|
|
49
|
+
export declare namespace log {
|
|
50
|
+
enum Level {
|
|
51
|
+
CRITICAL = 0,
|
|
52
|
+
ERROR = 1,
|
|
53
|
+
WARNING = 2,
|
|
54
|
+
INFO = 3,
|
|
55
|
+
DEBUG = 4
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Logs a critical message that terminates the subgraph.
|
|
59
|
+
*
|
|
60
|
+
* @param msg Format string a la "Value = {}, other = {}".
|
|
61
|
+
* @param args Format string arguments.
|
|
62
|
+
*/
|
|
63
|
+
function critical(msg: string, args: Array<string>): void;
|
|
64
|
+
/**
|
|
65
|
+
* Logs an error message.
|
|
66
|
+
*
|
|
67
|
+
* @param msg Format string a la "Value = {}, other = {}".
|
|
68
|
+
* @param args Format string arguments.
|
|
69
|
+
*/
|
|
70
|
+
function error(msg: string, args: Array<string>): void;
|
|
71
|
+
/** Logs a warning message.
|
|
72
|
+
*
|
|
73
|
+
* @param msg Format string a la "Value = {}, other = {}".
|
|
74
|
+
* @param args Format string arguments.
|
|
75
|
+
*/
|
|
76
|
+
function warning(msg: string, args: Array<string>): void;
|
|
77
|
+
/** Logs an info message.
|
|
78
|
+
*
|
|
79
|
+
* @param msg Format string a la "Value = {}, other = {}".
|
|
80
|
+
* @param args Format string arguments.
|
|
81
|
+
*/
|
|
82
|
+
function info(msg: string, args: Array<string>): void;
|
|
83
|
+
/** Logs a debug message.
|
|
84
|
+
*
|
|
85
|
+
* @param msg Format string a la "Value = {}, other = {}".
|
|
86
|
+
* @param args Format string arguments.
|
|
87
|
+
*/
|
|
88
|
+
function debug(msg: string, args: Array<string>): void;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Helper functions for Ethereum.
|
|
92
|
+
*/
|
|
93
|
+
export declare namespace EthereumUtils {
|
|
94
|
+
/**
|
|
95
|
+
* Returns the contract address that would result from the given CREATE2 call.
|
|
96
|
+
* @param from The Ethereum address of the account that is initiating the contract creation.
|
|
97
|
+
* @param salt A 32-byte value that is used to create a deterministic address for the contract. This can be any arbitrary value, but it should be unique to the contract being created.
|
|
98
|
+
* @param initCodeHash he compiled code that will be executed when the contract is created. This should be a hex-encoded string that represents the compiled bytecode.
|
|
99
|
+
* @returns Address of the contract that would be created.
|
|
100
|
+
*/
|
|
101
|
+
function getCreate2Address(from: Bytes, salt: Bytes, initCodeHash: Bytes): Bytes;
|
|
102
|
+
}
|