@moneyprotocol/lib-ethers
v5.4.3-stable-testnet
Published
Moneyp SDK Bitcoins-based implementation
Downloads
7
Maintainers
Readme
@moneyprotocol/lib-ethers
Bitcoins-based library for reading Moneyp protocol state and sending transactions.
Quickstart
Install in your project:
npm install --save @moneyprotocol/lib-base @moneyprotocol/lib-ethers ethers@^5.0.0
Connecting to an Ethereum node and sending a transaction:
const { Wallet, providers } = require("ethers");
const { BitcoinsMoneyp } = require("@moneyprotocol/lib-ethers");
async function example() {
const provider = new providers.JsonRpcProvider("http://localhost:8545");
const wallet = new Wallet(process.env.PRIVATE_KEY).connect(provider);
const moneyp = await BitcoinsMoneyp.connect(wallet);
const { newVault } = await moneyp.openVault({
depositCollateral: 5, // RBTC
borrowBPD: 2000
});
console.log(`Successfully opened a Moneyp Vault (${newVault})!`);
}
More examples
See packages/examples in the repo.
Moneyp's Dev UI itself contains many examples of @moneyprotocol/lib-ethers
use.
API Reference
For now, it can be found in the public Moneyp repo.