Skip to main content

Guide

An easier and faster way to Connect to Pando Rings engine.

Installing#

go get github.com/fox-one/pando-rings-sdk-go

Usage#

  • Initialize the endpoint
rings.Endpoint = "xxxxx" // e.g. rings.Endpoint = "https://compound-test-api.fox.one"
  • Import
import "github.com/fox-one/pando-rings-sdk-go"
  • Request all markets
rings.RequestAllMarkets(ctx context.Context) ([]*Market, error)
  • Request transactions
rings.RequestTransactions(ctx context.Context, limit int, offset time.Time) ([]*Transaction, error)
  • Request user action
//request supply action urlrings.RequestSupply(ctx context.Context, followID string, assetID string, amount decimal.Decimal) (string, string, error)
//request pledge action urlrings.RequestPledge(ctx context.Context, followID string, ctokenAssetID string, amount decimal.Decimal) (string, string, error)
// request unpledge action urlrings.RequestUnpledge(ctx context.Context, followID string, ctokenAssetID string, ctokenAmount decimal.Decimal) (string, string, error)
// request quick pledge action urlrings.RequestQuickPledge(ctx context.Context, followID string, assetID string, amount decimal.Decimal) (string, string, error)
// request redeem action urlrings.RequestRedeem(ctx context.Context, followID string, ctokenAssetID string, redeemAmount decimal.Decimal) (string, string, error)
// request quick redeem action urlrings.RequestQuickRedeem(ctx context.Context, followID string, ctokenAssetID string, redeemAmount decimal.Decimal) (string, string, error)
// request borrow action urlrings.RequestBorrow(ctx context.Context, followID string, assetID string, borrowAmount decimal.Decimal) (string, string, error)
// request quick borrow action urlrings.RequestQuickBorrow(ctx context.Context, followID string, supplyAssetID string, supplyAmount decimal.Decimal, borrowAssetID string, borrowAmount decimal.Decimal) (string, string, error)
// request repay action urlrings.RequestRepay(ctx context.Context, followID string, assetID string, amount decimal.Decimal) (string, string, error)
// request liquidate action urlrings.RequestLiquidate(ctx context.Context, followID string, supplyUserID string, supplyCTokenAssetID string, borrowAssetID string, repayAmount decimal.Decimal) (string, string, error)

More details of sdk using, please read the example, Or refer to the official full-featured version of Pando rings for implementation

Last updated on