Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7855

Solana Pay SDK (problem with createQR function)

$
0
0
import { encodeURL, createQR, createQROptions } from "@solana/pay";import {  PublicKey } from "@solana/web3.js";import BigNumber from "bignumber.js";const recipient = new PublicKey("2V4TiQYA4EdN7xrsUFHc5phvU1ozKZVHEtxbKVA8WPFv");const amount = new BigNumber(1);const label = "Michael";const message = "Thanks for all the fish";const url = encodeURL({  recipient,  amount,  label,  message,});const options = createQROptions(url);const qrcode = createQR(url)

When i run the code i get this error :

webpack://QRCodeStyling/./src/core/QRSVG.ts:48    this._element = document.createElementNS("http://www.w3.org/2000/svg", "svg");                    ^ReferenceError: document is not defined    at new t (webpack://QRCodeStyling/./src/core/QRSVG.ts:48:21)    at t._setupSvg (webpack://QRCodeStyling/./src/core/QRCodeStyling.ts:37:19)    at t.update (webpack://QRCodeStyling/./src/core/QRCodeStyling.ts:109:12)    at new t (webpack://QRCodeStyling/./src/core/QRCodeStyling.ts:24:10)

I want to save the qrcode as a svg or png on my desktop using fs module can i ?


Viewing all articles
Browse latest Browse all 7855

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>