diff --git a/wasm/wallet_schema.md b/wasm/wallet_schema.md new file mode 100644 index 00000000..cdfd1dec --- /dev/null +++ b/wasm/wallet_schema.md @@ -0,0 +1,156 @@ +``` +{ + "title": "Wallet", + "description": "Wallet object for a mercury layer client wallet", + "type": "object", + "properties": { + "name": { + "description": "user set wallet name", + "type": "string" + }, + "mnemonic": { + "description": "12 word bip39 wallet seed", + "type": "string" + }, + "version": { + "description": "Version number", + "type": "string" + }, + "state_entity_endpoint": { + "description": "Mercury server endpoint", + "type": "string" + }, + "electrum_endpoint": { + "description": "Elecrs/Esplora server http endpoint", + "type": "string" + }, + "blockheight": { + "description": "Current bitcoin blockheight", + "type": "number" + }, + "tokens": { + "type": "array", + "items": { + "description": "List of deposit tokens", + "type": "object", + "properties": + "token_id": { + "description": "Deposit token ID generated by server", + "type": "string" + }, + "value": { + "description": "Value of token", + "type": "number" + }, + "invoice": { + "description": "Bolt11 LN invoice for token payment", + "type": "string" + }, + "confirmed": { + "description": "Invoice payment confirmed", + "type": "boolean" + }, + } + }, + "activity": { + "type": "array", + "items": { + "description": "Activity log", + "type": "object", + "properties": { + "utxo": { + "description": "Coin UTXO outpoint TxID:vout", + "type": "string" + }, + "amount": { + "description": "Value of coin", + "type": "number" + }, + "action": { + "description": "Activity action", + "type": "string" + }, + "date": { + "description": "Epoch time of action", + "type": "number" + }, + } + } + }, + "coins": { + "type": "array", + "items": { + "description": "List of current coins", + "type": "object", + "properties": { + "utxo": { + "description": "Coin UTXO outpoint TxID:vout", + "type": "string" + }, + "address": { + "description": "Statecoin address", + "type": "string" + }, + "amount": { + "description": "Coin value", + "type": "number" + }, + "statechain_id": { + "description": "Statechain server ID", + "type": "string" + }, + "privkey": { + "description": "Coin private key share", + "type": "string" + }, + "auth_key": { + "description": "Auth private key", + "type": "string" + }, + "locktime": { + "description": "nLocktime of current backup tx", + "type": "number" + }, + "status": { + "description": "Coin status", + "type": "string" + }, + "backup_txs": { + "description": "List of previous backup transactions for the coin", + "type": "array", + "items: { + "type": "object", + "properties": { + "tx_n": { + "description": "tx number", + "type": "number" + }, + "tx": { + "description": "backup tx hex", + "type": "string" + }, + "client_public_nonce": { + "description": "client signature public nonce", + "type": "string" + }, + "blinding_factor": { + "description": "client blinding nonce", + "type": "string" + } + } + } + } + "tx_cpfp": { + "description": "CPFP transaction", + "type": "string" + }, + "tx_withdraw": { + "description": "Withdrawal transaction", + "type": "string" + }, + } + } + } + } +} +```