wavecli exitExit
Exit queues a cooperative leave for the specified VTXO outpoint by default. When the caller supplies force_unroll_ack exactly, the daemon starts a unilateral unroll instead after checking that the outpoint is present in the local backing wallet's UTXO set.
Endpoints
rpc Exit(ExitRequest) returns (ExitResponse)POST/v1/wallet/exitExamples
wavecli exit --outpoint 4b2e9f1a7c3d5e6f8091a2b3c4d5e6f70819a2b3c4d5e6f708192a3b4c5d6e7f:0wavecli exit --outpoint 4b2e9f1a7c3d5e6f8091a2b3c4d5e6f70819a2b3c4d5e6f708192a3b4c5d6e7f:0conn, 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.ExitRequest{
Outpoint: "4b2e9f1a7c3d5e6f8091a2b3c4d5e6f70819a2b3c4d5e6f708192a3b4c5d6e7f:0",
OnchainAddress: "bcrt1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
}
resp, err := client.Exit(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.ExitRequest(
outpoint="4b2e9f1a7c3d5e6f8091a2b3c4d5e6f70819a2b3c4d5e6f708192a3b4c5d6e7f:0",
onchain_address="bcrt1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
)
response = stub.Exit(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 = {
"outpoint": "4b2e9f1a7c3d5e6f8091a2b3c4d5e6f70819a2b3c4d5e6f708192a3b4c5d6e7f:0",
"onchain_address": "bcrt1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
};
// Calls wavewalletrpc.WalletService.Exit.
client.exit(request, (err, response) => {
if (err) throw err;
console.log(response);
});curl -X POST http://localhost:10031/v1/wallet/exit \
-H 'Content-Type: application/json' \
-d '{"outpoint":"4b2e9f1a7c3d5e6f8091a2b3c4d5e6f70819a2b3c4d5e6f708192a3b4c5d6e7f:0","onchain_address":"bcrt1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"}'const res = await fetch('http://localhost:10031/v1/wallet/exit', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"outpoint": "4b2e9f1a7c3d5e6f8091a2b3c4d5e6f70819a2b3c4d5e6f708192a3b4c5d6e7f:0",
"onchain_address": "bcrt1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
}),
});
const exitResponse = await res.json();RequestExitRequest
ExitRequest identifies the VTXO to exit and selects the exit path for WalletService.Exit: cooperative leave by default, or unilateral unroll when force_unroll_ack is supplied.
| Field | Type | Description |
|---|---|---|
outpoint | string | outpoint is the VTXO outpoint to exit, formatted as "txid:index". |
onchain_address | string | onchain_address is the cooperative leave destination. Empty asks the daemon to generate a fresh backing-wallet address internally. |
force_unroll_ack | string | force_unroll_ack must be exactly "I_KNOW_WHAT_I_AM_DOING" to bypass cooperative leave and start unilateral unroll. It cannot be combined with onchain_address, and the server requires at least one confirmed local backing-wallet UTXO before admitting forced unroll. |
ResponseExitResponse
ExitResponse reports the exit path the daemon took and its per-path detail for WalletService.Exit.
| Field | Type | Description |
|---|---|---|
created | bool | created indicates whether a new unilateral exit job was spawned. False if an existing job already covers this target. Cooperative exits leave this unset. |
actor_id | string | actor_id is the identifier of the durable unilateral exit job actor. |
mode | ExitMode | mode identifies the branch the daemon took. |
queued_outpoints | repeated string | queued_outpoints lists the outpoints accepted into cooperative leave. |
onchain_address | string | onchain_address is the cooperative leave destination used by the daemon. It may be caller-supplied or daemon-generated. |
ExitModeenum
ExitMode identifies whether Exit queued a cooperative leave or started a forced unilateral unroll.
| Name | Number | Description |
|---|---|---|
EXIT_MODE_UNSPECIFIED | 0 | EXIT_MODE_UNSPECIFIED is the proto zero value used when the exit path was not reported. |
EXIT_MODE_COOPERATIVE | 1 | EXIT_MODE_COOPERATIVE means Exit queued a cooperative leave (VTXO-to-onchain). |
EXIT_MODE_UNILATERAL | 2 | EXIT_MODE_UNILATERAL means Exit started a forced unilateral unroll. |