Options
All
  • Public
  • Public/Protected
  • All
Menu

PolygonOnEthereumSDK allows you to interact with Polygon Liquid Staking smart contracts on the Ethereum blockchain: MATIC, aMATICb, ankrMATIC, and polygonPool.

For more information on Polygon Liquid Staking from Ankr, refer to the development details.

Hierarchy

Implements

Index

Constructors

Properties

apiUrl?: string

apiUrl — URL of the advanced API.

readonly
contractConfig: IEthereumConfig

Contract addresses by current network mode.

currentAccount: string

currentAccount — connected account.

networkMode: ENetworkMode

Network mode.

readonly
readProvider: Web3KeyReadProvider

readProvider — provider which allows to read data without connecting the wallet.

readonly
writeProvider: Web3KeyWriteProvider

writeProvider — provider which has signer for signing transactions.

readonly

instance — SDK instance.

static

Accessors

  • get isMainnet(): boolean

Methods

  • addTokenToWallet(token: string): Promise<boolean>
  • approveACForAB(amount?: BigNumber, scale?: number): Promise<undefined | IWeb3SendResult>
  • approveMATICToken(amount?: BigNumber, scale?: number): Promise<IWeb3SendResult>
  • convertFromWei(amount: string): BigNumber
  • executeBatchCalls<T>(web3: default, calls: TWeb3Call<T>[]): Promise<T[]>
  • fetchTxReceipt(txHash: string): Promise<null | TransactionReceipt>
  • getABBalance(): Promise<BigNumber>
  • getACAllowance(): Promise<BigNumber>
  • getACBalance(): Promise<BigNumber>
  • getACRatio(): Promise<BigNumber>
  • getAMATICBTokenContract(): Contract
  • getANKRMATICTokenContract(): Contract
  • getBlocks(web3: default, blockNumbers: number[]): Promise<BlockTransactionObject[]>
  • getLatestBlock(): Promise<number>
  • getMaticBalance(): Promise<BigNumber>
  • getMaticTokenContract(): Contract
  • getMinimumStake(): Promise<BigNumber>
  • getPendingClaim(): Promise<BigNumber>
  • getPolygonPoolContract(): Contract
  • getPoolEventsBatch(from: number, to: number): Promise<IEventsBatch>
  • getStakeGasFee(amount: BigNumber, token: TMaticSyntToken, scale?: number): Promise<BigNumber>
  • getTxEventsHistoryGroup(rawEvents?: EventData[]): Promise<ITxHistoryItem[]>
  • getTxHistoryRange(lowestBlock: number, highestBlock: number, isUnstakeOnly?: boolean): Promise<ITxHistory>
  • Get transaction history for block range.

    note

    Amount of each event is in ETH. If you need ankrETH, multiply by ratio. Pending status is not specified.

    Parameters

    • lowestBlock: number

      from block number

    • highestBlock: number

      to block number

    • isUnstakeOnly: boolean = false

      if true, only unstake events will be returned

    Returns Promise<ITxHistory>

    • transaction history
  • getTxType(rawTxType?: string): null | string
  • getUnstakeTx(amount: BigNumber, token: string): { encodeABI: any; estimateGas: any }
  • getUnstakeTxFee(amount: BigNumber, token: string): Promise<BigNumber>
  • lockShares(args: IShareArgs): Promise<IWeb3SendResult>
  • stake(amount: BigNumber, token: string, scale?: number): Promise<IStakeData>
  • unlockShares(args: IShareArgs): Promise<IWeb3SendResult>
  • unstake(amount: BigNumber, token: string): Promise<IWeb3SendResult>

Generated using TypeDoc