sdk

package
v0.0.0-...-6db1f7a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArSeedCli

type ArSeedCli struct {
	ACli *goar.Client
	SCli *gentleman.Client
}

func New

func New(arSeedUrl string) *ArSeedCli

func (*ArSeedCli) BroadcastTxData

func (a *ArSeedCli) BroadcastTxData(arId string) error

func (*ArSeedCli) BroadcastTxMeta

func (a *ArSeedCli) BroadcastTxMeta(arId string) error

func (*ArSeedCli) BundleFee

func (a *ArSeedCli) BundleFee(size int64, currency string) (schema.RespFee,
	error)

func (*ArSeedCli) GetApiKey

func (a *ArSeedCli) GetApiKey(addr string) (schema.RespApiKey, error)

func (*ArSeedCli) GetBroadcastMetaTask

func (a *ArSeedCli) GetBroadcastMetaTask(arId string) (schema.Task, error)

func (*ArSeedCli) GetBroadcastTask

func (a *ArSeedCli) GetBroadcastTask(arId string) (schema.Task, error)

func (*ArSeedCli) GetBundler

func (a *ArSeedCli) GetBundler() (string, error)

func (*ArSeedCli) GetItemData

func (a *ArSeedCli) GetItemData(itemId string) ([]byte, error)

func (*ArSeedCli) GetItemIds

func (a *ArSeedCli) GetItemIds(arId string) ([]string, error)

func (*ArSeedCli) GetItemMeta

func (a *ArSeedCli) GetItemMeta(itemId string) (types.BundleItem, error)

func (*ArSeedCli) GetOrders

func (a *ArSeedCli) GetOrders(addr string, startId int) ([]schema.Order,
	error)

func (*ArSeedCli) GetSyncTask

func (a *ArSeedCli) GetSyncTask(arId string) (schema.Task, error)

func (*ArSeedCli) KillBroadcastMetaTask

func (a *ArSeedCli) KillBroadcastMetaTask(arId string) error

func (*ArSeedCli) KillBroadcastTask

func (a *ArSeedCli) KillBroadcastTask(arId string) error

func (*ArSeedCli) KillSyncTask

func (a *ArSeedCli) KillSyncTask(arId string) error

func (*ArSeedCli) SubmitItem

func (a *ArSeedCli) SubmitItem(itemBinary []byte, currency string,
	apikey string, needSequence bool) (*schema.RespOrder, error)

func (*ArSeedCli) SubmitItemStream

func (a *ArSeedCli) SubmitItemStream(itemBinary io.Reader, currency string,
	apikey string, needSequence bool) (*schema.RespOrder, error)

func (*ArSeedCli) SubmitNativeData

func (a *ArSeedCli) SubmitNativeData(apiKey string, currency string,
	data []byte, contentType string,
	tags map[string]string) (*schema.RespItemId, error)

func (*ArSeedCli) SubmitNativeDataStream

func (a *ArSeedCli) SubmitNativeDataStream(apiKey string, currency string,
	data io.Reader, contentType string,
	tags map[string]string) (*schema.RespItemId, error)

func (*ArSeedCli) SubmitTx

func (a *ArSeedCli) SubmitTx(arTx types.Transaction) error

func (*ArSeedCli) SubmitTxConcurrent

func (a *ArSeedCli) SubmitTxConcurrent(ctx context.Context, concurrentNum int,
	arTx types.Transaction) error

func (*ArSeedCli) SyncTx

func (a *ArSeedCli) SyncTx(arId string) error

type SDK

type SDK struct {
	ItemSigner *goar.ItemSigner
	Cli        *ArSeedCli
	Pay        *paySdk.SDK
}

func NewSDK

func NewSDK(arseedUrl, payUrl string, signer interface{}) (*SDK, error)

func (*SDK) BatchPayOrders

func (s *SDK) BatchPayOrders(orders []*arseedSchema.RespOrder) (everTxs []*paySchema.Transaction,
	err error)

func (*SDK) PayApikey

func (s *SDK) PayApikey(tokenTag string, amount *big.Int) (everHash string,
	err error)

func (*SDK) PayOrders

func (s *SDK) PayOrders(orders []*arseedSchema.RespOrder) (everTx *paySchema.Transaction,
	err error)

func (*SDK) SendData

func (s *SDK) SendData(data []byte, currency string, apikey string,
	option *schema.OptionItem,
	needSequence bool) (order *arseedSchema.RespOrder, err error)

func (*SDK) SendDataAndPay

func (s *SDK) SendDataAndPay(data []byte, currency string,
	option *schema.OptionItem,
	needSequence bool) (everTx *paySchema.Transaction, itemId string,
	err error)

func (*SDK) SendDataStream

func (s *SDK) SendDataStream(data *os.File, currency string, apikey string,
	option *schema.OptionItem,
	needSequence bool) (order *arseedSchema.RespOrder, err error)

func (*SDK) SendDataStreamAndPay

func (s *SDK) SendDataStreamAndPay(data *os.File, currency string,
	option *schema.OptionItem,
	needSequence bool) (everTx *paySchema.Transaction, itemId string,
	err error)

func (*SDK) UploadFolder

func (s *SDK) UploadFolder(rootPath string, batchSize int, indexFile string,
	currency string) (orders []*seedSchema.RespOrder, manifestId string,
	err error)

func (*SDK) UploadFolderAndPay

func (s *SDK) UploadFolderAndPay(rootPath string, batchSize int,
	indexFile string, currency string) (orders []*seedSchema.RespOrder,
	manifestId string, everTxs []*paySchema.Transaction, err error)

func (*SDK) UploadFolderWithNoFee

func (s *SDK) UploadFolderWithNoFee(rootPath string, batchSize int,
	indexFile string, noFeeApikey string) (orders []*seedSchema.RespOrder,
	manifestId string, err error)

func (*SDK) UploadFolderWithSequence

func (s *SDK) UploadFolderWithSequence(rootPath string, batchSize int,
	indexFile string, noFeeApikey string) (orders []*seedSchema.RespOrder,
	manifestId string, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL