sdk

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGasLimit = 5000000
	NameSuffix      = ".zec"
	MinGasFee       = 100000000000000 // 0.0001BNB

	BNBAssetId = 0
	LEGAssetId = 1
	REYAssetId = 2
)
View Source
const (
	TxTypeEmpty = iota
	TxTypeRegisterZns
	TxTypeCreatePair
	TxTypeUpdatePairRate
	TxTypeDeposit
	TxTypeDepositNft
	TxTypeTransfer
	TxTypeSwap
	TxTypeAddLiquidity
	TxTypeRemoveLiquidity
	TxTypeWithdraw
	TxTypeCreateCollection //11
	TxTypeMintNft          //12
	TxTypeTransferNft      //13
	TxTypeAtomicMatch      //----> 14
	TxTypeCancelOffer      //----> 15
	TxTypeWithdrawNft      //16
	TxTypeFullExit
	TxTypeFullExitNft //18
	TxTypeOffer
)

Variables

This section is empty.

Functions

func ConvertCancelOfferTxInfo added in v1.0.6

func ConvertCancelOfferTxInfo(tx *CancelOfferTxInfo) *legendTxTypes.CancelOfferTxInfo

func CreateL1Account

func CreateL1Account() (l1Addr, privateKeyStr, l2pk, seed string, err error)

func GetAccountIndex

func GetAccountIndex(accountName string) (int64, error)

func GetAccountL1Address

func GetAccountL1Address(accountName string) (common.Address, error)

func GetNextNonce

func GetNextNonce(accountIdx int64) (int64, error)

func GetSeedAndL2Pk

func GetSeedAndL2Pk(privateKeyStr string) (l2pk, seed string, err error)

func IfAccountRegistered

func IfAccountRegistered(accountName string) (bool, error)

func SignMessage

func SignMessage(key KeyManager, message string) string

Types

type AccountInfo

type AccountInfo struct {
	Index     uint32   `json:"account_index"`
	Name      string   `json:"account_name"`
	Nonce     int64    `json:"nonce"`
	AccountPk string   `json:"account_pk"`
	Assets    []*Asset `json:"assets"`
}

type Asset

type Asset struct {
	AssetId                  uint32 `json:"asset_id"`
	Balance                  string `json:"balance"`
	LpAmount                 string `json:"lp_amount"`
	OfferCanceledOrFinalized string `json:"offer_canceled_or_finalized"`
}

func GetAccountAssetsInfoByAccountName added in v1.0.6

func GetAccountAssetsInfoByAccountName(accountName string) ([]*Asset, error)

type AssetInfo added in v1.0.6

type AssetInfo struct {
	AssetId       uint32 `json:"asset_id"`
	AssetName     string `json:"asset_name"`
	AssetDecimals uint32 `json:"asset_decimals"`
	AssetSymbol   string `json:"asset_symbol"`
	AssetAddress  string `json:"asset_address"`
	IsGasAsset    uint32 `json:"is_gas_asset"`
}

type AtomicMatchTxInfo

type AtomicMatchTxInfo struct {
	AccountIndex      int64
	BuyOffer          *OfferTxInfo
	SellOffer         *OfferTxInfo
	GasAccountIndex   int64
	GasFeeAssetId     int64
	GasFeeAssetAmount *big.Int
	CreatorAmount     *big.Int
	TreasuryAmount    *big.Int
	Nonce             int64
	ExpiredAt         int64
	Sig               []byte
}

type CancelOfferTxInfo added in v1.0.6

type CancelOfferTxInfo struct {
	AccountIndex      int64
	OfferId           int64
	GasAccountIndex   int64
	GasFeeAssetId     int64
	GasFeeAssetAmount *big.Int
	ExpiredAt         int64
	Nonce             int64
	Sig               []byte
}

type Categorie

type Categorie struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient added in v1.0.4

func NewClient(accountName, seed string) (*Client, error)

func RegisterAccountWithPrivateKey

func RegisterAccountWithPrivateKey(accountName, l1Addr, privateKey string) (*Client, error)

func (*Client) AcceptOffer

func (c *Client) AcceptOffer(offerId int64, isSell bool, assetAmount *big.Int) (*RespAcceptOffer, error)

func (*Client) CancelOffer

func (c *Client) CancelOffer(offerId int64) (*RespCancelOffer, error)

func (*Client) CreateBuyOffer

func (c *Client) CreateBuyOffer(AssetId int64, AssetType int64, AssetAmount *big.Int) (*RespListOffer, error)

func (*Client) CreateCollection

func (c *Client) CreateCollection(ShortName string, CategoryId string, CreatorEarningRate string, ops ...model.CollectionOption) (*RespCreateCollection, error)

func (*Client) CreateSellOffer

func (c *Client) CreateSellOffer(AssetId int64, AssetType int64, AssetAmount *big.Int) (*RespListOffer, error)

func (*Client) Deposit added in v1.0.6

func (c *Client) Deposit(accountName, privateKey string, assetId, assetAmount int64, BEP20token common.Address) (*types.Transaction, error)

func (*Client) DepositNft added in v1.0.6

func (c *Client) DepositNft(accountName, privateKey string, _nftL1Address common.Address, _nftL1TokenId *big.Int) (*types.Transaction, error)

func (*Client) FullExit added in v1.0.6

func (c *Client) FullExit(accountName, privateKey string, assetAddress common.Address, amount int64) (*types.Transaction, error)

func (*Client) FullExitNft added in v1.0.6

func (c *Client) FullExitNft(accountName, privateKey string, _nftIndex uint32) (*types.Transaction, error)

func (*Client) GetKeyManager added in v1.0.6

func (c *Client) GetKeyManager() KeyManager

func (*Client) GetMyInfo

func (c *Client) GetMyInfo() (accountName string, l2pk string, seed string)

GetMyInfo accountName、l2pk、seed

func (*Client) MintNft

func (c *Client) MintNft(CollectionId int64, NftUrl string, Name string, Description string, Media string, Properties string, Levels string, Stats string) (*RespCreateAsset, error)

func (*Client) Offer

func (c *Client) Offer(accountName string, tx string) (*RespListOffer, error)

func (*Client) SetKeyManager

func (c *Client) SetKeyManager(keyManager KeyManager)

func (*Client) TransferNft

func (c *Client) TransferNft(
	AssetId int64,
	toAccountName string) (*RespSendTransferNft, error)

func (*Client) UpdateCollection

func (c *Client) UpdateCollection(Id string, Name string, ops ...model.CollectionOption) (*RespUpdateCollection, error)

func (*Client) Withdraw added in v1.0.6

func (c *Client) Withdraw(tol1Address string, assetId, assetAmount int64) (*RespSendWithdrawTx, error)

func (*Client) WithdrawNft

func (c *Client) WithdrawNft(AssetId int64, tol1Address string) (*RespSendWithdrawNft, error)

type Collection

type Collection struct {
	Id                 int64  `json:"id"`
	L2CollectionId     int64  `json:"l2_collection_id"`
	AccountName        string `json:"account_name"`
	Name               string `json:"name"`
	ShortName          string `json:"short_name"`
	Description        string `json:"description"`
	CategoryId         int64  `json:"category_id"`
	CollectionUrl      string `json:"collection_url"`
	ExternalLink       string `json:"external_link"`
	TwitterLink        string `json:"twitter_link"`
	InstagramLink      string `json:"instagram_link"`
	TelegramLink       string `json:"telegram_link"`
	DiscordLink        string `json:"discord_link"`
	LogoImage          string `json:"logo_image"`
	LogoThumb          string `json:"logo_thumb"`
	FeaturedImage      string `json:"featured_image"`
	FeaturedThumb      string `json:"featured_Thumb"`
	BannerImage        string `json:"banner_image"`
	BannerThumb        string `json:"banner_thumb"`
	CreatorEarningRate int64  `json:"creator_earning_rate"`
	Status             string `json:"status"`
	ExpiredAt          int64  `json:"expired_at"`
	CreatedAt          int64  `json:"created_at"`
	ItemCount          int64  `json:"item_count"`
	BrowseCount        int64  `json:"browse_count"`
	FloorPrice         int64  `json:"floor_price"`
	OneDayTradeVolume  int64  `json:"one_day_trade_volume"`
	TotalTradeVolume   int64  `json:"total_trade_volume"`
}

type CreateCollectionTxInfo

type CreateCollectionTxInfo struct {
	AccountIndex      int64
	CollectionId      int64
	Name              string
	Introduction      string
	GasAccountIndex   int64
	GasFeeAssetId     int64
	GasFeeAssetAmount *big.Int
	ExpiredAt         int64
	Nonce             int64
	Sig               []byte
}

type CreatePairTxInfo

type CreatePairTxInfo struct {
	TxType               uint8
	PairIndex            int64
	AssetAId             int64
	AssetBId             int64
	FeeRate              int64
	TreasuryAccountIndex int64
	TreasuryRate         int64
}

type DepositNftTxInfo

type DepositNftTxInfo struct {
	TxType              uint8
	AccountIndex        int64
	NftIndex            int64
	NftL1Address        string
	CreatorAccountIndex int64
	CreatorTreasuryRate int64
	NftContentHash      []byte
	NftL1TokenId        *big.Int
	AccountNameHash     []byte
	CollectionId        int64
}

type DepositTxInfo

type DepositTxInfo struct {
	TxType          uint8
	AccountIndex    int64
	AccountNameHash []byte
	AssetId         int64
	AssetAmount     *big.Int
}

type FullExitNftTxInfo

type FullExitNftTxInfo struct {
	TxType                 uint8
	AccountIndex           int64
	CreatorAccountIndex    int64
	CreatorTreasuryRate    int64
	NftIndex               int64
	CollectionId           int64
	NftL1Address           string
	AccountNameHash        []byte
	CreatorAccountNameHash []byte
	NftContentHash         []byte
	NftL1TokenId           *big.Int
}

type FullExitTxInfo

type FullExitTxInfo struct {
	TxType          uint8
	AccountIndex    int64
	AccountNameHash []byte
	AssetId         int64
	AssetAmount     *big.Int
}

type HasuraDataOffer

type HasuraDataOffer struct {
	Offers []*HasuraOffer `json:"offer"`
}

type HasuraOffer

type HasuraOffer struct {
	Id                 int64          `json:"id"`
	L2OfferId          int64          `json:"l2_offer_id"`
	Direction          int            `json:"direction"`
	AssetId            int64          `json:"asset_id"`
	PaymentAssetId     int64          `json:"payment_asset_id"`
	PaymentAssetAmount float64        `json:"payment_asset_amount"`
	Status             int            `json:"status"`
	Signature          string         `json:"signature"`
	ExpiredAt          int64          `json:"expired_at"`
	CreatedAt          string         `json:"created_at"`
	Asset              *HauaraNftInfo `json:"asset"`
}

type HauaraNftInfo

type HauaraNftInfo struct {
	Id                 int64       `json:"id"`
	NftIndex           int64       `json:"nft_index"`
	CollectionId       int64       `json:"collection_id"`
	CreatorEarningRate int64       `json:"creator_earning_rate"`
	Name               string      `json:"name"`
	Description        string      `json:"description"`
	Media              MediaDetail `json:"media_detail"`
	ImageThumb         string      `json:"image_thumb"`
	VideoThumb         string      `json:"video_thumb"`
	AudioThumb         string      `json:"audio_thumb"`
	Status             int64       `json:"status"`
	ContentHash        string      `json:"content_hash"`
	NftUrl             string      `json:"nft_url"`
	ExpiredAt          int64       `json:"expired_at"`
	CreatedAt          int64       `json:"created_at"`
	Properties         Propertie   `json:"properties"`
	Levels             Level       `json:"levels"`
	Stats              Stat        `json:"stats"`
}

type KeyManager

type KeyManager interface {
	Sign(message []byte, hFunc hash.Hash) ([]byte, error)
	Public() signature.PublicKey
}

func NewSeedKeyManager

func NewSeedKeyManager(seed string) (KeyManager, error)

type Level

type Level struct {
	Name     string `json:"name"`
	Value    int64  `json:"value"`
	MaxValue int64  `json:"maxValue"`
}

type MediaDetail

type MediaDetail struct {
	Url string `json:"url"`
}

========================= hasura struct ============================

type MintNftTxInfo

type MintNftTxInfo struct {
	CreatorAccountIndex int64
	ToAccountIndex      int64
	ToAccountNameHash   string
	NftIndex            int64
	NftContentHash      string
	NftCollectionId     int64
	CreatorTreasuryRate int64
	GasAccountIndex     int64
	GasFeeAssetId       int64
	GasFeeAssetAmount   *big.Int
	ExpiredAt           int64
	Nonce               int64
	Sig                 []byte
}

type NftAccountInfo

type NftAccountInfo struct {
	Id            int64  `json:"id"`
	AccountIndex  int64  `json:"account_index"`
	AccountPk     string `json:"account_pk"`
	AccountName   string `json:"account_name"`
	Bio           string `json:"bio"`
	Email         string `json:"email"`
	ExternalLink  string `json:"external_link"`
	TwitterLink   string `json:"twitter_link"`
	InstagramLink string `json:"instagram_link"`
	ProfileImage  string `json:"profile_image"`
	ProfileThumb  string `json:"profile_thumb"`
	BannerImage   string `json:"banner_image"`
	BannerThumb   string `json:"banner_thumb"`
	CreatedAt     int64  `json:"created_at"`
}

type NftInfo

type NftInfo struct {
	Id                 int64       `json:"id"`
	AccountName        string      `json:"account_name"`
	NftIndex           int64       `json:"nft_index"`
	CollectionId       int64       `json:"collection_id"`
	CreatorEarningRate int64       `json:"creator_earning_rate"`
	Name               string      `json:"name"`
	Description        string      `json:"description"`
	Media              string      `json:"media"`
	ImageThumb         string      `json:"image_thumb"`
	VideoThumb         string      `json:"video_thumb"`
	AudioThumb         string      `json:"audio_thumb"`
	Status             string      `json:"status"`
	ContentHash        string      `json:"content_hash"`
	NftUrl             string      `json:"nft_url"`
	ExpiredAt          int64       `json:"expired_at"`
	CreatedAt          int64       `json:"created_at"`
	Properties         []Propertie `json:"properties"`
	Levels             []Level     `json:"levels"`
	Stats              []Stat      `json:"stats"`
}

type Offer

type Offer struct {
	Id                 int64  `json:"id"`
	L2OfferId          int64  `json:"l2_offer_id"`
	AccountName        string `json:"account_name"`
	Direction          string `json:"direction"`
	AssetId            int64  `json:"asset_id"`
	PaymentAssetId     int64  `json:"payment_asset_id"`
	PaymentAssetAmount string `json:"payment_asset_amount"`
	Status             string `json:"status"`
	Signature          string `json:"signature"`
	ExpiredAt          int64  `json:"expired_at"`
	CreatedAt          int64  `json:"created_at"`
}

type OfferTxInfo

type OfferTxInfo struct {
	Type         int64
	OfferId      int64
	AccountIndex int64
	NftIndex     int64
	AssetId      int64
	AssetAmount  *big.Int
	ListedAt     int64
	ExpiredAt    int64
	TreasuryRate int64
	Sig          []byte
}

type Propertie

type Propertie struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type RegisterZnsTxInfo

type RegisterZnsTxInfo struct {
	TxType          uint8
	AccountIndex    int64
	AccountName     string
	AccountNameHash []byte
	PubKey          string
}

type ReqGetAllCollectionByCategoryId

type ReqGetAllCollectionByCategoryId struct {
	CategoryId int64 `form:"category_id"`
}

type ReqGetOfferByOfferId

type ReqGetOfferByOfferId struct {
	OfferId int64 `form:"offer_id"`
}

type ReqGetPrepareCreateCollectionTxInfo

type ReqGetPrepareCreateCollectionTxInfo struct {
	AccountName string `form:"account_name"`
}

