在钱包内生成地址
curl --request POST \
--url https://apidev.nusd.me/v2/wallets/{wallet_id}/addresses \
--header 'BIZ-API-KEY: <api-key>' \
--header 'Biz-Api-Nonce: <api-key>' \
--header 'Biz-Api-Signature: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"chain_id": "<string>",
"count": 1
}
'import requests
url = "https://apidev.nusd.me/v2/wallets/{wallet_id}/addresses"
payload = {
"chain_id": "<string>",
"count": 1
}
headers = {
"BIZ-API-KEY": "<api-key>",
"Biz-Api-Nonce": "<api-key>",
"Biz-Api-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'BIZ-API-KEY': '<api-key>',
'Biz-Api-Nonce': '<api-key>',
'Biz-Api-Signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({chain_id: '<string>', count: 1})
};
fetch('https://apidev.nusd.me/v2/wallets/{wallet_id}/addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apidev.nusd.me/v2/wallets/{wallet_id}/addresses"
payload := strings.NewReader("{\n \"chain_id\": \"<string>\",\n \"count\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("BIZ-API-KEY", "<api-key>")
req.Header.Add("Biz-Api-Nonce", "<api-key>")
req.Header.Add("Biz-Api-Signature", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apidev.nusd.me/v2/wallets/{wallet_id}/addresses")
.header("BIZ-API-KEY", "<api-key>")
.header("Biz-Api-Nonce", "<api-key>")
.header("Biz-Api-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chain_id\": \"<string>\",\n \"count\": 1\n}")
.asString();{
"data": [
{
"address": "0x1000000000000000000000000000000000000000",
"chain_id": "ETH",
"memo": "82340924",
"path": "m/44/60/20/0",
"encoding": "ENCODING_P2PKH",
"pubkey": "tpubl4EqF1Ex3U4NpGi/0nWzA7Z7E5tPS7QW9Fwa8EsN9eJkpwAQCpJQ2-pro1Bidz1QnTSBounJ3AzFz0PB2A9sFy7YTeN2Qz4A9eYF7HLEH",
"x_only_pubkey": "9b451e62f24e0ce2ddd64e0a6b0f7900003b59a0f164af7235c21fc47a281945",
"root_pubkey": "xpub6cjm9MfAbaPq6sRLVP5GiJvQME90ysuuqE27f9S0wiqz2FSWQC1kTXjqwo-EXgL2v7W96QXjQWgN9hKRrr1UEKEndwzrHwcP2uMmrLzG7e",
"taproot_script_tree_hash": "0x138df60fc5b336455553c776c25924ea70bc74b1b27aa46e4b-d9f464d19f5f0",
"taproot_internal_address": "3JWy6ta57t9Y7y1UfVPgpmrL2wLz6yocC"
}
]
}{
"data": [
{
"address": "0x1000000000000000000000000000000000000000",
"chain_id": "ETH",
"memo": "82340924",
"path": "m/44/60/20/0",
"encoding": "ENCODING_P2PKH",
"pubkey": "tpubl4EqF1Ex3U4NpGi/0nWzA7Z7E5tPS7QW9Fwa8EsN9eJkpwAQCpJQ2-pro1Bidz1QnTSBounJ3AzFz0PB2A9sFy7YTeN2Qz4A9eYF7HLEH",
"x_only_pubkey": "9b451e62f24e0ce2ddd64e0a6b0f7900003b59a0f164af7235c21fc47a281945",
"root_pubkey": "xpub6cjm9MfAbaPq6sRLVP5GiJvQME90ysuuqE27f9S0wiqz2FSWQC1kTXjqwo-EXgL2v7W96QXjQWgN9hKRrr1UEKEndwzrHwcP2uMmrLzG7e",
"taproot_script_tree_hash": "0x138df60fc5b336455553c776c25924ea70bc74b1b27aa46e4b-d9f464d19f5f0",
"taproot_internal_address": "3JWy6ta57t9Y7y1UfVPgpmrL2wLz6yocC"
}
]
}Payin(收款)
创建钱包地址(废弃)
在指定钱包内一次生成一个或多个地址。支持生成 Taproot(含 Tweaked Taproot)等格式;MPC 钱包会返回派生路径、公钥等附加信息。
POST
/
v2
/
wallets
/
{wallet_id}
/
addresses
在钱包内生成地址
curl --request POST \
--url https://apidev.nusd.me/v2/wallets/{wallet_id}/addresses \
--header 'BIZ-API-KEY: <api-key>' \
--header 'Biz-Api-Nonce: <api-key>' \
--header 'Biz-Api-Signature: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"chain_id": "<string>",
"count": 1
}
'import requests
url = "https://apidev.nusd.me/v2/wallets/{wallet_id}/addresses"
payload = {
"chain_id": "<string>",
"count": 1
}
headers = {
"BIZ-API-KEY": "<api-key>",
"Biz-Api-Nonce": "<api-key>",
"Biz-Api-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'BIZ-API-KEY': '<api-key>',
'Biz-Api-Nonce': '<api-key>',
'Biz-Api-Signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({chain_id: '<string>', count: 1})
};
fetch('https://apidev.nusd.me/v2/wallets/{wallet_id}/addresses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apidev.nusd.me/v2/wallets/{wallet_id}/addresses"
payload := strings.NewReader("{\n \"chain_id\": \"<string>\",\n \"count\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("BIZ-API-KEY", "<api-key>")
req.Header.Add("Biz-Api-Nonce", "<api-key>")
req.Header.Add("Biz-Api-Signature", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apidev.nusd.me/v2/wallets/{wallet_id}/addresses")
.header("BIZ-API-KEY", "<api-key>")
.header("Biz-Api-Nonce", "<api-key>")
.header("Biz-Api-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chain_id\": \"<string>\",\n \"count\": 1\n}")
.asString();{
"data": [
{
"address": "0x1000000000000000000000000000000000000000",
"chain_id": "ETH",
"memo": "82340924",
"path": "m/44/60/20/0",
"encoding": "ENCODING_P2PKH",
"pubkey": "tpubl4EqF1Ex3U4NpGi/0nWzA7Z7E5tPS7QW9Fwa8EsN9eJkpwAQCpJQ2-pro1Bidz1QnTSBounJ3AzFz0PB2A9sFy7YTeN2Qz4A9eYF7HLEH",
"x_only_pubkey": "9b451e62f24e0ce2ddd64e0a6b0f7900003b59a0f164af7235c21fc47a281945",
"root_pubkey": "xpub6cjm9MfAbaPq6sRLVP5GiJvQME90ysuuqE27f9S0wiqz2FSWQC1kTXjqwo-EXgL2v7W96QXjQWgN9hKRrr1UEKEndwzrHwcP2uMmrLzG7e",
"taproot_script_tree_hash": "0x138df60fc5b336455553c776c25924ea70bc74b1b27aa46e4b-d9f464d19f5f0",
"taproot_internal_address": "3JWy6ta57t9Y7y1UfVPgpmrL2wLz6yocC"
}
]
}{
"data": [
{
"address": "0x1000000000000000000000000000000000000000",
"chain_id": "ETH",
"memo": "82340924",
"path": "m/44/60/20/0",
"encoding": "ENCODING_P2PKH",
"pubkey": "tpubl4EqF1Ex3U4NpGi/0nWzA7Z7E5tPS7QW9Fwa8EsN9eJkpwAQCpJQ2-pro1Bidz1QnTSBounJ3AzFz0PB2A9sFy7YTeN2Qz4A9eYF7HLEH",
"x_only_pubkey": "9b451e62f24e0ce2ddd64e0a6b0f7900003b59a0f164af7235c21fc47a281945",
"root_pubkey": "xpub6cjm9MfAbaPq6sRLVP5GiJvQME90ysuuqE27f9S0wiqz2FSWQC1kTXjqwo-EXgL2v7W96QXjQWgN9hKRrr1UEKEndwzrHwcP2uMmrLzG7e",
"taproot_script_tree_hash": "0x138df60fc5b336455553c776c25924ea70bc74b1b27aa46e4b-d9f464d19f5f0",
"taproot_internal_address": "3JWy6ta57t9Y7y1UfVPgpmrL2wLz6yocC"
}
]
}授权
API Key,请求需在请求头中携带。
时间戳,请求需在请求头中携带。
签名串,请求需在请求头中携带。
路径参数
钱包 ID。
请求体
application/json
链 ID,区块链的唯一标识。 可用选项
- ETH: EVM钱包
- TRON: TRON钱包
要生成的地址数量。允许范围:1 ≤ count ≤ 50。
必填范围:
1 <= x <= 50示例:
1
用于生成 Tweaked Taproot 地址的脚本树哈希列表。仅在生成 Tweaked Taproot 地址时必填。
原始(未调整)Taproot 地址。仅在生成 Tweaked Taproot 地址时必填。
示例:
"3JWy6ta57t9Y7y1UfVPgpmrL2wLz6yocC"
地址编码格式(仅适用于与比特币类似的链)。
可用选项:
ENCODING_P2PKH, ENCODING_P2SH_P2WPKH, ENCODING_BECH32, ENCODING_P2PKH_UNCOMPRESSED, ENCODING_P2SH_P2WSH_P2MS, ENCODING_P2SH_P2SH_P2MS, ENCODING_P2TR, ENCODING_ADA_BYRON, ENCODING_ADA_SHELLEY, ENCODING_DEFAULT 示例:
"ENCODING_P2PKH"
响应
请求成功,返回生成的地址列表及相关信息。
请求成功时返回的数据。
生成的地址对象列表。
Show child attributes
Show child attributes