window.dogesoft
PSBTs & the request() interface
Sign and push custom PSBTs for swaps and marketplaces, or speak the generic request() interface.
Signing a PSBT
For anything the friendly methods don't cover — swaps, marketplace listings, multi-input transactions — build a PSBT (Partially Signed Bitcoin Transaction) yourself and hand it to the wallet for signing. The user sees exactly what they're signing; you never see their key.
const { psbtHex } = await dogesoft.signPsbt(unsignedPsbtHex, {
autoFinalize: true
});
const { txid } = await dogesoft.pushPsbt(psbtHex);
signPsbt() signs the inputs the connected account controls and returns
the (optionally finalized) PSBT hex. pushPsbt() finalizes if needed and
broadcasts. Keep them separate when you need to collect more than one party's signature before
broadcasting — for example, a peer-to-peer swap.
The request() interface
Every method above also has an equivalent under a single generic dispatcher, shaped like the EIP-1193 pattern many wallet adapters already expect. Use it if you'd rather have one call site than eight methods on the object.
| Method string | Equivalent to |
|---|---|
doge_requestAccounts | connect() |
doge_accounts | getAccounts() |
doge_getBalance | getBalance() |
doge_signMessage | signMessage() |
doge_signPsbt | signPsbt() |
doge_pushPsbt | pushPsbt() |
doge_sendDoge | sendDoge() |
doge_sendDrc20 | sendDrc20() |
const accounts = await window.dogesoft.request({
method: "doge_requestAccounts"
});
const signature = await window.dogesoft.request({
method: "doge_signMessage",
params: { message: "Sign in", address: accounts[0] }
});
A method string outside this table rejects with
Error('DogeSoft: unknown method "<method>"') — see
Errors.