Skip to content

Commit

Permalink
Merge pull request #24 from filswan/develop
Browse files Browse the repository at this point in the history
release v4.2.0
  • Loading branch information
rykci authored Feb 27, 2023
2 parents d5e1f4d + 8e5901f commit be64df0
Show file tree
Hide file tree
Showing 37 changed files with 2,327 additions and 4,886 deletions.
Binary file modified .DS_Store
Binary file not shown.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,18 @@ main()
- Create a bucket

```js
let bucketData = await mcs.createBucket(<BUCKET_NAME>)
let bucketData = await mcs.createBucket('<BUCKET_NAME>')
console.log(bucketData)
```

- Upload a file to the bucket

```js
let fileData = mcs.uploadToBucket(<FILE_PATH>, <BUCKET_UID>, prefix="")
let fileData = mcs.uploadToBucket(
'<BUCKET_NAME>',
'<OBJECT_NAME>',
'<FILE_PATH>',
)
console.log(fileData)
```

Expand All @@ -103,14 +107,14 @@ To use certain Onchain Storage features (upload, payment, minting), you will nee
- Upload File to Onchain storage

```js
let uploadResponse = await mcs.upload([{ fileName: <FILE_NAME>, file: fs.createReadStream(<FILE_PATH>) }])
let uploadResponse = await mcs.upload('<FILE_PATH>')
console.log(uploadResponse)
```

- Pay for file storage
after uploading, the response should return the `source_file_upload_id` and the file size.
```js
let tx = await mcs.makePayment(<SOURCE_FILE_UPLOAD_ID>, <FILE_SIZE>)
let tx = await mcs.makePayment('SOURCE_FILE_UPLOAD_ID>', '<FILE_SIZE>')
console.log(transaction hash: ' + tx.transactionHash)
```
Expand Down
Loading

0 comments on commit be64df0

Please sign in to comment.