@towns-labs/react-sdk 2.0.11 → 2.0.12

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.
@@ -17,17 +17,6 @@ export const useMember = (props, config) => {
17
17
  userId: data.userId,
18
18
  streamId: data.streamId,
19
19
  initialized: data.initialized,
20
- // username
21
- username: data.username,
22
- isUsernameConfirmed: data.isUsernameConfirmed,
23
- isUsernameEncrypted: data.isUsernameEncrypted,
24
- // displayName
25
- displayName: data.displayName,
26
- isDisplayNameEncrypted: data.isDisplayNameEncrypted,
27
- // ensAddress
28
- ensAddress: data.ensAddress,
29
- // nft
30
- nft: data.nft,
31
20
  // membership
32
21
  membership: data.membership,
33
22
  ...rest,
@@ -1 +1 @@
1
- {"version":3,"file":"useMember.js","sourceRoot":"","sources":["../../src/useMember.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACrB,KAA2C,EAC3C,MAAgD,EAClD,EAAE;IACA,MAAM,IAAI,GAAG,YAAY,EAAE,CAAA;IAC3B,MAAM,MAAM,GAAG,OAAO,CAClB,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,EAC7D,CAAC,IAAI,EAAE,KAAK,CAAC,CAChB,CAAA;IACD,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvD,OAAO;QACH,gHAAgH;QAChH,MAAM,EAAE,IAAI,CAAC,MAA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EAAE,IAAI,CAAC,MAAM;QACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,aAAa;QACb,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,GAAG,IAAI;KACV,CAAA;AACL,CAAC,CAAA"}
@@ -1,5 +1,4 @@
1
1
  import { useMemo } from 'react';
2
- import { useAction } from './internals/useAction';
3
2
  import { useObservable } from './useObservable';
4
3
  import { useSyncAgent } from './useSyncAgent';
5
4
  import { getRoom } from './utils';
@@ -18,54 +17,4 @@ export const useMyMember = (streamId, config) => {
18
17
  ...data,
19
18
  };
20
19
  };
21
- /**
22
- * Hook to set the ENS address of the current user in a stream.
23
- * You should be validating if the ENS address belongs to the user before setting it.
24
- * @param streamId - The id of the stream to set the ENS address of.
25
- * @param config - Configuration options for the action.
26
- * @returns The `setEnsAddress` action and its loading state.
27
- */
28
- export const useSetEnsAddress = (streamId, config) => {
29
- const sync = useSyncAgent();
30
- const member = useMemo(() => getMyMember(sync, streamId), [sync, streamId]);
31
- const { action: setEnsAddress, ...rest } = useAction(member, 'setEnsAddress', config);
32
- return { setEnsAddress, ...rest };
33
- };
34
- /**
35
- * Hook to set the username of the current user in a stream.
36
- * @param streamId - The id of the stream to set the username of.
37
- * @param config - Configuration options for the action.
38
- * @returns The `setUsername` action and its loading state.
39
- */
40
- export const useSetUsername = (streamId, config) => {
41
- const sync = useSyncAgent();
42
- const member = useMemo(() => getMyMember(sync, streamId), [sync, streamId]);
43
- const { action: setUsername, ...rest } = useAction(member, 'setUsername', config);
44
- return { setUsername, ...rest };
45
- };
46
- /**
47
- * Hook to set the display name of the current user in a stream.
48
- * @param streamId - The id of the stream to set the display name of.
49
- * @param config - Configuration options for the action.
50
- * @returns The `setDisplayName` action and its loading state.
51
- */
52
- export const useSetDisplayName = (streamId, config) => {
53
- const sync = useSyncAgent();
54
- const member = useMemo(() => getMyMember(sync, streamId), [sync, streamId]);
55
- const { action: setDisplayName, ...rest } = useAction(member, 'setDisplayName', config);
56
- return { setDisplayName, ...rest };
57
- };
58
- /**
59
- * Hook to set the NFT of the current user in a stream.
60
- * You should be validating if the NFT belongs to the user before setting it.
61
- * @param streamId - The id of the stream to set the NFT of.
62
- * @param config - Configuration options for the action.
63
- * @returns The `setNft` action and its loading state.
64
- */
65
- export const useSetNft = (streamId, config) => {
66
- const sync = useSyncAgent();
67
- const member = useMemo(() => getMyMember(sync, streamId), [sync, streamId]);
68
- const { action: setNft, ...rest } = useAction(member, 'setNft', config);
69
- return { setNft, ...rest };
70
- };
71
20
  //# sourceMappingURL=useMyMember.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMyMember.js","sourceRoot":"","sources":["../../src/useMyMember.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAqB,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAyB,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,MAAM,WAAW,GAAG,CAAC,IAAe,EAAE,QAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,MAAM,CAAA;AAEjG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,MAAgD,EAAE,EAAE;IAC9F,MAAM,IAAI,GAAG,YAAY,EAAE,CAAA;IAC3B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAA;IAC3E,MAAM,EAAE,IAAI,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrD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,EAAE,CAAA;IAC3B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAA;IAC3E,MAAM,EAAE,IAAI,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrD,OAAO;QACH,GAAG,IAAI;KACV,CAAA;AACL,CAAC,CAAA"}
@@ -19,9 +19,9 @@ export declare const useCreateSpace: (config?: ActionConfig<Spaces["createSpace"
19
19
  * @param opts - Options for the create space action.
20
20
  * @param signer - The signer used to create the space.
21
21
  */
22
- createSpace: (params: Partial<Omit<import("@towns-labs/web3").CreateSpaceParams, "spaceName">> & {
23
- spaceName: string;
24
- }, _signer: import("ethers").Signer) => Promise<{
22
+ createSpace: (params?: {
23
+ channelName?: string;
24
+ } | undefined, _signer?: import("ethers").Signer | undefined) => Promise<{
25
25
  spaceId: string;
26
26
  defaultChannelId: string;
27
27
  }>;
@@ -18,13 +18,6 @@ export declare const useMember: (props: {
18
18
  userId: string;
19
19
  streamId: string;
20
20
  initialized: boolean;
21
- username: string;
22
- isUsernameConfirmed: boolean;
23
- isUsernameEncrypted: boolean;
24
- displayName: string;
25
- isDisplayNameEncrypted: boolean | undefined;
26
- ensAddress: string | undefined;
27
- nft: import("@towns-labs/sdk").NftModel | undefined;
28
21
  membership: import("@towns-labs/proto").MembershipOp | undefined;
29
22
  };
30
23
  //# sourceMappingURL=useMember.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMember.d.ts","sourceRoot":"","sources":["../../src/useMember.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAIxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAIvD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAClB,OAAO;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC3C,SAAS,gBAAgB,CAAC,cAAc,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;CA4BnD,CAAA"}
1
+ {"version":3,"file":"useMember.d.ts","sourceRoot":"","sources":["../../src/useMember.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAIxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAIvD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAClB,OAAO;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC3C,SAAS,gBAAgB,CAAC,cAAc,CAAC,MAAM,CAAC;;;;;;;;;;CAiBnD,CAAA"}
@@ -1,5 +1,4 @@
1
- import type { Member, Myself } from '@towns-labs/sdk';
2
- import { type ActionConfig } from './internals/useAction';
1
+ import type { Member } from '@towns-labs/sdk';
3
2
  import { type ObservableConfig } from './useObservable';
4
3
  /**
5
4
  * Hook to get the data of the current user in a stream.
@@ -8,76 +7,10 @@ import { type ObservableConfig } from './useObservable';
8
7
  * @returns The MemberModel of the current user.
9
8
  */
10
9
  export declare const useMyMember: (streamId: string, config?: ObservableConfig.FromObservable<Member>) => {
11
- id: string;
12
10
  userId: string;
13
11
  streamId: string;
14
12
  initialized: boolean;
15
- username: string;
16
- isUsernameConfirmed: boolean;
17
- isUsernameEncrypted: boolean;
18
- displayName: string;
19
- isDisplayNameEncrypted?: boolean;
20
- ensAddress?: string;
21
- nft?: import("@towns-labs/sdk").NftModel;
22
13
  membership?: import("@towns-labs/proto").MembershipOp;
23
14
  appAddress?: string;
24
15
  };
25
- /**
26
- * Hook to set the ENS address of the current user in a stream.
27
- * You should be validating if the ENS address belongs to the user before setting it.
28
- * @param streamId - The id of the stream to set the ENS address of.
29
- * @param config - Configuration options for the action.
30
- * @returns The `setEnsAddress` action and its loading state.
31
- */
32
- export declare const useSetEnsAddress: (streamId: string, config?: ActionConfig<Myself["setEnsAddress"]>) => {
33
- data: void | undefined;
34
- error: Error | undefined;
35
- isPending: boolean;
36
- isSuccess: boolean;
37
- isError: boolean;
38
- setEnsAddress: (ensAddress: `0x${string}`) => Promise<void>;
39
- };
40
- /**
41
- * Hook to set the username of the current user in a stream.
42
- * @param streamId - The id of the stream to set the username of.
43
- * @param config - Configuration options for the action.
44
- * @returns The `setUsername` action and its loading state.
45
- */
46
- export declare const useSetUsername: (streamId: string, config?: ActionConfig<Myself["setUsername"]>) => {
47
- data: void | undefined;
48
- error: Error | undefined;
49
- isPending: boolean;
50
- isSuccess: boolean;
51
- isError: boolean;
52
- setUsername: (username: string) => Promise<void>;
53
- };
54
- /**
55
- * Hook to set the display name of the current user in a stream.
56
- * @param streamId - The id of the stream to set the display name of.
57
- * @param config - Configuration options for the action.
58
- * @returns The `setDisplayName` action and its loading state.
59
- */
60
- export declare const useSetDisplayName: (streamId: string, config?: ActionConfig<Myself["setDisplayName"]>) => {
61
- data: void | undefined;
62
- error: Error | undefined;
63
- isPending: boolean;
64
- isSuccess: boolean;
65
- isError: boolean;
66
- setDisplayName: (displayName: string) => Promise<void>;
67
- };
68
- /**
69
- * Hook to set the NFT of the current user in a stream.
70
- * You should be validating if the NFT belongs to the user before setting it.
71
- * @param streamId - The id of the stream to set the NFT of.
72
- * @param config - Configuration options for the action.
73
- * @returns The `setNft` action and its loading state.
74
- */
75
- export declare const useSetNft: (streamId: string, config?: ActionConfig<Myself["setNft"]>) => {
76
- data: void | undefined;
77
- error: Error | undefined;
78
- isPending: boolean;
79
- isSuccess: boolean;
80
- isError: boolean;
81
- setNft: (nft: import("@towns-labs/sdk").NftModel) => Promise<void>;
82
- };
83
16
  //# sourceMappingURL=useMyMember.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMyMember.d.ts","sourceRoot":"","sources":["../../src/useMyMember.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAa,MAAM,iBAAiB,CAAA;AAEhE,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,iBAAiB,CAAA;AAMtE;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,EAAE,SAAS,gBAAgB,CAAC,cAAc,CAAC,MAAM,CAAC;;;;;;;;;;;;;;CAO7F,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GACzB,UAAU,MAAM,EAChB,SAAS,YAAY,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;;;;;;;CAMjD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,EAAE,SAAS,YAAY,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;;;;;;;CAK5F,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAC1B,UAAU,MAAM,EAChB,SAAS,YAAY,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;;;;;;;CAMlD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,UAAU,MAAM,EAAE,SAAS,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;;;;;;;CAKlF,CAAA"}
1
+ {"version":3,"file":"useMyMember.d.ts","sourceRoot":"","sources":["../../src/useMyMember.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAa,MAAM,iBAAiB,CAAA;AAExD,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,iBAAiB,CAAA;AAMtE;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,EAAE,SAAS,gBAAgB,CAAC,cAAc,CAAC,MAAM,CAAC;;;;;;CAO7F,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@towns-labs/react-sdk",
3
3
  "description": "React Hooks for Towns Protocol SDK",
4
- "version": "2.0.11",
4
+ "version": "2.0.12",
5
5
  "type": "module",
6
6
  "main": "./dist/esm/index.js",
7
7
  "types": "./dist/types/index.d.ts",
@@ -18,9 +18,9 @@
18
18
  "watch": "bun run build -w"
19
19
  },
20
20
  "dependencies": {
21
- "@towns-labs/proto": "^2.0.11",
22
- "@towns-labs/sdk": "^2.0.11",
23
- "@towns-labs/web3": "^2.0.11",
21
+ "@towns-labs/proto": "^2.0.12",
22
+ "@towns-labs/sdk": "^2.0.12",
23
+ "@towns-labs/web3": "^2.0.12",
24
24
  "ethers": "^5.8.0"
25
25
  },
26
26
  "devDependencies": {
package/src/useMember.ts CHANGED
@@ -27,17 +27,6 @@ export const useMember = (
27
27
  userId: data.userId,
28
28
  streamId: data.streamId,
29
29
  initialized: data.initialized,
30
- // username
31
- username: data.username,
32
- isUsernameConfirmed: data.isUsernameConfirmed,
33
- isUsernameEncrypted: data.isUsernameEncrypted,
34
- // displayName
35
- displayName: data.displayName,
36
- isDisplayNameEncrypted: data.isDisplayNameEncrypted,
37
- // ensAddress
38
- ensAddress: data.ensAddress,
39
- // nft
40
- nft: data.nft,
41
30
  // membership
42
31
  membership: data.membership,
43
32
  ...rest,
@@ -1,6 +1,5 @@
1
- import type { Member, Myself, SyncAgent } from '@towns-labs/sdk'
1
+ import type { Member, SyncAgent } from '@towns-labs/sdk'
2
2
  import { useMemo } from 'react'
3
- import { type ActionConfig, useAction } from './internals/useAction'
4
3
  import { type ObservableConfig, useObservable } from './useObservable'
5
4
  import { useSyncAgent } from './useSyncAgent'
6
5
  import { getRoom } from './utils'
@@ -21,63 +20,3 @@ export const useMyMember = (streamId: string, config?: ObservableConfig.FromObse
21
20
  ...data,
22
21
  }
23
22
  }
24
-
25
- /**
26
- * Hook to set the ENS address of the current user in a stream.
27
- * You should be validating if the ENS address belongs to the user before setting it.
28
- * @param streamId - The id of the stream to set the ENS address of.
29
- * @param config - Configuration options for the action.
30
- * @returns The `setEnsAddress` action and its loading state.
31
- */
32
- export const useSetEnsAddress = (
33
- streamId: string,
34
- config?: ActionConfig<Myself['setEnsAddress']>,
35
- ) => {
36
- const sync = useSyncAgent()
37
- const member = useMemo(() => getMyMember(sync, streamId), [sync, streamId])
38
- const { action: setEnsAddress, ...rest } = useAction(member, 'setEnsAddress', config)
39
- return { setEnsAddress, ...rest }
40
- }
41
-
42
- /**
43
- * Hook to set the username of the current user in a stream.
44
- * @param streamId - The id of the stream to set the username of.
45
- * @param config - Configuration options for the action.
46
- * @returns The `setUsername` action and its loading state.
47
- */
48
- export const useSetUsername = (streamId: string, config?: ActionConfig<Myself['setUsername']>) => {
49
- const sync = useSyncAgent()
50
- const member = useMemo(() => getMyMember(sync, streamId), [sync, streamId])
51
- const { action: setUsername, ...rest } = useAction(member, 'setUsername', config)
52
- return { setUsername, ...rest }
53
- }
54
-
55
- /**
56
- * Hook to set the display name of the current user in a stream.
57
- * @param streamId - The id of the stream to set the display name of.
58
- * @param config - Configuration options for the action.
59
- * @returns The `setDisplayName` action and its loading state.
60
- */
61
- export const useSetDisplayName = (
62
- streamId: string,
63
- config?: ActionConfig<Myself['setDisplayName']>,
64
- ) => {
65
- const sync = useSyncAgent()
66
- const member = useMemo(() => getMyMember(sync, streamId), [sync, streamId])
67
- const { action: setDisplayName, ...rest } = useAction(member, 'setDisplayName', config)
68
- return { setDisplayName, ...rest }
69
- }
70
-
71
- /**
72
- * Hook to set the NFT of the current user in a stream.
73
- * You should be validating if the NFT belongs to the user before setting it.
74
- * @param streamId - The id of the stream to set the NFT of.
75
- * @param config - Configuration options for the action.
76
- * @returns The `setNft` action and its loading state.
77
- */
78
- export const useSetNft = (streamId: string, config?: ActionConfig<Myself['setNft']>) => {
79
- const sync = useSyncAgent()
80
- const member = useMemo(() => getMyMember(sync, streamId), [sync, streamId])
81
- const { action: setNft, ...rest } = useAction(member, 'setNft', config)
82
- return { setNft, ...rest }
83
- }