npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kanalabs/mirai

v0.2.8

Published

Mirai - Account Abstraction SDK (EVM + non-EVM)

Downloads

135

Readme

Mirai

Mirai - Account Abstraction SDK (EVM + non-EVM)

Installation

npm i @kanalabs/mirai

Supported Networks

Mainnets:

- AptosMainnet
- mainnet (Ethereum)
- polygon
- optimism
- linea
- gnosis
- mantle
- avalanche
- base
- bsc
- klaytn
- scroll
- flare
- bifrost

Testnets:

- AptosTestnet
- bscTestnet
- KlaytnTestnet
- ScrollSepolia
- FuseSparknet
- goerli
- mumbai
- sepolia
- flareTestnet
- bifrostTestnet

Available Properties in SDKGateway

| Properties | Description | | --------------- | ------------------------------------------------------- | | instances | Returns all initialized instances | | currentNetwork | Returns the current default network | | currentInstance | Returns the current default SDK instance | | contractAddress | Returns KanaWallet address for initialized chains | | walletProvider | Returns the wallet provider which used to init the sdk | | activeNetworks | Returns available networks with their respective status |

Available Methods in SDKGateway

| Methods | Description | | --------------------------------------------------|--------------------------------------------------------| | initialize(network?: NetworkNames) | To initialize the SDK instance specify a network,and | | | and return the result of initialization. | | getNativeBalance(network?: NetworkNames) | To get the native token balance of the smart wallet. | | | Returns native token balance. | | setCurrentInstance(network: NetworkNames) | To set the default SDK instance and retrieve the SDK | | | instance associated with the specified network. | | erc20(tokenAddress: string,network?: NetworkNames)| To get the ERC20 token instance for building ERC20 | | | transactions. Returns the ERC20 contract instance. | | erc721(collectionAddress: string, | To get the ERC721 collection instance for building | | network?: NetworkNames) | ERC721 transactions.Returns the ERC721 contractinstance| | erc1155(collectionAddress: string, | To get the ERC1155 collection instance for building | | network?: NetworkNames) | ERC1155 transactions. Returns the ERC1155 contract | | instance transactions.Returns the ERC721
| isNetworkActive(networkName: string): boolean | To check if the given network is available and active. | | | Returns bool | | | Example const isActive = isNetworkActive (networkName) | | | transactions. Returns the ERC20 contract instance. | | getProvider(network: NetworkNames) | To get the RPC Provider for the given network. | | providers.JsonRpcProvider | Returns providers.JsonRpcProvider | | | Example const provider = getProvider(networkName) | | destroy(network: NetworkNames) | To destroy the SDK instance specifying a network for | | | destruction, or destroying all instances if no network | | | is provided. | | | Example const provider = getProvider(networkName) | | getAptosInstance(network: NetworkNames) | To get the RPC Provider for the given network. | | | Retrieve the Aptos SDK instance |

Available Methods in SDK

| Methods | Description | | --------------------------------------------------|--------------------------------------------------------| | getCounterFactualAddress(): Promise | To get the KanaWallet address | | signMessage(dto: SignMessageDto): Promise | To sign a message | | getNativeBalance(): Promise | To get the native token balance of the wallet | | getTokenBalance(tokenAddress: string) | To get the ERC20 token balance of the wallet | | : Promise | | | addUserOpsToBatch(tx: UserOpsRequest) | To add transactions to the batch | | : Promise | | | clearUserOpsFromBatch(): Promise | To clear the transactions in the batch | | estimate(gasDetails?: TransactionGasInfoForUserOp)| To estimate transactions added to the batch and get the| | : Promise | fee data for the UserOp | | send(userOp: UserOperationStruct): Promise| To sign the UserOp and send it to the bundler . | | Returns userOp | | createSession(dto?: CreateSessionDto) | To sign create a session | | : Promise | | | getUserOpReceipt(userOpHash: string) | To get the transaction hash | | getGasFee(): Promise | To get the Gas data | | destroy(): void | To destroy the instance |

Helpers

Available Properties in ERC20

| Properties | Description | | ----------------- | ----------------------------------------------------------------- | | name | Returns the name of the token | | symbol | Returns the symbol (ticker) of the token. | | decimals | Returns the number of decimal places that the token uses | | totalSupply | Returns the total supply of the token in its smallest units. | | balanceOf | Returns the token balance of a specific address (owner) | | allowance | Returns the amount of tokens that the spender is allowed to spend | | approve | Allows the owner to approve a spender to spend | | decreaseAllowance | Decreases the amount of tokens that a spender is allowed to spend | | increaseAllowance | Increases the amount of tokens that a spender is allowed | | transfer | Allows the sender to transfer a certain amount of tokens | | transferFrom | Allows the spender to transfer a certain amount of tokens |

Available Properties in ERC721

| Properties | Description | | ----------------- | ------------------------------------------------------------------ | | name | Returns the name of the NFT contract | | symbol | Returns the symbol (ticker) of the NFT contract | | balanceOf | Returns the number of NFTs owned by a specific address (owner). | | ownerof | Returns the address of the owner of a specific NFT identified | | getApproved | Returns the address that has been approved to take ownership | | isApprovedForAll | Returns whether a specific operator address is approved | | tokenURI | Returns the metadata URI associated with a specific NFT identified | | safeTransferFrom | Safely transfers the ownership of a specific NFT from the sender | | transferFrom | Transfers the ownership of a specific NFT | | approve | Approves another address (to) to take ownership of a specific NFT | | setApprovalForAll | Sets or revokes operator status for an address to manage all NFTs |

Available Properties in ERC1155

| Properties | Description | | --------------------- | ---------------------------------------------------------------- | | balanceOf | Returns the amount of tokens of token type id owned by account | | balanceOfBatch | Returns the balances of multiple token IDs for multiple accounts | | setApprovalForAll | Grants permission to operator to transfer tokens | | isApprovedForAll | Returns true if operator is approved to transfer tokens. | | safeTransferFrom | Safely transfers specific token type and quantity | | safeBatchTransferFrom | Safely transfers multiple token types and quantities | | uri | Returns the URI of that tokenId |

Available Properties in DATASERVICE

| Properties | Description | | --------------------- | ---------------------------------------------------------------- | | getAccountBalances | Returns the account balances for the particular address | | getTransaction | Returns the transaction history for the particular transactions | | getNftsList | Returns the nfts list for the particular address |

Available Properties in PAYMASTER

| Properties | Description | | --------------------- | -------------------------------------------------------------------------| | addWhitelist | To add a whitelist using the specified accountAddress and chain ID | | checkWhitelist | To check a whitelist using the specified accountAddress and chain ID | | depositWhitelist | To Deposit using the specified amount and chain ID | | getSponsorBalance | To get a sponsor balance using the specified sponsorAddress and chain ID |