Questions tagged [solana-web3js]

322 questions
0
votes
2 answers

How to generate and mint the same NFT gif multiple times?

I am currently working on a Solana project where there are 4 different gifs (mp4) and I would like to turn one of them into 1500 NFTs, the second into 500, the third into 190 and the forth into 10. I need a collection of 2200 NFTs with all the…
0
votes
2 answers

Are these things possible to do with frontend development on Web3?

I'm starting to get interested on Web3 development, and I'd like to get some advices to help me on this journey. Well, following this amazing tutorial I've created a token on the Solana blockchain and I have these questions about what can I do on…
0
votes
1 answer

Calling specific methods on a Solana Solidity program

I've built a simple smart contract to run on the Ethereum blockchain and I'm trying to replicate some of it's behavior on Solana. After making some slight changes I've managed to compile the program with Solang targeting Solana, but I'm not sure how…
Robert May
  • 799
  • 6
  • 13
0
votes
2 answers

Solana: Parse Token Data

How does one parse the data in an SPL token account? It contains a binary blob and I'd like to get the token type and number of tokens. An acceptable language is solana-cli, web3.js, or solana.py. I'm looking for any solution.
Test
  • 962
  • 9
  • 26
0
votes
1 answer

How to get the wallet ID of sender and receiver from solana transaction signature?

I have the signature of a Solana transaction and I want to find the wallet ID of the sender and the receiver. This is what I did: const connection = new Web3.Connection(Web3.clusterApiUrl("devnet"), "confirmed"); const transaction = await…
Muhammed Jaseem
  • 782
  • 6
  • 18
0
votes
1 answer

How do I handle an error with account subscribe?

When an account is closed (on-chain), the account.subscribe listener try to decode the account, and it throws an error. How can I handle the error, to execute a callback when the error happens. It's an expected event. Currently, I'm getting: "Error:…
patriciobcs
  • 161
  • 5
0
votes
0 answers

How to pass the custom types props in react from the children components

I want to use the below component in a send button in UI.On click of which the logic should execute. import { useConnection, useWallet } from '@solana/wallet-adapter-react'; import React, { useCallback } from 'react'; interface Props { children:…
aroha_blue
  • 33
  • 6
0
votes
2 answers

Receiving "Phantom - RPC Error: Transaction creation failed" while building solana escrow with @solana/web3.js

I am trying to replicate https://github.com/dboures/solana-random-number-betting-game Although when I try to initiate my the Escrow I receive the following error: Phantom - RPC Error: Transaction creation failed. Uncaught (in promise) {code: -32003,…
0
votes
1 answer

Creating FS wallets on solana using JSON RPC

I'm new to Solana and trying to create FS wallets using JSON RPC API. I read about solana CLI interface and can generate new FS wallets using solana-keygen new . But now I'm trying to do the same using JSON RPC. I've…
Saad Saadi
  • 1,031
  • 10
  • 26
0
votes
1 answer

How to achieve Solidity's mapping in Solana?

How to achieve the functionality of Solidity's mapping in Solana? What I need is a map with an arbitrary number of entries (it'll be evergrowing). So how to calculate the rent exemption and how to actually do this? Is it even possible? I just need 1…
6b86b273ff
  • 11
  • 2
0
votes
0 answers

Solana wallet adapter access wallet automatically

Is there a way to connect to a wallet automatically using public keypair, then store credentials for future use without user required to give permission every time?
muniryasir
  • 109
  • 1
  • 8
0
votes
1 answer

sendTransaction v sendAndConfirmTransaction

So in my code I am doing the following in my backend and wondering which I should use? const sig = await web3.sendAndConfirmTransaction(connection, createMetadataTx, [mint_authority], { skipPreflight: false }) const sig = await…
1977
  • 2,580
  • 6
  • 26
  • 37
0
votes
1 answer

Caclulate Fee on @solana/web3.js

How to calculate the transaction fee using the library @solana/web3.js? I found the interface here, but I don't know how to use it
vlabster
  • 33
  • 4
0
votes
1 answer

TypeError: y.pubkey.toBase58 is not a function

I am trying to send 1 solana I have this code But it throws an error: Uncaught (in promise) TypeError: y.pubkey.toBase58 is not a function at transaction.ts:264:33 Help solve this error async function connectWallet() { let provider = null …
0
votes
1 answer

How to get staked amount of an account in Solana

I am building a stake pool for my spl-token on Solana. On my website I can get staked amount of an address by Anchor to call rpc API via connected program. Is there any way to get staked amount of a wallet address from my server?
agentp
  • 335
  • 4
  • 17