UNPKG

opnet

Version:

The perfect library for building Bitcoin-based applications.

112 lines (111 loc) 4.54 kB
import { Address } from '../../../../../node_modules/@btc-vision/transaction/build/index.js'; import { CallResult } from '../../../../contracts/CallResult.js'; import { OPNetEvent } from '../../../../contracts/OPNetEvent.js'; import { DomainSeparator } from './IOP20Contract.js'; import { IOP_NETContract } from './IOP_NETContract.js'; export type TransferredEventNFT = { readonly operator: Address; readonly from: Address; readonly to: Address; readonly amount: bigint; }; export type ApprovedEventNFT = { readonly owner: Address; readonly spender: Address; readonly value: bigint; }; export type ApprovedForAllEventNFT = { readonly account: Address; readonly operator: Address; readonly approved: boolean; }; export type URIEventNFT = { readonly value: string; readonly id: bigint; }; export type NameNFT = CallResult<{ name: string; }, OPNetEvent<never>[]>; export type SymbolNFT = CallResult<{ symbol: string; }, OPNetEvent<never>[]>; export type MaxSupplyNFT = CallResult<{ maxSupply: bigint; }, OPNetEvent<never>[]>; export type TokenURI = CallResult<{ uri: string; }, OPNetEvent<never>[]>; export type TotalSupplyNFT = CallResult<{ totalSupply: bigint; }, OPNetEvent<never>[]>; export type BalanceOfNFT = CallResult<{ balance: bigint; }, OPNetEvent<never>[]>; export type OwnerOfNFT = CallResult<{ owner: Address; }, OPNetEvent<never>[]>; export type SafeTransferFromNFT = CallResult<{}, OPNetEvent<TransferredEventNFT>[]>; export type TransferFromNFT = CallResult<{}, OPNetEvent<TransferredEventNFT>[]>; export type ApproveNFT = CallResult<{}, OPNetEvent<ApprovedEventNFT>[]>; export type GetApprovedNFT = CallResult<{ approved: Address; }, OPNetEvent<never>[]>; export type SetApprovalForAllNFT = CallResult<{}, OPNetEvent<ApprovedForAllEventNFT>[]>; export type IsApprovedForAllNFT = CallResult<{ approved: boolean; }, OPNetEvent<never>[]>; export type TransferBySignatureNFT = CallResult<{}, OPNetEvent<TransferredEventNFT>[]>; export type ApproveBySignatureNFT = CallResult<{}, OPNetEvent<ApprovedEventNFT>[]>; export type BurnNFT = CallResult<{}, OPNetEvent<TransferredEventNFT>[]>; export type TokenOfOwnerByIndex = CallResult<{ tokenId: bigint; }, OPNetEvent<never>[]>; export type GetTransferNonce = CallResult<{ nonce: bigint; }, OPNetEvent<never>[]>; export type GetApproveNonce = CallResult<{ nonce: bigint; }, OPNetEvent<never>[]>; export type SetBaseURI = CallResult<{}, OPNetEvent<URIEventNFT>[]>; export type MetadataNFT = CallResult<{ name: string; symbol: string; icon: string; banner: string; description: string; website: string; totalSupply: bigint; maximumSupply: bigint; domainSeparator: Uint8Array; }, OPNetEvent<never>[]>; export type CollectionInfo = CallResult<{ icon: string; banner: string; description: string; website: string; }, OPNetEvent<never>[]>; export interface IOP721 extends IOP_NETContract { name(): Promise<NameNFT>; symbol(): Promise<SymbolNFT>; maxSupply(): Promise<MaxSupplyNFT>; tokenURI(tokenId: bigint): Promise<TokenURI>; collectionInfo(): Promise<CollectionInfo>; totalSupply(): Promise<TotalSupplyNFT>; metadata(): Promise<MetadataNFT>; balanceOf(owner: Address): Promise<BalanceOfNFT>; ownerOf(tokenId: bigint): Promise<OwnerOfNFT>; safeTransferFrom(from: Address, to: Address, tokenId: bigint, data: Uint8Array): Promise<SafeTransferFromNFT>; transferFrom(from: Address, to: Address, tokenId: bigint): Promise<TransferFromNFT>; approve(to: Address, tokenId: bigint): Promise<ApproveNFT>; getApproved(tokenId: bigint): Promise<GetApprovedNFT>; setApprovalForAll(operator: Address, approved: boolean): Promise<SetApprovalForAllNFT>; isApprovedForAll(owner: Address, operator: Address): Promise<IsApprovedForAllNFT>; transferBySignature(owner: Address, to: Address, tokenId: bigint, deadline: bigint, signature: Uint8Array): Promise<TransferBySignatureNFT>; approveBySignature(owner: Address, spender: Address, tokenId: bigint, deadline: bigint, signature: Uint8Array): Promise<ApproveBySignatureNFT>; burn(tokenId: bigint): Promise<BurnNFT>; domainSeparator(): Promise<DomainSeparator>; tokenOfOwnerByIndex(owner: Address, index: bigint): Promise<TokenOfOwnerByIndex>; getTransferNonce(owner: Address): Promise<GetTransferNonce>; getApproveNonce(owner: Address): Promise<GetApproveNonce>; setBaseURI(baseURI: string): Promise<SetBaseURI>; }