0.6.11 • Published 3 years ago
webnative-filecoin v0.6.11
Webnative Filecoin
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
0.6.11
3 years ago
0.6.9
3 years ago
0.6.10
3 years ago
0.6.7
3 years ago
0.6.6
3 years ago
0.6.8
3 years ago
0.6.3
3 years ago
0.6.2
3 years ago
0.6.5
3 years ago
0.6.4
3 years ago
0.6.0
3 years ago
0.5.3
3 years ago
0.5.6
3 years ago
0.5.5
3 years ago
0.5.0
3 years ago
0.5.2
3 years ago
0.5.1
3 years ago
0.4.1
3 years ago
0.4.0
3 years ago
0.3.0
3 years ago
0.3.2
3 years ago
0.3.1
3 years ago
0.2.1
3 years ago
0.2.0
3 years ago
0.2.2
3 years ago
0.1.0
3 years ago