跳到主内容

指南

连接到 Pando Rings 引擎的更简单快捷的方式。

安装#

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

使用情况#

  • 初始化终点
rings.Endpoint = "xxxxx" // e.g. rings.Endpoint = "https://compound-test-api.fox.one"
  • 导入
导入 "github.com/fox-one/pando-rings-sdk-go"
  • 请求所有市场
rings.RequestAllMarkets(ctx context.Context) ([]*Market, error)
  • 请求交易
rings.RequestTransactions(ctx context.Context, limit int, offset time.Time) ([]*Transaction, error)
  • 请求用户操作
//请求供应rings.RequestSupply(ctx context.Context, followID string, assetID string, amount decimal.Decimal) (string, string, error)
//请求质押rings.RequestPledge(ctx context.Context, followID string, ctokenAssetID string, amount decimal.Decimal) (string, string, error)
//请求取消质押rings.RequestUnpledge(ctx context.Context, followID string, ctokenAssetID string, ctokenAmount decimal.Decimal) (string, string, error)
//请求快速质押rings.RequestQuickPledge(ctx context.Context, followID string, assetID string, amount decimal.Decimal) (string, string, error)
//请求赎回rings.RequestRedeem(ctx context.Context, followID string, ctokenAssetID string, redeemAmount decimal.Decimal) (string, string, error)
//请求快速赎回rings.RequestQuickRedeem(ctx context.Context, followID string, ctokenAssetID string, redeemAmount decimal.Decimal) (string, string, error)
//请求借出rings.RequestBorrow(ctx context.Context, followID string, assetID string, borrowAmount decimal.Decimal) (string, string, error)
//请求快速借出rings.RequestQuickBorrow(ctx context.Context, followID string, supplyAssetID string, supplyAmount decimal.Decimal, borrowAssetID string, borrowAmount decimal.Decimal) (string, string, error)
//请求快速还款rings.RequestRepay(ctx context.Context, followID string, assetID string, amount decimal.Decimal) (string, string, error)
//请求清算操作rings.RequestLiquidate(ctx context.Context, followID string, supplyUserID string, supplyCTokenAssetID string, borrowAssetID string, repayAmount decimal.Decimal) (string, string, error)

更多SDK使用细节请阅读示例,或者参考Pando Rings 的实现

最后更新: 于 于