1.0.28 • Published 2 years ago

portal-sol-pay-package v1.0.28

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Portal-Sol-Pay-Package

This project is a npm package that provides React Components and Contexts for Solana Chain QR Payment services, that is built on top of Portal wallet and other service partners.

NPM:

npm i portal-sol-pay-package
yarn add portal-sol-pay-package

We provide a QR scanner for you to integrate into your wallet, that helps your wallet do payment and transfer:

  • via solana pay
  • to real life merchant
  • to solana Address

Tech

Supports Next.js

Get Starter

Include a next.config.mjs in your root

/** @type {import('next').NextConfig} */
const nextConfig = {
  env: {
    portalClientApiKey: process.env.PORTAL_CLIENT_API_KEY,
    solanaChainId: 'solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1',
    solMint: 'So11111111111111111111111111111111111111112',
    pyUsdMint: 'CXk2AMBfi3TwaEL2468s6zP8xq9NxTXjp9gjMgzeUynM',
    solanaRpcUrl: 'https://api.devnet.solana.com',
    pyUsdMainnet: '2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo',
  },
};

export default nextConfig;

create a 'PORTAL_CLIENT_API_KEY' in .env

Wrap PortalProvider and PayProvider around your project root. This will allow you to use the functions provided by portal-sol-pay-package.

import { PortalProvider, PayProvider } from 'portal-sol-pay-package';

    <PortalProvider>
      <PayProvider>
        {children}
      </PayProvider>
    </PortalProvider>

Last, on your page, import the Scanner UI that we provide, you are all set to see payment functions in your wallet

import { usePay, PayUI } from 'portal-sol-pay-package';
import React from 'react';

const Scan = () => {
  const payCrypto = usePay();

  return (
    <div>
      <PayUI payCrypto={payCrypto} />
    </div>
  );
};

export default Scan;
1.0.28

2 years ago

1.0.27

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago