Züs
Search
K

Importing Libraries and js-sdk functions

1
import React, { useState } from "react";
2
import Head from "next/head";
3
4
import {
5
init,
6
setWallet,
7
Greeter,
8
listAllocations,
9
createAllocation,
10
getAllocation,
11
getBalance,
12
getBalanceWasm,
13
bulkUpload,
14
download,
15
getFaucetToken,
16
sendTransaction,
17
listObjects,
18
share,
19
showLogs,
20
hideLogs,
21
deleteObject,
22
renameObject,
23
copyObject,
24
moveObject,
25
reloadAllocation,
26
freezeAllocation,
27
cancelAllocation,
28
updateAllocation,
29
createDir,
30
getFileStats,
31
downloadBlocks,
32
getUSDRate,
33
isWalletID,
34
getPublicEncryptionKey,
35
getLookupHash,
36
createAllocationWithBlobbers,
37
getAllocationBlobbers,
38
getBlobberIds,
39
createReadPool,
40
createWallet,
41
recoverWallet,
42
getAllocationFromAuthTicket,
43
getReadPoolInfo,
44
lockWritePool,
45
getBlobbers,
46
decodeAuthTicket,
47
initBridge,
48
burnZCN,
49
mintZCN,
50
getMintWZCNPayload,
51
} from "@zerochain/zus-sdk";
52
53
import { startPlay, stopPlay } from "./player";
54
55
import styles from "../styles/Home.module.css";
Describing Code :
  • Line 1 import React useState is a Hook that lets you add React state to function components. A Hook is a special function that lets you “hook into” React features.
  • Line 2 import Head from "next/head" expose a built-in component for appending elements to the head of the page.
  • Line 4 to 51 import all the functionalities from js-sdk to use in the sample web site .Check SDK Reference here.
  • Line 53 import variables to capture the current playing audio or video.
  • Line 55 import link CSS (stylesheetfiles) file in the HTML <head