1.0.4 • Published 28 days ago

ethers-suave v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
28 days ago

ethers-suave

A typescript library, built on top of ethers.js, for interacting with Suave confidential requests.

Usage

Send confidential request

const provider = new SuaveProvider(kettleUrl)
const wallet = new SuaveWallet(pk, provider)

const StoreContract = new SuaveContract(confidentialContractAdd, storeABI, wallet)
const milkLiters = 2
const milkType = 'whole'
// Non-confidential methods are called as usual
const milkPrice = await StoreContract.milkSpotPrice(milkType)
const confidentialInputs = createPaymentBundle(milkPrice, milkLiters)
// Response is ConfidentialTransactionResponse 
const res = await StoreContract.buyMilk.sendConfidentialRequest(milkType, milkLiters, { confidentialInputs })
// Receipt is a normal EVM transaction receipt
const receipt = await res.wait()

Create a confidential request

const ccr = await StoreContract.buyMilk.prepareConfidentialRequest(milkType, milkLiters, { confidentialInputs }) 

Get a confidential request

const tx = await provider.getConfidentialTransaction('0xafac2...')

Dev Setup

Install dependencies

yarn install --dev

Test

yarn test

Contributions

Any contributions are welcome! Please submit a PR or an issue.

1.0.4

28 days ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago