Module: @moralisweb3/common-sol-utils
moralis-monorepo / @moralisweb3/common-sol-utils
Module: @moralisweb3/common-sol-utils
Table of contents
DataType Classes
Other Classes
Variables
- CommonSolUtilsConfig
- getBalanceOperation
- getNFTMetadataOperation
- getNFTsOperation
- getPortfolioOperation
- getSPLOperation
- getTokenPriceOperation
- operations
Type Aliases
- GetBalanceJSONRequest
- GetBalanceResponse
- GetNFTMetadataJSONRequest
- GetNFTMetadataResponse
- GetNFTsJSONRequest
- GetNFTsResponse
- GetPortfolioJSONRequest
- GetPortfolioResponse
- GetSPLJSONRequest
- GetSPLResponse
- GetTokenPriceJSONRequest
- GetTokenPriceResponse
- SolAddressish
- SolNativeUnit
- SolNativeish
- SolNetworkName
- SolNetworkNameish
- SolNetworkish
Interfaces
- GetBalanceJSONResponse
- GetBalanceRequest
- GetBalanceResponseAdapter
- GetNFTMetadataJSONResponse
- GetNFTMetadataRequest
- GetNFTMetadataResponseAdapter
- GetNFTsJSONResponse
- GetNFTsRequest
- GetNFTsResponseAdapter
- GetPortfolioJSONResponse
- GetPortfolioRequest
- GetPortfolioResponseAdapter
- GetSPLJSONResponse
- GetSPLRequest
- GetSPLResponseAdapter
- GetTokenPriceJSONResponse
- GetTokenPriceRequest
- GetTokenPriceResponseAdapter
Variables
CommonSolUtilsConfig
• Const
CommonSolUtilsConfig: Object
Type declaration
Name | Type |
---|---|
defaultSolNetwork | ConfigKey <SolNetworkish > |
getBalanceOperation
• Const
getBalanceOperation: Operation
<GetBalanceRequest
, GetBalanceJSONRequest
, GetBalanceResponse
, GetBalanceJSONResponse
>
Gets native balance owned by the given network and address
getNFTMetadataOperation
• Const
getNFTMetadataOperation: Operation
<GetNFTMetadataRequest
, GetNFTMetadataJSONRequest
, GetNFTMetadataResponse
, GetNFTMetadataJSONResponse
>
Gets the contract level metadata (mint, standard, name, symbol, metaplex) for the given network and contract
getNFTsOperation
• Const
getNFTsOperation: Operation
<GetNFTsRequest
, GetNFTsJSONRequest
, any
[], GetNFTsJSONResponse
>
Gets NFTs owned by the given network and address
getPortfolioOperation
• Const
getPortfolioOperation: Operation
<GetPortfolioRequest
, GetPortfolioJSONRequest
, GetPortfolioResponse
, GetPortfolioJSONResponse
>
Gets the portfolio of the given network and address
getSPLOperation
• Const
getSPLOperation: Operation
<GetSPLRequest
, GetSPLJSONRequest
, any
[], GetSPLJSONResponse
>
Gets token balances owned by the given network and address
getTokenPriceOperation
• Const
getTokenPriceOperation: Operation
<GetTokenPriceRequest
, GetTokenPriceJSONRequest
, GetTokenPriceResponse
, GetTokenPriceJSONResponse
>
Gets the token price (usd and native) for a given contract address and network
operations
• Const
operations: (Operation
<GetBalanceRequest
, { address
: string
; network
: "mainnet"
| "devnet"
}, SolNative
, GetBalanceJSONResponse
> | Operation
<GetNFTsRequest
, { address
: string
; network
: "mainnet"
| "devnet"
}, { associatedTokenAddress
: SolAddress
; mint
: SolAddress
}[], GetNFTsJSONResponse
> | Operation
<GetPortfolioRequest
, { address
: string
; network
: "mainnet"
| "devnet"
}, { nativeBalance
: SolNative
; nfts
: { associatedTokenAddress
: SolAddress
; mint
: SolAddress
}[] ; tokens
: { amount
: SolNative
; associatedTokenAddress
: SolAddress
; mint
: SolAddress
}[] }, GetPortfolioJSONResponse
> | Operation
<GetNFTMetadataRequest
, { address
: string
; network
: "mainnet"
| "devnet"
}, { metaplex
: { isMutable
: boolean
= jsonResponse.metaplex.isMutable; masterEdition
: boolean
= jsonResponse.metaplex.masterEdition; metadataUri
: string
= jsonResponse.metaplex.metadataUri; primarySaleHappened
: boolean
= jsonResponse.metaplex.primarySaleHappened; sellerFeeBasisPoints
: number
= jsonResponse.metaplex.sellerFeeBasisPoints; updateAuthority
: SolAddress
} ; mint
: SolAddress
; name
: string
= jsonResponse.name; standard
: string
= jsonResponse.standard; symbol
: string
= jsonResponse.symbol }, GetNFTMetadataJSONResponse
> | Operation
<GetTokenPriceRequest
, { address
: string
; network
: "mainnet"
| "devnet"
}, { exchangeAddress
: SolAddress
; exchangeName
: string
= jsonResponse.exchangeName; nativePrice
: { decimals
: number
= jsonResponse.nativePrice.decimals; name
: string
= jsonResponse.nativePrice.name; symbol
: string
= jsonResponse.nativePrice.symbol; value
: SolNative
} ; usdPrice
: number
= jsonResponse.usdPrice }, GetTokenPriceJSONResponse
>)[]
Type Aliases
GetBalanceJSONRequest
Ƭ GetBalanceJSONRequest: ReturnType
<typeof serializeRequest
>
GetBalanceResponse
Ƭ GetBalanceResponse: ReturnType
<typeof deserializeResponse
>
GetNFTMetadataJSONRequest
Ƭ GetNFTMetadataJSONRequest: ReturnType
<typeof serializeRequest
>
GetNFTMetadataResponse
Ƭ GetNFTMetadataResponse: ReturnType
<typeof deserializeResponse
>
GetNFTsJSONRequest
Ƭ GetNFTsJSONRequest: ReturnType
<typeof serializeRequest
>
GetNFTsResponse
Ƭ GetNFTsResponse: ReturnType
<typeof deserializeResponse
>
GetPortfolioJSONRequest
Ƭ GetPortfolioJSONRequest: ReturnType
<typeof serializeRequest
>
GetPortfolioResponse
Ƭ GetPortfolioResponse: ReturnType
<typeof deserializeResponse
>
GetSPLJSONRequest
Ƭ GetSPLJSONRequest: ReturnType
<typeof serializeRequest
>
GetSPLResponse
Ƭ GetSPLResponse: ReturnType
<typeof deserializeResponse
>
GetTokenPriceJSONRequest
Ƭ GetTokenPriceJSONRequest: ReturnType
<typeof serializeRequest
>
GetTokenPriceResponse
Ƭ GetTokenPriceResponse: ReturnType
<typeof deserializeResponse
>
SolAddressish
Ƭ SolAddressish: SolAddress
| string
Valid input for a new SolAddress instance. This can be an existing SolAddress or a valid address string.
Example
"9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
Example
SolAddress.create("9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM")
SolNativeUnit
Ƭ SolNativeUnit: "solana"
| "lamports"
| number
Type containing valid Solana native units
SolNativeish
Ƭ SolNativeish: SolNative
| BigNumberish
Valid input for a new SolNative instance. This can be an existing SolNative or a valid BigNumberish type
SolNetworkName
Ƭ SolNetworkName: typeof solNetworkNames
[number
]
A name of Solana network.
Example
"mainnet"
Example
"devnet"
SolNetworkNameish
Ƭ SolNetworkNameish: SolNetworkName
| string
A name of Solana network.
Example
"mainnet"
Example
"devnet"
SolNetworkish
Ƭ SolNetworkish: SolNetwork
| SolNetworkNameish
Valid input for a new SolNetwork instance. This can be an existing SolNetwork or a valid network name.
Example
"mainnet"
Example
"devnet"
Example
SolNetwork.create("mainnet")