type ReqGetPrepareTransferNftTxInfo

type ReqGetPrepareTransferNftTxInfo struct {
	AccountName   string `form:"account_name"`
	ToAccountName string `form:"to_account_name"`
	NftIndex      int64  `form:"nft_index"`
}

type ReqGetPrepareWithdrawNftTxInfo

type ReqGetPrepareWithdrawNftTxInfo struct {
	AccountName string `form:"account_name"`
	NftIndex    int64  `form:"nft_index"`
}

type ReqGetSdkAccountAssets added in v1.0.5

type ReqGetSdkAccountAssets struct {
	AccountIndex int64 `json:"account_index"`
}

type ReqGetSdkAccountCollections added in v1.0.5

type ReqGetSdkAccountCollections struct {
	AccountIndex int64 `json:"account_index"`
}

type ReqGetSdkAccountOffers added in v1.0.5

type ReqGetSdkAccountOffers struct {
	AccountIndex int64 `json:"account_index"`
}

type ReqGetSdkAssetById added in v1.0.5

type ReqGetSdkAssetById struct {
	AssetId int64 `json:"asset_id"`
}

type ReqGetSdkAssetOffers added in v1.0.5

type ReqGetSdkAssetOffers struct {
	AssetId int64 `json:"asset_id"`
}

type ReqGetSdkAtomicMatchWithTx added in v1.0.5

type ReqGetSdkAtomicMatchWithTx struct {
	AccountName string `form:"account_name"`
	IsSell      bool   `form:"is_sell"`
	OfferId     int64  `form:"offer_id"`
	MoneyId     int64  `form:"money_id"`
	MoneyAmount string `form:"money_amount"`
}

type ReqGetSdkCancelOfferTxInfo added in v1.0.5

type ReqGetSdkCancelOfferTxInfo struct {
	AccountName string `form:"account_name"`
	OfferId     int64  `form:"offer_id"`
}

type ReqGetSdkCollection added in v1.0.5

type ReqGetSdkCollection struct {
	CollectionId int64 `json:"collection_id"`
}

type ReqGetSdkCollectionAssets added in v1.0.5

type ReqGetSdkCollectionAssets struct {
	CollectionId int64 `json:"collection_id"`
}

type ReqGetSdkCollectionById added in v1.0.5

type ReqGetSdkCollectionById struct {
	CollectionId int64 `json:"collection_id"`
}

type ReqGetSdkCreateCollectionTxInfo added in v1.0.5

type ReqGetSdkCreateCollectionTxInfo struct {
	AccountName string `form:"account_name"`
}

======================= sdk ======================================

type ReqGetSdkMintNftTxInfo added in v1.0.5

type ReqGetSdkMintNftTxInfo struct {
	AccountName  string `form:"account_name"`
	CollectionId int64  `form:"collection_id"`
	TreasuryRate int64  `form:"treasury_rate"`
	Name         string `form:"name"`
	ContentHash  string `form:"content_hash"`
}

type ReqGetSdkOffer added in v1.0.5

type ReqGetSdkOffer struct {
	OfferId int64 `json:"offer_id"`
}

type ReqGetSdkOfferTxInfo added in v1.0.5

type ReqGetSdkOfferTxInfo struct {
	AccountName string `form:"account_name"`
	NftId       int64  `form:"nft_id"`
	MoneyId     int64  `form:"money_id"`
	MoneyAmount string `form:"money_amount"`
	IsSell      bool   `form:"is_sell"`
}

type ReqGetSdkTransferNftTxInfo added in v1.0.5

type ReqGetSdkTransferNftTxInfo struct {
	AccountName   string `form:"account_name"`
	ToAccountName string `form:"to_account_name"`
	NftId         int64  `form:"nft_id"`
}

type ReqGetSdkWithdrawNftTxInfo added in v1.0.5

type ReqGetSdkWithdrawNftTxInfo struct {
	AccountName string `form:"account_name"`
	NftId       int64  `form:"nft_id"`
}

type ReqMediaUpload

type ReqMediaUpload struct {
	// contains filtered or unexported fields
}

