0.0.19 • Published 2 years ago
js-databox v0.0.19
databox_js_sdk
databox & metabox
Get Start
Install
npm install crypto-js
npm install string-random
npm install js-databox
Example
const plug_agent = await window.ic.plug.agent
const agent = plug_agent
const metaboxApi = new MetaBox(agent)
const res = await metaboxApi.createDataBox({
is_private: true,
box_name: "isp_test",
box_type: {'data_box': null}
})
const boxes = await metaboxApi.getBoxes(await agent.getPrincipal())
console.log(boxes)
const dataBoxCai = boxes[2].canister_id.toString()
const dataBoxApi = new DataBox(dataBoxCai, agent)
console.log(await dataBoxApi.get_all_files_info())
console.log(await dataBoxApi.canisterState())
const keyArr = await dataBoxApi.put_plain_files(acceptedFiles, true)
const blob = await dataBoxApi.get_plain_file(keyArr[0])
console.log(blob)
console.log(await dataBoxApi.delete_ic_plain_file(keyArr[0]))
console.log(await dataBoxApi.clear_box())
0.0.19
2 years ago
0.0.15
2 years ago
0.0.16
2 years ago
0.0.17
2 years ago
0.0.18
2 years ago
0.0.14
2 years ago
0.0.13
2 years ago
0.0.12
2 years ago
0.0.11
3 years ago
0.0.10
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago