Questions tagged [js]
The js tag has no usage guidance.
24
questions
1
vote
0
answers
33
views
Help Needed to Retrieve Transaction Details Using Solana SDK in JavaScript/TypeScript
I've been trying for a few days with the Solana SDK to get information about a transaction. Actually, what I'm trying to get is this:
Swap 2,172,062.080193 NEIRO for 30.038762944 SOL
By providing the ...
0
votes
1
answer
36
views
Fetch list of addresses of token holders
I'm working on a project involving Solana's SPL tokens and need to retrieve a list of all addresses holding a specific SPL token using JavaScript. However, I'm struggling with getting a list of token ...
0
votes
0
answers
45
views
Log Decode Instruction from webSocket
For three days now I have been trying to figure out how to Decode these codes when there is no proper documentation and no proper instructions.
log => {
signature: '...
0
votes
1
answer
84
views
How to give up metadata update permission for spl token via solana api?
I have created spl token , I now want to lock the metadata so that no one can update him. I tried to do it using the following code but received the error “ ‘Program log: Error: Invalid instruction’”
...
0
votes
2
answers
647
views
How to get live price in dollar for any Solana tokens?
I'm working on a Node.js bot using the Raydium SDK. My goal is to fetch the price of any token on the Solana blockchain, given its address, and display the updated price in the terminal every second. ...
0
votes
1
answer
359
views
RangeError: encoding overruns Uint8Array
I am getting this error when combining two sets of swap instructions into one, can anyone elaborate on what causes it? Thanks
RangeError: encoding overruns Uint8Array
0
votes
0
answers
36
views
Market Not Found Error using @project-serum/serum library on Devnet
I am write a script to execute a buy order on serum @project-serum/serum and @solana/web3.js libraries.
Getting " Error: Market not found" even though this address https://solscan.io/...
0
votes
1
answer
259
views
TypeError: Cannot read properties of undefined (reading 'toBase58')
Hello Im trying to get the metadata for the latest 5 newly minted tokens on the blockchain, I keep getting the error
const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, ...
1
vote
2
answers
82
views
Is it possible to burn tokens on transfer?
Hey is it possible to create a token2022, and burn x% of tokens on every transfer? Something like transfer tax, but burning the tokens. Also i got second question, how can i deploy token on-chain, ...
0
votes
1
answer
75
views
How do I get lamports sent from a parsed transaction
How do I get the lamports sent in each transaction and why are there multiple transaction accounts on each message?
This is the code I have, but 'parsed' is typed as any in the SDK
const ...
1
vote
1
answer
135
views
Can I make an onchain program using JavaScript/TypeScript?
Is there a way to write up and deploy a smart contract using JS instead of Rust for my custom token?
0
votes
2
answers
55
views
Sender can send but the receiver not receing amount, and also I can't make it work for USDC
Hello Stack Overflow community,
I'm encountering a few challenges with a transaction, and I'd appreciate your insights.
Problem with Transaction Signature:
I'm receiving the signature from the sender,...
1
vote
0
answers
42
views
Is there any JS library that support slip0023(BIP32 - EDD25519)? [closed]
Is there any JS library that support slip0023(BIP32 - EDD25519)?
I know about that Rust support slip0023, but I wanna know about JS library.
0
votes
1
answer
77
views
Clear JS - Metaplex is not a constructor
I am trying to construct new Metaplex with connection, but I am getting error
Uncaught (in promise) ReferenceError: Metaplex is not defined
My code:
<h1>Moralis API Response:</h1>
<div ...
2
votes
0
answers
195
views
Error with buffer-layout and @tensor-hq/tensorswap-sdk v1.4.5
I am using the @tensor-hq/tensorswap-sdk and trying to use one of the functions in there as follow:
import { TensorSwapSDK, CurveType, PoolType} from "@tensor-hq/tensorswap-sdk";
const ...
0
votes
2
answers
561
views
Solana Token Swap Program - Program log: panicked at 'index out of bounds: the len is 0 but the index is 0', token-swap/program/src/state.rs:61:17
I am facing an issue when I try to create a token swap through the js binding for the token swap program.
https://github.com/solana-labs/solana-program-library/tree/master/token-swap
I don't get the ...
1
vote
1
answer
166
views
Pubkey of Token account?
Some API end points accept
<string> - Pubkey of Token account to query, as base-58 encoded string
as an account address.
What's "Pubkey of Token account"?
And how to get one ...
2
votes
1
answer
1k
views
Is there a better way to use onLogs and getTransaction to be able to receive data real-time?
Right now I am using the onLogs stream to subscribe to a wallet.
I check the logs and when is the type of tx I need I use the getTransaction to be able to get more info about the tx.
Is there a better ...
7
votes
3
answers
248
views
How to submit a transaction on ui side?
Rust program:
use {
anchor_lang::prelude::*,
clockwork_sdk::{
queue_program::accounts::{Queue, QueueAccount},
CrankResponse,
},
};
#[derive(Accounts)]
#[instruction(name: ...
1
vote
1
answer
911
views
@metaplex-foundation/js .findByMint() getting TypeError: Cannot read properties of undefined (reading 'toBuffer')
I am using Node.js
I am trying to get NFT metada but getting this error:
file:///home/tiosam/sns-tw-bot/node_modules/@metaplex-foundation/js/dist/esm/plugins/nftModule/pdas.mjs:10
return Pda.find(...
1
vote
2
answers
62
views
RPC CALL WITHOUT HAVING LAMPORTS
So, I want to know if I make an RPC call from my client-side and my account has 0 balance. Does the RPC call go till the validator and get rejected or does the RPC call itself reject the program?
4
votes
2
answers
490
views
React Native build error when installing @solana/wallet-adapter "Module parse failed"
I recently installed the @solana packages in order to use the Solana Wallet Adapter but am now running into build errors. The packages I installed using npm are
@solana/wallet-adapter-base ^0.9.16
@...
1
vote
1
answer
295
views
How to add confirmationStrategy in JS
Hello I already read this question
But I don't know how to create the BlockheightBasedTransactionConfirmationStrategy object in JS as in that example TS is used.
I will like to get this code in JS:
...
0
votes
1
answer
109
views
Get staking rewards for a specific account
Wondering what is the best way to get all the rewards for a specific account.
Currently I’m using getInflationReward RPC endpoint but it requires me to call it per epoch so eventually I’m looping from ...