Category "solana"

Solana: Create PDA account on chain

I am trying to write a Solana program which creates a PDA account for me on-chain. I can't get it to work and tbh, no idea what I am doing wrong :/ I have the f

How to get all Candy Machine Ids on solana chain by web3 or json rpc

I wanna get all Candy Machine Ids on chain by web3 or json rpc call. I have tried with getProgramAccounts json rpc but have response with Maximum response size

Failing tests -> Cannot read properties of undefined (reading 'rpc')

I was writing a test in TypeScript for Adding two numbers. I am receiving the following error: Adds two numbers: TypeError: Cannot read properties of undef

TypeError: Unknown file extension ".ts" in a Solana Anchor project

I got this error after updating Solana-cli to 1.9.4 and Anchor-cli to 0.20.1 and other local npm versions... Local npm package: @project-serum/anchor 0.18.2 Sol

failed to deploy solana smart contract (solang compiler)

I run: Solana-keygen new --force solana airdrop 5 I have a solidity smart contract that looks like this: // SPDX-License-Identifier: MIT pragma solidity ^0.7.0;

Error loading workspace IDL for Solana Anchor Testing

For some reason, my mocha test is unable to find my IDL. I am getting the error below: name@Mabels-MacBook-Pro solana-anchor-reactjs-payment % anchor test BPF S

Error loading workspace IDL for Solana Anchor Testing

For some reason, my mocha test is unable to find my IDL. I am getting the error below: name@Mabels-MacBook-Pro solana-anchor-reactjs-payment % anchor test BPF S

How to sale Solana NFT which has minted with my own contract?

I have minted NFTS with my own contract on Solana blockchain. I am going to sell these NFTS on Marketplace but marketplaces need candy machine addresses or hash

How to transfer SOL in anchor smart contract instruction

I am creating a dapp where multiple users can deposit SOL into an event account, and depending on whoever wins the event, they can redeem SOL back to their wall

custom program error: 0xbbf on anchor framework solana

const connection = new anchor.web3.Connection("https://api.devnet.solana.com"); const provider = new anchor.Provider(connection, wallet, { preflight

Solana. Need to export all addresses from the blockchain to the DB

I found a way: https://docs.solana.com/developing/plugins/geyser-plugins OR https://github.com/solana-labs/solana-accountsdb-plugin-postgres But for this need t

Requesting airdrop of 1 SOL on the devnet

I have properly setup a Solana wallet on the devnet, using these commands: curl https://release.solana.com/v1.8.6/solana-install-init-x86_64-pc-windows-msvc.exe

Solana / web3.js : getting web3.Signer from wallet

I want to send a token from one wallet to another using web3.js and spl-token. To send it I have to create an object named Token, one of the parameters of the c

Solana nft staking program

I am trying to implement this staking program but I don't understand how to deploy it, do I have to deploy the program first? This the frontend: https://github.

the trait `anchor_lang::AccountDeserialize` is not implemented for `anchor_spl::token::Mint`

I am trying to CPI the Token Program to send spl-tokens to a wallet. For this the derive accounts in the context struct has three accounts without any attribute

Give another account ability to transfer portion of SOL - Solana

In SPL Token there is a function called Approve which gives the delegate account the ability to transfer an amount of tokens. So far I can only see this working

Anchor,Solana -> failed to send transaction: Transaction simulation failed Custom Error 0x0

I am trying to build a simple coin flip game in solana. Full code here I get this error: Error: failed to send transaction: Transaction simulation failed: Error

Import web3 not found... in solana web3.js

I npm installed everything, yet only web3 is not working? Is this a bug or is there an alternative to this solution? import React,{useEffect, useState}from 're

Solana program to send multiple lamport transfers and emit event

I’m building a program intended to manage multiple payments with one call. The program needs to complete the following steps: Accept a certain amount of l

How do I close an account, empty the rent into a wrapped sol account, and then sync it?

I have an account that stores some data and is owned by my Solana program. I'd like to implement a Close instruction that "closes" the account and transfers the