@graphprotocol/grc-20 0.9.1 → 0.9.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.
package/dist/index.d.ts CHANGED
@@ -20,6 +20,9 @@ export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpa
20
20
  */
21
21
  export { Account } from './src/account.js';
22
22
  export { DataBlock, ImageBlock, TextBlock } from './src/blocks.js';
23
+ export * as Encoding from './src/encoding.js';
24
+ export { getChecksumAddress } from './src/core/get-checksum-address.js';
25
+ export * as Graph from './src/graph/index.js';
23
26
  /**
24
27
  * This module provides utility functions for working with knowledge graph
25
28
  * images in TypeScript.
@@ -27,13 +30,14 @@ export { DataBlock, ImageBlock, TextBlock } from './src/blocks.js';
27
30
  * @since 0.0.6
28
31
  */
29
32
  export { Image } from './src/image.js';
30
- export { Position, PositionRange } from './src/position.js';
31
33
  /**
32
- * This module provides utility functions for working with Triples in TypeScript.
34
+ * This module provides utility functions for interacting with the default
35
+ * IPFS gateway in TypeScript.
33
36
  *
34
- * @since 0.0.6
37
+ * @since 0.1.1
35
38
  */
36
- export { Triple } from './src/triple.js';
39
+ export * as Ipfs from './src/ipfs.js';
40
+ export { Position, PositionRange } from './src/position.js';
37
41
  /**
38
42
  * This module provides utility functions for working with Relations in TypeScript.
39
43
  *
@@ -46,18 +50,15 @@ export { Relation } from './src/relation.js';
46
50
  * @since 0.0.6
47
51
  */
48
52
  export { GraphUrl } from './src/scheme.js';
53
+ export { getSmartAccountWalletClient } from './src/smart-wallet.js';
49
54
  /**
50
55
  * Provides ids for commonly used entities across the Knowledge Graph.
51
56
  */
52
57
  export { ContentIds, NetworkIds, SystemIds } from './src/system-ids.js';
53
- export { getChecksumAddress } from './src/core/get-checksum-address.js';
54
58
  /**
55
- * This module provides utility functions for interacting with the default
56
- * IPFS gateway in TypeScript.
59
+ * This module provides utility functions for working with Triples in TypeScript.
57
60
  *
58
- * @since 0.1.1
61
+ * @since 0.0.6
59
62
  */
60
- export * as Ipfs from './src/ipfs.js';
61
- export * as Graph from './src/graph/index.js';
62
- export { getSmartAccountWalletClient } from './src/smart-wallet.js';
63
+ export { Triple } from './src/triple.js';
63
64
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEnE;;;;;GAKG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAE9C,OA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20,9 @@ export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpa
20
20
  */
21
21
  export { Account } from './src/account.js';
22
22
  export { DataBlock, ImageBlock, TextBlock } from './src/blocks.js';
23
+ export * as Encoding from './src/encoding.js';
24
+ export { getChecksumAddress } from './src/core/get-checksum-address.js';
25
+ export * as Graph from './src/graph/index.js';
23
26
  /**
24
27
  * This module provides utility functions for working with knowledge graph
25
28
  * images in TypeScript.
@@ -27,13 +30,14 @@ export { DataBlock, ImageBlock, TextBlock } from './src/blocks.js';
27
30
  * @since 0.0.6
28
31
  */
29
32
  export { Image } from './src/image.js';
30
- export { Position, PositionRange } from './src/position.js';
31
33
  /**
32
- * This module provides utility functions for working with Triples in TypeScript.
34
+ * This module provides utility functions for interacting with the default
35
+ * IPFS gateway in TypeScript.
33
36
  *
34
- * @since 0.0.6
37
+ * @since 0.1.1
35
38
  */
36
- export { Triple } from './src/triple.js';
39
+ export * as Ipfs from './src/ipfs.js';
40
+ export { Position, PositionRange } from './src/position.js';
37
41
  /**
38
42
  * This module provides utility functions for working with Relations in TypeScript.
39
43
  *
@@ -46,18 +50,15 @@ export { Relation } from './src/relation.js';
46
50
  * @since 0.0.6
47
51
  */
48
52
  export { GraphUrl } from './src/scheme.js';
53
+ export { getSmartAccountWalletClient } from './src/smart-wallet.js';
49
54
  /**
50
55
  * Provides ids for commonly used entities across the Knowledge Graph.
51
56
  */
52
57
  export { ContentIds, NetworkIds, SystemIds } from './src/system-ids.js';
53
- export { getChecksumAddress } from './src/core/get-checksum-address.js';
54
58
  /**
55
- * This module provides utility functions for interacting with the default
56
- * IPFS gateway in TypeScript.
59
+ * This module provides utility functions for working with Triples in TypeScript.
57
60
  *
58
- * @since 0.1.1
61
+ * @since 0.0.6
59
62
  */
60
- export * as Ipfs from './src/ipfs.js';
61
- export * as Graph from './src/graph/index.js';
62
- export { getSmartAccountWalletClient } from './src/smart-wallet.js';
63
+ export { Triple } from './src/triple.js';
63
64
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEnE;;;;;GAKG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAE9C;;;;;GAKG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEpE;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAExE;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,11 @@
1
+ type GetEditCalldataParams = {
2
+ spaceId: string;
3
+ cid: string;
4
+ network?: 'TESTNET' | 'MAINNET';
5
+ };
6
+ export declare function getEditCalldata(params: GetEditCalldataParams): Promise<{
7
+ to: `0x${string}`;
8
+ data: `0x${string}`;
9
+ }>;
10
+ export {};
11
+ //# sourceMappingURL=encoding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../src/encoding.ts"],"names":[],"mappings":"AAMA,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC,CAAC;AAEF,wBAAsB,eAAe,CAAC,MAAM,EAAE,qBAAqB;QAmB/C,KAAK,MAAM,EAAE;UACT,KAAK,MAAM,EAAE;GAapC"}
@@ -0,0 +1,32 @@
1
+ import { Micro } from 'effect';
2
+ class GetEditCalldataError extends Error {
3
+ _tag = 'GetEditCalldataError';
4
+ }
5
+ export async function getEditCalldata(params) {
6
+ const getCalldata = Micro.gen(function* () {
7
+ const result = yield* Micro.tryPromise({
8
+ try: () => fetch(`https://api-testnet.grc-20.thegraph.com/space/${params.spaceId}/edit/calldata`, {
9
+ method: 'POST',
10
+ body: JSON.stringify({
11
+ cid: params.cid,
12
+ // Optionally specify TESTNET or MAINNET. Defaults to MAINNET
13
+ network: params.network ?? 'MAINNET',
14
+ }),
15
+ }),
16
+ catch: error => new GetEditCalldataError(`Could not get edit calldata from space ${params.spaceId}: ${error}`),
17
+ });
18
+ const calldata = yield* Micro.tryPromise({
19
+ try: async () => {
20
+ const { to, data } = await result.json();
21
+ return {
22
+ to: to,
23
+ data: data,
24
+ };
25
+ },
26
+ catch: error => new GetEditCalldataError(`Could not parse response from API when getting calldata for space ${params.spaceId}: ${error}`),
27
+ });
28
+ return calldata;
29
+ });
30
+ return await Micro.runPromise(getCalldata);
31
+ }
32
+ //# sourceMappingURL=encoding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encoding.js","sourceRoot":"","sources":["../../src/encoding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAA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
1
1
  {
2
2
  "name": "@graphprotocol/grc-20",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "license": "MIT",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,14 +0,0 @@
1
- /**
2
- * Utilities for working with Parquet files within the knowledge graph.
3
- *
4
- * @since 0.9.0
5
- */
6
- import type { CsvMetadata } from '~/src/types.js';
7
- type WriteOptions = {
8
- data: Array<unknown>;
9
- metadata: CsvMetadata;
10
- };
11
- export declare function stringify(options: WriteOptions): string;
12
- export declare function read(fileName: string): Blob;
13
- export {};
14
- //# sourceMappingURL=csv.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../../../../src/core/csv/csv.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,KAAK,YAAY,GAAG;IAElB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACrB,QAAQ,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF,wBAAgB,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAUvD;AAED,wBAAgB,IAAI,CAAC,QAAQ,EAAE,MAAM,QAEpC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Utilities for working with Parquet files within the knowledge graph.
3
- *
4
- * @since 0.9.0
5
- */
6
- export function stringify(options) {
7
- const columns = options.metadata.columns.map((c, i) => {
8
- return {
9
- header: c.id,
10
- prop: i,
11
- };
12
- });
13
- throw new Error("Not implemented");
14
- // return Csv.stringify(options.data, { columns, headers: true });
15
- }
16
- export function read(fileName) {
17
- return new Blob();
18
- }
19
- //# sourceMappingURL=csv.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"csv.js","sourceRoot":"","sources":["../../../../src/core/csv/csv.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,MAAM,UAAU,SAAS,CAAC,OAAqB;IAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAW,EAAE;QAC7D,OAAO;YACL,MAAM,EAAE,CAAC,CAAC,EAAE;YACZ,IAAI,EAAE,CAAC;SACR,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;IAClC,kEAAkE;AACpE,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,QAAgB;IACnC,OAAO,IAAI,IAAI,EAAE,CAAC;AACpB,CAAC"}
package/dist/src/csv.d.ts DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * Utilities for working with CSV files within the knowledge graph.
3
- *
4
- * @since 0.9.0
5
- */
6
- export * as Csv from './core/csv/csv.js';
7
- //# sourceMappingURL=csv.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"csv.d.ts","sourceRoot":"","sources":["../../src/csv.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC"}
package/dist/src/csv.js DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * Utilities for working with CSV files within the knowledge graph.
3
- *
4
- * @since 0.9.0
5
- */
6
- export * as Csv from './core/csv/csv.js';
7
- //# sourceMappingURL=csv.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"csv.js","sourceRoot":"","sources":["../../src/csv.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC"}