Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
1
vote
Accepted
Can I transfer sol using pubkey?
In order to transfer Sol to a pubkey, you need to pass that pubkey (Account) in your program instruction (Context). Solana programs (Smart Contracts) have to load all accounts before being able to sen …
0
votes
Accepted
How to figure out if an address is an associated token address owned by the running program?
If you understand PDAs
an Associated Token Account (ATA) is a PDA derived from the SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID and with seeds:
wallet address
TOKEN_PROGRAM
mint address
This makes it for …
3
votes
can i get nft or accounts on user address in solana program (smart contract) rust?
If you are using Anchor, which I recommend for beginners.
You have an account that is defined as Account<'info, anchor_spl::token::TokenAccount>, you can get the amount of SPL tokens stored in that ac …
2
votes
How to Invoke contract function on react app?
I advise you to follow this example
Anchor backend
React Frontend
Wallet using Solana Wallet Adapter
The main advantage of using Anchor with React is reusing the test code in your /tests folder
3
votes
How to define a Constant Address (Publickey) in Anchor
A neat way to initialize constant Pubkeys in an organized way.
Lib.rs
// Program Id
declare_id!("e8zpvHybTbjMjoDR7CWjBUj1ttxQwRMUebhAf2z52ba");
mod pubkeys {
use anchor_lang::prelude::*;
// …
1
vote
How can I get the transaction history of a wallet with more than 1000 transactions/signatures?
Use this getSignaturesForAddress template to get signatures (transactions) up to a certain limit (default 100000).
It takes connection, address, and maxLength and returns list of signatures
* @param …
3
votes
Accepted
CPI from Program A to B via a Rust crate?
First, you need to create the 2 programs. Let's define 2 programs, puppet and puppet-master where puppet-master does a CPI into puppet.
anchor init puppet
anchor new puppet-master
Then you need to im …
2
votes
InstructionFallbackNotFound. Error Number: 101. Error Message: Fallback functions are not su...
Fetch Instruction Discriminator in Rust
pub fn sighash(namespace: &str, name: &str) -> [u8; 8] {
let preimage = format! …
1
vote
How to define constant Pubkeys while developing with Anchor?
A neat way to initialize constant Pubkeys in an organized way.
Lib.rs
// Program Id
declare_id!("e8zpvHybTbjMjoDR7CWjBUj1ttxQwRMUebhAf2z52ba");
mod pubkeys {
use anchor_lang::prelude::*;
// …
4
votes
how can i check / verify past events of my smartcontract?
You can fetch the transaction history of your program (address) and then parse the transactions using Anchor event parser.
fetching the transactions
connection.getSignaturesForAddress is limited to 10 …