To develop for Marina, install Marina on your development machine. Download here.
Once Marina is installed and running, you should find that new browser tabs have a window.marina object available in the developer console. This is how your website will interact with Marina.
You can review the full API for that object here.
To make things easier, we have created a package that provides utilities and common types related to Marina.
or using yarn
To verify if the browser is running Marina, you can use the marina-provider package that provides a function
detectProvider to inspect and fetch the
You can review the full API for the
window.marina object here.
## Connect to outside world
Marina connects to Blockstream's ElectrumX server via WebSocket by default. You can customize the WS endpoint in the settings/explorer tab of the extension.
Don't be too reckless. You should develop your applications against a local testnet. Marina defaults to
ws://localhost:1234 wich is the websocket endpoint of the Electrs-compatible server exposed by Nigiri box. You can download and run an Electrs instance from here, but we strongly suggest Nigiri which setup a complete RegTest environment in one click. Moreover the Electrs-compatible server exposed adds nice features for developers suchs as
/faucet endpoints with automatic block generation and a Liquid asset registry similar to what Blockstream maintains.
On http://localhost:5001 you can see Esplora frontend
Browser libraries will help you develop faster your apps that handle Liquid transactions and doing operations such as creating, funding and build unsigned transactions or decode transaction built from other parties.
We suggest using liquidjs-lib.