WalletServiceCLI
wavecli unlockUnlock
Unlock decrypts the on-disk wallet seed using the supplied password and starts the wallet subsystem. Proxies waverpc.UnlockWallet.
Endpoints
gRPC
rpc Unlock(UnlockRequest) returns (UnlockResponse)REST
POST/v1/wallet/unlockExamples
wavecli unlockwavecli unlockconn, err := grpc.NewClient("localhost:10029",
grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
log.Fatal(err)
}
defer conn.Close()
client := wavewalletrpc.NewWalletServiceClient(conn)
ctx := context.Background()
req := &wavewalletrpc.UnlockRequest{
WalletPassword: "c3RyYXdiZXJyeS1tb29zZQ==",
}
resp, err := client.Unlock(ctx, req)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp)import grpc
import wallet_pb2
import wallet_pb2_grpc
channel = grpc.insecure_channel('localhost:10029')
stub = wallet_pb2_grpc.WalletServiceStub(channel)
request = wallet_pb2.UnlockRequest(
wallet_password="c3RyYXdiZXJyeS1tb29zZQ==",
)
response = stub.Unlock(request)
print(response)const grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');
const packageDefinition = protoLoader.loadSync('wallet.proto');
const { wavewalletrpc } = grpc.loadPackageDefinition(packageDefinition);
const client = new wavewalletrpc.WalletService(
'localhost:10029',
grpc.credentials.createInsecure(),
);
const request = {
"wallet_password": "c3RyYXdiZXJyeS1tb29zZQ=="
};
// Calls wavewalletrpc.WalletService.Unlock.
client.unlock(request, (err, response) => {
if (err) throw err;
console.log(response);
});curl -X POST http://localhost:10031/v1/wallet/unlock \
-H 'Content-Type: application/json' \
-d '{"wallet_password":"c3RyYXdiZXJyeS1tb29zZQ=="}'const res = await fetch('http://localhost:10031/v1/wallet/unlock', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"wallet_password": "c3RyYXdiZXJyeS1tb29zZQ=="
}),
});
const unlockResponse = await res.json();RequestUnlockRequest
UnlockRequest carries the password used to decrypt the on-disk seed for WalletService.Unlock.
| Field | Type | Description |
|---|---|---|
wallet_password | bytes | wallet_password is the password used to decrypt the on-disk seed. |
ResponseUnlockResponse
UnlockResponse returns the identity of the wallet unlocked by WalletService.Unlock.
| Field | Type | Description |
|---|---|---|
identity_pubkey | string | identity_pubkey is the hex-encoded daemon wallet identity public key of the unlocked wallet. |