Neucron
Search
K
Comment on page

Wallet

Wallet Creation

The /wallet/create endpoint allows you to create a new wallet. This endpoint is protected with Bearer Token authentication and accepts a POST request with the following parameters:
  • mnemonic (optional): A string containing the mnemonic phrase for wallet creation. If not provided, the API will generate a mnemonic phrase for you.
  • X-Neucron-App-ID: A header parameter for specifying the app ID.
  • X-Neucron-Key-ID: A header parameter for specifying the key ID.
  • X-Neucron-Key-Secret: A header parameter for specifying the key secret.
  • X-Neucron-User-ID: A header parameter for specifying the user ID.

Endpoint Details

  • URL: https://dev.neucron.io/wallet/create
  • Method: POST
  • Consumes: application/json
  • Produces: application/json
  • Tags: Wallet
  • Summary: Create Wallet

Request Example

Here's an example CURL request for creating a wallet without providing a mnemonic (it will be generated by the API):
curl -X 'POST' \
'https://dev.neucron.io/wallet/create' \
-H 'accept: application/json' \
-H 'Authorization: <Your_Bearer_Token>'
Replace <Your_Bearer_Token> with your actual Bearer Token.

Response

The API responds with JSON data containing a walletID upon successful creation. If you didn't provide a mnemonic, the API will generate one for you. Here's the response structure:
{
"data": {
"walletID": "string",
"mnemonic": "string" // The generated mnemonic phrase
},
"status_code": "integer"
}
  • data.walletID: A string representing the wallet's unique identifier.
  • data.mnemonic: A string representing the generated mnemonic phrase (if not provided in the request).
  • status_code: An integer representing the HTTP status code.

Response Codes

  • 200: OK - The wallet was successfully created.
  • 400: Bad Request - If there's an issue with the request, you'll receive an error response.
  • 500: Internal Server Error - If there's a problem with the server, you'll receive an error response.

JavaScript Demo Code

Here's an updated JavaScript demo code snippet that allows you to create a wallet without providing a mnemonic:
const axios = require('axios');
const createWallet = async () => {
try {
const response = await axios.post('https://dev.neucron.io/wallet/create', {}, {
headers: {
'Authorization': '<Your_Bearer_Token>',
'Content-Type': 'application/json',
},
});
console.log('Wallet ID:', response.data.data.walletID);
console.log('Generated Mnemonic:', response.data.data.mnemonic);
} catch (error) {
console.error('Error:', error.message);
}
};
// Call the function to create a wallet
createWallet();
Replace <Your_Bearer_Token> with your actual Bearer Token before running the code. This code now makes a POST request without providing a mnemonic, and the API will generate one for you.
post
https://dev.neucron.io
/wallet/create
Generate new wallet using mnemonic

Wallet List

The /wallet/list endpoint allows you to retrieve a list of wallets. This endpoint is protected with Bearer Token authentication and accepts a GET request with the following parameters:
  • X-Neucron-App-ID: A header parameter for specifying the app ID.
  • X-Neucron-Key-ID: A header parameter for specifying the key ID.
  • X-Neucron-Key-Secret: A header parameter for specifying the key secret.
  • X-Neucron-User-ID: A header parameter for specifying the user ID.

Endpoint Details

  • URL: https://dev.neucron.io/wallet/list
  • Method: GET
  • Consumes: application/json
  • Produces: application/json
  • Tags: Wallet
  • Summary: Get List of Wallets

Request Example

Here's an example CURL request to retrieve a list of wallets:
curl -X 'GET' \
'https://dev.neucron.io/wallet/list' \
-H 'accept: application/json' \
-H 'Authorization: <Your_Bearer_Token>'
Replace <Your_Bearer_Token> with your actual Bearer Token.

Response

The API responds with JSON data containing a list of wallet IDs. Here's the response structure:
{
"data": {
"walletList": ["string1", "string2", ...]
},
"status_code": "integer"
}
  • data.walletList: An array of strings representing the wallet IDs.
  • status_code: An integer representing the HTTP status code.

Response Codes

  • 200: OK - The list of wallets was successfully retrieved.
  • 400: Bad Request - If there's an issue with the request, you'll receive an error response.
  • 500: Internal Server Error - If there's a problem with the server, you'll receive an error response.

JavaScript Demo Code

Here's a JavaScript demo code snippet using the axios library to make a GET request to retrieve a list of wallets:
const axios = require('axios');
const getWalletList = async () => {
try {
const response = await axios.get('https://dev.neucron.io/wallet/list', {
headers: {
'Authorization': '<Your_Bearer_Token>',
'Content-Type': 'application/json',
},
});
console.log('Wallet List:', response.data.data.walletList);
} catch (error) {
console.error('Error:', error.message);
}
};
// Call the function to retrieve the wallet list
getWalletList();
Replace <Your_Bearer_Token> with your actual Bearer Token before running the code. This code makes a GET request to retrieve the list of wallets and logs them to the console.
get
https://dev.neucron.io
/wallet/list
get list of wallet

