Questions tagged [js]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
64 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?
johnny's user avatar
  • 49
0 votes
2 answers
29 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,...
Artashes Baghdasaryan's user avatar
1 vote
0 answers
34 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.
jeong's user avatar
  • 23
0 votes
1 answer
58 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 ...
Loo G's user avatar
  • 1
1 vote
0 answers
152 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 ...
CryptoTioSam's user avatar
0 votes
2 answers
297 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 ...
Skelt's user avatar
  • 31
1 vote
1 answer
89 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 ...
Kum's user avatar
  • 107
1 vote
1 answer
316 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 ...
CryptoTioSam's user avatar
7 votes
3 answers
170 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: ...
Taylor Lee's user avatar
1 vote
1 answer
635 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(...
CryptoTioSam's user avatar
1 vote
2 answers
47 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?
Killerthief's user avatar
4 votes
2 answers
406 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 @...
cerritosMonkey's user avatar
1 vote
1 answer
164 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: ...
CryptoTioSam's user avatar
0 votes
1 answer
80 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 ...
Viacheslav Serebrianniy's user avatar