JSPM

  • Created
  • Published
  • Downloads 2880
  • Score
    100M100P100Q141119F
  • License Apache-2.0

Paper.xyz sdk for embedded wallets

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@paperxyz/embedded-wallet-service-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme



    Paper Embedded wallet Service SDK

    npm version Join our Discord!

    Paper is a developer-first NFT checkout solution that easily onboard users without wallets or cryptocurrencies.

    Documentation

    Installation

    Install this SDK:

    npm install @paperxyz/embedded-wallet-service-sdk
    yarn add @paperxyz/embedded-wallet-service-sdk
    pnpm add @paperxyz/embedded-wallet-service-sdk

    Then get started right away:

    import { PaperEmbeddedWalletSdk } from "@paperxyz/embedded-wallet-service-sdk";
    
    // initialize the SDK
    const Paper = new PaperEmbeddedWalletSdk({
      clientId: "YOUR_CLIENT_ID",
      chain: "Mumbai",
    });
    
    // log the user in
    await Paper.auth.loginWithOtp();
    
    // create or recover the user's wallet if needed
    const user = await Paper.initializeUser();
    
    // Execute a transaction without the user wallet needing gas money
    const { transactionHash } = await user.wallet.gasless.callContract({
      methodInterface: "function mintFreeNft(uint256 quantity) external",
      methodArgs: [1],
      contractAddress: "0x...",
    });