Wallet List

The /wallet/list endpoint allows you to retrieve a list of wallets. This endpoint is protected with Bearer Token authentication and accepts a GET request with the following parameters:
  • X-Neucron-App-ID: A header parameter for specifying the app ID.
  • X-Neucron-Key-ID: A header parameter for specifying the key ID.
  • X-Neucron-Key-Secret: A header parameter for specifying the key secret.
  • X-Neucron-User-ID: A header parameter for specifying the user ID.

Endpoint Details

  • URL: https://dev.neucron.io/wallet/list
  • Method: GET
  • Consumes: application/json
  • Produces: application/json
  • Tags: Wallet
  • Summary: Get List of Wallets

Request Example

Here's an example CURL request to retrieve a list of wallets:
curl -X 'GET' \
'https://dev.neucron.io/wallet/list' \
-H 'accept: application/json' \
-H 'Authorization: <Your_Bearer_Token>'
Replace <Your_Bearer_Token> with your actual Bearer Token.

Response

The API responds with JSON data containing a list of wallet IDs. Here's the response structure:
{
"data": {
"walletList": ["string1", "string2", ...]
},
"status_code": "integer"
}
  • data.walletList: An array of strings representing the wallet IDs.
  • status_code: An integer representing the HTTP status code.

Response Codes

  • 200: OK - The list of wallets was successfully retrieved.
  • 400: Bad Request - If there's an issue with the request, you'll receive an error response.
  • 500: Internal Server Error - If there's a problem with the server, you'll receive an error response.

JavaScript Demo Code

Here's a JavaScript demo code snippet using the axios library to make a GET request to retrieve a list of wallets:
const axios = require('axios');
const getWalletList = async () => {
try {
const response = await axios.get('https://dev.neucron.io/wallet/list', {
headers: {
'Authorization': '<Your_Bearer_Token>',
'Content-Type': 'application/json',
},
});
console.log('Wallet List:', response.data.data.walletList);
} catch (error) {
console.error('Error:', error.message);
}
};
// Call the function to retrieve the wallet list
getWalletList();
Replace <Your_Bearer_Token> with your actual Bearer Token before running the code. This code makes a GET request to retrieve the list of wallets and logs them to the console.
post
https://dev.neucron.io
/wallet/default
set default wallet

Get Xpub Key

The /wallet/xpubkeys endpoint allows you to retrieve the Xpub key associated with a wallet. This endpoint is protected with Bearer Token authentication and accepts a GET request with the following parameters:
  • walletID: A query parameter specifying the ID of the wallet for which you want to retrieve the Xpub key.
  • X-Neucron-App-ID: A header parameter for specifying the app ID.
  • X-Neucron-Key-ID: A header parameter for specifying the key ID.
  • X-Neucron-Key-Secret: A header parameter for specifying the key secret.
  • X-Neucron-User-ID: A header parameter for specifying the user ID.

Endpoint Details

  • URL: https://dev.neucron.io/wallet/xpubkeys
  • Method: GET
  • Consumes: application/json
  • Produces: application/json
  • Tags: Wallet
  • Summary: Get Xpub Key

Request Example

Here's an example CURL request to retrieve the Xpub key for a specific wallet:
curl -X 'GET' \
'https://dev.neucron.io/wallet/xpubkeys?walletID=<Wallet_ID>' \
-H 'accept: application/json' \
-H 'Authorization: <Your_Bearer_Token>'
Replace <Wallet_ID> with the ID of the wallet for which you want to retrieve the Xpub key, and <Your_Bearer_Token> with your actual Bearer Token.

Response

The API responds with a JSON object containing the Xpub key for the specified wallet. Here's the response structure:
{
"data": {
"xPubKey": "string"
},
"status_code": "integer"
}
  • data.xPubKey: A string representing the Xpub key of the wallet.
  • status_code: An integer representing the HTTP status code.

Response Codes

  • 200: OK - The Xpub key was successfully retrieved.
  • 400: Bad Request - If there's an issue with the request, you'll receive an error response.
  • 500: Internal Server Error - If there's a problem with the server, you'll receive an error response.

Curl Example

Here's the CURL example to retrieve the Xpub key for a specific wallet (replace <Wallet_ID> and <Your_Bearer_Token> as mentioned above):
curl -X 'GET' \
'https://dev.neucron.io/wallet/xpubkeys?walletID=<Wallet_ID>' \
-H 'accept: application/json' \
-H 'Authorization: <Your_Bearer_Token>'
This CURL request will retrieve the Xpub key for the specified wallet and return it in the response.
get
https://dev.neucron.io
/wallet/xpubkeys
get master public key