@loopring-web/loopring-sdk / Exports / NFTAPI

Class: NFTAPI

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new NFTAPI(param, timeout?)

Parameters

Name Type Default value
param InitParam undefined
timeout number 3000

Inherited from

BaseAPI.constructor

Defined in

api/base_api.ts:86

Properties

baseUrl

Protected baseUrl: string = ""

Inherited from

BaseAPI.baseUrl

Defined in

api/base_api.ts:37


chainId

Protected chainId: ChainId = ChainId.MAINNET

Inherited from

BaseAPI.chainId

Defined in

api/base_api.ts:38


KEY_MESSAGE

Static KEY_MESSAGE: string = KEY_MESSAGE

Inherited from

BaseAPI.KEY_MESSAGE

Defined in

api/base_api.ts:36

Methods

_genContract

Private _genContract(web3, contractAddress, type?): any

Parameters

Name Type Default value
web3 any undefined
contractAddress string undefined
type NFTType NFTType.ERC1155

Returns

any

Defined in

api/nft_api.ts:77


_genContractData

Private _genContractData(Contract, method, data): any

Parameters

Name Type
Contract any
method string
data any

Returns

any

Defined in

api/nft_api.ts:65


_genERC1155Data

Private _genERC1155Data(method, data): any

Parameters

Name Type
method string
data any

Returns

any

Defined in

api/nft_api.ts:69


_genERC721Data

Private _genERC721Data(method, data): any

Parameters

Name Type
method string
data any

Returns

any

Defined in

api/nft_api.ts:73


approveNFT

approveNFT(__namedParameters): Promise<any>

approveNFT

Parameters

Name Type
__namedParameters ApproveParam

Returns

Promise<any>

Defined in

api/nft_api.ts:237


callContractMethod

Private callContractMethod(web3, method, data, contractAddress, type?): Promise<any>

Parameters

Name Type Default value
web3 any undefined
method string undefined
data any[] undefined
contractAddress string undefined
type NFTType NFTType.ERC1155

Returns

Promise<any>

Defined in

api/nft_api.ts:53


computeNFTAddress

computeNFTAddress(__namedParameters): Object

function computeNFTAddress

throws Error

Parameters

Name Type
__namedParameters Object
__namedParameters.nftBaseUri? string
__namedParameters.nftFactory? string
__namedParameters.nftOwner string

Returns

Object

tokenAddress

Name Type
tokenAddress string

Defined in

api/nft_api.ts:404


depositNFT

depositNFT(__namedParameters): Promise<any>

depositparam an NFTAction to the specified account.

Parameters

Name Type
__namedParameters DepositNFTParam

Returns

Promise<any>

Defined in

api/nft_api.ts:356


genErr

genErr(err): RESULT_INFO

Parameters

Name Type
err Error

Returns

RESULT_INFO

Inherited from

BaseAPI.genErr

Defined in

api/base_api.ts:39


getAvailableBroker

getAvailableBroker(): Promise<{ broker: string }>

Returns

Promise<{ broker: string }>

Inherited from

BaseAPI.getAvailableBroker

Defined in

api/base_api.ts:97


getContractNFTMeta

getContractNFTMeta(__namedParameters): Promise<any>

getContractNFTMeta

Parameters

Name Type
__namedParameters ContractNFTMetaParam

Returns

Promise<any>

Defined in

api/nft_api.ts:195


getCounterFactualInfo

getCounterFactualInfo<T>(request): Promise<{ counterFactualInfo: undefined | CounterFactualInfo ; error?: RESULT_INFO ; raw_data: T }>

Type parameters

Name Type
T extends unknown

Parameters

Name Type
request GetCounterFactualInfoRequest

Returns

Promise<{ counterFactualInfo: undefined | CounterFactualInfo ; error?: RESULT_INFO ; raw_data: T }>

Inherited from

BaseAPI.getCounterFactualInfo

Defined in

api/base_api.ts:108


getInfoForNFTTokens

getInfoForNFTTokens(nftDatas): Promise<undefined | { [key: string]: NFTTokenInfo; }>

getInfoForNFTTokens

Parameters

Name Type Description
nftDatas Object NftData[]
nftDatas.nftDatas string[] -

Returns

Promise<undefined | { [key: string]: NFTTokenInfo; }>

Defined in

api/nft_api.ts:150


getNFTBalance

getNFTBalance(__namedParameters): Promise<{ count?: string }>

getNFTBalance

Parameters

Name Type
__namedParameters UserNFTBalanceParam

Returns

Promise<{ count?: string }>

Defined in

api/nft_api.ts:98


ipfsCid0ToNftID

ipfsCid0ToNftID(cidV0Str): string

Parameters

Name Type
cidV0Str string

Returns

string

Defined in

api/nft_api.ts:286


ipfsNftIDToCid

ipfsNftIDToCid(nftId): any

Parameters

Name Type Description
nftId string 16

Returns

any

Defined in

api/nft_api.ts:299


isApprovedForAll

isApprovedForAll(__namedParameters): Promise<any>

isApprovedForAll

Parameters

Name Type
__namedParameters IsApproveParam

Returns

Promise<any>

Defined in

api/nft_api.ts:315


makeReq

Protected makeReq(): Request

Returns

Request

Inherited from

BaseAPI.makeReq

Defined in

api/base_api.ts:151


returnTxHash

Protected returnTxHash<T>(raw_data): RESULT_INFO | Omit<T, "resultInfo"> & { raw_data: Omit<T, "resultInfo"> }

Type parameters

Name Type
T extends TX_HASH_API

Parameters

Name Type
raw_data T

Returns

RESULT_INFO | Omit<T, "resultInfo"> & { raw_data: Omit<T, "resultInfo"> }

Inherited from

BaseAPI.returnTxHash

Defined in

api/base_api.ts:66


setBaseUrl

setBaseUrl(baseUrl): void

Parameters

Name Type
baseUrl string

Returns

void

Inherited from

BaseAPI.setBaseUrl

Defined in

api/base_api.ts:147


setChainId

setChainId(chainId): void

Parameters

Name Type
chainId ChainId

Returns

void

Inherited from

BaseAPI.setChainId

Defined in

api/base_api.ts:142

results matching ""

    No results matching ""