PapayaBySigInteraction
Class for using writable methods of Papaya Contract
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 blockchainpapayaAddress(
`0x{string}`
)
- smart-contract addresstokenAddress(
`0x{string}`
)
- token addressprovider( JsonRpcProvider )
- jsonRpc blockchain provider from ethers.jssecretKey(
string
)
- wallet private key
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 fundsdeadline(
number
)
-isPermit2(
boolean
)
- a flag indicating the specificity of the token
permitAndDeposit
description
async permitAndDeposit(amount, deadline)
parameters
amount(
number
)
- amount of fundsdeadline(
number
)
-
bySigDepositFor
description
async bySigDepositFor(to, amount, deadline, isPermit2 = false)
parameters
to(
`0x{string}`
)
-amount(
number
)
- amount of fundsdeadline(
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 fundsdeadline(
number
)
-isPermit2(
boolean
)
- a flag indicating the specificity of the token
bySigWithdraw
description
async bySigWithdraw(amount, deadline)
parameters
amount (
number
)
- amount of fundsdeadline(
number
)
-
bySigWithdrawTo
description
async bySigWithdrawTo(to, amount, deadline)
parameters
to(
`0x{string}`
)
-amount(
number
)
- amount of fundsdeadline(
number
)
-
bySigPay
description
async bySigPay(to, amount, deadline)
parameters
to(
`0x{string}`
)
-amount(
number
)
- amount of fundsdeadline(
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
)
-
Last updated