Questions tagged [solana-program-library]

90 questions
0
votes
1 answer

"Invalid param: not a Token account" when trying to obtain the balance of USDT account in Solana

I'm trying to get the balance of a random USDT account in Solana. I've tried several public gateways and hasn't successed. Here's one example: curl --request POST \ --url https://solana-mainnet.g.alchemy.com/v2/demo \ --header 'accept:…
0
votes
0 answers

Unable to transfer token to another account due toTypeError: Cannot read property 'toString' of undefined

I am trying to transfer the token to another account using the Solana rust program. I am currently using the Anchor framework. I have created the program for it. Now, I am trying to execute the test case to check the transfer functionality. But I am…
0
votes
2 answers

Solana Anchor: CPI with PDA

I'm trying to create an Mint having my program as authority and I'm struggling to get my CPI calls right. Here is a toy example of what I have so far: use anchor_lang::prelude::*; use anchor_spl::token::{ self, set_authority,…
0
votes
0 answers

Error code 3012 when trying to transfer WSOL to SPL token like ETH with Phantom

The error message says "The program expected this account to be already initialized." This error occurs on Jupiter Exchange when trying to transfer WSOL to a token like ETH, but the error does not occur when transferring SOL to the same token (when…
0
votes
1 answer

Make a stake program for my own nft project

Friends, I want to stake my own nft project. I wonder if there is a tool like candy machine for this? How can I make a staking program?
0
votes
0 answers

Getting error: No identifiers allowed directly after numeric literal

I am getting the error : [SyntaxError: No identifiers allowed directly after numeric literal] Actually I am using @solana/web3.js and @solana/spl-token libraries. /* param is {"amount": "1", "mintAddress":…
0
votes
1 answer

Solana can't mint to a different token account

Folks, I'm starting with Solana and it's been rough to learn. Despite the poor error messages and the learning curve of Rust, I'm making my way through it. I'm trying to develop a new token that will be a fungible asset (0 decimals, supply greater…
0
votes
1 answer

Can I do solana spl-token authorize mint --disable but from javascript?

I am trying create an NFT mint, I know how to do it from CLI, but I need to do it from JS, I am looking at the code of @solana/spl-token package, but cannot find API analogous to spl-token authorize mint --disable Does anyone know how to…
0
votes
0 answers

Solana: Error processing Instruction 0: Cross-program invocation with unauthorized signer or writable account, Transfer sol to wallet without pri key

I am trying to implement Program Flow of a bet game in solana with following features: A Player transfers some amount to house wallet (deposit_wallet) and plays a game System records the win loss net balance in a player specific PDA account…
0
votes
2 answers

Smart contract to Lock/Hold Solana tokens for a short period

I have a solana program that will transfer some amount. After agreeing to the amount to transfer, the transaction will take place a little later. Few hours to few days. Is there a way my solana smart contract can put a hold/lock kind of enforcement…
Subash Chaturanga
  • 814
  • 2
  • 10
  • 20
0
votes
1 answer

Validate the integrity of the solana program request content

Suppose I have a simple web UI to connect wallet and click a button to invoke a solana program transaction. Since the call is happening actually on user’s host machine/the browser, it's possible somehow the sol smart contract request metadata can be…
0
votes
1 answer

Testnet validator is not coming up the with leader schedule

Hello I have started the Testnet validator, and it's not validating at all, I have changed the Validator identity and Vote account identityy it's still showing the same info. There is no issue with catchup Not sure what's happening here any Insight…
anish
  • 6,884
  • 13
  • 74
  • 140
0
votes
2 answers

Is it possible to continue a computation in a Solana smart-contract beyond the compute budget?

I've been trying to figure out if it's at all possible to create a smart contract in Solana that will run a long-ish calculation (e.g. many sha256 iterations, or a KDF), maybe in parts, even though the calculation as a whole is obviously longer than…
0
votes
0 answers

having issues with deploying smart contract on solana

Anytime I try to deploy a contract on Solana I am always getting these issues. Deploying workspace: https://api.devnet.solana.com Upgrade authority: /Users/*****/.config/solana/id.json Deploying program ... Program path:…
0
votes
2 answers

Filtering by collectionID tokens owned by a solana wallet

I would like to do the following on the front-end. I would like to have a list of "collections" we support and which user can select from. User connects to Phantom wallet and selects "collection A". Now I check all tokens in the user's wallet that…