Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

token-js: Add TokenGroup support #6175

Closed
joncinque opened this issue Jan 24, 2024 · 4 comments
Closed

token-js: Add TokenGroup support #6175

joncinque opened this issue Jan 24, 2024 · 4 comments
Labels

Comments

@joncinque
Copy link
Contributor

Problem

The TokenGroup, TokenGroupMember, GroupPointer, and GroupMemberPointer extensions are all in the token-2022 program, and the two pointer extensions are live on all networks, but they aren't supported in @solana/spl-token.

The TokenGroup and TokenGroupMember have a JS library at https://github.com/solana-labs/solana-program-library/tree/master/token-group/js

Proposed Solution

Similar to #5667, add support for these extensions by incorporating @solana/spl-token-group into @solana/spl-token

buffalojoec pushed a commit that referenced this issue Feb 24, 2024
As mentioned in #6175, the `GroupPointer` extension is live on Token-2022
mainnet-beta, but it's not currently supported in the `@solana/spl-token`.

This change adds that support!
buffalojoec pushed a commit that referenced this issue Feb 24, 2024
As mentioned in #6175, and building on the previous PR, the `GroupMemberPointer`
extension is live on Token-2022 mainnet-beta.

This change adds support for `GroupMemberPointer` in `@solana/spl-token`!
@buffalojoec
Copy link
Contributor

The pointers have been added! Now we just need support for the Token Group interface, similarly to Token Metadata, by making use of the existing @solana/spl-token-group package!

@qiweiii
Copy link
Contributor

qiweiii commented Feb 25, 2024

I can add that!

@minute-med
Copy link

Hello there, i'm having an issue and after googling my error i landed here.
Might be of interest for you:

"@solana/spl-token": "^0.4.2",
"@solana/web3.js": "^1.91.1",

`✔ Vite server hmr 9 files in 19.54ms

WARN [Vue Router warn]: uncaught error during route navigation:

ERROR The requested module '@solana/spl-token-group' does not provide an export named 'TOKEN_GROUP_MEMBER_SIZE'

TOKEN_GROUP_MEMBER_SIZE,
^

SyntaxError: The requested module '@solana/spl-token-group' does not provide an export named 'TOKEN_GROUP_MEMBER_SIZE'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)

WARN [Vue Router warn]: uncaught error during route navigation:

ERROR The requested module '@solana/spl-token-group' does not provide an export named 'TOKEN_GROUP_MEMBER_SIZE'

TOKEN_GROUP_MEMBER_SIZE,
^

SyntaxError: The requested module '@solana/spl-token-group' does not provide an export named 'TOKEN_GROUP_MEMBER_SIZE'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)

WARN Cannot stringify arbitrary non-POJOs SyntaxError

✘ [ERROR] No matching export in "node_modules/@solana/spl-token-group/lib/esm/index.js" for import "TOKEN_GROUP_SIZE"

node_modules/@solana/spl-token/lib/esm/extensions/tokenGroup/actions.js:2:154:
  2 │ ...n, createUpdateGroupMaxSizeInstruction, createUpdateGroupAuthorityInstruction, createInitializeMemberInstruction, TOKEN_GROUP_SIZE, TOKEN_GROUP_MEMBER_SIZE, } from '@solana/spl-token-group';
    ╵                                                                                                                      ~~~~~~~~~~~~~~~~

✘ [ERROR] No matching export in "node_modules/@solana/spl-token-group/lib/esm/index.js" for import "TOKEN_GROUP_MEMBER_SIZE"

node_modules/@solana/spl-token/lib/esm/extensions/tokenGroup/actions.js:2:172:
  2 │ ...n, createUpdateGroupMaxSizeInstruction, createUpdateGroupAuthorityInstruction, createInitializeMemberInstruction, TOKEN_GROUP_SIZE, TOKEN_GROUP_MEMBER_SIZE, } from '@solana/spl-token-group';
    ╵                                                                                                                                        ~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] No matching export in "node_modules/@solana/spl-token-group/lib/esm/index.js" for import "TOKEN_GROUP_SIZE"

node_modules/@solana/spl-token/lib/esm/extensions/tokenGroup/state.js:4:9:
  4 │ export { TOKEN_GROUP_SIZE, TOKEN_GROUP_MEMBER_SIZE } from '@solana/spl-token-group';
    ╵          ~~~~~~~~~~~~~~~~

✘ [ERROR] No matching export in "node_modules/@solana/spl-token-group/lib/esm/index.js" for import "TOKEN_GROUP_MEMBER_SIZE"

node_modules/@solana/spl-token/lib/esm/extensions/tokenGroup/state.js:4:27:
  4 │ export { TOKEN_GROUP_SIZE, TOKEN_GROUP_MEMBER_SIZE } from '@solana/spl-token-group';
    ╵                            ~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] No matching export in "node_modules/@solana/spl-token-group/lib/esm/index.js" for import "TOKEN_GROUP_SIZE"

node_modules/@solana/spl-token/lib/esm/extensions/tokenGroup/state.js:4:9:
  4 │ export { TOKEN_GROUP_SIZE, TOKEN_GROUP_MEMBER_SIZE } from '@solana/spl-token-group';
    ╵          ~~~~~~~~~~~~~~~~

✘ [ERROR] No matching export in "node_modules/@solana/spl-token-group/lib/esm/index.js" for import "TOKEN_GROUP_MEMBER_SIZE"

node_modules/@solana/spl-token/lib/esm/extensions/tokenGroup/state.js:4:27:
  4 │ export { TOKEN_GROUP_SIZE, TOKEN_GROUP_MEMBER_SIZE } from '@solana/spl-token-group';
    ╵                            ~~~~~~~~~~~~~~~~~~~~~~~

ERROR error while updating dependencies: 3:50:40 PM
Error: Build failed with 6 errors:
node_modules/@solana/spl-token/lib/esm/extensions/tokenGroup/actions.js:2:154: ERROR: No matching export in "node_modules/@solana/spl-token-group/lib/esm/index.js" for import "TOKEN_GROUP_SIZE"
node_modules/@solana/spl-token/lib/esm/extensions/tokenGroup/actions.js:2:172: ERROR: No matching export in "node_modules/@solana/spl-token-group/lib/esm/index.js" for import "TOKEN_GROUP_MEMBER_SIZE"
node_modules/@solana/spl-token/lib/esm/extensions/tokenGroup/state.js:4:9: ERROR: No matching export in "node_modules/@solana/spl-token-group/lib/esm/index.js" for import "TOKEN_GROUP_SIZE"
node_modules/@solana/spl-token/lib/esm/extensions/tokenGroup/state.js:4:9: ERROR: No matching export in "node_modules/@solana/spl-token-group/lib/esm/index.js" for import "TOKEN_GROUP_SIZE"
node_modules/@solana/spl-token/lib/esm/extensions/tokenGroup/state.js:4:27: ERROR: No matching export in "node_modules/@solana/spl-token-group/lib/esm/index.js" for import "TOKEN_GROUP_MEMBER_SIZE"`

@buffalojoec
Copy link
Contributor

@ErwanTouba Thanks for reporting. Solution was published.
https://github.com/solana-labs/solana-program-library/releases/tag/token-js-v0.4.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants