webnative-filecoin
TypeScript icon, indicating that this package has built-in type declarations

0.6.11 • Public • Published

Webnative Filecoin

NPM Build Status License Maintainability Built by FISSION Discord Discourse

Send secure Filecoin transactions from the browser.

Use Fission's webnative SDK to store keys and securely send transactions by aggregating signatures between the in-browser key and a cosigning server that depends on UCANs (user-controlled, distributed auth tokens).

Get started

import { getWallet, getWalletFromKey, DEFAULT_KEY_PERMISSION } from 'webnative-filecoin'
import * as wn from 'webnative'

// Initialize webnative
const state = await wn.initialise({
  permissions: {
    app: {
      name: 'AppName',
      creator: 'Creator'
    },
    fs: {
      // make sure to request permission for the keychain path
      privatePaths:[DEFAULT_KEY_PERMISSION] // Defaults to `private/Keychain/fil-cosigner`
      publicPaths:[]
    }
  }
})
// Do necessary state checks / redirects

// Pass the filesystem to webnative-filecoin as well as your implementation of wn
const wallet = await getWallet(state.fs, wn) // if using a keyName other than the default, pass that as a third param
// Fund the Fission storage provider
const receipt = await wallet.fundProvider(1)
// Send FIL to an arbitrary address
const receipt2 = await wallet.send('t1hx...', 1)
// Wait for tx to be confirmed on Filecoin network
const verifiedReceipt = await wallet.waitForReceipt(receipt.messageId)

Development

# install dependencies
yarn

# build
yarn build

# build w/ reloading
yarn dev

# test
yarn test

# test w/ reloading
yarn test:watch

Readme

Keywords

none

Package Sidebar

Install

npm i webnative-filecoin

Weekly Downloads

27

Version

0.6.11

License

Apache-2.0

Unpacked Size

36.4 MB

Total Files

48

Last publish

Collaborators

  • andrewvivash
  • appcypher
  • icidasset
  • quinnwilton
  • bgins-fission
  • expede
  • walkah
  • philipp-fission
  • dholms