Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The new account created has no funds and cannot be transferred unless --allow-unfunded-recipient is added #2195

Closed
Patrickming opened this issue Feb 26, 2024 · 3 comments
Labels
question Add this to close an issue with instructions on how to repost as a question on Stack Exchange

Comments

@Patrickming
Copy link

Problem

When I create a new account using the following two methods, there is no fund by default and cannot be transferred.

  1. use the @solana/web3.js
import { Keypair } from "@solana/web3.js";

const keypair = Keypair.generate();

console.log(`The public key is: `, keypair.publicKey.toBase58());

Error message:

      throw new SendTransactionError(
            ^


SendTransactionError: failed to send transaction: Transaction simulation failed: Transaction results in an account (1) with insufficient funds for rent
    at Connection.sendEncodedTransaction (D:\web3_code\solana_learn\node_modules\@solana\web3.js\src\connection.ts:5921:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Connection.sendRawTransaction (D:\web3_code\solana_learn\node_modules\@solana\web3.js\src\connection.ts:5880:20)
    at Connection.sendTransaction (D:\web3_code\solana_learn\node_modules\@solana\web3.js\src\connection.ts:5868:12)
    at sendAndConfirmTransaction (D:\web3_code\solana_learn\node_modules\@solana\web3.js\src\utils\send-and-confirm-transaction.ts:35:21)    
    at <anonymous> (d:\web3_code\solana_learn\solanatransfer.ts:50:53) {
  logs: [
    'Program 11111111111111111111111111111111 invoke [1]',
    'Program 11111111111111111111111111111111 success'
  ]
}

Node.js v18.18.2
  1. use solana cli
solana-keygen new --force
solana transfer HV4egCuRfqnoGipQxVGRLLVRRfbmPH6EWdxKDKdyLktg 0.1

Error message:

Error: The recipient address (HV4egCuRfqnoGipQxVGRLLVRRfbmPH6EWdxKDKdyLktg) is not funded. Add `--allow-unfunded-recipient` to complete the transfer

Proposed Solution

  1. use solana cli
solana transfer --allow-unfunded-recipient 9w4egkmzj6Byop2iEA8ecP3m65zVn9ayNFFD1DNSdNPA 0.1 
  1. use the @solana/web3.js
    I don't know how to deal with this problem, like I don't know why the newly created account is unfunded and can't be transferred
@mcintyre94 mcintyre94 added the question Add this to close an issue with instructions on how to repost as a question on Stack Exchange label Feb 26, 2024
Copy link
Contributor

Hi @Patrickming,

Thanks for your question!

We want to make sure to keep signal strong in the GitHub issue tracker – to make sure that it remains the best place to track issues that affect the development of the Solana JavaScript SDK itself.

Questions like yours deserve a purpose-built Q&A forum. Unless there exists evidence that this is a bug with the Solana JavaScript SDK itself, please post your question to the Solana Stack Exchange using this link: https://solana.stackexchange.com/questions/ask


This automated message is a result of having added the ‘question’ tag.

@mcintyre94
Copy link
Collaborator

Looks like you already found the stackexchange, which is the right place for this question.

Copy link
Contributor

github-actions bot commented Mar 5, 2024

Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Add this to close an issue with instructions on how to repost as a question on Stack Exchange
Projects
None yet
Development

No branches or pull requests

2 participants