upload_public_file_from_vaccount
Upload from LiquidAccount and pin
1
import { getClient } from "./client";
2
const ecc = require("eosjs-ecc");
3
​
4
(async () => {
5
const service = await (await getClient()).service('storage', "5jqee4kl1ns1");
6
const data = Buffer.from("a great LiquidAccount success", "utf8");
7
const vAccount1 = `vaccount1`;
8
const privateKeyWif = "5HzXLtjFr34BCBYzjYeMgKGyvZJ41VqhcCAwUb5mKhtdDmQwnEB";
9
const options = {
10
// if true, DAG leaves will contain raw file data and not be wrapped in a protobuf
11
rawLeaves: true
12
};
13
const response = await service.upload_public_file_from_vaccount(
14
data,
15
{
16
name: vAccount1,
17
key: privateKeyWif
18
},
19
options
20
);
21
console.log(`uri: ${response.uri}`);
22
})().catch((e) => { console.log(e); });
Copied!
Last modified 7mo ago
Copy link