DOGE Connecting

Docs / Wallet provider / PSBTs & the request() interface

window.dogesoft

PSBTs & the request() interface

Sign and push custom PSBTs for swaps and marketplaces, or speak the generic request() interface.

Live

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.

sign-psbt.js
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 stringEquivalent to
doge_requestAccountsconnect()
doge_accountsgetAccounts()
doge_getBalancegetBalance()
doge_signMessagesignMessage()
doge_signPsbtsignPsbt()
doge_pushPsbtpushPsbt()
doge_sendDogesendDoge()
doge_sendDrc20sendDrc20()
request.js
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.