@graphprotocol/grc-20 0.20.2 → 0.21.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/dist/index.d.ts +14 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/src/core/position.d.ts +20 -6
- package/dist/src/core/position.d.ts.map +1 -1
- package/dist/src/core/position.js +35 -6
- package/dist/src/core/position.js.map +1 -1
- package/dist/src/core/position.test.d.ts +2 -0
- package/dist/src/core/position.test.d.ts.map +1 -0
- package/dist/src/core/position.test.js +119 -0
- package/dist/src/core/position.test.js.map +1 -0
- package/dist/src/position.d.ts +1 -1
- package/dist/src/position.d.ts.map +1 -1
- package/dist/src/position.js +1 -1
- package/dist/src/position.js.map +1 -1
- package/package.json +2 -3
- package/dist/constants.d.ts +0 -7
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -8
- package/dist/constants.js.map +0 -1
- package/dist/convert-ids.d.ts +0 -2
- package/dist/convert-ids.d.ts.map +0 -1
- package/dist/convert-ids.js +0 -42
- package/dist/convert-ids.js.map +0 -1
- package/dist/protov2.d.ts +0 -11
- package/dist/protov2.d.ts.map +0 -1
- package/dist/protov2.js +0 -11
- package/dist/protov2.js.map +0 -1
- package/dist/src/core/blocks/image.d.ts +0 -15
- package/dist/src/core/blocks/image.d.ts.map +0 -1
- package/dist/src/core/blocks/image.js +0 -15
- package/dist/src/core/blocks/image.js.map +0 -1
- package/dist/src/core/idsv2/content.d.ts +0 -59
- package/dist/src/core/idsv2/content.d.ts.map +0 -1
- package/dist/src/core/idsv2/content.js +0 -59
- package/dist/src/core/idsv2/content.js.map +0 -1
- package/dist/src/core/idsv2/network.d.ts +0 -5
- package/dist/src/core/idsv2/network.d.ts.map +0 -1
- package/dist/src/core/idsv2/network.js +0 -5
- package/dist/src/core/idsv2/network.js.map +0 -1
- package/dist/src/core/idsv2/system.d.ts +0 -222
- package/dist/src/core/idsv2/system.d.ts.map +0 -1
- package/dist/src/core/idsv2/system.js +0 -230
- package/dist/src/core/idsv2/system.js.map +0 -1
- package/dist/src/core/image.d.ts +0 -40
- package/dist/src/core/image.d.ts.map +0 -1
- package/dist/src/core/image.js +0 -76
- package/dist/src/core/image.js.map +0 -1
- package/dist/src/core/image.test.d.ts +0 -2
- package/dist/src/core/image.test.d.ts.map +0 -1
- package/dist/src/core/image.test.js +0 -52
- package/dist/src/core/image.test.js.map +0 -1
- package/dist/src/core/relation.d.ts +0 -88
- package/dist/src/core/relation.d.ts.map +0 -1
- package/dist/src/core/relation.js +0 -89
- package/dist/src/core/relation.js.map +0 -1
- package/dist/src/core/relation.test.d.ts +0 -2
- package/dist/src/core/relation.test.d.ts.map +0 -1
- package/dist/src/core/relation.test.js +0 -45
- package/dist/src/core/relation.test.js.map +0 -1
- package/dist/src/core/triple.d.ts +0 -50
- package/dist/src/core/triple.d.ts.map +0 -1
- package/dist/src/core/triple.js +0 -56
- package/dist/src/core/triple.js.map +0 -1
- package/dist/src/core/triple.test.d.ts +0 -2
- package/dist/src/core/triple.test.d.ts.map +0 -1
- package/dist/src/core/triple.test.js +0 -37
- package/dist/src/core/triple.test.js.map +0 -1
- package/dist/src/graph/delete-entity.d.ts +0 -14
- package/dist/src/graph/delete-entity.d.ts.map +0 -1
- package/dist/src/graph/delete-entity.js +0 -21
- package/dist/src/graph/delete-entity.js.map +0 -1
- package/dist/src/graph/delete-entity.test.d.ts +0 -2
- package/dist/src/graph/delete-entity.test.d.ts.map +0 -1
- package/dist/src/graph/delete-entity.test.js +0 -23
- package/dist/src/graph/delete-entity.test.js.map +0 -1
- package/dist/src/graph/graph.test.d.ts +0 -2
- package/dist/src/graph/graph.test.d.ts.map +0 -1
- package/dist/src/graph/graph.test.js +0 -46
- package/dist/src/graph/graph.test.js.map +0 -1
- package/dist/src/graph/helpers/create-default-properties.d.ts +0 -5
- package/dist/src/graph/helpers/create-default-properties.d.ts.map +0 -1
- package/dist/src/graph/helpers/create-default-properties.js +0 -44
- package/dist/src/graph/helpers/create-default-properties.js.map +0 -1
- package/dist/src/graph/helpers/create-properties.d.ts +0 -8
- package/dist/src/graph/helpers/create-properties.d.ts.map +0 -1
- package/dist/src/graph/helpers/create-properties.js +0 -53
- package/dist/src/graph/helpers/create-properties.js.map +0 -1
- package/dist/src/graphv2/constants.d.ts +0 -2
- package/dist/src/graphv2/constants.d.ts.map +0 -1
- package/dist/src/graphv2/constants.js +0 -2
- package/dist/src/graphv2/constants.js.map +0 -1
- package/dist/src/graphv2/create-entity.d.ts +0 -52
- package/dist/src/graphv2/create-entity.d.ts.map +0 -1
- package/dist/src/graphv2/create-entity.js +0 -140
- package/dist/src/graphv2/create-entity.js.map +0 -1
- package/dist/src/graphv2/create-entity.test.d.ts +0 -2
- package/dist/src/graphv2/create-entity.test.d.ts.map +0 -1
- package/dist/src/graphv2/create-entity.test.js +0 -158
- package/dist/src/graphv2/create-entity.test.js.map +0 -1
- package/dist/src/graphv2/create-image.d.ts +0 -28
- package/dist/src/graphv2/create-image.d.ts.map +0 -1
- package/dist/src/graphv2/create-image.js +0 -71
- package/dist/src/graphv2/create-image.js.map +0 -1
- package/dist/src/graphv2/create-image.test.d.ts +0 -2
- package/dist/src/graphv2/create-image.test.d.ts.map +0 -1
- package/dist/src/graphv2/create-image.test.js +0 -142
- package/dist/src/graphv2/create-image.test.js.map +0 -1
- package/dist/src/graphv2/create-property.d.ts +0 -22
- package/dist/src/graphv2/create-property.d.ts.map +0 -1
- package/dist/src/graphv2/create-property.js +0 -129
- package/dist/src/graphv2/create-property.js.map +0 -1
- package/dist/src/graphv2/create-property.test.d.ts +0 -2
- package/dist/src/graphv2/create-property.test.d.ts.map +0 -1
- package/dist/src/graphv2/create-property.test.js +0 -82
- package/dist/src/graphv2/create-property.test.js.map +0 -1
- package/dist/src/graphv2/create-relation.d.ts +0 -33
- package/dist/src/graphv2/create-relation.d.ts.map +0 -1
- package/dist/src/graphv2/create-relation.js +0 -66
- package/dist/src/graphv2/create-relation.js.map +0 -1
- package/dist/src/graphv2/create-relation.test.d.ts +0 -2
- package/dist/src/graphv2/create-relation.test.d.ts.map +0 -1
- package/dist/src/graphv2/create-relation.test.js +0 -208
- package/dist/src/graphv2/create-relation.test.js.map +0 -1
- package/dist/src/graphv2/create-space.d.ts +0 -13
- package/dist/src/graphv2/create-space.d.ts.map +0 -1
- package/dist/src/graphv2/create-space.js +0 -21
- package/dist/src/graphv2/create-space.js.map +0 -1
- package/dist/src/graphv2/create-type.d.ts +0 -22
- package/dist/src/graphv2/create-type.d.ts.map +0 -1
- package/dist/src/graphv2/create-type.js +0 -64
- package/dist/src/graphv2/create-type.js.map +0 -1
- package/dist/src/graphv2/create-type.test.d.ts +0 -2
- package/dist/src/graphv2/create-type.test.d.ts.map +0 -1
- package/dist/src/graphv2/create-type.test.js +0 -109
- package/dist/src/graphv2/create-type.test.js.map +0 -1
- package/dist/src/graphv2/delete-entity.d.ts +0 -14
- package/dist/src/graphv2/delete-entity.d.ts.map +0 -1
- package/dist/src/graphv2/delete-entity.js +0 -21
- package/dist/src/graphv2/delete-entity.js.map +0 -1
- package/dist/src/graphv2/delete-entity.test.d.ts +0 -2
- package/dist/src/graphv2/delete-entity.test.d.ts.map +0 -1
- package/dist/src/graphv2/delete-entity.test.js +0 -24
- package/dist/src/graphv2/delete-entity.test.js.map +0 -1
- package/dist/src/graphv2/delete-relation.d.ts +0 -14
- package/dist/src/graphv2/delete-relation.d.ts.map +0 -1
- package/dist/src/graphv2/delete-relation.js +0 -21
- package/dist/src/graphv2/delete-relation.js.map +0 -1
- package/dist/src/graphv2/delete-relation.test.d.ts +0 -2
- package/dist/src/graphv2/delete-relation.test.d.ts.map +0 -1
- package/dist/src/graphv2/delete-relation.test.js +0 -24
- package/dist/src/graphv2/delete-relation.test.js.map +0 -1
- package/dist/src/graphv2/index.d.ts +0 -12
- package/dist/src/graphv2/index.d.ts.map +0 -1
- package/dist/src/graphv2/index.js +0 -12
- package/dist/src/graphv2/index.js.map +0 -1
- package/dist/src/graphv2/remove-entity-properties.d.ts +0 -25
- package/dist/src/graphv2/remove-entity-properties.d.ts.map +0 -1
- package/dist/src/graphv2/remove-entity-properties.js +0 -24
- package/dist/src/graphv2/remove-entity-properties.js.map +0 -1
- package/dist/src/graphv2/unset-entity-values.d.ts +0 -21
- package/dist/src/graphv2/unset-entity-values.d.ts.map +0 -1
- package/dist/src/graphv2/unset-entity-values.js +0 -26
- package/dist/src/graphv2/unset-entity-values.js.map +0 -1
- package/dist/src/graphv2/unset-entity-values.test.d.ts +0 -2
- package/dist/src/graphv2/unset-entity-values.test.d.ts.map +0 -1
- package/dist/src/graphv2/unset-entity-values.test.js +0 -40
- package/dist/src/graphv2/unset-entity-values.test.js.map +0 -1
- package/dist/src/graphv2/unset-relation-fields.d.ts +0 -25
- package/dist/src/graphv2/unset-relation-fields.d.ts.map +0 -1
- package/dist/src/graphv2/unset-relation-fields.js +0 -34
- package/dist/src/graphv2/unset-relation-fields.js.map +0 -1
- package/dist/src/graphv2/unset-relation-fields.test.d.ts +0 -2
- package/dist/src/graphv2/unset-relation-fields.test.d.ts.map +0 -1
- package/dist/src/graphv2/unset-relation-fields.test.js +0 -64
- package/dist/src/graphv2/unset-relation-fields.test.js.map +0 -1
- package/dist/src/graphv2/update-entity.d.ts +0 -28
- package/dist/src/graphv2/update-entity.d.ts.map +0 -1
- package/dist/src/graphv2/update-entity.js +0 -73
- package/dist/src/graphv2/update-entity.js.map +0 -1
- package/dist/src/graphv2/update-entity.test.d.ts +0 -2
- package/dist/src/graphv2/update-entity.test.d.ts.map +0 -1
- package/dist/src/graphv2/update-entity.test.js +0 -116
- package/dist/src/graphv2/update-entity.test.js.map +0 -1
- package/dist/src/graphv2/update-relation.d.ts +0 -21
- package/dist/src/graphv2/update-relation.d.ts.map +0 -1
- package/dist/src/graphv2/update-relation.js +0 -37
- package/dist/src/graphv2/update-relation.js.map +0 -1
- package/dist/src/idv2.d.ts +0 -27
- package/dist/src/idv2.d.ts.map +0 -1
- package/dist/src/idv2.js +0 -88
- package/dist/src/idv2.js.map +0 -1
- package/dist/src/idv2.test.d.ts +0 -2
- package/dist/src/idv2.test.d.ts.map +0 -1
- package/dist/src/idv2.test.js +0 -26
- package/dist/src/idv2.test.js.map +0 -1
- package/dist/src/image.d.ts +0 -8
- package/dist/src/image.d.ts.map +0 -1
- package/dist/src/image.js +0 -8
- package/dist/src/image.js.map +0 -1
- package/dist/src/ipfsv2.d.ts +0 -96
- package/dist/src/ipfsv2.d.ts.map +0 -1
- package/dist/src/ipfsv2.js +0 -163
- package/dist/src/ipfsv2.js.map +0 -1
- package/dist/src/ipfsv2.test.d.ts +0 -2
- package/dist/src/ipfsv2.test.d.ts.map +0 -1
- package/dist/src/ipfsv2.test.js +0 -22
- package/dist/src/ipfsv2.test.js.map +0 -1
- package/dist/src/proto/editv2.d.ts +0 -11
- package/dist/src/proto/editv2.d.ts.map +0 -1
- package/dist/src/proto/editv2.js +0 -81
- package/dist/src/proto/editv2.js.map +0 -1
- package/dist/src/proto/editv2.test.d.ts +0 -2
- package/dist/src/proto/editv2.test.d.ts.map +0 -1
- package/dist/src/proto/editv2.test.js +0 -211
- package/dist/src/proto/editv2.test.js.map +0 -1
- package/dist/src/proto/gen/src/proto/ipfsv2_pb.d.ts +0 -410
- package/dist/src/proto/gen/src/proto/ipfsv2_pb.d.ts.map +0 -1
- package/dist/src/proto/gen/src/proto/ipfsv2_pb.js +0 -536
- package/dist/src/proto/gen/src/proto/ipfsv2_pb.js.map +0 -1
- package/dist/src/relation.d.ts +0 -7
- package/dist/src/relation.d.ts.map +0 -1
- package/dist/src/relation.js +0 -7
- package/dist/src/relation.js.map +0 -1
- package/dist/src/smart-wallet-2.test-invalid.d.ts +0 -2
- package/dist/src/smart-wallet-2.test-invalid.d.ts.map +0 -1
- package/dist/src/smart-wallet-2.test-invalid.js +0 -49
- package/dist/src/smart-wallet-2.test-invalid.js.map +0 -1
- package/dist/src/smart-wallet-2.test.d.ts +0 -2
- package/dist/src/smart-wallet-2.test.d.ts.map +0 -1
- package/dist/src/smart-wallet-2.test.js +0 -49
- package/dist/src/smart-wallet-2.test.js.map +0 -1
- package/dist/src/system-ids-v2.d.ts +0 -7
- package/dist/src/system-ids-v2.d.ts.map +0 -1
- package/dist/src/system-ids-v2.js +0 -7
- package/dist/src/system-ids-v2.js.map +0 -1
- package/dist/src/triple.d.ts +0 -7
- package/dist/src/triple.d.ts.map +0 -1
- package/dist/src/triple.js +0 -7
- package/dist/src/triple.js.map +0 -1
- package/dist/src/types-backup.d.ts +0 -134
- package/dist/src/types-backup.d.ts.map +0 -1
- package/dist/src/types-backup.js +0 -13
- package/dist/src/types-backup.js.map +0 -1
- package/dist/src/typesv2.d.ts +0 -173
- package/dist/src/typesv2.d.ts.map +0 -1
- package/dist/src/typesv2.js +0 -8
- package/dist/src/typesv2.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./src/types.js";
|
|
2
2
|
/**
|
|
3
3
|
* This module provides utility functions for working knowledge graph
|
|
4
4
|
* identifiers in TypeScript.
|
|
5
5
|
*
|
|
6
6
|
* @since 0.0.6
|
|
7
7
|
*/
|
|
8
|
-
export * as Id from
|
|
9
|
-
export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpaceGovernanceType, getProcessGeoProposalArguments, getRemoveEditorArguments, getRemoveSubspaceArguments, } from
|
|
8
|
+
export * as Id from "./src/id.js";
|
|
9
|
+
export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpaceGovernanceType, getProcessGeoProposalArguments, getRemoveEditorArguments, getRemoveSubspaceArguments, } from "./src/encodings/index.js";
|
|
10
10
|
/**
|
|
11
11
|
* This module provides utility functions for working with knowledge graph
|
|
12
12
|
* images in TypeScript.
|
|
13
13
|
*
|
|
14
14
|
* @since 0.0.6
|
|
15
15
|
*/
|
|
16
|
-
export { Account } from
|
|
17
|
-
export { DataBlock, TextBlock } from
|
|
18
|
-
export * as Encoding from
|
|
19
|
-
export { getChecksumAddress } from
|
|
20
|
-
export * as Graph from
|
|
16
|
+
export { Account } from "./src/account.js";
|
|
17
|
+
export { DataBlock, TextBlock } from "./src/blocks.js";
|
|
18
|
+
export * as Encoding from "./src/encoding.js";
|
|
19
|
+
export { getChecksumAddress } from "./src/core/get-checksum-address.js";
|
|
20
|
+
export * as Graph from "./src/graph/index.js";
|
|
21
21
|
/**
|
|
22
22
|
* This module provides utility functions for interacting with the default
|
|
23
23
|
* IPFS gateway in TypeScript.
|
|
24
24
|
*
|
|
25
25
|
* @since 0.1.1
|
|
26
26
|
*/
|
|
27
|
-
export * as Ipfs from
|
|
28
|
-
export { Position
|
|
27
|
+
export * as Ipfs from "./src/ipfs.js";
|
|
28
|
+
export { Position } from "./src/position.js";
|
|
29
29
|
/**
|
|
30
30
|
* This module provides utility functions for working with Graph URIs in TypeScript.
|
|
31
31
|
*
|
|
32
32
|
* @since 0.0.6
|
|
33
33
|
*/
|
|
34
|
-
export { GraphUrl } from
|
|
35
|
-
export { getSmartAccountWalletClient } from
|
|
34
|
+
export { GraphUrl } from "./src/scheme.js";
|
|
35
|
+
export { getSmartAccountWalletClient } from "./src/smart-wallet.js";
|
|
36
36
|
/**
|
|
37
37
|
* Provides ids for commonly used entities across the Knowledge Graph.
|
|
38
38
|
*/
|
|
39
|
-
export { ContentIds, NetworkIds, SystemIds } from
|
|
39
|
+
export { ContentIds, NetworkIds, SystemIds } from "./src/system-ids.js";
|
|
40
40
|
/**
|
|
41
41
|
* This module provides utility functions for working with base58 ids
|
|
42
42
|
* in TypeScript.
|
|
43
43
|
*/
|
|
44
|
-
export * as Base58 from
|
|
44
|
+
export * as Base58 from "./src/core/base58.js";
|
|
45
45
|
//# 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":[],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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;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./src/types.js";
|
|
2
2
|
/**
|
|
3
3
|
* This module provides utility functions for working knowledge graph
|
|
4
4
|
* identifiers in TypeScript.
|
|
5
5
|
*
|
|
6
6
|
* @since 0.0.6
|
|
7
7
|
*/
|
|
8
|
-
export * as Id from
|
|
9
|
-
export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpaceGovernanceType, getProcessGeoProposalArguments, getRemoveEditorArguments, getRemoveSubspaceArguments, } from
|
|
8
|
+
export * as Id from "./src/id.js";
|
|
9
|
+
export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpaceGovernanceType, getProcessGeoProposalArguments, getRemoveEditorArguments, getRemoveSubspaceArguments, } from "./src/encodings/index.js";
|
|
10
10
|
/**
|
|
11
11
|
* This module provides utility functions for working with knowledge graph
|
|
12
12
|
* images in TypeScript.
|
|
13
13
|
*
|
|
14
14
|
* @since 0.0.6
|
|
15
15
|
*/
|
|
16
|
-
export { Account } from
|
|
17
|
-
export { DataBlock, TextBlock } from
|
|
18
|
-
export * as Encoding from
|
|
19
|
-
export { getChecksumAddress } from
|
|
20
|
-
export * as Graph from
|
|
16
|
+
export { Account } from "./src/account.js";
|
|
17
|
+
export { DataBlock, TextBlock } from "./src/blocks.js";
|
|
18
|
+
export * as Encoding from "./src/encoding.js";
|
|
19
|
+
export { getChecksumAddress } from "./src/core/get-checksum-address.js";
|
|
20
|
+
export * as Graph from "./src/graph/index.js";
|
|
21
21
|
/**
|
|
22
22
|
* This module provides utility functions for interacting with the default
|
|
23
23
|
* IPFS gateway in TypeScript.
|
|
24
24
|
*
|
|
25
25
|
* @since 0.1.1
|
|
26
26
|
*/
|
|
27
|
-
export * as Ipfs from
|
|
28
|
-
export { Position
|
|
27
|
+
export * as Ipfs from "./src/ipfs.js";
|
|
28
|
+
export { Position } from "./src/position.js";
|
|
29
29
|
/**
|
|
30
30
|
* This module provides utility functions for working with Graph URIs in TypeScript.
|
|
31
31
|
*
|
|
32
32
|
* @since 0.0.6
|
|
33
33
|
*/
|
|
34
|
-
export { GraphUrl } from
|
|
35
|
-
export { getSmartAccountWalletClient } from
|
|
34
|
+
export { GraphUrl } from "./src/scheme.js";
|
|
35
|
+
export { getSmartAccountWalletClient } from "./src/smart-wallet.js";
|
|
36
36
|
/**
|
|
37
37
|
* Provides ids for commonly used entities across the Knowledge Graph.
|
|
38
38
|
*/
|
|
39
|
-
export { ContentIds, NetworkIds, SystemIds } from
|
|
39
|
+
export { ContentIds, NetworkIds, SystemIds } from "./src/system-ids.js";
|
|
40
40
|
/**
|
|
41
41
|
* This module provides utility functions for working with base58 ids
|
|
42
42
|
* in TypeScript.
|
|
43
43
|
*/
|
|
44
|
-
export * as Base58 from
|
|
44
|
+
export * as Base58 from "./src/core/base58.js";
|
|
45
45
|
//# 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,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,OAAO,EAAE,OAAO,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AK,MAAM,MAAM,sBAAsB,CAAC"}
|
|
@@ -3,10 +3,24 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @since 0.0.6
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
export declare function generateBetween(first: string | null, second: string | null): string;
|
|
7
|
+
/**
|
|
8
|
+
* Generates a random position with jittering.
|
|
9
|
+
*
|
|
10
|
+
* @returns A random position as a string.
|
|
11
|
+
*/
|
|
12
|
+
export declare function generate(): string;
|
|
13
|
+
type MaybePosition = string | null;
|
|
14
|
+
export declare function compare(a: MaybePosition, b: MaybePosition): number;
|
|
15
|
+
/**
|
|
16
|
+
* Sorts a list of positions in ascending order. In
|
|
17
|
+
* the knowledge graph positions are optional. This
|
|
18
|
+
* function sorts null positions so they are always
|
|
19
|
+
* at the bottom.
|
|
20
|
+
*
|
|
21
|
+
* @param positions - The list of positions to sort.
|
|
22
|
+
* @returns The sorted list of positions.
|
|
23
|
+
*/
|
|
24
|
+
export declare function sort(positions: MaybePosition[]): MaybePosition[];
|
|
25
|
+
export {};
|
|
12
26
|
//# sourceMappingURL=position.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../src/core/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../src/core/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,UAE1E;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,MAAM,CAEjC;AAED,KAAK,aAAa,GAAG,MAAM,GAAG,IAAI,CAAA;AAElC,wBAAgB,OAAO,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,UAOzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,aAAa,EAAE,CAEhE"}
|
|
@@ -3,10 +3,39 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @since 0.0.6
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import { generateJitteredKeyBetween } from "fractional-indexing-jittered";
|
|
7
|
+
export function generateBetween(first, second) {
|
|
8
|
+
return generateJitteredKeyBetween(first, second);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generates a random position with jittering.
|
|
12
|
+
*
|
|
13
|
+
* @returns A random position as a string.
|
|
14
|
+
*/
|
|
15
|
+
export function generate() {
|
|
16
|
+
return generateBetween(null, null);
|
|
17
|
+
}
|
|
18
|
+
export function compare(a, b) {
|
|
19
|
+
// This ALWAYS puts nulls at the bottom, regardless of what
|
|
20
|
+
// fractional indexes exist
|
|
21
|
+
if (a === null && b === null)
|
|
22
|
+
return 0;
|
|
23
|
+
if (a === null)
|
|
24
|
+
return 1; // a goes to bottom
|
|
25
|
+
if (b === null)
|
|
26
|
+
return -1; // b goes to bottom
|
|
27
|
+
return a.localeCompare(b);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Sorts a list of positions in ascending order. In
|
|
31
|
+
* the knowledge graph positions are optional. This
|
|
32
|
+
* function sorts null positions so they are always
|
|
33
|
+
* at the bottom.
|
|
34
|
+
*
|
|
35
|
+
* @param positions - The list of positions to sort.
|
|
36
|
+
* @returns The sorted list of positions.
|
|
37
|
+
*/
|
|
38
|
+
export function sort(positions) {
|
|
39
|
+
return positions.sort(compare);
|
|
40
|
+
}
|
|
12
41
|
//# sourceMappingURL=position.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.js","sourceRoot":"","sources":["../../../src/core/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"position.js","sourceRoot":"","sources":["../../../src/core/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,MAAM,UAAU,eAAe,CAAC,KAAoB,EAAE,MAAqB;IACzE,OAAO,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AACpC,CAAC;AAID,MAAM,UAAU,OAAO,CAAC,CAAgB,EAAE,CAAgB;IACxD,4DAA4D;IAC5D,2BAA2B;IAC3B,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IACvC,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC,CAAE,mBAAmB;IAC9C,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC,CAAC,CAAC,mBAAmB;IAC9C,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,IAAI,CAAC,SAA0B;IAC7C,OAAO,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.test.d.ts","sourceRoot":"","sources":["../../../src/core/position.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { sort } from './position.js'; // Adjust import path as needed
|
|
3
|
+
describe('fractional index sorting', () => {
|
|
4
|
+
describe('sort function', () => {
|
|
5
|
+
it('should handle empty array', () => {
|
|
6
|
+
const result = sort([]);
|
|
7
|
+
expect(result).toEqual([]);
|
|
8
|
+
});
|
|
9
|
+
it('should handle array with only nulls', () => {
|
|
10
|
+
const positions = [null, null, null];
|
|
11
|
+
const result = sort(positions);
|
|
12
|
+
expect(result).toEqual([null, null, null]);
|
|
13
|
+
});
|
|
14
|
+
it('should handle array with only strings', () => {
|
|
15
|
+
const positions = ['c', 'a', 'b'];
|
|
16
|
+
const result = sort(positions);
|
|
17
|
+
expect(result).toEqual(['a', 'b', 'c']);
|
|
18
|
+
});
|
|
19
|
+
it('should put null values at the bottom when mixed with strings', () => {
|
|
20
|
+
const positions = ['b', null, 'a', null, 'c'];
|
|
21
|
+
const result = sort(positions);
|
|
22
|
+
expect(result).toEqual(['a', 'b', 'c', null, null]);
|
|
23
|
+
});
|
|
24
|
+
it('should sort fractional indexes correctly', () => {
|
|
25
|
+
const positions = ['a1', 'a0', 'a2'];
|
|
26
|
+
const result = sort(positions);
|
|
27
|
+
expect(result).toEqual(['a0', 'a1', 'a2']);
|
|
28
|
+
});
|
|
29
|
+
it('should handle complex fractional indexes', () => {
|
|
30
|
+
const positions = ['a0V', 'a0', 'a0G', 'a1'];
|
|
31
|
+
const result = sort(positions);
|
|
32
|
+
expect(result).toEqual(['a0', 'a0G', 'a0V', 'a1']);
|
|
33
|
+
});
|
|
34
|
+
it('should maintain stable sort for identical values', () => {
|
|
35
|
+
const positions = ['a0', 'a0', 'a1'];
|
|
36
|
+
const result = sort(positions);
|
|
37
|
+
expect(result).toEqual(['a0', 'a0', 'a1']);
|
|
38
|
+
});
|
|
39
|
+
it('should handle single null value', () => {
|
|
40
|
+
const positions = [null];
|
|
41
|
+
const result = sort(positions);
|
|
42
|
+
expect(result).toEqual([null]);
|
|
43
|
+
});
|
|
44
|
+
it('should handle single string value', () => {
|
|
45
|
+
const positions = ['a0'];
|
|
46
|
+
const result = sort(positions);
|
|
47
|
+
expect(result).toEqual(['a0']);
|
|
48
|
+
});
|
|
49
|
+
it('should sort with nulls at bottom regardless of position in input', () => {
|
|
50
|
+
const positions1 = [null, 'a', 'b'];
|
|
51
|
+
const positions2 = ['a', null, 'b'];
|
|
52
|
+
const positions3 = ['a', 'b', null];
|
|
53
|
+
const expected = ['a', 'b', null];
|
|
54
|
+
expect(sort(positions1)).toEqual(expected);
|
|
55
|
+
expect(sort(positions2)).toEqual(expected);
|
|
56
|
+
expect(sort(positions3)).toEqual(expected);
|
|
57
|
+
});
|
|
58
|
+
it('should handle very long fractional indexes', () => {
|
|
59
|
+
const positions = [`a0${'x'.repeat(50)}`, 'a0', `a0${'y'.repeat(30)}`];
|
|
60
|
+
const result = sort(positions);
|
|
61
|
+
expect(result).toEqual(['a0', `a0${'x'.repeat(50)}`, `a0${'y'.repeat(30)}`]);
|
|
62
|
+
});
|
|
63
|
+
it('should handle mixed case and special characters', () => {
|
|
64
|
+
const positions = ['Z', 'a', 'A', 'z'];
|
|
65
|
+
const result = sort(positions);
|
|
66
|
+
// JavaScript's localeCompare should handle this correctly
|
|
67
|
+
expect(result).toEqual(['a', 'A', 'z', 'Z']);
|
|
68
|
+
});
|
|
69
|
+
it('should handle large arrays efficiently', () => {
|
|
70
|
+
const positions = [];
|
|
71
|
+
// Create a large array with mixed values
|
|
72
|
+
for (let i = 100; i >= 0; i--) {
|
|
73
|
+
positions.push(`a${i}`);
|
|
74
|
+
if (i % 10 === 0)
|
|
75
|
+
positions.push(null);
|
|
76
|
+
}
|
|
77
|
+
const result = sort(positions);
|
|
78
|
+
// Check that all string values are sorted before nulls
|
|
79
|
+
const stringValues = result.filter(p => p !== null);
|
|
80
|
+
const nullValues = result.filter(p => p === null);
|
|
81
|
+
// String values should be sorted
|
|
82
|
+
for (let i = 1; i < stringValues.length; i++) {
|
|
83
|
+
const left = stringValues[i - 1];
|
|
84
|
+
const right = stringValues[i];
|
|
85
|
+
if (left && right) {
|
|
86
|
+
expect(left.localeCompare(right)).toBeLessThanOrEqual(0);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// All nulls should be at the end
|
|
90
|
+
const firstNullIndex = result.indexOf(null);
|
|
91
|
+
if (firstNullIndex !== -1) {
|
|
92
|
+
expect(result.slice(firstNullIndex)).toEqual(nullValues);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
it('should handle edge case fractional indexes that might cause sorting issues', () => {
|
|
96
|
+
const positions = [
|
|
97
|
+
'z'.repeat(10), // Very "high" value
|
|
98
|
+
'a0',
|
|
99
|
+
null,
|
|
100
|
+
'', // Empty string
|
|
101
|
+
'a',
|
|
102
|
+
];
|
|
103
|
+
const result = sort(positions);
|
|
104
|
+
// Empty string should come first, then sorted strings, then nulls
|
|
105
|
+
expect(result[0]).toBe('');
|
|
106
|
+
expect(result[result.length - 1]).toBe(null);
|
|
107
|
+
// Check that non-null, non-empty strings are sorted
|
|
108
|
+
const nonEmptyStrings = result.filter(p => p !== null && p !== '');
|
|
109
|
+
for (let i = 1; i < nonEmptyStrings.length; i++) {
|
|
110
|
+
const left = nonEmptyStrings[i - 1];
|
|
111
|
+
const right = nonEmptyStrings[i];
|
|
112
|
+
if (left && right) {
|
|
113
|
+
expect(left.localeCompare(right)).toBeLessThanOrEqual(0);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=position.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.test.js","sourceRoot":"","sources":["../../../src/core/position.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC,CAAC,+BAA+B;AAErE,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;QAC7B,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;YACnC,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;YACxB,MAAM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C;gBAC3D,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/src/position.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../src/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../src/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAC"}
|
package/dist/src/position.js
CHANGED
package/dist/src/position.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.js","sourceRoot":"","sources":["../../src/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"position.js","sourceRoot":"","sources":["../../src/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphprotocol/grc-20",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"exports": {
|
|
14
14
|
"./package.json": "./package.json",
|
|
15
15
|
".": "./dist/index.js",
|
|
16
|
-
"./constants": "./dist/constants.js",
|
|
17
16
|
"./proto": "./dist/proto.js",
|
|
18
17
|
"./contracts": "./dist/contracts.js",
|
|
19
18
|
"./abis": "./dist/abis.js"
|
|
@@ -24,10 +23,10 @@
|
|
|
24
23
|
"effect": "^3.13.6",
|
|
25
24
|
"ethers": "^5.7.2",
|
|
26
25
|
"fflate": "^0.8.2",
|
|
26
|
+
"fractional-indexing-jittered": "^1.0.0",
|
|
27
27
|
"graphql-request": "^7.1.2",
|
|
28
28
|
"image-size": "^2.0.0",
|
|
29
29
|
"permissionless": "^0.2.35",
|
|
30
|
-
"position-strings": "^2.0.1",
|
|
31
30
|
"uuid": "^11.1.0",
|
|
32
31
|
"viem": "^2.23.6"
|
|
33
32
|
},
|
package/dist/constants.d.ts
DELETED
package/dist/constants.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,4BAA4B,QAA8C,CAAC"}
|
package/dist/constants.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This module provides common constants used in the knowledge graph.
|
|
3
|
-
*
|
|
4
|
-
* @since 0.0.6
|
|
5
|
-
*/
|
|
6
|
-
import { Position, PositionRange } from './src/position.js';
|
|
7
|
-
export const INITIAL_RELATION_INDEX_VALUE = Position.createBetween(PositionRange.FIRST);
|
|
8
|
-
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,CAAC,MAAM,4BAA4B,GAAG,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC"}
|
package/dist/convert-ids.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-ids.d.ts","sourceRoot":"","sources":["../convert-ids.ts"],"names":[],"mappings":""}
|
package/dist/convert-ids.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { readFile, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { dirname, join } from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { decodeBase58ToUUID } from './src/core/base58.js';
|
|
5
|
-
// Helper function to check if a string is a UUID
|
|
6
|
-
function isUUID(str) {
|
|
7
|
-
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
8
|
-
return uuidRegex.test(str);
|
|
9
|
-
}
|
|
10
|
-
async function convertIds() {
|
|
11
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
-
const __dirname = dirname(__filename);
|
|
13
|
-
const filePath = join(__dirname, 'src/core/idsv2/content.ts');
|
|
14
|
-
// Read the file content
|
|
15
|
-
const content = await readFile(filePath, 'utf-8');
|
|
16
|
-
// Find all Id() calls and convert them
|
|
17
|
-
const updatedContent = content.replace(/Id\(['"]([^'"]+)['"]\)/g, (match, id) => {
|
|
18
|
-
if (isUUID(id)) {
|
|
19
|
-
console.log(`Already a UUID: ${id}`);
|
|
20
|
-
return match;
|
|
21
|
-
}
|
|
22
|
-
try {
|
|
23
|
-
const uuid = decodeBase58ToUUID(id);
|
|
24
|
-
console.log(`Converting ${id} to UUID ${uuid}`);
|
|
25
|
-
return `Id('${uuid}')`;
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
if (error instanceof Error) {
|
|
29
|
-
console.error(`Error converting ${id}: ${error.message}`);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
console.error(`Error converting ${id}: Unknown error`);
|
|
33
|
-
}
|
|
34
|
-
return match;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
// Write the updated content back to the file
|
|
38
|
-
await writeFile(filePath, updatedContent, 'utf-8');
|
|
39
|
-
console.log('File has been updated with converted UUIDs');
|
|
40
|
-
}
|
|
41
|
-
convertIds().catch(console.error);
|
|
42
|
-
//# sourceMappingURL=convert-ids.js.map
|
package/dist/convert-ids.js.map
DEL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;QACzB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAC5D,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAC;YACzD,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,6CAA6C;IAC7C,MAAM,SAAS,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;AAC5D,CAAC;AAED,UAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
package/dist/protov2.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This module provides utility functions for working with GRC-20 protobufs
|
|
3
|
-
* in TypeScript.
|
|
4
|
-
*/
|
|
5
|
-
export * from './src/proto/gen/src/proto/ipfsv2_pb.js';
|
|
6
|
-
/**
|
|
7
|
-
* This module provides utility functions for working with the GRC-20 Edit
|
|
8
|
-
* protobuf in TypeScript.
|
|
9
|
-
*/
|
|
10
|
-
export * as EditProposal from './src/proto/editv2.js';
|
|
11
|
-
//# sourceMappingURL=protov2.d.ts.map
|
package/dist/protov2.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protov2.d.ts","sourceRoot":"","sources":["../protov2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,wCAAwC,CAAC;AAEvD;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC"}
|
package/dist/protov2.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This module provides utility functions for working with GRC-20 protobufs
|
|
3
|
-
* in TypeScript.
|
|
4
|
-
*/
|
|
5
|
-
export * from './src/proto/gen/src/proto/ipfsv2_pb.js';
|
|
6
|
-
/**
|
|
7
|
-
* This module provides utility functions for working with the GRC-20 Edit
|
|
8
|
-
* protobuf in TypeScript.
|
|
9
|
-
*/
|
|
10
|
-
export * as EditProposal from './src/proto/editv2.js';
|
|
11
|
-
//# sourceMappingURL=protov2.js.map
|
package/dist/protov2.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protov2.js","sourceRoot":"","sources":["../protov2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,wCAAwC,CAAC;AAEvD;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This module provides utility functions for working with image blocks
|
|
3
|
-
* in TypeScript.
|
|
4
|
-
*
|
|
5
|
-
* @since 0.0.6
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Image entities and Image Blocks are functionally the same thing. The
|
|
9
|
-
* relation consuming the entity is what gives it contextual meaning. e.g.,
|
|
10
|
-
* if the Image is consumed by an Avatar relation, then we know the image
|
|
11
|
-
* is an avatar. If it's consumed by a Block relation, then we know the
|
|
12
|
-
* image is a block.
|
|
13
|
-
*/
|
|
14
|
-
export { make } from '../image.js';
|
|
15
|
-
//# sourceMappingURL=image.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../src/core/blocks/image.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This module provides utility functions for working with image blocks
|
|
3
|
-
* in TypeScript.
|
|
4
|
-
*
|
|
5
|
-
* @since 0.0.6
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Image entities and Image Blocks are functionally the same thing. The
|
|
9
|
-
* relation consuming the entity is what gives it contextual meaning. e.g.,
|
|
10
|
-
* if the Image is consumed by an Avatar relation, then we know the image
|
|
11
|
-
* is an avatar. If it's consumed by a Block relation, then we know the
|
|
12
|
-
* image is a block.
|
|
13
|
-
*/
|
|
14
|
-
export { make } from '../image.js';
|
|
15
|
-
//# sourceMappingURL=image.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../../src/core/blocks/image.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC"}
|