type RespAcceptOffer

type RespAcceptOffer struct {
	Offer Offer `json:"offer"`
}

type RespApplyRegisterHost

type RespApplyRegisterHost struct {
	Ok bool `json:"ok"`
}

func ApplyRegisterHost

func ApplyRegisterHost(
	accountName string, l2Pk string, OwnerAddr string) (*RespApplyRegisterHost, error)

type RespCancelOffer

type RespCancelOffer struct {
	Offer Offer `json:"offer"`
}

type RespCategoryById

type RespCategoryById struct {
	Category Categorie `json:"categorie"`
}

type RespCreateAsset

type RespCreateAsset struct {
	Asset NftInfo `json:"asset"`
}

type RespCreateCollection

type RespCreateCollection struct {
	Collection Collection `json:"collection"`
}

type RespGetAccountByAccountName

type RespGetAccountByAccountName struct {
	Account NftAccountInfo `json:"account"`
}

func GetAccountByAccountName

func GetAccountByAccountName(accountName string) (*RespGetAccountByAccountName, error)

type RespGetAllAssetByCollectionId

type RespGetAllAssetByCollectionId struct {
	Total  int64    `json:"total"`
	Assets []*Asset `json:"assets"`
}

type RespGetAllCollectionByCategoryId

type RespGetAllCollectionByCategoryId struct {
	Total       int64        `json:"total"`
	Collections []Collection `json:"collections"`
}

type RespGetAssetsList added in v1.0.6

type RespGetAssetsList struct {
	Assets []*AssetInfo `json:"assets"`
}

func GetAssetsList added in v1.0.6

func GetAssetsList() (*RespGetAssetsList, error)

type RespGetCollectionAction

type RespGetCollectionAction struct {
	OpCode     string     `json:"opCode"`
	Collection Collection `json:"collection"`
}

type RespGetCollectionCategories

type RespGetCollectionCategories struct {
	Categories []*Categorie `json:"categories"`
}

func GetCategories

func GetCategories() (*RespGetCollectionCategories, error)

type RespGetCollectionOwnerNum added in v1.0.6

type RespGetCollectionOwnerNum struct {
	OwnerNum int64 `json:"owner_num"`
}

type RespGetContentHash

type RespGetContentHash struct {
	ContentHash string `json:"content_hash"`
}

type RespGetLayer2BasicInfo

type RespGetLayer2BasicInfo struct {
	BlockCommitted             int64    `json:"block_committed"`
	BlockVerified              int64    `json:"block_verified"`
	TotalTransactions          int64    `json:"total_transactions"`
	TransactionsCountYesterday int64    `json:"transactions_count_yesterday"`
	TransactionsCountToday     int64    `json:"transactions_count_today"`
	DauYesterday               int64    `json:"dau_yesterday"`
	DauToday                   int64    `json:"dau_today"`
	ContractAddresses          []string `json:"contract_addresses"`
	NftOfferTreasuryRate       int64    `json:"nft_offer_treasury_rate"`
}

func GetLayer2BasicInfo

func GetLayer2BasicInfo() (*RespGetLayer2BasicInfo, error)

type RespGetListingOffers added in v1.0.5

type RespGetListingOffers struct {
	Data *HasuraDataOffer `json:"data"`
}

func GetListingOffers

func GetListingOffers(isSell int64) (*RespGetListingOffers, error)

type RespGetNextNonce

type RespGetNextNonce struct {
	Nonce int64 `json:"nonce"`
}

type RespGetNextOfferId

type RespGetNextOfferId struct {
	Id int64 `json:"id"`
}

func GetNextOfferId

func GetNextOfferId(AccountName string) (*RespGetNextOfferId, error)

type RespGetNftBeingBuy

type RespGetNftBeingBuy struct {
	Data *HasuraDataOffer `json:"data"`
}

type RespGetOfferByAccountNameAndAssetId

type RespGetOfferByAccountNameAndAssetId struct {
	Offer Offer `json:"offer"`
}

type RespGetOfferById

type RespGetOfferById struct {
	OfferId Offer `json:"offer"`
}

