bonfida / sns-sdk Goto Github PK
View Code? Open in Web Editor NEWSolana Name Service SDKs monorepo
Home Page: https://bonfida.org/
Solana Name Service SDKs monorepo
Home Page: https://bonfida.org/
I'm using sns-sdk = "1.2.0"
inside my project and getting this error when trying to import sns-sdk
Log:
rust-analyzer failed to load workspace: Failed to load the project at /GitHub/api/Cargo.toml: Failed to read Cargo metadata from Cargo.toml file /GitHub/api/Cargo.toml, Some(Version { major: 1, minor: 71, patch: 0 }): Failed to run `cd "/GitHub/api" && "cargo" "metadata" "--format-version" "1" "--manifest-path" "/GitHub/api/Cargo.toml" "--filter-platform" "aarch64-apple-darwin"`: `cargo metadata` exited with an error: Updating crates.io index
error: failed to select a version for `curve25519-dalek`.
... required by package `solana-program v1.14.18`
... which satisfies dependency `solana-program = "=1.14.18"` of package `solana-address-lookup-table-program v1.14.18`
... which satisfies dependency `solana-address-lookup-table-program = "=1.14.18"` of package `solana-account-decoder v1.14.18`
... which satisfies dependency `solana-account-decoder = "=1.14.18"` of package `solana-client v1.14.18`
... which satisfies dependency `solana-client = "^1.14.18"` of package `sns-sdk v1.2.0`
... which satisfies dependency `sns-sdk = "^1.2.0"` of package `name_resolver v1.0.0 (/GitHub/api/name_resolver)`
... which satisfies path dependency `name_resolver` (locked to 1.0.0) of package `client v1.0.0 (/GitHub/api/client)`
versions that meet the requirements `^3.2.1` are: 3.2.1
all possible versions conflict with previously selected packages.
previously selected package `curve25519-dalek v3.0.0`
... which satisfies dependency `curve25519-dalek = "^3"` of package `ed25519-dalek v1.0.1`
... which satisfies dependency `ed25519-dalek = "^1.0.1"` of package `sns-sdk v1.2.0`
... which satisfies dependency `sns-sdk = "^1.2.0"` of package `name_resolver v1.0.0 (/GitHub/api/name_resolver)`
... which satisfies path dependency `name_resolver` (locked to 1.0.0) of package `client v1.0.0 (/GitHub/api/client)`
failed to select a version for `curve25519-dalek` which could resolve this conflict
When running unit tests:
console.log
mint Avcptd1yzx67NnK8ed8g8HZGeg8vFZp6437cwSm3gQj6
at F (node_modules/@bonfida/spl-name-service/dist/index.cjs:1:8742)
console.log
mint 6sLbLpia2LuH8jNyfgc1EEjeZkCTDmsfujhmzunkwnZ3
at F (node_modules/@bonfida/spl-name-service/dist/index.cjs:1:8742)
console.log
mint 4QdW7gKBvYkfyGndoq2LJ4uJRAgdDFrgV336zdd86nDW
at F (node_modules/@bonfida/spl-name-service/dist/index.cjs:1:8742)
console.log
mint 6sLbLpia2LuH8jNyfgc1EEjeZkCTDmsfujhmzunkwnZ3
at F (node_modules/@bonfida/spl-name-service/dist/index.cjs:1:8742)
I can't find this in your code (searching for mint
doesn't find anything so maybe you just need to rebuild.
See https://sns.guide/changelog.html. I'm currently trying to update to the latest version and seeing
Module '"@bonfida/spl-name-service"' has no exported member 'getAllDomains'
But there's nothing in the Changelog to tell me what to fix.
I am going to make the script to transfer the domain
but I have "Error: Signature verification failed" issue
Please help me to fix this issue
this is my current code
const { pubkey } = await getDomainKey(domain_sol);
let anotherKeypair = Keypair.generate();
// Step 2
// The registry object contains all the info about the domain name
// The NFT owner is of type PublicKey | undefined
const { registry, nftOwner } = await NameRegistryState.retrieve(
connection,
pubkey
);
const newOwner = new PublicKey(phantomWalletDestinatiob);
const ix = await transferNameOwnership(
connection,
domain_sol,
newOwner,
wallet.publicKey,
registry.class,
registry.parentName
);
const tx = new Transaction();
tx.add(ix)
tx.feePayer = wallet.publicKey;
tx.recentBlockhash =(await connection.getRecentBlockhash('max')).blockhash;
// await tx.setSigners(wallet.publicKey, anotherKeypair.publicKey);
// await tx.partialSign(anotherKeypair)
console.log(tx)
const result = await sendAndConfirmTransaction (
connection,
tx,
[wallet]
)
-----Solution----------
images convert in webp format.
I tried to use the @bonfida/spl-name-service
package and tried running the example given in here
const connection = new Connection(clusterApiUrl("mainnet-beta"));
const owner = await resolve(connection, "bonfida");
expect(owner.toBase58()).toBe("HKKp49qGWXd639QsuH7JiLijfVW5UtCVY4s1n2HANwEA");
This runs but there is a error logged in the console as shown below
node index.js
Error: Invalid name account provided
at G.retrieve (/Users/aadhi/Documents/github/bonfida-trial/node_modules/@bonfida/spl-name-service/dist/index.cjs:1:9672)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ue (/Users/aadhi/Documents/github/bonfida-trial/node_modules/@bonfida/spl-name-service/dist/index.cjs:1:15017)
at async pe (/Users/aadhi/Documents/github/bonfida-trial/node_modules/@bonfida/spl-name-service/dist/index.cjs:1:15166)
at async exports.resolve (/Users/aadhi/Documents/github/bonfida-trial/node_modules/@bonfida/spl-name-service/dist/index.cjs:1:23924)
at async main (/Users/aadhi/Documents/github/bonfida-trial/index.js:11:17)
{
owner: PublicKey [PublicKey(HKKp49qGWXd639QsuH7JiLijfVW5UtCVY4s1n2HANwEA)] {
_bn: <BN: f26cb7227020209c2da674948f8f3c330ee4f9a386256bd14f37a6e0c567542b>
}
} HKKp49qGWXd639QsuH7JiLijfVW5UtCVY4s1n2HANwEA
Looks like this is thrown from here
Lines 151 to 161 in e0f96e2
Specifically the line
const result = _deriveSync(sub, parentKey);
produces a pubkey that doesn't exists.
sub
however is \x01SOL
which indeed matches with what is given in this guide
What could be causing the problem here? Can you please help me out?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.