@graphprotocol/grc-20 0.9.2 → 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 +12 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/dist/src/encoding.d.ts +11 -0
- package/dist/src/encoding.d.ts.map +1 -0
- package/dist/src/encoding.js +32 -0
- package/dist/src/encoding.js.map +1 -0
- package/package.json +1 -1
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
|
|
34
|
+
* This module provides utility functions for interacting with the default
|
|
35
|
+
* IPFS gateway in TypeScript.
|
|
33
36
|
*
|
|
34
|
-
* @since 0.
|
|
37
|
+
* @since 0.1.1
|
|
35
38
|
*/
|
|
36
|
-
export
|
|
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
|
|
56
|
-
* IPFS gateway in TypeScript.
|
|
59
|
+
* This module provides utility functions for working with Triples in TypeScript.
|
|
57
60
|
*
|
|
58
|
-
* @since 0.
|
|
61
|
+
* @since 0.0.6
|
|
59
62
|
*/
|
|
60
|
-
export
|
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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
|
|
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,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"}
|
package/dist/index.js
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
|
|
34
|
+
* This module provides utility functions for interacting with the default
|
|
35
|
+
* IPFS gateway in TypeScript.
|
|
33
36
|
*
|
|
34
|
-
* @since 0.
|
|
37
|
+
* @since 0.1.1
|
|
35
38
|
*/
|
|
36
|
-
export
|
|
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
|
|
56
|
-
* IPFS gateway in TypeScript.
|
|
59
|
+
* This module provides utility functions for working with Triples in TypeScript.
|
|
57
60
|
*
|
|
58
|
-
* @since 0.
|
|
61
|
+
* @since 0.0.6
|
|
59
62
|
*/
|
|
60
|
-
export
|
|
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
|
|
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,CAAC;AAE/B,MAAM,oBAAqB,SAAQ,K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