0.3.3 • Published 1 year ago

wagmi-bitkubnext-connector v0.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Wagmi Bitkubnext Connector

Use a bitkubnext wallet as a wagmi connector!

  • BitkubNextConnector - Wagmi connector for bitkubnext
  • BitkubNextCaller - To interact with smart contracts on bitkubnext

Installation

npm install wagmi-bitkubnext-connector

Usage

import { createClient } from "wagmi";
import { BitkubNextConnector, BitkubNextCaller } from "wagmi-bitkubnext-connector";


export const bitkubnextCaller = new BitkubNextCaller({
  clientId: // <YOUR_CLIENT_ID>,
  networkMode: // <YOUR_NETWORK_MODE>,
  oauthRedirectURI: //<YOUR_REDIRECT_URI>,
});

const client = createClient({
  connectors: [
    new BitkubNextConnector({
      options: {
        clientId: // <YOUR_CLIENT_ID>,
        networkMode: // <YOUR_NETWORK_MODE>,
        oauthRedirectURI: //<YOUR_REDIRECT_URI>,
      },
    }),
  ],
});

API

options

KeyValueRequiredExample
networkModetestnet,mainnettruetestnet
clientIdstringtrueXXXXXX
oauthRedirectURIstringtruehttp://localhost:3000/oauth/callback

Set up callback pages

You will need to set up a callback pages before using the connector and caller.

BitkubnextConnector

  1. create a callback page at /pages/oauth/callback.tsx
  2. set up a callback page to receive the access token and login to the wallet.

BitkubNextCaller

  1. create a callback folder /pages/callback
  2. set up these callback pages to send the transaction.

Send transaction

async function handleSendTransaction() {
  await bitkubnextCaller.send({
    contractAddr: "",
    methodName: "",
    methodParams: [""], // don't need to add sender to params
  });
}

Contribute

Feel free to contribute. Pull requests and issues are welcome!

0.3.0

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.2.2

1 year ago

0.3.3

1 year ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago