solana-api

id.json 私钥导入

id.json import

Demo

Doc:
https://github.com/solana-developers/web3-examples

TX

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

// Create transaction
const tx = new web3.Transaction({
...blockhashInfo,
});

// console.log(tx)

// Add our hello world program instruction
tx.add(
new web3.TransactionInstruction({
programId: pg.PROGRAM_ID,
keys: [],
data: Buffer.from([]),
})
);
// Sign transaction
tx.sign(pg.wallet.keypair);
// Send the transaction to the Solana cluster
const txHash = await pg.connection.sendRawTransaction(tx.serialize());
console.log(txHash);
// this txHash can view in