public class Cis2Client extends Object
Modifier and Type | Method and Description |
---|---|
Map<BalanceQuery,TokenAmount> |
balanceOf(BalanceQuery... queries)
Query the balance of token ids and associated
AbstractAddress |
ClientV2 |
getClient() |
ContractAddress |
getContractAddress() |
InitName |
getContractName() |
Iterator<Cis2EventWithMetadata> |
getEvents(BlockQuery from,
BlockQuery to)
Retrieve all events emitted from the CIS2 contract.
|
Iterator<Cis2EventWithMetadata> |
getEventsFor(BlockQuery... queries)
Get any events associated emitted from the specified CIS2 contract.
|
Iterator<Cis2EventWithMetadata> |
getEventsForFinalizedTransaction(Hash transactionHash)
Get any events associated emitted from the specified CIS2 contract by the
supplied transaction hash.
|
static Cis2Client |
newClient(ClientV2 client,
ContractAddress address)
|
Map<OperatorQuery,Boolean> |
operatorOf(OperatorQuery... queries)
Query whether one or more owners are operators for one or more addresses.
|
Map<TokenId,TokenMetadata> |
tokenMetadata(TokenId... tokenIds)
Query the token metadata for each provided token id
|
Hash |
transfer(AccountAddress sender,
TransactionSigner signer,
Energy maxEnergyCost,
Cis2Transfer... transfers)
Perform a CIS2 transfer on the contract.
|
Hash |
updateOperator(AccountAddress sender,
TransactionSigner signer,
Energy maxEnergyCost,
Map<AbstractAddress,Boolean> operatorUpdates)
Update the addresses of which the owner (sender of this transaction) operates.
|
public static Cis2Client newClient(ClientV2 client, ContractAddress address)
client
- client to useaddress
- the address of the cis 2 contractpublic Hash transfer(AccountAddress sender, TransactionSigner signer, Energy maxEnergyCost, Cis2Transfer... transfers)
sender
- address of the sender of the transaction.signer
- signer of the transaction.transfers
- the CIS2 transfers.public Hash updateOperator(AccountAddress sender, TransactionSigner signer, Energy maxEnergyCost, Map<AbstractAddress,Boolean> operatorUpdates)
operatorUpdates
- the updates to carry out. The keys of the map correspond to the
addresses which the sender (owner) should or should not operate given
by the provided boolean.public Map<BalanceQuery,TokenAmount> balanceOf(BalanceQuery... queries)
AbstractAddress
queries
- the token ids and addresses to querypublic Map<OperatorQuery,Boolean> operatorOf(OperatorQuery... queries)
queries
- the addresses to query.public Map<TokenId,TokenMetadata> tokenMetadata(TokenId... tokenIds)
tokenIds
- the token ids to queryTokenId
public Iterator<Cis2EventWithMetadata> getEvents(BlockQuery from, BlockQuery to)
from
- block to start fromto
- block to end frompublic Iterator<Cis2EventWithMetadata> getEventsFor(BlockQuery... queries)
queries
- blocks to querypublic Iterator<Cis2EventWithMetadata> getEventsForFinalizedTransaction(Hash transactionHash)
transactionHash
- the hash of the transaction to query outcome for.IllegalArgumentException
- if the transaction was not finalized.public ClientV2 getClient()
public ContractAddress getContractAddress()
public InitName getContractName()
Copyright © 2025. All rights reserved.