Code Monkey home page Code Monkey logo

sns-sdk's Issues

Not able to pull latest rust sns-sdk library

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

Minor: console.logs() left in built version

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.

Error: Signature verification failed

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]
)

[BUG] Results with Errors

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

sns-sdk/js/src/utils.ts

Lines 151 to 161 in e0f96e2

export const getDomainKeySync = (domain: string, record = false) => {
if (domain.endsWith(".sol")) {
domain = domain.slice(0, -4);
}
const splitted = domain.split(".");
if (splitted.length === 2) {
const prefix = Buffer.from([record ? 1 : 0]).toString();
const sub = prefix.concat(splitted[0]);
const { pubkey: parentKey } = _deriveSync(splitted[1]);
const result = _deriveSync(sub, parentKey);
return { ...result, isSub: true, parent: parentKey };

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.