type RespGetOfferByOfferId

type RespGetOfferByOfferId struct {
	Offer Offer `json:"offer"`
}

func GetOfferById

func GetOfferById(OfferId int64) (*RespGetOfferByOfferId, error)

type RespGetSdkAccountAssets added in v1.0.5

type RespGetSdkAccountAssets struct {
	SdkAssets []*NftInfo `json:"sdkAssets"`
}

func GetAccountNFTs

func GetAccountNFTs(AccountIndex int64) (*RespGetSdkAccountAssets, error)

type RespGetSdkAccountCollections added in v1.0.5

type RespGetSdkAccountCollections struct {
	SdkCollections []*Collection `json:"sdkCollections"`
}

func GetCollectionsByAccountIndex

func GetCollectionsByAccountIndex(AccountIndex int64) (*RespGetSdkAccountCollections, error)

type RespGetSdkAccountOffers added in v1.0.5

type RespGetSdkAccountOffers struct {
	SdkOffers []*Offer `json:"sdkOffers"`
}

func GetAccountOffers

func GetAccountOffers(AccountIndex int64) (*RespGetSdkAccountOffers, error)

type RespGetSdkAssetById added in v1.0.5

type RespGetSdkAssetById struct {
	Asset *NftInfo `json:"asset"`
}

func GetNftById

func GetNftById(nftId int64) (*RespGetSdkAssetById, error)

type RespGetSdkAssetOffers added in v1.0.5

type RespGetSdkAssetOffers struct {
	SdkOffers []*Offer `json:"sdkOffers"`
}

func GetNftOffers

func GetNftOffers(NftId int64) (*RespGetSdkAssetOffers, error)

type RespGetSdkCollectionById added in v1.0.5

type RespGetSdkCollectionById struct {
	Collection Collection `json:"collection"`
}

func GetCollectionById

func GetCollectionById(collectionId int64) (*RespGetSdkCollectionById, error)

type RespGetSdkOfferById added in v1.0.5

type RespGetSdkOfferById struct {
	OfferId Offer `json:"offer"`
}

type RespListOffer

type RespListOffer struct {
	Offer Offer `json:"offer"`
}

type RespMediaUpload

type RespMediaUpload struct {
	PublicId string `json:"public_id"`
	Url      string `json:"url,omitempty"`
}

func UploadMedia

func UploadMedia(filePath string) (*RespMediaUpload, error)

type RespSearchAsset

type RespSearchAsset struct {
	Total  int64    `json:"total"`
	Assets []*Asset `json:"assets"`
}

type RespSearchCollection

type RespSearchCollection struct {
	Total       int64        `json:"total"`
	Collections []Collection `json:"collections"`
}

type RespSearchOffer

type RespSearchOffer struct {
	Offer []Offer `json:"offers"`
}

type RespSendTransferNft added in v1.0.6

type RespSendTransferNft struct {
	Success bool `json:"success"`
}

type RespSendWithdrawNft added in v1.0.6

type RespSendWithdrawNft struct {
	Success bool `json:"success"`
}

type RespSendWithdrawTx added in v1.0.6

type RespSendWithdrawTx struct {
	TxId string `json:"tx_id"`
}

type RespUpdateCollection

type RespUpdateCollection struct {
	Collection Collection `json:"collection"`
}

type RespetPreparetxInfo

type RespetPreparetxInfo struct {
	TxType    int64  `json:"tx_type"`
	Transtion string `json:"transtion"`
}

type RespetSdktxInfo added in v1.0.5

type RespetSdktxInfo struct {
	TxType    int64  `json:"tx_type"`
	Transtion string `json:"transtion"`
}

type ResqGetSdkCollectionAssets added in v1.0.5

type ResqGetSdkCollectionAssets struct {
	SdkAssets []*NftInfo `json:"sdkAssets"`
}

type SeedKeyManager

type SeedKeyManager struct {
	// contains filtered or unexported fields
}

func (*SeedKeyManager) Public

func (key *SeedKeyManager) Public() signature.PublicKey

func (*SeedKeyManager) Sign

