This package has been deprecated

Author message:

WARNING: This project has been moved to @multiversx/sdk-wallet-connect-provider. Use @multiversx/sdk-wallet-connect-provider instead.

@elrondnetwork/erdjs-wallet-connect-provider
TypeScript icon, indicating that this package has built-in type declarations

2.0.3 • Public • Published

Elrond SDK for JavaScript: Wallet Connect provider

Signing provider for dApps: Wallet Connect.

Distribution

npm

Installation

erdjs-wallet-connect-provider is delivered via npm, therefore it can be installed as follows:

npm install @elrondnetwork/erdjs-wallet-connect-provider

Building the library

In order to compile the library, run the following:

npm install
npm run compile

Usage example

const bridgeUrl = "https://bridge.walletconnect.org";

export class MyApp {
    constructor() {
        const callbacks = {
            onClientLogin: async function () {
                alert("onClientLogin()");
            },
            onClientLogout: async function () {
                alert("onClientLogout()");
            }
        };

        this.provider = new WalletConnectProvider(bridgeUrl, callbacks);
    }

    async login() {
        await this.provider.init();
        let connectorUri = await this.provider.login();
        QRCodeModal.open(connectorUri);
    }

    async signTransaction() {
        const transaction = new DummyTransaction(1);
        await this.provider.signTransaction(transaction);
        alert(`Signature = ${transaction.signature}.`);
    }

    async signTransactions() {
        const transactions = [new DummyTransaction(2), new DummyTransaction(3)];
        await this.provider.signTransactions(transactions);
        const signatures = transactions.map(transaction => transaction.signature);
        alert(`Signatures = ${JSON.stringify(signatures, null, 4)}.`);
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @elrondnetwork/erdjs-wallet-connect-provider

Weekly Downloads

18

Version

2.0.3

License

GPL-3.0-or-later

Unpacked Size

31.2 kB

Total Files

26

Last publish

Collaborators

  • lucian.mincu