bitaps-com / wallet-api-examples Goto Github PK
View Code? Open in Web Editor NEWWallet API examples
Wallet API examples
Is there any smart contract in new style API? I can't see this in docs on website. Any support of smart contracts in BTC?
Hello!
Seems the host server for this endpoint is down:
BITAPS_TESTNET=https://api.bitaps.com/btc/testnet/v1/
I tried this via Postman:
https://api.bitaps.com/btc/testnet/v1/wallet/state/BTCucU8RXjWkssG2fPmAJEnjxZZ4kdzgvPLnYjv4Fqk4DyRvLwEYf
Here is what I get:
{
"error_code": 1,
"message": "internal server error",
"details": ""
}
The endpoint worked before even right from my code while creating wallet (/create/wallet) and while checking the wallet state (/wallet/state/) 2 days ago. Since yesterday it has not been working as I am getting error not comprehensive enough for me to debug. Below is the detailed error log::
Detailed log
{ Error: Request failed with status code 500
at createError (C:\Users\User\Documents\Projects\CryptoVilla\cryptovillacapital\node_modules\axios\lib\core\createError.js:16:15)
at settle (C:\Users\User\Documents\Projects\CryptoVilla\cryptovillacapital\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd (C:\Users\User\Documents\Projects\CryptoVilla\cryptovillacapital\node_modules\axios\lib\adapters\http.js:237:11)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1129:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
config:
{ url: 'https://api.bitaps.com/btc/testnet/v1/create/wallet',
method: 'post',
data:
'{"callback_link":"http://localhost:3000/wallet/cryptovilla"}',
headers:
{ Accept: 'application/json, text/plain, /',
'Content-Type': 'application/json;charset=utf-8',
'User-Agent': 'axios/0.19.0',
'Content-Length': 60 },
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 0,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus] },
request:
ClientRequest {
_events:
[Object: null prototype] {
socket: [Function],
abort: [Function],
aborted: [Function],
error: [Function],
timeout: [Function],
prefinish: [Function: requestOnPrefinish] },
_eventsCount: 6,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket:
TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: 'api.bitaps.com',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object],
_eventsCount: 8,
connecting: false,
_hadError: false,
_handle: [TLSWrap],
_parent: null,
_host: 'api.bitaps.com',
_readableState: [ReadableState],
readable: true,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular],
[Symbol(res)]: [TLSWrap],
[Symbol(asyncId)]: 285,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object] },
connection:
TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: 'api.bitaps.com',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object],
_eventsCount: 8,
connecting: false,
_hadError: false,
_handle: [TLSWrap],
_parent: null,
_host: 'api.bitaps.com',
_readableState: [ReadableState],
readable: true,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular],
[Symbol(res)]: [TLSWrap],
[Symbol(asyncId)]: 285,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object] },
_header:
'POST /btc/testnet/v1/create/wallet HTTP/1.1\r\nAccept: application/json, text/plain, /\r\nContent-Type: application/json;charset=utf-8\r\nUser-Agent: axios/0.19.0\r\nContent-Length: 60\r\nHost: api.bitaps.com\r\nConnection: close\r\n\r\n',
_onPendingData: [Function: noopPendingOutput],
agent:
Agent {
_events: [Object],
_eventsCount: 1,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object],
requests: {},
sockets: [Object],
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
maxCachedSessions: 100,
_sessionCache: [Object] },
socketPath: undefined,
timeout: undefined,
method: 'POST',
path: '/btc/testnet/v1/create/wallet',
_ended: true,
res:
IncomingMessage {
_readableState: [ReadableState],
readable: false,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
socket: [TLSSocket],
connection: [TLSSocket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers: [Object],
rawHeaders: [Array],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 500,
statusMessage: 'Internal Server Error',
client: [TLSSocket],
_consuming: false,
_dumped: false,
req: [Circular],
responseUrl: 'https://api.bitaps.com/btc/testnet/v1/create/wallet',
redirects: [] },
aborted: undefined,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
_redirectable:
Writable {
_writableState: [WritableState],
writable: true,
_events: [Object],
_eventsCount: 2,
_maxListeners: undefined,
_options: [Object],
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 60,
_requestBodyBuffers: [],
_onNativeResponse: [Function],
_currentRequest: [Circular],
_currentUrl: 'https://api.bitaps.com/btc/testnet/v1/create/wallet' },
[Symbol(isCorked)]: false,
[Symbol(outHeadersKey)]:
[Object: null prototype] {
accept: [Array],
'content-type': [Array],
'user-agent': [Array],
'content-length': [Array],
host: [Array] } },
response:
{ status: 500,
statusText: 'Internal Server Error',
headers:
{ date: 'Sat, 03 Aug 2019 15:52:22 GMT',
'content-type': 'application/json; charset=utf-8',
'content-length': '68',
connection: 'close',
'access-control-allow-origin': '*',
content_type: 'application/json',
server: 'api.bitaps.com',
bitcoin: 'because fuck the banks',
'strict-transport-security': 'max-age=31536000',
ip: '196.45.51.47',
'ratelimit-limit': '10',
'ratelimit-period': '5',
'ratelimit-remaining': '9',
'ratelimit-reset': '5' },
config:
{ url: 'https://api.bitaps.com/btc/testnet/v1/create/wallet',
method: 'post',
data:
'{"callback_link":"http://localhost:3000/wallet/cryptovilla"}',
headers: [Object],
transformRequest: [Array],
transformResponse: [Array],
timeout: 0,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus] },
request:
ClientRequest {
_events: [Object],
_eventsCount: 6,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: [TLSSocket],
connection: [TLSSocket],
_header:
'POST /btc/testnet/v1/create/wallet HTTP/1.1\r\nAccept: application/json, text/plain, /\r\nContent-Type: application/json;charset=utf-8\r\nUser-Agent: axios/0.19.0\r\nContent-Length: 60\r\nHost: api.bitaps.com\r\nConnection: close\r\n\r\n',
_onPendingData: [Function: noopPendingOutput],
agent: [Agent],
socketPath: undefined,
timeout: undefined,
method: 'POST',
path: '/btc/testnet/v1/create/wallet',
_ended: true,
res: [IncomingMessage],
aborted: undefined,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
_redirectable: [Writable],
[Symbol(isCorked)]: false,
[Symbol(outHeadersKey)]: [Object] },
data:
{ error_code: 1, message: 'internal server error', details: '' } },
isAxiosError: true,
toJSON: [Function] }
Kindly check and fix. Thanks.
I am not getting any response while trying to create wallet. Does it mean this API does not support NodeJs or what was I doing wrong?
When I create an ETH payment address in my wallet, the addresses are incorrect. When I transfer to another address it shows me this error: invalid amount, receiver list index 0
Code:
$params = array("password" => "Password123");
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.bitaps.com/eth/v1/create/wallet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($params)
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
print_r(json_decode($response));
echo ("
");
$wallet_id=json_decode($response)->wallet_id;
$params = array("wallet_id"=> $wallet_id);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.bitaps.com/".$currency."/v1/create/wallet/payment/address",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($params)));
$response = curl_exec($curl);
print_r(json_decode($response));
echo ("
");
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.