func (key *SeedKeyManager) Sign(message []byte, hFunc hash.Hash) ([]byte, error)

type Stat

type Stat struct {
	Name     string `json:"name"`
	Value    int64  `json:"value"`
	MaxValue int64  `json:"maxValue"`
}

type TransferNftTxInfo

type TransferNftTxInfo struct {
	FromAccountIndex  int64
	ToAccountIndex    int64
	ToAccountNameHash string
	NftIndex          int64
	GasAccountIndex   int64
	GasFeeAssetId     int64
	GasFeeAssetAmount *big.Int
	CallData          string
	CallDataHash      []byte
	ExpiredAt         int64
	Nonce             int64
	Sig               []byte
}

type TransferTxInfo

type TransferTxInfo struct {
	FromAccountIndex  int64
	ToAccountIndex    int64
	ToAccountNameHash string
	AssetId           int64
	AssetAmount       *big.Int
	GasAccountIndex   int64
	GasFeeAssetId     int64
	GasFeeAssetAmount *big.Int
	Memo              string
	CallData          string
	CallDataHash      []byte
	ExpiredAt         int64
	Nonce             int64
	Sig               []byte
}

type Tx

type Tx struct {
	TxId          int64       `json:"tx_id"`
	TxHash        string      `json:"tx_hash"`
	TxType        int64       `json:"tx_type"`
	GasFee        string      `json:"gas_fee"`
	GasFeeAssetId int64       `json:"gas_fee_asset_id"`
	TxStatus      int64       `json:"tx_status"`
	BlockHeight   int64       `json:"block_height"`
	BlockId       int64       `json:"block_id"`
	StateRoot     string      `json:"state_root"`
	NftIndex      int64       `json:"nft_index"`
	PairIndex     int64       `json:"pair_index"`
	AssetId       int64       `json:"asset_id"`
	TxAmount      string      `json:"tx_amount"`
	NativeAddress string      `json:"native_address"`
	TxInfo        string      `json:"tx_info"`
	TxDetails     []*TxDetail `json:"tx_details"`
	ExtraInfo     string      `json:"extra_info"`
	Memo          string      `json:"memo"`
	AccountIndex  int64       `json:"account_index"`
	Nonce         int64       `json:"nonce"`
	ExpiredAt     int64       `json:"expired_at"`
}

type TxDetail

type TxDetail struct {
	TxId            int64  `json:"tx_id"`
	AssetId         int64  `json:"asset_id"`
	AssetType       int64  `json:"asset_type"`
	AccountIndex    int64  `json:"account_index"`
	AccountName     string `json:"account_name"`
	Balance         string `json:"balance"`
	BalanceDelta    string `json:"balance_delta"`
	Order           int64  `json:"order"`
	AccountOrder    int64  `json:"account_order"`
	Nonce           int64  `json:"nonce"`
	CollectionNonce int64  `json:"collection_nonce"`
}

type UpdatePairRateTxInfo

type UpdatePairRateTxInfo struct {
	TxType               uint8
	PairIndex            int64
	FeeRate              int64
	TreasuryAccountIndex int64
	TreasuryRate         int64
}

type WithdrawNftTxInfo

type WithdrawNftTxInfo struct {
	AccountIndex           int64
	CreatorAccountIndex    int64
	CreatorAccountNameHash []byte
	CreatorTreasuryRate    int64
	NftIndex               int64
	NftContentHash         []byte
	NftL1Address           string
	NftL1TokenId           *big.Int
	CollectionId           int64
	ToAddress              string
	GasAccountIndex        int64
	GasFeeAssetId          int64
	GasFeeAssetAmount      *big.Int
	ExpiredAt              int64
	Nonce                  int64
	Sig                    []byte
}

type WithdrawTxInfo

type WithdrawTxInfo struct {
	FromAccountIndex  int64
	AssetId           int64
	AssetAmount       *big.Int
	GasAccountIndex   int64
	GasFeeAssetId     int64
	GasFeeAssetAmount *big.Int
	ToAddress         string
	ExpiredAt         int64
	Nonce             int64
	Sig               []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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