UNPKG

@bthn/opensea-js

Version:

JavaScript SDK for the OpenSea marketplace. Let users buy or sell crypto collectibles and other cryptogoods, all on your own site!

437 lines (436 loc) 23.4 kB
/// <reference types="node" /> import BN from "bn.js"; import { ContractOptions } from "web3-eth-contract"; import { EventLog } from "web3-core"; import { EventEmitter } from "events"; import { Callback, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "./types"; export interface EventOptions { filter?: object; fromBlock?: BlockType; topics?: string[]; } export declare type Approval = ContractEventLog<{ _id: string; _owner: string; _spender: string; _value: string; 0: string; 1: string; 2: string; 3: string; }>; export declare type Initialize = ContractEventLog<{ _block: string; _storage: string; _oldContract: string; 0: string; 1: string; 2: string; }>; export declare type Retire = ContractEventLog<{ _block: string; _nextContract: string; 0: string; 1: string; }>; export declare type Log = ContractEventLog<{ _id: string; _from: string; _data: string; 0: string; 1: string; 2: string; }>; export declare type UpdateDecimals = ContractEventLog<{ _id: string; 0: string; }>; export declare type UpdateName = ContractEventLog<{ _id: string; 0: string; }>; export declare type UpdateSymbol = ContractEventLog<{ _id: string; 0: string; }>; export declare type SetURI = ContractEventLog<{ _id: string; _uri: string; 0: string; 1: string; }>; export declare type Assign = ContractEventLog<{ _id: string; _from: string; _to: string; 0: string; 1: string; 2: string; }>; export declare type AcceptAssignment = ContractEventLog<{ _id: string; _creator: string; 0: string; 1: string; }>; export declare type Create = ContractEventLog<{ _id: string; _creator: string; _isNonFungible: boolean; 0: string; 1: string; 2: boolean; }>; export declare type Mint = ContractEventLog<{ _id: string; _value: string; 0: string; 1: string; }>; export declare type UpdateMaxMeltFee = ContractEventLog<{ _id: string; 0: string; }>; export declare type UpdateMeltFee = ContractEventLog<{ _id: string; 0: string; }>; export declare type OperatorApproval = ContractEventLog<{ _owner: string; _operator: string; _id: string; _approved: boolean; 0: string; 1: string; 2: string; 3: boolean; }>; export declare type Transfer = ContractEventLog<{ _id: string; _from: string; _to: string; _value: string; 0: string; 1: string; 2: string; 3: string; }>; export declare type TransferFee = ContractEventLog<{ _id: string; _sender: string; _feeId: string; _feeValue: string; 0: string; 1: string; 2: string; 3: string; }>; export declare type UpdateMaxTransferFee = ContractEventLog<{ _id: string; 0: string; }>; export declare type UpdateTransferable = ContractEventLog<{ _id: string; 0: string; }>; export declare type UpdateTransferFee = ContractEventLog<{ _id: string; 0: string; }>; export declare type Whitelist = ContractEventLog<{ _id: string; _account: string; _whitelisted: string; _on: boolean; 0: string; 1: string; 2: string; 3: boolean; }>; export declare type Melt = ContractEventLog<{ _id: string; _owner: string; _value: string; 0: string; 1: string; 2: string; }>; export declare type DeployERCAdapter = ContractEventLog<{ _id: string; _sender: string; 0: string; 1: string; }>; export declare type CreateTrade = ContractEventLog<{ _tradeId: string; _firstParty: string; _secondParty: string; _escrowedEnjFirstParty: string; 0: string; 1: string; 2: string; 3: string; }>; export declare type CompleteTrade = ContractEventLog<{ _tradeId: string; _firstParty: string; _secondParty: string; _receivedEnjFirstParty: string; _changeEnjFirstParty: string; _receivedEnjSecondParty: string; 0: string; 1: string; 2: string; 3: string; 4: string; 5: string; }>; export declare type CancelTrade = ContractEventLog<{ _tradeId: string; _firstParty: string; _receivedEnjFirstParty: string; 0: string; 1: string; 2: string; }>; export interface ERC1155Abi extends BaseContract { constructor(jsonInterface: any[], address?: string, options?: ContractOptions): ERC1155Abi; clone(): ERC1155Abi; methods: { supportsInterface(_interfaceID: string | number[]): NonPayableTransactionObject<boolean>; create(_name: string, _totalSupply: number | string | BN, _initialReserve: number | string | BN, _supplyModel: string, _meltValue: number | string | BN, _meltFeeRatio: number | string | BN, _transferable: number | string | BN, _transferFeeSettings: (number | string | BN)[], _nonFungible: boolean): NonPayableTransactionObject<void>; minMeltValue(_initialReserve: number | string | BN): NonPayableTransactionObject<string>; mintFungibles(_id: number | string | BN, _to: string[], _values: (number | string | BN)[]): NonPayableTransactionObject<void>; mintNonFungibles(_id: number | string | BN, _to: string[]): NonPayableTransactionObject<void>; mintNonFungiblesWithData(_id: number | string | BN, _to: string[], _data: (number | string | BN)[]): NonPayableTransactionObject<void>; reserve(_id: number | string | BN): NonPayableTransactionObject<string>; releaseReserve(_id: number | string | BN, _value: number | string | BN): NonPayableTransactionObject<void>; updateName(_id: number | string | BN, _name: string): NonPayableTransactionObject<void>; assign(_id: number | string | BN, _creator: string): NonPayableTransactionObject<void>; acceptAssignment(_id: number | string | BN): NonPayableTransactionObject<void>; setWhitelisted(_id: number | string | BN, _account: string, _whitelisted: string, _on: boolean): NonPayableTransactionObject<void>; setTransferable(_id: number | string | BN, _transferable: number | string | BN): NonPayableTransactionObject<void>; setMeltFee(_id: number | string | BN, _fee: number | string | BN): NonPayableTransactionObject<void>; decreaseMaxMeltFee(_id: number | string | BN, _fee: number | string | BN): NonPayableTransactionObject<void>; setTransferFee(_id: number | string | BN, _fee: number | string | BN): NonPayableTransactionObject<void>; decreaseMaxTransferFee(_id: number | string | BN, _fee: number | string | BN): NonPayableTransactionObject<void>; deployERC20Adapter(_id: number | string | BN, _decimals: number | string | BN, _symbol: string): NonPayableTransactionObject<string>; deployERC721Adapter(_id: number | string | BN, _symbol: string): NonPayableTransactionObject<string>; addLog(_id: number | string | BN, _data: string): NonPayableTransactionObject<void>; typeCount(): NonPayableTransactionObject<string>; typeByIndex(_index: number | string | BN): NonPayableTransactionObject<string>; nonFungibleTypeCount(): NonPayableTransactionObject<string>; nonFungibleTypeByIndex(_index: number | string | BN): NonPayableTransactionObject<string>; fungibleTypeCount(): NonPayableTransactionObject<string>; fungibleTypeByIndex(_index: number | string | BN): NonPayableTransactionObject<string>; typeData(_id: number | string | BN): NonPayableTransactionObject<{ _name: string; _creator: string; _meltValue: string; _meltFeeRatio: string; _meltFeeMaxRatio: string; _supplyModel: string; _totalSupply: string; _circulatingSupply: string; _reserve: string; _transferable: string; _transferFeeData: string[]; _nonFungible: boolean; 0: string; 1: string; 2: string; 3: string; 4: string; 5: string; 6: string; 7: string; 8: string; 9: string; 10: string[]; 11: boolean; }>; transferSettings(_id: number | string | BN): NonPayableTransactionObject<{ _transferable: string; _transferFeeType: string; _transferFeeCurrency: string; _transferFeeValue: string; _transferFeeMaxValue: string; 0: string; 1: string; 2: string; 3: string; 4: string; }>; isCreatorOf(_id: number | string | BN, _creator: string): NonPayableTransactionObject<boolean>; whitelisted(_id: number | string | BN, _account: string, _whitelisted: string): NonPayableTransactionObject<boolean>; name(_id: number | string | BN): NonPayableTransactionObject<string>; totalSupply(_id: number | string | BN): NonPayableTransactionObject<string>; mintableSupply(_id: number | string | BN): NonPayableTransactionObject<string>; circulatingSupply(_id: number | string | BN): NonPayableTransactionObject<string>; balanceOf(_id: number | string | BN, _owner: string): NonPayableTransactionObject<string>; decimals(_id: number | string | BN): NonPayableTransactionObject<string>; symbol(_id: number | string | BN): NonPayableTransactionObject<string>; getERC20Adapter(_id: number | string | BN): NonPayableTransactionObject<string>; getERC721Adapter(_id: number | string | BN): NonPayableTransactionObject<string>; transfer(_to: string, _id: number | string | BN, _value: number | string | BN): NonPayableTransactionObject<void>; safeTransfer(_to: string, _id: number | string | BN, _value: number | string | BN, _data: string | number[]): NonPayableTransactionObject<void>; transferAdapter(_to: string, _id: number | string | BN, _value: number | string | BN, _msgSender: string): NonPayableTransactionObject<void>; transferFrom(_from: string, _to: string, _id: number | string | BN, _value: number | string | BN): NonPayableTransactionObject<void>; safeTransferFrom(_from: string, _to: string, _id: number | string | BN, _value: number | string | BN, _data: string | number[]): NonPayableTransactionObject<void>; transferFromAdapter(_from: string, _to: string, _id: number | string | BN, _value: number | string | BN, _msgSender: string): NonPayableTransactionObject<void>; batchTransfer(_to: string, _ids: (number | string | BN)[], _values: (number | string | BN)[]): NonPayableTransactionObject<void>; safeBatchTransfer(_to: string, _ids: (number | string | BN)[], _values: (number | string | BN)[], _data: string | number[]): NonPayableTransactionObject<void>; batchTransferFrom(_from: string, _to: string, _ids: (number | string | BN)[], _values: (number | string | BN)[]): NonPayableTransactionObject<void>; safeBatchTransferFrom(_from: string, _to: string, _ids: (number | string | BN)[], _values: (number | string | BN)[], _data: string | number[]): NonPayableTransactionObject<void>; multicastTransfer(_to: string[], _ids: (number | string | BN)[], _values: (number | string | BN)[]): NonPayableTransactionObject<void>; safeMulticastTransfer(_to: string[], _ids: (number | string | BN)[], _values: (number | string | BN)[], _data: string | number[]): NonPayableTransactionObject<void>; multicastTransferFrom(_from: string[], _to: string[], _ids: (number | string | BN)[], _values: (number | string | BN)[]): NonPayableTransactionObject<void>; allowance(_id: number | string | BN, _owner: string, _spender: string): NonPayableTransactionObject<string>; approve(_spender: string, _id: number | string | BN, _currentValue: number | string | BN, _value: number | string | BN): NonPayableTransactionObject<void>; approveAdapter(_spender: string, _id: number | string | BN, _currentValue: number | string | BN, _value: number | string | BN, _msgSender: string): NonPayableTransactionObject<void>; batchApprove(_spender: string, _ids: (number | string | BN)[], _currentValues: (number | string | BN)[], _values: (number | string | BN)[]): NonPayableTransactionObject<void>; setApproval(_operator: string, _ids: (number | string | BN)[], _approved: boolean): NonPayableTransactionObject<void>; setApprovalForAll(_operator: string, _approved: boolean): NonPayableTransactionObject<void>; setApprovalAdapter(_operator: string, _id: number | string | BN, _approved: boolean, _msgSender: string): NonPayableTransactionObject<void>; isApproved(_owner: string, _operator: string, _id: number | string | BN): NonPayableTransactionObject<boolean>; isApprovedForAll(_owner: string, _operator: string): NonPayableTransactionObject<boolean>; transferFees(_id: number | string | BN, _value: number | string | BN, _from: string, _to: string): NonPayableTransactionObject<{ _transferValue: string; _minTransferValue: string; _transferFeeCurrency: string; _fee: string; _maxFee: string; 0: string; 1: string; 2: string; 3: string; 4: string; }>; createTrade(_askingIds: (number | string | BN)[], _askingValues: (number | string | BN)[], _offeringIds: (number | string | BN)[], _offeringValues: (number | string | BN)[], _secondParty: string): NonPayableTransactionObject<void>; tradeCompletable(_id: number | string | BN): NonPayableTransactionObject<string>; completeTrade(_id: number | string | BN): NonPayableTransactionObject<void>; cancelTrade(_id: number | string | BN): NonPayableTransactionObject<void>; melt(_ids: (number | string | BN)[], _values: (number | string | BN)[]): NonPayableTransactionObject<void>; ownerOf(_id: number | string | BN): NonPayableTransactionObject<string>; setURI(_id: number | string | BN, _uri: string): NonPayableTransactionObject<void>; uri(_id: number | string | BN): NonPayableTransactionObject<string>; nonFungibleCount(_id: number | string | BN): NonPayableTransactionObject<string>; nonFungibleByIndex(_id: number | string | BN, _index: number | string | BN): NonPayableTransactionObject<string>; nonFungibleOfOwnerByIndex(_id: number | string | BN, _owner: string, _index: number | string | BN): NonPayableTransactionObject<string>; isNonFungible(_id: number | string | BN): NonPayableTransactionObject<boolean>; isContract(_addr: string): NonPayableTransactionObject<boolean>; releaseERC20(_erc20ContractAddress: string, _to: string, _value: number | string | BN): NonPayableTransactionObject<void>; releaseETH(_to: string, _value: number | string | BN): NonPayableTransactionObject<void>; releaseERC721(_erc721ContractAddress: string, _to: string, _token: number | string | BN): NonPayableTransactionObject<void>; releaseERC1155(_erc1155ContractAddress: string, _to: string, _id: number | string | BN, _value: number | string | BN): NonPayableTransactionObject<void>; initialize(_storage: string, _oldContract: string): NonPayableTransactionObject<void>; retire(_nextContract: string): NonPayableTransactionObject<void>; }; events: { Approval(cb?: Callback<Approval>): EventEmitter; Approval(options?: EventOptions, cb?: Callback<Approval>): EventEmitter; Initialize(cb?: Callback<Initialize>): EventEmitter; Initialize(options?: EventOptions, cb?: Callback<Initialize>): EventEmitter; Retire(cb?: Callback<Retire>): EventEmitter; Retire(options?: EventOptions, cb?: Callback<Retire>): EventEmitter; Log(cb?: Callback<Log>): EventEmitter; Log(options?: EventOptions, cb?: Callback<Log>): EventEmitter; UpdateDecimals(cb?: Callback<UpdateDecimals>): EventEmitter; UpdateDecimals(options?: EventOptions, cb?: Callback<UpdateDecimals>): EventEmitter; UpdateName(cb?: Callback<UpdateName>): EventEmitter; UpdateName(options?: EventOptions, cb?: Callback<UpdateName>): EventEmitter; UpdateSymbol(cb?: Callback<UpdateSymbol>): EventEmitter; UpdateSymbol(options?: EventOptions, cb?: Callback<UpdateSymbol>): EventEmitter; SetURI(cb?: Callback<SetURI>): EventEmitter; SetURI(options?: EventOptions, cb?: Callback<SetURI>): EventEmitter; Assign(cb?: Callback<Assign>): EventEmitter; Assign(options?: EventOptions, cb?: Callback<Assign>): EventEmitter; AcceptAssignment(cb?: Callback<AcceptAssignment>): EventEmitter; AcceptAssignment(options?: EventOptions, cb?: Callback<AcceptAssignment>): EventEmitter; Create(cb?: Callback<Create>): EventEmitter; Create(options?: EventOptions, cb?: Callback<Create>): EventEmitter; Mint(cb?: Callback<Mint>): EventEmitter; Mint(options?: EventOptions, cb?: Callback<Mint>): EventEmitter; UpdateMaxMeltFee(cb?: Callback<UpdateMaxMeltFee>): EventEmitter; UpdateMaxMeltFee(options?: EventOptions, cb?: Callback<UpdateMaxMeltFee>): EventEmitter; UpdateMeltFee(cb?: Callback<UpdateMeltFee>): EventEmitter; UpdateMeltFee(options?: EventOptions, cb?: Callback<UpdateMeltFee>): EventEmitter; OperatorApproval(cb?: Callback<OperatorApproval>): EventEmitter; OperatorApproval(options?: EventOptions, cb?: Callback<OperatorApproval>): EventEmitter; Transfer(cb?: Callback<Transfer>): EventEmitter; Transfer(options?: EventOptions, cb?: Callback<Transfer>): EventEmitter; TransferFee(cb?: Callback<TransferFee>): EventEmitter; TransferFee(options?: EventOptions, cb?: Callback<TransferFee>): EventEmitter; UpdateMaxTransferFee(cb?: Callback<UpdateMaxTransferFee>): EventEmitter; UpdateMaxTransferFee(options?: EventOptions, cb?: Callback<UpdateMaxTransferFee>): EventEmitter; UpdateTransferable(cb?: Callback<UpdateTransferable>): EventEmitter; UpdateTransferable(options?: EventOptions, cb?: Callback<UpdateTransferable>): EventEmitter; UpdateTransferFee(cb?: Callback<UpdateTransferFee>): EventEmitter; UpdateTransferFee(options?: EventOptions, cb?: Callback<UpdateTransferFee>): EventEmitter; Whitelist(cb?: Callback<Whitelist>): EventEmitter; Whitelist(options?: EventOptions, cb?: Callback<Whitelist>): EventEmitter; Melt(cb?: Callback<Melt>): EventEmitter; Melt(options?: EventOptions, cb?: Callback<Melt>): EventEmitter; DeployERCAdapter(cb?: Callback<DeployERCAdapter>): EventEmitter; DeployERCAdapter(options?: EventOptions, cb?: Callback<DeployERCAdapter>): EventEmitter; CreateTrade(cb?: Callback<CreateTrade>): EventEmitter; CreateTrade(options?: EventOptions, cb?: Callback<CreateTrade>): EventEmitter; CompleteTrade(cb?: Callback<CompleteTrade>): EventEmitter; CompleteTrade(options?: EventOptions, cb?: Callback<CompleteTrade>): EventEmitter; CancelTrade(cb?: Callback<CancelTrade>): EventEmitter; CancelTrade(options?: EventOptions, cb?: Callback<CancelTrade>): EventEmitter; allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter; }; once(event: "Approval", cb: Callback<Approval>): void; once(event: "Approval", options: EventOptions, cb: Callback<Approval>): void; once(event: "Initialize", cb: Callback<Initialize>): void; once(event: "Initialize", options: EventOptions, cb: Callback<Initialize>): void; once(event: "Retire", cb: Callback<Retire>): void; once(event: "Retire", options: EventOptions, cb: Callback<Retire>): void; once(event: "Log", cb: Callback<Log>): void; once(event: "Log", options: EventOptions, cb: Callback<Log>): void; once(event: "UpdateDecimals", cb: Callback<UpdateDecimals>): void; once(event: "UpdateDecimals", options: EventOptions, cb: Callback<UpdateDecimals>): void; once(event: "UpdateName", cb: Callback<UpdateName>): void; once(event: "UpdateName", options: EventOptions, cb: Callback<UpdateName>): void; once(event: "UpdateSymbol", cb: Callback<UpdateSymbol>): void; once(event: "UpdateSymbol", options: EventOptions, cb: Callback<UpdateSymbol>): void; once(event: "SetURI", cb: Callback<SetURI>): void; once(event: "SetURI", options: EventOptions, cb: Callback<SetURI>): void; once(event: "Assign", cb: Callback<Assign>): void; once(event: "Assign", options: EventOptions, cb: Callback<Assign>): void; once(event: "AcceptAssignment", cb: Callback<AcceptAssignment>): void; once(event: "AcceptAssignment", options: EventOptions, cb: Callback<AcceptAssignment>): void; once(event: "Create", cb: Callback<Create>): void; once(event: "Create", options: EventOptions, cb: Callback<Create>): void; once(event: "Mint", cb: Callback<Mint>): void; once(event: "Mint", options: EventOptions, cb: Callback<Mint>): void; once(event: "UpdateMaxMeltFee", cb: Callback<UpdateMaxMeltFee>): void; once(event: "UpdateMaxMeltFee", options: EventOptions, cb: Callback<UpdateMaxMeltFee>): void; once(event: "UpdateMeltFee", cb: Callback<UpdateMeltFee>): void; once(event: "UpdateMeltFee", options: EventOptions, cb: Callback<UpdateMeltFee>): void; once(event: "OperatorApproval", cb: Callback<OperatorApproval>): void; once(event: "OperatorApproval", options: EventOptions, cb: Callback<OperatorApproval>): void; once(event: "Transfer", cb: Callback<Transfer>): void; once(event: "Transfer", options: EventOptions, cb: Callback<Transfer>): void; once(event: "TransferFee", cb: Callback<TransferFee>): void; once(event: "TransferFee", options: EventOptions, cb: Callback<TransferFee>): void; once(event: "UpdateMaxTransferFee", cb: Callback<UpdateMaxTransferFee>): void; once(event: "UpdateMaxTransferFee", options: EventOptions, cb: Callback<UpdateMaxTransferFee>): void; once(event: "UpdateTransferable", cb: Callback<UpdateTransferable>): void; once(event: "UpdateTransferable", options: EventOptions, cb: Callback<UpdateTransferable>): void; once(event: "UpdateTransferFee", cb: Callback<UpdateTransferFee>): void; once(event: "UpdateTransferFee", options: EventOptions, cb: Callback<UpdateTransferFee>): void; once(event: "Whitelist", cb: Callback<Whitelist>): void; once(event: "Whitelist", options: EventOptions, cb: Callback<Whitelist>): void; once(event: "Melt", cb: Callback<Melt>): void; once(event: "Melt", options: EventOptions, cb: Callback<Melt>): void; once(event: "DeployERCAdapter", cb: Callback<DeployERCAdapter>): void; once(event: "DeployERCAdapter", options: EventOptions, cb: Callback<DeployERCAdapter>): void; once(event: "CreateTrade", cb: Callback<CreateTrade>): void; once(event: "CreateTrade", options: EventOptions, cb: Callback<CreateTrade>): void; once(event: "CompleteTrade", cb: Callback<CompleteTrade>): void; once(event: "CompleteTrade", options: EventOptions, cb: Callback<CompleteTrade>): void; once(event: "CancelTrade", cb: Callback<CancelTrade>): void; once(event: "CancelTrade", options: EventOptions, cb: Callback<CancelTrade>): void; }