@geoprotocol/geo-sdk 0.1.1 → 0.2.2
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/README.md +154 -161
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/src/encoding.test.js +2 -2
- package/dist/src/encoding.test.js.map +1 -1
- package/dist/src/full-flow-test.test.js +12 -34
- package/dist/src/full-flow-test.test.js.map +1 -1
- package/dist/src/graph/constants.d.ts +1 -1
- package/dist/src/graph/create-image.js +1 -1
- package/dist/src/graph/create-image.js.map +1 -1
- package/dist/src/graph/create-image.test.js +1 -1
- package/dist/src/graph/create-image.test.js.map +1 -1
- package/dist/src/graph/index.d.ts +1 -1
- package/dist/src/graph/index.d.ts.map +1 -1
- package/dist/src/graph/index.js +1 -1
- package/dist/src/graph/index.js.map +1 -1
- package/dist/src/id.d.ts.map +1 -1
- package/dist/src/id.js +3 -8
- package/dist/src/id.js.map +1 -1
- package/dist/src/internal/uuid.d.ts +1 -0
- package/dist/src/internal/uuid.d.ts.map +1 -1
- package/dist/src/internal/uuid.js +1 -1
- package/dist/src/internal/uuid.js.map +1 -1
- package/dist/src/ipfs.d.ts.map +1 -1
- package/dist/src/ipfs.js.map +1 -1
- package/dist/src/personal-space/constants.d.ts +4 -0
- package/dist/src/personal-space/constants.d.ts.map +1 -0
- package/dist/src/personal-space/constants.js +5 -0
- package/dist/src/personal-space/constants.js.map +1 -0
- package/dist/src/personal-space/create-space.d.ts +25 -0
- package/dist/src/personal-space/create-space.d.ts.map +1 -0
- package/dist/src/personal-space/create-space.js +31 -0
- package/dist/src/personal-space/create-space.js.map +1 -0
- package/dist/src/personal-space/create-space.test.d.ts +2 -0
- package/dist/src/personal-space/create-space.test.d.ts.map +1 -0
- package/dist/src/personal-space/create-space.test.js +26 -0
- package/dist/src/personal-space/create-space.test.js.map +1 -0
- package/dist/src/personal-space/index.d.ts +4 -0
- package/dist/src/personal-space/index.d.ts.map +1 -0
- package/dist/src/personal-space/index.js +3 -0
- package/dist/src/personal-space/index.js.map +1 -0
- package/dist/src/personal-space/publish-edit.d.ts +29 -0
- package/dist/src/personal-space/publish-edit.d.ts.map +1 -0
- package/dist/src/personal-space/publish-edit.js +73 -0
- package/dist/src/personal-space/publish-edit.js.map +1 -0
- package/dist/src/personal-space/publish-edit.test.d.ts +2 -0
- package/dist/src/personal-space/publish-edit.test.d.ts.map +1 -0
- package/dist/src/personal-space/publish-edit.test.js +124 -0
- package/dist/src/personal-space/publish-edit.test.js.map +1 -0
- package/dist/src/personal-space/types.d.ts +21 -0
- package/dist/src/personal-space/types.d.ts.map +1 -0
- package/dist/src/personal-space/types.js +2 -0
- package/dist/src/personal-space/types.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { PublishEditParams, PublishEditResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Publish an edit to IPFS and get the calldata for submitting it on-chain.
|
|
4
|
+
*
|
|
5
|
+
* This function:
|
|
6
|
+
* 1. Validates the spaceId (accepts UUID or 32-char hex string)
|
|
7
|
+
* 2. Publishes the ops to IPFS using the GRC-20 binary format
|
|
8
|
+
* 3. Encodes the calldata for the Space Registry's `enter()` function
|
|
9
|
+
*
|
|
10
|
+
* @param params - The parameters for publishing the edit
|
|
11
|
+
* @returns Object containing `editId`, `cid`, `to` (contract address), and `calldata`
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { personalSpace, Graph } from '@geoprotocol/geo-sdk';
|
|
16
|
+
*
|
|
17
|
+
* const { ops } = Graph.createEntity({ name: 'Test' });
|
|
18
|
+
* const { editId, cid, to, calldata } = await personalSpace.publishEdit({
|
|
19
|
+
* name: 'Add entity',
|
|
20
|
+
* spaceId: 'your-space-id',
|
|
21
|
+
* ops,
|
|
22
|
+
* author: '0x...',
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* await walletClient.sendTransaction({ to, data: calldata });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function publishEdit(params: PublishEditParams): Promise<PublishEditResult>;
|
|
29
|
+
//# sourceMappingURL=publish-edit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-edit.d.ts","sourceRoot":"","sources":["../../../src/personal-space/publish-edit.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAsBvE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAwBvF"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { encodeFunctionData, stringToHex, toHex } from 'viem';
|
|
2
|
+
import { TESTNET } from '../../contracts.js';
|
|
3
|
+
import { SpaceRegistryAbi } from '../abis/index.js';
|
|
4
|
+
import { isValid } from '../id.js';
|
|
5
|
+
import { toBytes } from '../id-utils.js';
|
|
6
|
+
import { UUID_DASHLESS_REGEX } from '../internal/uuid.js';
|
|
7
|
+
import * as Ipfs from '../ipfs.js';
|
|
8
|
+
import { EDITS_PUBLISHED, EMPTY_SIGNATURE, EMPTY_TOPIC } from './constants.js';
|
|
9
|
+
/**
|
|
10
|
+
* Converts a spaceId to bytes16 hex format.
|
|
11
|
+
* Accepts either a valid UUID (Id type) or a 32-char hex string (on-chain bytes16).
|
|
12
|
+
*/
|
|
13
|
+
function spaceIdToBytes16(spaceId) {
|
|
14
|
+
// If it's a 32-char hex string (bytes16 from on-chain), use directly
|
|
15
|
+
// Check this first since on-chain space IDs may look like UUIDs but aren't valid ones
|
|
16
|
+
if (UUID_DASHLESS_REGEX.test(spaceId)) {
|
|
17
|
+
return `0x${spaceId.toLowerCase()}`;
|
|
18
|
+
}
|
|
19
|
+
// If it's a valid UUID (with dashes), use the standard toBytes conversion
|
|
20
|
+
if (isValid(spaceId)) {
|
|
21
|
+
const bytes = toBytes(spaceId);
|
|
22
|
+
return toHex(bytes);
|
|
23
|
+
}
|
|
24
|
+
throw new Error(`Invalid spaceId: "${spaceId}". Expected a valid UUID or 32-character hex string.`);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Publish an edit to IPFS and get the calldata for submitting it on-chain.
|
|
28
|
+
*
|
|
29
|
+
* This function:
|
|
30
|
+
* 1. Validates the spaceId (accepts UUID or 32-char hex string)
|
|
31
|
+
* 2. Publishes the ops to IPFS using the GRC-20 binary format
|
|
32
|
+
* 3. Encodes the calldata for the Space Registry's `enter()` function
|
|
33
|
+
*
|
|
34
|
+
* @param params - The parameters for publishing the edit
|
|
35
|
+
* @returns Object containing `editId`, `cid`, `to` (contract address), and `calldata`
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { personalSpace, Graph } from '@geoprotocol/geo-sdk';
|
|
40
|
+
*
|
|
41
|
+
* const { ops } = Graph.createEntity({ name: 'Test' });
|
|
42
|
+
* const { editId, cid, to, calldata } = await personalSpace.publishEdit({
|
|
43
|
+
* name: 'Add entity',
|
|
44
|
+
* spaceId: 'your-space-id',
|
|
45
|
+
* ops,
|
|
46
|
+
* author: '0x...',
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* await walletClient.sendTransaction({ to, data: calldata });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export async function publishEdit(params) {
|
|
53
|
+
const { name, spaceId, ops, author, network = 'TESTNET' } = params;
|
|
54
|
+
const spaceIdBytes16 = spaceIdToBytes16(spaceId);
|
|
55
|
+
const { cid, editId } = await Ipfs.publishEdit({
|
|
56
|
+
name,
|
|
57
|
+
ops,
|
|
58
|
+
author,
|
|
59
|
+
network,
|
|
60
|
+
});
|
|
61
|
+
const calldata = encodeFunctionData({
|
|
62
|
+
abi: SpaceRegistryAbi,
|
|
63
|
+
functionName: 'enter',
|
|
64
|
+
args: [spaceIdBytes16, spaceIdBytes16, EDITS_PUBLISHED, EMPTY_TOPIC, stringToHex(cid), EMPTY_SIGNATURE],
|
|
65
|
+
});
|
|
66
|
+
return {
|
|
67
|
+
editId,
|
|
68
|
+
cid,
|
|
69
|
+
to: TESTNET.SPACE_REGISTRY_ADDRESS,
|
|
70
|
+
calldata,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=publish-edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-edit.js","sourceRoot":"","sources":["../../../src/personal-space/publish-edit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG/E;;;GAGG;AACH,SAAS,gBAAgB,CAAC,OAAe;IACvC,qEAAqE;IACrE,sFAAsF;IACtF,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,OAAO,KAAK,OAAO,CAAC,WAAW,EAAE,EAAmB,CAAC;IACvD,CAAC;IAED,0EAA0E;IAC1E,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACrB,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAC/B,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,qBAAqB,OAAO,sDAAsD,CAAC,CAAC;AACtG,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAyB;IACzD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAG,SAAS,EAAE,GAAG,MAAM,CAAC;IAEnE,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAEjD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;QAC7C,IAAI;QACJ,GAAG;QACH,MAAM;QACN,OAAO;KACR,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,kBAAkB,CAAC;QAClC,GAAG,EAAE,gBAAgB;QACrB,YAAY,EAAE,OAAO;QACrB,IAAI,EAAE,CAAC,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC;KACxG,CAAC,CAAC;IAEH,OAAO;QACL,MAAM;QACN,GAAG;QACH,EAAE,EAAE,OAAO,CAAC,sBAAsB;QAClC,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-edit.test.d.ts","sourceRoot":"","sources":["../../../src/personal-space/publish-edit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { TESTNET } from '../../contracts.js';
|
|
3
|
+
import { createEntity } from '../graph/create-entity.js';
|
|
4
|
+
import { generate } from '../id-utils.js';
|
|
5
|
+
import { publishEdit } from './publish-edit.js';
|
|
6
|
+
describe('publishEdit', () => {
|
|
7
|
+
it('should return correct structure', async () => {
|
|
8
|
+
const spaceId = '0eed5491b917cf58b33ac81255fe7ae9';
|
|
9
|
+
const { ops } = createEntity({ name: 'Test Entity' });
|
|
10
|
+
const result = await publishEdit({
|
|
11
|
+
name: 'Test Edit',
|
|
12
|
+
spaceId,
|
|
13
|
+
ops,
|
|
14
|
+
author: '0x0000000000000000000000000000000000000000',
|
|
15
|
+
});
|
|
16
|
+
expect(result).toHaveProperty('editId');
|
|
17
|
+
expect(result).toHaveProperty('cid');
|
|
18
|
+
expect(result).toHaveProperty('to');
|
|
19
|
+
expect(result).toHaveProperty('calldata');
|
|
20
|
+
});
|
|
21
|
+
it('should return the correct contract address', async () => {
|
|
22
|
+
const spaceId = '0eed5491b917cf58b33ac81255fe7ae9';
|
|
23
|
+
const { ops } = createEntity({ name: 'Test Entity' });
|
|
24
|
+
const { to } = await publishEdit({
|
|
25
|
+
name: 'Test Edit',
|
|
26
|
+
spaceId,
|
|
27
|
+
ops,
|
|
28
|
+
author: '0x0000000000000000000000000000000000000000',
|
|
29
|
+
});
|
|
30
|
+
expect(to).toBe(TESTNET.SPACE_REGISTRY_ADDRESS);
|
|
31
|
+
});
|
|
32
|
+
it('should return valid calldata', async () => {
|
|
33
|
+
const spaceId = '0eed5491b917cf58b33ac81255fe7ae9';
|
|
34
|
+
const { ops } = createEntity({ name: 'Test Entity' });
|
|
35
|
+
const { calldata } = await publishEdit({
|
|
36
|
+
name: 'Test Edit',
|
|
37
|
+
spaceId,
|
|
38
|
+
ops,
|
|
39
|
+
author: '0x0000000000000000000000000000000000000000',
|
|
40
|
+
});
|
|
41
|
+
expect(calldata).toBeTypeOf('string');
|
|
42
|
+
expect(calldata.startsWith('0x')).toBe(true);
|
|
43
|
+
});
|
|
44
|
+
it('should return valid CID', async () => {
|
|
45
|
+
const spaceId = '0eed5491b917cf58b33ac81255fe7ae9';
|
|
46
|
+
const { ops } = createEntity({ name: 'Test Entity' });
|
|
47
|
+
const { cid } = await publishEdit({
|
|
48
|
+
name: 'Test Edit',
|
|
49
|
+
spaceId,
|
|
50
|
+
ops,
|
|
51
|
+
author: '0x0000000000000000000000000000000000000000',
|
|
52
|
+
});
|
|
53
|
+
expect(cid).toMatch(/^ipfs:\/\//);
|
|
54
|
+
});
|
|
55
|
+
it('should return valid editId', async () => {
|
|
56
|
+
const spaceId = '0eed5491b917cf58b33ac81255fe7ae9';
|
|
57
|
+
const { ops } = createEntity({ name: 'Test Entity' });
|
|
58
|
+
const { editId } = await publishEdit({
|
|
59
|
+
name: 'Test Edit',
|
|
60
|
+
spaceId,
|
|
61
|
+
ops,
|
|
62
|
+
author: '0x0000000000000000000000000000000000000000',
|
|
63
|
+
});
|
|
64
|
+
expect(editId).toBeTruthy();
|
|
65
|
+
expect(editId).toHaveLength(32);
|
|
66
|
+
});
|
|
67
|
+
it('should accept 32-char hex string spaceId (on-chain format)', async () => {
|
|
68
|
+
const spaceId = 'abcdef12345678901234567890abcdef';
|
|
69
|
+
const { ops } = createEntity({ name: 'Test Entity' });
|
|
70
|
+
const result = await publishEdit({
|
|
71
|
+
name: 'Test Edit',
|
|
72
|
+
spaceId,
|
|
73
|
+
ops,
|
|
74
|
+
author: '0x0000000000000000000000000000000000000000',
|
|
75
|
+
});
|
|
76
|
+
expect(result.cid).toMatch(/^ipfs:\/\//);
|
|
77
|
+
expect(result.calldata.startsWith('0x')).toBe(true);
|
|
78
|
+
});
|
|
79
|
+
it('should accept valid UUID spaceId', async () => {
|
|
80
|
+
const spaceId = generate();
|
|
81
|
+
const { ops } = createEntity({ name: 'Test Entity' });
|
|
82
|
+
const result = await publishEdit({
|
|
83
|
+
name: 'Test Edit',
|
|
84
|
+
spaceId,
|
|
85
|
+
ops,
|
|
86
|
+
author: '0x0000000000000000000000000000000000000000',
|
|
87
|
+
});
|
|
88
|
+
expect(result.cid).toMatch(/^ipfs:\/\//);
|
|
89
|
+
expect(result.calldata.startsWith('0x')).toBe(true);
|
|
90
|
+
});
|
|
91
|
+
it('should accept UUID with dashes', async () => {
|
|
92
|
+
const spaceId = '550e8400-e29b-41d4-a716-446655440000';
|
|
93
|
+
const { ops } = createEntity({ name: 'Test Entity' });
|
|
94
|
+
const result = await publishEdit({
|
|
95
|
+
name: 'Test Edit',
|
|
96
|
+
spaceId,
|
|
97
|
+
ops,
|
|
98
|
+
author: '0x0000000000000000000000000000000000000000',
|
|
99
|
+
});
|
|
100
|
+
expect(result.cid).toMatch(/^ipfs:\/\//);
|
|
101
|
+
expect(result.calldata.startsWith('0x')).toBe(true);
|
|
102
|
+
});
|
|
103
|
+
it('should throw for invalid spaceId', async () => {
|
|
104
|
+
const invalidSpaceId = 'invalid';
|
|
105
|
+
const { ops } = createEntity({ name: 'Test Entity' });
|
|
106
|
+
await expect(publishEdit({
|
|
107
|
+
name: 'Test Edit',
|
|
108
|
+
spaceId: invalidSpaceId,
|
|
109
|
+
ops,
|
|
110
|
+
author: '0x0000000000000000000000000000000000000000',
|
|
111
|
+
})).rejects.toThrow('Invalid spaceId');
|
|
112
|
+
});
|
|
113
|
+
it('should throw for spaceId that is too short', async () => {
|
|
114
|
+
const shortSpaceId = 'abc123';
|
|
115
|
+
const { ops } = createEntity({ name: 'Test Entity' });
|
|
116
|
+
await expect(publishEdit({
|
|
117
|
+
name: 'Test Edit',
|
|
118
|
+
spaceId: shortSpaceId,
|
|
119
|
+
ops,
|
|
120
|
+
author: '0x0000000000000000000000000000000000000000',
|
|
121
|
+
})).rejects.toThrow('Invalid spaceId');
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
//# sourceMappingURL=publish-edit.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-edit.test.js","sourceRoot":"","sources":["../../../src/personal-space/publish-edit.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B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B,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Op } from '@geoprotocol/grc-20';
|
|
2
|
+
import type { Id } from '../id.js';
|
|
3
|
+
import type { Network } from '../types.js';
|
|
4
|
+
export type CreateSpaceResult = {
|
|
5
|
+
to: `0x${string}`;
|
|
6
|
+
calldata: `0x${string}`;
|
|
7
|
+
};
|
|
8
|
+
export type PublishEditParams = {
|
|
9
|
+
name: string;
|
|
10
|
+
spaceId: Id | string;
|
|
11
|
+
ops: Op[];
|
|
12
|
+
author: `0x${string}`;
|
|
13
|
+
network?: Network;
|
|
14
|
+
};
|
|
15
|
+
export type PublishEditResult = {
|
|
16
|
+
editId: Id;
|
|
17
|
+
cid: string;
|
|
18
|
+
to: `0x${string}`;
|
|
19
|
+
calldata: `0x${string}`;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/personal-space/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,KAAK,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,EAAE,GAAG,MAAM,CAAC;IACrB,GAAG,EAAE,EAAE,EAAE,CAAC;IACV,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,EAAE,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,KAAK,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/personal-space/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geoprotocol/geo-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"./abis": "./dist/abis.js"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@geoprotocol/grc-20": "^0.
|
|
21
|
+
"@geoprotocol/grc-20": "^0.2.3",
|
|
22
22
|
"effect": "^3.17.13",
|
|
23
23
|
"fflate": "^0.8.2",
|
|
24
24
|
"fractional-indexing-jittered": "^1.0.0",
|