High-level API
Initialization
PhantasmaAPI(string host, RpcClient? rpcClient)
PhantasmaAPI(string host, RpcClient? rpcClient)Dispose()
Dispose()Account
Task<AccountResult?> GetAccountAsync(string address)
Task<AccountResult?> GetAccountAsync(string address)Task<AccountResult[]?> GetAccountsAsync(string[] addresses)
Task<AccountResult[]?> GetAccountsAsync(string[] addresses)Task<string?> LookUpNameAsync(string name)
Task<string?> LookUpNameAsync(string name)Task<CursorPaginatedResult<BalanceResult[]>?> GetAccountFungibleTokensAsync(string account, string tokenSymbol = "", ulong carbonTokenId = 0, uint pageSize = 10, string cursor = "", bool checkAddressReservedByte = true)
Task<CursorPaginatedResult<BalanceResult[]>?> GetAccountFungibleTokensAsync(string account, string tokenSymbol = "", ulong carbonTokenId = 0, uint pageSize = 10, string cursor = "", bool checkAddressReservedByte = true)Task<CursorPaginatedResult<TokenDataResult[]>?> GetAccountNFTsAsync(string account, string tokenSymbol = "", ulong carbonTokenId = 0, uint carbonSeriesId = 0, uint pageSize = 10, string cursor = "", bool extended = false, bool checkAddressReservedByte = true)
Task<CursorPaginatedResult<TokenDataResult[]>?> GetAccountNFTsAsync(string account, string tokenSymbol = "", ulong carbonTokenId = 0, uint carbonSeriesId = 0, uint pageSize = 10, string cursor = "", bool extended = false, bool checkAddressReservedByte = true)Task<CursorPaginatedResult<TokenResult[]>?> GetAccountOwnedTokensAsync(string account, string tokenSymbol = "", ulong carbonTokenId = 0, uint pageSize = 10, string cursor = "", bool checkAddressReservedByte = true)
Task<CursorPaginatedResult<TokenResult[]>?> GetAccountOwnedTokensAsync(string account, string tokenSymbol = "", ulong carbonTokenId = 0, uint pageSize = 10, string cursor = "", bool checkAddressReservedByte = true)Task<CursorPaginatedResult<TokenSeriesResult[]>?> GetAccountOwnedTokenSeriesAsync(string account, string tokenSymbol = "", ulong carbonTokenId = 0, uint pageSize = 10, string cursor = "", bool checkAddressReservedByte = true)
Task<CursorPaginatedResult<TokenSeriesResult[]>?> GetAccountOwnedTokenSeriesAsync(string account, string tokenSymbol = "", ulong carbonTokenId = 0, uint pageSize = 10, string cursor = "", bool checkAddressReservedByte = true)Auction
Task<int> GetAuctionsCountAsync(string chainAddressOrName, string symbol)
Task<int> GetAuctionsCountAsync(string chainAddressOrName, string symbol)Task<(AuctionResult[]? result, uint page, uint total, uint totalPages)> GetAuctionsAsync(string chainAddressOrName, string symbol, uint page, uint pageSize)
Task<(AuctionResult[]? result, uint page, uint total, uint totalPages)> GetAuctionsAsync(string chainAddressOrName, string symbol, uint page, uint pageSize)Task<AuctionResult?> GetAuctionAsync(string chainAddressOrName, string symbol, string id)
Task<AuctionResult?> GetAuctionAsync(string chainAddressOrName, string symbol, string id)Block
Task<long> GetBlockHeightAsync(string chain)
Task<long> GetBlockHeightAsync(string chain)Task<int> GetBlockTransactionCountByHashAsync(string chainAddressOrName, string blockHash)
Task<int> GetBlockTransactionCountByHashAsync(string chainAddressOrName, string blockHash)Task<BlockResult?> GetBlockByHashAsync(string blockHash)
Task<BlockResult?> GetBlockByHashAsync(string blockHash)Task<BlockResult?> GetBlockByHeightAsync(string chain, long height)
Task<BlockResult?> GetBlockByHeightAsync(string chain, long height)Task<BlockResult?> GetLatestBlockAsync(string chain)
Task<BlockResult?> GetLatestBlockAsync(string chain)Task<TransactionResult?> GetTransactionByBlockHashAndIndexAsync(string blockHash, int index)
Task<TransactionResult?> GetTransactionByBlockHashAndIndexAsync(string blockHash, int index)Chain
Task<ChainResult[]?> GetChainsAsync()
Task<ChainResult[]?> GetChainsAsync()Task<ChainResult?> GetChainAsync(string name = "main", bool extended = true)
Task<ChainResult?> GetChainAsync(string name = "main", bool extended = true)Contract
Task<ContractResult?> GetContractAsync(string contractName)
Task<ContractResult?> GetContractAsync(string contractName)Task<ContractResult?> GetContractByAddressAsync(string chainAddressOrName, string contractAddress)
Task<ContractResult?> GetContractByAddressAsync(string chainAddressOrName, string contractAddress)Task<ContractResult[]?> GetContractsAsync()
Task<ContractResult[]?> GetContractsAsync()Leaderboard
Task<LeaderboardResult?> GetLeaderboardAsync(string name)
Task<LeaderboardResult?> GetLeaderboardAsync(string name)Nexus
Task<NexusResult?> GetNexusAsync()
Task<NexusResult?> GetNexusAsync()Organization
Task<OrganizationResult?> GetOrganizationAsync(string id)
Task<OrganizationResult?> GetOrganizationAsync(string id)Task<OrganizationResult?> GetOrganizationByNameAsync(string name)
Task<OrganizationResult?> GetOrganizationByNameAsync(string name)Task<OrganizationResult[]?> GetOrganizationsAsync()
Task<OrganizationResult[]?> GetOrganizationsAsync()Token
Task<TokenResult?> GetTokenAsync(string symbol)
Task<TokenResult?> GetTokenAsync(string symbol)Task<TokenResult?> GetTokenAsync(string symbol, bool extended, ulong carbonTokenId)
Task<TokenResult?> GetTokenAsync(string symbol, bool extended, ulong carbonTokenId)Task<TokenResult[]?> GetTokensAsync()
Task<TokenResult[]?> GetTokensAsync()Task<TokenResult[]?> GetTokensAsync(bool extended, string? ownerAddress = null)
Task<TokenResult[]?> GetTokensAsync(bool extended, string? ownerAddress = null)Task<CursorPaginatedResult<TokenSeriesResult[]>?> GetTokenSeriesAsync(string symbol = "", ulong carbonTokenId = 0, uint pageSize = 10, string cursor = "")
Task<CursorPaginatedResult<TokenSeriesResult[]>?> GetTokenSeriesAsync(string symbol = "", ulong carbonTokenId = 0, uint pageSize = 10, string cursor = "")Task<CursorPaginatedResult<TokenDataResult[]>?> GetTokenNFTsAsync(ulong carbonTokenId, uint carbonSeriesId = 0, uint pageSize = 10, string cursor = "", bool extended = false)
Task<CursorPaginatedResult<TokenDataResult[]>?> GetTokenNFTsAsync(ulong carbonTokenId, uint carbonSeriesId = 0, uint pageSize = 10, string cursor = "", bool extended = false)Task<BalanceResult?> GetTokenBalanceAsync(string address, string symbol, string chain = "main")
Task<BalanceResult?> GetTokenBalanceAsync(string address, string symbol, string chain = "main")Task<TokenDataResult?> GetTokenDataAsync(string symbol, string tokenId)
Task<TokenDataResult?> GetTokenDataAsync(string symbol, string tokenId)Task<TokenDataResult?> GetNFTAsync(string symbol, string tokenId, bool loadProperties)
Task<TokenDataResult?> GetNFTAsync(string symbol, string tokenId, bool loadProperties)Task<TokenDataResult[]?> GetNFTsAsync(string symbol, IEnumerable<string> tokenIds, bool extended = false)
Task<TokenDataResult[]?> GetNFTsAsync(string symbol, IEnumerable<string> tokenIds, bool extended = false)Transactions
Task<(AccountTransactionsResult? result, uint page, uint totalPages)> GetAddressTransactionsAsync(string address, uint page, uint pageSize)
Task<(AccountTransactionsResult? result, uint page, uint totalPages)> GetAddressTransactionsAsync(string address, uint page, uint pageSize)Task<int> GetAddressTransactionCountAsync(string address, string chain)
Task<int> GetAddressTransactionCountAsync(string address, string chain)Task<TransactionResult?> GetTransactionAsync(string txHash)
Task<TransactionResult?> GetTransactionAsync(string txHash)Task<string?> SendRawTransactionAsync(string txData)
Task<string?> SendRawTransactionAsync(string txData)Task<string?> SendCarbonTransactionAsync(string txData)
Task<string?> SendCarbonTransactionAsync(string txData)Task<ScriptResult?> InvokeRawScriptAsync(string chain, string scriptData)
Task<ScriptResult?> InvokeRawScriptAsync(string chain, string scriptData)Task<string?> SignAndSendCarbonTransactionAsync(IKeyPair keys, TxMsg txMsg)
Task<string?> SignAndSendCarbonTransactionAsync(IKeyPair keys, TxMsg txMsg)Task<string?> SignAndSendTransactionAsync(IKeyPair keys, string nexus, byte[] script, string chain, string payload, Func<byte[], byte[], byte[], byte[]>? customSignFunction = null)
Task<string?> SignAndSendTransactionAsync(IKeyPair keys, string nexus, byte[] script, string chain, string payload, Func<byte[], byte[], byte[], byte[]>? customSignFunction = null)Task<string?> SignAndSendTransactionAsync(IKeyPair keys, string nexus, byte[] script, string chain, byte[] payload, Func<byte[], byte[], byte[], byte[]>? customSignFunction = null)
Task<string?> SignAndSendTransactionAsync(IKeyPair keys, string nexus, byte[] script, string chain, byte[] payload, Func<byte[], byte[], byte[], byte[]>? customSignFunction = null)Storage
Task<ArchiveResult?> GetArchiveAsync(string hash)
Task<ArchiveResult?> GetArchiveAsync(string hash)Task<bool> WriteArchiveAsync(string hash, int blockIndex, byte[] blockContent)
Task<bool> WriteArchiveAsync(string hash, int blockIndex, byte[] blockContent)Task<string?> ReadArchiveAsync(string hash, int blockIndex)
Task<string?> ReadArchiveAsync(string hash, int blockIndex)Validation helpers
static bool IsValidPrivateKey(string key)
static bool IsValidPrivateKey(string key)static bool IsValidAddress(string address)
static bool IsValidAddress(string address)Last updated