I want to create my own Solana token that takes %2 fee to all transactions and total supply should be 100k token. That's why i used spl-token cli for this spl-token create-token --transfer-fee 50 1000, however after executing this command i get an error like
Error: Program(IncorrectProgramId)
How can i fix this error or how can i create my own token with transaction fee.
When creating a new token with transfer fees, you must specify the program id as the token-2022 program id of TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb, so instead, do:
spl-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb create-token --transfer-fee 50 1000
Related
I have a problem with Binance API when placing a market order using the order_market_buy method.
def order_market_buy(symbol, quantity):
client.order_market_buy(symbol=symbol, quantity=quantity, recvWindow=50000)
order_market_buy('BNBBTC', 0.0001)
When you run this code, the following error occurs.
BTC on the wallet account is enough to carry out a transaction.
What could be the cause of the error?
Using the BNBBTC pair means you want to buy BNB using BTC. That error suggests that you don't have enough BTC in your Binance account. Also, the minimum transaction size is $10 so with the current price of BNB you might have to buy closer to .017 of it.
I've got problem with printing transactions received on address.
On my machine I've got full sync node
but still cannot get transactions on address. Command which I use:
bitcoin-cli getreceivedbyaddress ADDRESS
Result:
error code: -4
error message:
Address not found in wallet
Is there anything more that I should do?
getreceivedbyaddress is a wallet RPC query. It queries your own wallet.
Bitcoind does not maintain a full per-address index of the blockchain.
To query any address you should use importaddress RPC call
importaddress "address" ( "label" rescan p2sh ) Adds an address or
script (in hex) that can be watched as if it were in your wallet but
cannot be used to spend. Requires a new wallet backup.
rescan is on by default and rescanning can take some time.
I am a relative newbie in bitcoin and blockchain and hope you can help me with some of the questions.
So I launched a "regtest" network and generated 101 blocks using
bitcoin-cli -regtest generate 101
Now, if I launch 'bitcoin-cli -regtest getaddressesbyaccount ""', I get the public address of my default account:
[
"mwpKJNJ4UZL7yFyj53RSVcwauGAK84UvV2"
]
And of course, I should not have any other accounts as for now.
When I launch 'bitcoin-cli -regtest listunspent':
[
{
"txid": "694030f8638318c8c54054515ec716159edc494b14234885deb48f294b75a2fe",
"vout": 0,
"address": "n1queZpweTHjrMLvwSmcfrrJSQjsrYG3nG",
"scriptPubKey": "21038cadb266ed1ae6c474f5c1b74fc5f6790eacde843a673a16cfc924a100f2a679ac",
"amount": 50.00000000,
"confirmations": 101,
"spendable": true,
"solvable": true,
"safe": true
}
]
First question:
I understand that the only transaction listed by "listunspent" is UTXO,
meaning this is a transaction what I received to my address "n1queZpweTHjrMLvwSmcfrrJSQjsrYG3nG" with 50 BTC as amount.
Where this address comes from? By what bitcoin-cli command I can see/find it in my wallet?
Second question:
How can I create a new wallet with some balances and switch between them ( using bitcoin-cli )?
Basically, I would like to be able to test my app using bitcoin-cli - I need to be able to create wallets, switch between them and send btc between the addresses.
Coinbase coins can't be transferred until 100 blocks after they were created.
(Why did you generate "101" blocks specifically?)
So, the amount in your wallet you see is from the first block you mined. You can verify that by bitcoin-cli -regtest getblock "<hash of first block>" which you had got in return to the generate 101 command you ran earlier (an array of 101 block hashes).
Try the following
generate one more block bitcoin-cli -regtest generate 1
now listunspent and you should see 2 utxos instead of 1.
Depending on what you want to test, maybe simply creating a new address and sending money to it is enough for you?
[Edit]
Shut down core properly.
Rename your wallet.dat file
When you restart, a new wallet(wallet.dat) will be created. You can use them by supplying -wallet arg to bitcoin-qt
For example, if you are on linux:
Create 4 wallets by starting bitcoin core, stopping bitcoin core and then renaming the wallet.dat in your ~/.bitcoin folder (then repeating the process). For example, run this process 4 times to generate :
mywallet.dat
wifeswallet.dat
kidswallet.dat
businesswallet.dat
Then, in linux, in your .bashrc :
alias mywallet="bitcoin-qt -wallet=~/.bitcoin/mywallet.dat"
alias wifeswallet="bitcoin-qt -wallet=~/.bitcoin/wifeswallet.dat"
alias kidswallet="bitcoin-qt -wallet=~/.bitcoin/kidswallet.dat"
alias businesswallet="bitcoin-qt -wallet=~/.bitcoin/businesswallet.dat"
I am using square_connect ruby gem to refund payments.
body =
#<SquareConnect::CreateRefundRequest
#amount_money=#<SquareConnect::Money #amount=200, #currency="USD">,
#idempotency_key="be70cc12-28dd-4168-96ea-6eb78f299207",
#tender_id="asdkasdkakdakdakda">
All other parameters are just as intended. I have changed Tender key too.
result = api_instance.create_refund(authorization, location_id, transaction_id, body)
This gives me INTERNAL SERVER ERROR.
ETHON: performed EASY effective_url=https://connect.squareup.com/v2/locations/BP6GXQNEANA9B/transactions/b2fd4689-af1b-40a4-b706-aafd592e1111/refund response_code=500 return_code=ok total_time=1.883598
SquareConnect::ApiError: Internal Server Error - {"errors":[{"category":"API_ERROR","code":"INTERNAL_SERVER_ERROR","detail":"An internal error has occurred, and the API was unable to service your request."}]}
Are you sure that your tender_id matches a tender you want to refund? 500 isn't the correct response, but it seems like you are likely not selecting a correct tender to refund.
Also you should look into upgrading your SDK to the latest version.
This is a major bug in the Square Connect API. I was actually trying with a wrong transaction ID, instead of getting something like "Incorrect Transaction ID" I was getting 500 Internal Server Error.
I have been using Stripe, Payflow. Authorize.net, Braintree and Moneris API for almost 2 years now but I have never received a 500 Internal server error for a wrong transaction Id. So Square needs to address it on urgent basis.
I am getting this error -> {"code": 500, "message": "Forwarding error"} every time I try to get related concepts from my private account and corpus. The error seems to be a timeout error since it always dies at 2:30.
I've replaced the sample provided by IBM to point to my account and corpus. Does anybody know why this is occurring?
curl -u "{username}":"{password}" "https://gateway.watsonplatform.net/concept-insights/api/v2/corpora/accountid/corpus/related_concepts?limit=3&level=0"
cURL result
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 44 0 44 0 0 0 0 --:--:-- 0:02:30 --:--:-- 10
Corpus status
{"id":"/corpora/accountid/corpus","documents":10,"last_updated":"0001-01-01T00:00:00Z","build_status":{"ready":10,"error":0,"processing":0}}
NOTE: I do not get this error if I use the public example provided by IBM on the API. I have also masked my account id, corpus, username, and password for this public posting.
Unfortunately, since the error is corpus specific (since you mentioned you can the API to work on the public corpus), we would need to know more information about your corpus (like account id and corpus id) in order to help you out.
One way to allow you to provide this information privately is to open a ticket with the Bluemix system (there are 2 options described here)
https://developer.ibm.com/bluemix/support/#support
If you list the "Watson Concept Insights" service in the ticket, we will get your information.