Papaya Finance Protocol
SDKProtocol
  • Introduction
  • Interaction
  • Getting Started
    • Initial Setup
    • Integration Steps
    • Go Live
  • Features
    • Real-Time Payment Streaming
    • Supported Networks
    • Business Dashboard
  • Use Cases
    • For Enterprises
    • For Financial Services
    • For Digital Economy
  • FAQ
  • Glossary
  • Future Development
  • Protocol
    • Common Methods
    • Recurring Payments
    • Subscription Methods
    • Auto Top-up
    • Liquidations
    • Fees
    • Advanced Section
      • Events
      • Subscriptions
      • Projects
      • Signatures
  • SDK
    • Installation
    • Quick Start
    • API
      • PapayaGetter
      • PapayaInteraction
      • PapayaBySigInteraction
Powered by GitBook
On this page
  • constructor
  • bySigDeposit
  • permitAndDeposit
  • bySigDepositFor
  • permitAndBySigDepositFor
  • bySigWithdraw
  • bySigWithdrawTo
  • bySigPay
  • bySigSubscribe
  • bySigUnsubscribe
  • bySigLiquidate
  • buildBySigTraits
  1. SDK
  2. API

PapayaBySigInteraction

Class for using writable methods of Papaya Contract

PreviousPapayaInteraction

Last updated 8 months ago


constructor

description

"rpcUrl" is an address of your rpc

constructor({chainId: number, papayaAddress: string, tokenAddress: string, provider?: JsonRpcProvider, secretKey?: string})

parameters

  • chainId(number) - id of selected blockchain

  • papayaAddress(`0x{string}`) - smart-contract address

  • tokenAddress(`0x{string}`) - token address

  • provider( JsonRpcProvider ) - jsonRpc blockchain provider from

  • secretKey(string) - wallet private key

secretKey and rpcUrl are mostly made for the NodeJS environment. It is not recommended to use them in browser.

usage

import { PapayaBySigInteraction } from "@papaya-metaverse/papaya-sdk"

const papayaBySigInteraction = new PapayaBySigInteraction({
    chainId: 1,
    papayaAddress: "0x1c3E45F2D9Dd65ceb6a644A646337015119952ff",
    tokenAddress: "0x1234567890123456789012345678901234567890",
    provider:  new JsonRpcProvider("https://polygon.infura.io/v3/${INFURA_API_KEY}"),
    //secretKey: "<WALLET_PRIVATE_KEY>" - only when there is no way to allow users to connect their wallets
})

bySigDeposit

description

async bySigDeposit(amount, deadline, isPermit2 = false)

parameters

  • amount(number) - amount of funds

  • deadline(number) -

  • isPermit2(boolean) - a flag indicating the specificity of the token


permitAndDeposit

description

async permitAndDeposit(amount, deadline)

parameters

  • amount(number) - amount of funds

  • deadline(number) -


bySigDepositFor

description

async bySigDepositFor(to, amount, deadline, isPermit2 = false)

parameters

  • to(`0x{string}`) -

  • amount(number) - amount of funds

  • deadline(number) -

  • isPermit2(boolean) - a flag indicating the specificity of the token


permitAndBySigDepositFor

description

async permitAndBySigDepositFor(to, amount, deadline, isPermit2 = false)

parameters

  • to(`0x{string}`) -

  • amount(number) - amount of funds

  • deadline(number) -

  • isPermit2(boolean) - a flag indicating the specificity of the token


bySigWithdraw

description

async bySigWithdraw(amount, deadline)

parameters

  • amount (number) - amount of funds

  • deadline(number) -


bySigWithdrawTo

description

async bySigWithdrawTo(to, amount, deadline)

parameters

  • to(`0x{string}`) -

  • amount(number) - amount of funds

  • deadline(number) -


bySigPay

description

async bySigPay(to, amount, deadline)

parameters

  • to(`0x{string}`) -

  • amount(number) - amount of funds

  • deadline(number) -


bySigSubscribe

description

async bySigSubscribe(author, subscriptionRate, projectId, deadline)

parameters

  • author(`0x{string}`) -

  • subscriptionRate(number) -

  • projectId(number) -

  • deadline(number) -


bySigUnsubscribe

description

async bySigUnsubscribe(author, deadline)

parameters

  • author(`0x{string}`) -

  • deadline(number) -


bySigLiquidate

description

async bySigLiquidate(account, deadline)

parameters

  • account(`0x{string}`) -

  • deadline(number) -


buildBySigTraits

description

async buildBySigTraits({ nonceType = 0n, deadline = 0n, relayer = constants.ZERO_ADDRESS.toString(), nonce = 0n, })

parameters

  • nonceType(`BigInt`) -

  • subscriptionRate(number) -

  • relayer(`0x{string}`) -

  • deadline(BigInt) -

ethers.js