钱包

List all imported wallets

GET//localhost:9090/api/wallet
Response

OK

Body
addressstring

Address is the Filecoin full address of the wallet

idstring

ID is the short ID of the wallet

privateKeystring

PrivateKey is the private key of the wallet

Request
const response = await fetch('//localhost:9090/api/wallet', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
[
  {
    "address": "text",
    "id": "text",
    "privateKey": "text"
  }
]

Import a private key

POST//localhost:9090/api/wallet
Body

Request body

privateKeystring

This is the exported private key from lotus wallet export

Response

OK

Body
addressstring

Address is the Filecoin full address of the wallet

idstring

ID is the short ID of the wallet

privateKeystring

PrivateKey is the private key of the wallet

Request
const response = await fetch('//localhost:9090/api/wallet', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "address": "text",
  "id": "text",
  "privateKey": "text"
}

Remove a wallet

DELETE//localhost:9090/api/wallet/{address}
Path parameters
address*string

Address

Response

No Content

Request
const response = await fetch('//localhost:9090/api/wallet/{address}', {
    method: 'DELETE',
    headers: {},
});
const data = await response.json();
Response
{
  "err": "text"
}

Last updated