0.0.42 • Published 2 years ago
@polymedia/suits v0.0.42
Polymedia SuiTS
Sui TypeScript utilities.

Usage
Add SuiTS to your project:
pnpm add @polymedia/suitsUse it in your code, for example:
import { validateAndNormalizeSuiAddress } from '@polymedia/suits';Exports
Constants
const ADDRESS_REGEX- Regular expression to match a normalized Sui address.
Types
type NetworkName- A Sui network name (mainnet/testnet/devnet/localnet).type SuiExplorerItem- A Polymedia Explorer item type (address/object/package/txblock).
API functions
function apiRequestIndexer- Make a request to the Indexer.xyz API (NFTs).
Sui functions
function devInspectAndGetResults- CallSuiClient.devInspectTransactionBlock()and return the results.function devInspectAndGetReturnValues- CallSuiClient.devInspectTransactionBlock()and return the deserialized return values.function fetchAllDynamicFields- Get all dynamic object fields owned by an object.function generateRandomAddress- Generate a random Sui address (for development only).function getCoinOfValue- Get aCoin<T>of a given value from the owner. Handles coin merging and splitting.function getSuiObjectResponseFields- Validate a SuiObjectResponse and return its content.function makeExplorerUrl- Build a Polymedia Explorer URL.function removeLeadingZeros- Remove leading zeros from a Sui address (lossless).function requestSuiFromFaucet- Get SUI from the faucet on localnet/devnet/testnet.function shortenSuiAddress- Abbreviate a Sui address for display purposes (lossy).function validateAndNormalizeSuiAddress- Validate a Sui address and return its normalized form, ornullif invalid.
Classes
class SuiEventFetcher- A tool to fetch the latest Sui events and parse them into custom objects.function fetchEvents- Fetch the latest events. Every time the function is called it looks for events that took place since the last call.
class SuiMultiClient- A tool to make many RPC requests using multiple endpoints.function executeInBatches- ExecuteSuiClientRPC operations in parallel using multiple endpoints.function testEndpoints- Test the latency of various Sui RPC endpoints.
Misc functions
function chunkArray- Split an array into multiple chunks of a certain size.function convertNumberToBigInt- Convert a number to a bigint, scaled to the specified decimals.function convertBigIntToNumber- Convert a bigint to a number, scaled down to the specified decimals.function formatBigInt- Format a bigint into a readable string, scaled down to the specified decimals.function formatNumber- Format a number into a readable string.function log- Log a message including the current date and time.function makeRanges- Generate an array of ranges of a certain size between two numbers.function sleep- Wait for a number of milliseconds.
0.0.42
2 years ago
0.0.41
2 years ago
0.0.40
2 years ago
0.0.39
2 years ago
0.0.38
2 years ago
0.0.37
2 years ago
0.0.36
2 years ago
0.0.35
2 years ago
0.0.34
2 years ago
0.0.32
2 years ago
0.0.33
2 years ago
0.0.31
2 years ago
0.0.30
2 years ago
0.0.28
2 years ago
0.0.29
2 years ago
0.0.26
2 years ago
0.0.27
2 years ago
0.0.25
2 years ago
0.0.21
2 years ago
0.0.22
2 years ago
0.0.23
2 years ago
0.0.24
2 years ago
0.0.20
2 years ago
0.0.19
2 years ago
0.0.18
2 years ago
0.0.17
2 years ago
0.0.16
2 years ago
0.0.14
2 years ago
0.0.15
2 years ago
0.0.13
2 years ago
0.0.11
2 years ago
0.0.12
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.6
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago