Class Ylide

Description

It's a singleton entry point to all interactions with Ylide SDK

Example

import { Ylide } from '@ylide/sdk';
import { tvm } from '@ylide/everscale';

const keysRegistry = new YlideKeysRegistry();
const ylide = new Ylide(keysRegistry);
ylide.add(tvm);

const wallet = await ylide.instantiateWallet('everscale', 'everwallet');

const account = await wallet.getAuthenticatedAccount();

Hierarchy

  • Ylide

Constructors

  • Parameters

    • Optional keysRegistry: YlideKeysRegistry

      Reference to YlideKeysRegistry instance

    • Optional indexerBlockchains: string[]

      Array of blockchains that should be firstly read from Indexer. Omit if you want to use defaults

    Returns Ylide

Properties

_blockchainFactories: BlockchainMap<BlockchainControllerFactory> = {}
_blockchainToGroupMap: Record<string, string> = {}
_isVerbose: boolean = false
auth: YlideAuth
controllers: YlideControllers
core: YlideCore
keysRegistry: YlideKeysRegistry
mailbox: YlideMailbox

Accessors

  • get blockchainToGroupMap(): Record<string, string>
  • Description

    Getter of blockchain to blockchain group map. Like "ETHEREUM" -> "evm", "GNOSIS" => "evm"

    Returns Record<string, string>

  • get blockchainsList(): {
        blockchain: string;
        factory: BlockchainControllerFactory;
    }[]
  • Method to get registered blockchain controllers

    Example

    const ethereumChains = ylide.blockchainsList.filter(t => t.blockchain === 'ethereum');
    

    Returns {
        blockchain: string;
        factory: BlockchainControllerFactory;
    }[]

  • get isVerbose(): boolean
  • Description

    This method is used to check if SDK is verbose.

    Returns boolean

  • get walletsList(): {
        blockchainGroup: string;
        factory: WalletControllerFactory;
        wallet: string;
    }[]
  • Getter for the registered wallet controllers

    Example

    const evmWallets = ylide.walletsList.filter(t => t.blockchainGroup === 'evm');
    

    Returns {
        blockchainGroup: string;
        factory: WalletControllerFactory;
        wallet: string;
    }[]

Methods

  • Method to add all available crypto-wallets and blockchains of the certain connector in Ylide.

    Parameters

    • scope: ConnectorScope

      Connector scope got from the corresponding library, e.g. evm/tvm

    Returns void

  • Method to get a list of registered wallet controllers that are available in the user's browser (wallets installed)

    Example

    const availableWallets = await ylide.getAvailableWallets();
    

    Returns Promise<WalletControllerFactory[]>

  • Method to get wallet controller factory for a certain blockchain group and wallet type

    Parameters

    • blockchainGroup: string

      Name of the blockchain group

    • wallet: string

      Name of in-browser wallet

    Returns WalletControllerFactory

  • Method to instantiate blockchain controller

    Example

    const blockchainController = await ylide.instantiateBlockchain('everscale');

    const isMyAddressValid = blockchainController.isAddressValid('0:81f452f5aec2263ab10116f7108a20209d5051081bb3caed34f139f976a0e279');

    Parameters

    • blockchain: string
    • Optional options: any

    Returns Promise<AbstractBlockchainController>

  • Method to instantiate wallet controller

    Example

    const wallet = await ylide.instantiateWallet('everscale', 'everwallet');

    const account = await wallet.getAuthenticatedAccount();

    Parameters

    • blockchainGroup: string
    • wallet: string
    • Optional options: any

    Returns Promise<AbstractWalletController>

  • Method to check availability of a certain blockchain connector

    Example

    ylide.isBlockchainRegistered('everscale'); // return true if `ylide.registerBlockchain` was called with this blockchain controller factory before
    

    Parameters

    • blockchain: string

      Name of blockchain you want to check

    Returns boolean

  • Method to check availability of a certain blockchain for sending messages

    Example

    ylide.isWalletRegistered('everscale', 'everwallet'); // return true if `Ylide.registerWallet` was called with this wallet factory before
    

    Parameters

    • blockchain: string

      Name of blockchain you want to check

    • wallet: string

    Returns boolean

  • Use this method to register certain blockchain connector in Ylide.

    Example

    import { everscaleBlockchainFactory } from '@ylide/everscale';

    ylide.registerBlockchain(everscaleBlockchainFactory);

    Parameters

    Returns void

  • Use this method to register certain crypto-wallet connector in Ylide.

    Example

    import { everscaleWalletFactory } from '@ylide/everscale';

    ylide.registerWallet(everscaleWalletFactory);

    Parameters

    Returns void

  • Description

    This method is used to make SDK silent. It means that all extra logs will be hidden.

    Returns void

  • Description

    This method is used to make SDK verbose. It means that all extra logs will be printed to console.

    Returns void

  • Parameters

    • Rest ...args: any[]

    Returns (() => void)

      • (): void
      • Returns void

Generated using TypeDoc