Everything a dApp can call on window.loroco (and the opt-in window.chia mirror).
Each method is in exactly one approval class. Reads return immediately; writes pop a per-call approval dialog.
read — no approval, requires a prior connection write — pops an approval popup every call stub — returns empty/graceful until full impl lands
The router canonicalises before gating, so the same method answers to every namespace dApps use in the wild:
chia_connect, chia_send, chia_getNFTschip0002_signMessageget_address, sign_message_by_addresssignCoinSpends, createOfferMETHOD_ALIASES map to a canonical that must be present in
NO_APPROVAL_METHODS or ALWAYS_APPROVAL_METHODS. Adding a new canonical without
registering its approval class makes it silently mutating-without-approval.
| Method | Class | Params | Result |
|---|---|---|---|
connect | write | { eager?: boolean } | boolean — the only entry point; grants read access |
chainId | read | — | ChainId (mainnet / testnet) |
requestAccounts | write | — | string[] — connect + accounts in one round-trip (prompts if not connected) |
accounts | read | — | string[] — addresses without prompting; throws 4900 if unconnected |
getAddress | read | — | { address } |
walletSwitchChain | write | { chainId } | null |
walletWatchAsset | write | { options: { assetId, symbol, logo? } } | boolean — popup shows the assetId verbatim |
Served straight from the JS coin-store (chrome.storage.local["coins.<fp>"]) so any dApp hitting the namespaces above gets WC-compatible reads without a new WASM build.
| Method | Class | Params | Result |
|---|---|---|---|
getPublicKeys | read | { limit?, offset?, hardened? } | Hex[] |
getAssetCoins | read | { type, assetId, … } | SpendableCoin[] |
getAssetBalance | read | { type, assetId } | AssetBalance |
filterUnlockedCoins | read | { coinNames: Hex[] } | Hex[] |
getCoins | read | { limit?, offset?, … } | CoinView[] |
getCoinsByIds | read | { coinIds: Hex[] } | CoinView[] |
isAssetOwned | read | { type: "cat"|"did"|"nft", assetId } | boolean |
getDerivations | read | { limit?, offset? } | Derivation[] |
getTransactions | read | { limit?, offset?, pendingOnly? } | TransactionView[] |
getPendingTransactions | read | — | TransactionView[] |
| Method | Class | Params | Result |
|---|---|---|---|
getCats | read | { limit?, offset? } | CatAssetView[] — enriched with Dexie name/symbol/icon |
getAllCats | read | { limit?, offset? } | CatAssetView[] |
getToken | read | { assetId } | CatAssetView | null |
getNFTs | read | { … } | NftInfo[] | { nfts } |
getNFTInfo | read | { coinId?, launcherId? } | NftInfo | null |
getNftCollections | stub | { limit?, offset? } | NftCollectionInfo[] |
getNftCollection | stub | { collectionId } | NftCollectionInfo | null |
getMinterDidIds | stub | { limit?, offset? } | Hex[] |
getDids | read | { limit?, offset? } | DidInfo[] — from the local dids.<fp> store |
getOffers | read | { limit?, offset?, includeCancelled? } | OfferView[] |
getOffer | read | { id } | OfferView | null |
Every method here pops an approval dialog whose body must show the actual recipient, amount, fee and asset id — never a bare count.
| Method | Class | Params | Result |
|---|---|---|---|
signMessage | write | { message: Hex, publicKey: Hex } | Hex |
signMessageByAddress | write | { message, address } | { publicKey, signature } |
signCoinSpends | write | { coinSpends, partialSign? } | Hex — BLS aggregated sig; popup decodes the bundle |
transfer (chia_send) | write | { to/address, amount, assetId?, fee? } | { id } | {} |
sendTransaction | write | { spendBundle } | TransactionResp[] |
bulkSendXch | write | { outputs[], fee? } | { id } | {} |
bulkSendCat | write | { assetId, outputs[], fee? } | { id } | {} |
multiSend | write | { outputs[], fee? } | { id } | {} |
combine | write | { maxInputs?, fee? } | { id } | {} |
split | write | { parts, fee? } | { id } | {} |
| Method | Class | Params | Result |
|---|---|---|---|
createOffer | write | { offerAssets, requestAssets, fee? } | { id, offer } — persists input coins + origin |
takeOffer | write | { offer, fee? } | { id } — popup shows engine-verified royalty amount + on-chain puzzle hash |
cancelOffer | write | { id, fee?, secure? } | { id, cancelled } | {} — filtered by origin stamp |
issueCat | write | { amount, fee?, … } | { id, assetId } |
addNftUri | write | { launcherId, uri, kind, fee? } | { id, launcherId } |
bulkMintNfts | write | { didCoinId, didDerivationIndex, mints[], … } | { nftIds[] } |
createDid | write | { fee?, … } | { id, didId, didCoinId, didDerivationIndex } |
transferDid | write | { launcherId, address, fee? } | { id, launcherId } |
normalizeDids | write | { … } | { id } |
derivation_kind. Coins imported from Sage on the hardened
path would otherwise fail to sign against a handler hardcoded to unhardened.
Thrown as a ChiaProviderError with { code, message, data }.
| Code | Name | Meaning |
|---|---|---|
4000 | InvalidParams | Params failed validation. |
4001 | Unauthorized | Origin not connected — thrown before any work, and before any approval popup. |
4002 | UserRejected | The user declined the approval dialog. |
4003 | SpendableBalanceExceeded | Not enough spendable balance for the requested spend. |
4004 | MethodNotFound | Unknown or not-yet-implemented method. |
4005 | NoSecretKey | Wallet doesn't own a secret key the request needs. |
4029 | LimitExceeded | Payload exceeded the 4 MiB cap (DoS guard) or a rate limit. |