1.4.4 • Published 11 months ago

@delab-team/connect v1.4.4

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

DeLab Connect

Typescript React TON npm

Modal package with different TON wallets for React JS.

example

Install

  • as local project package
yarn add @delab-team/connect

Usage

possible types of event

  • connect
  • disconnect
  • error
  • error-transaction
  • error-toncoinwallet
  • error-tonhub
  • error-tonkeeper
import {
    DeLabModal,
    DeLabButton,
    DeLabConnect,
    DeLabConnecting,
    DeLabTransaction,
    DeLabEvent
} from '@delab-team/connect'

// DeLabConnect must be created outside of the React Component
const DeLabConnector = new DeLabConnect('https://example.com', 'Example', 'mainnet', 'https://yourapp.com/tonconnect_manifest.json')
// - URL your DApp
// - Name your DApp
// - network
// - tonconnect-manifest (optional)

DeLabConnector.on('connect', (data: DeLabEvent) => {
    const connectConfig: DeLabConnecting = data.data
    const trans: DeLabTransaction = {
        to: 'EQCkR1cGmnsE45N4K0otPl5EnxnRakmGqeJUNua5fkWhales',
        value: '1000000' // string value in nano-coins
    }
    const data = await DeLabConnector.sendTransaction(trans)
})

DeLabConnector.on('disconnect', () => {
    console.log('disconect')
})

// Use loadWallet() after the subscriptions are installed
DeLabConnector.loadWallet()

DeLabModal must be children of the root React Component

// supported scheme: 'light' | 'dark'
<DeLabButton DeLabConnectObject={DeLabConnector} scheme={'dark'} />
// ...
<DeLabModal DeLabConnectObject={DeLabConnector} scheme={'dark'} />

License

MIT License Copyright (c) 2022 DeLab Team

1.4.4

11 months ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.3.2

1 year ago

1.4.0

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago