Package Exports
- 4everland-pinning
- 4everland-pinning/dist/foreverland.cjs.js
- 4everland-pinning/dist/foreverland.esm.js
- 4everland-pinning/dist/foreverland.umd.min.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (4everland-pinning) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
4everland-sdk
Install
npm i 4everland-sdk
yarn add 4everland-sdk
Esmodule
import { Client } from '4everland-sdk'
const client = new Client({
authServiceUrl: '',
pinningServiceUrl: '',
endpoint: '',
storageType: 'IPFS'
})
let address = '' // metamask address
const signMessage = await client.getSignText(address)
// Use signMessage for signing
// ....
// Verification signature
// if expiration expired, you need Verification signature again
const { expiration } = await client.verifySign(address, signature)
// upload
const task = client.upload({
Key: file.name,
Body: file,
ContentType: file.type
})
task.progress((e) => {
// loaded , total
})
const { cid } = await task.done()
const { requestid } = await client.addPin({
cid
})
// specified pin
await clinet.getPin(requestid)
// pin list
await clinet.listPin()CommonJs
const { Client } = require('4everland-sdk')Browser
<script src="../dist/4everland-sdk.umd.min.js"></script>
<script>
const { Client } = Clientland
</script>