🧑Initialization

Initialize

import { LongshipSDK } from '@traitsniper/wallet-sdk';

const longshipWallet = new LongshipSDK({
        appKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx', // required
        env: 'test', // required, test|prod
        chainType: 'bsc', // required
        // optional
        appSetting: {
            appName: 'your app name',
            appIcon: 'your app logo'
        },
});

SDK Methods

  • login():connect able wallet.

  • logout():disconnect able wallet.

  • isLogin():returns the login status.

  • getAccount():returns the account info(address, email, current chain id,etc).

  • getAddress():returns the address of your account.

  • getProvider():returns current provider that your account is using.

  • sendTransaction():returns the response of transaction.

  • signMessage():returns the signature using personal sign.

  • signTypedData():returns the signature using sign typed data.

  • updateConfig():update current wallet config(env,chain,appSetting).

Get Info of Wallet

getAccount()

This returns the account info(address, email, current chain id,etc).

getAddress()

This returns the address of your account.

getProvider()

This returns current provider that your account is using.

updateConfig()

This update current wallet config(env,chain,appSetting).

logout()

This disconnect able wallet or logout wallet.

Last updated