Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
matrix-world-voucher-flow-js-sdk
Advanced tools
core apis [VoucherClient](./src/client/VoucherClient.ts)
Readme
core apis VoucherClient
You can also check Demo-front-page for reference
/** Setup global FCL instance
*
* @async
* @param {FLowEnv} env - FlowEnv.{localEmulator, flowTestnet, flowMainnet}
* @returns {Promise<void>}
*/
public async setupGlobalFcl(env: FLowEnv): Promise<void>;
/**
* Send transferFUSD transaction
*
* @async
* @param {string} to - addresses of recipient
* @param {string} amount - amount in string (1.0 means 1.0 FUSD)
* @returns {Promise<string>} transactionId which can be used to verify the payment to server
*/
public async transferFUSD(to: string, amount: string): Promise<string>;
/**
* Get FUSDBalance of an Account
*
* @async
* @param {string} address - account address
* @returns {Promise<number>} account balance (1.0 means 1.0 FUSD)
*/
public async FUSDBalance(address: string): Promise<number>;
// TODO
public async transferFLOW(to: string, amount: string): Promise<string>;
public async FLOWBalance(): Promise<number>;
sh -ci "$(curl -fsSL https://storage.googleapis.com/flow-cli/install.sh)"
Setup Flow CLI (Above)
Got to contracts directory, where a flow.json is located
cd ./packages/contracts/
Open a new terminal and start emulator
flow emulator start
Run bootstrap script
make bootstrap-local
Start dev-wallet docker (Account information here is default service account in Local Emulator)
docker run -it \
-e PORT=8701 \
-e FLOW_ACCESS_NODE=http://localhost:8080 \
-e FLOW_ACCOUNT_KEY_ID=0 \
-e FLOW_ACCOUNT_PRIVATE_KEY=2eae2f31cb5b756151fa11d82949c634b8f28796a711d7eb1e52cc301ed11111 \
-e FLOW_ACCOUNT_PUBLIC_KEY=31a053a2003d95760d8fff623aeedcc927022d8e0767972ab507608a5f611636e81857c6c46b048be6f66eddc13f5553627861153f6ce301caf5a056d68efc29 \
-e FLOW_INIT_ACCOUNTS=0 \
-e FLOW_ACCOUNT_ADDRESS=0xf8d6e0586b0a20c7 \
-e FLOW_AVATAR_URL=https://avatars.onflow.org/avatar/ \
--network host \
ghcr.io/onflow/fcl-dev-wallet:latest
Import FCL from SDK
import { fcl, FclVoucherClient, FLowEnv } from "matrix-world-voucher-flow-js-sdk/dist";
const client = new FclVoucherClient();
await client.setupGlobalFcl(FLowEnv.localEmulator);
await fcl.logIn();
await fcl.authenticate();
sample code for sending FUSD
import { fcl, FclVoucherClient } from "matrix-world-voucher-flow-js-sdk/dist";
// transferFUSD
const client = new FclVoucherClient();
const ret = await client.transferFUSD("0x01cf0e2f2f715450", "10.0");
console.log(ret);
sample code for getting FUSD balance
import { fcl, FclVoucherClient } from "matrix-world-voucher-flow-js-sdk/dist";
// transferFUSD
const client = new FclVoucherClient();
const ret = await client.FUSDBalance("0x01cf0e2f2f715450");
console.log(ret);
FAQs
core apis [VoucherClient](./src/client/VoucherClient.ts)
The npm package matrix-world-voucher-flow-js-sdk receives a total of 0 weekly downloads. As such, matrix-world-voucher-flow-js-sdk popularity was classified as not popular.
We found that matrix-world-voucher-flow-js-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.