0.0.1 • Published 1 year ago

@metasky/metasky-js v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Metasky UI

This library helps you to integrate Metasky Wallet in your project. Metasky wallet supports multiple blockchains and provide easy way to get started with integrating both custodial and non-custodial wallet with few lines of code.

Installation

You can install this library via NPM or YARN.

NPM

  npm i @metasky/metasky-js

YARN

  yarn add @metasky/metasky-js

Example Integration

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Metasky</title>
    <script src="./dist/main.js"></script>
    <script>
      function openWallet() {
        var metasky = window.Metasky({ clubId: "YOUR CLUB ID" });
        metasky.open();
      }
    </script>
    <style>
      .center {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
        margin: 0px;
      }
    </style>
  </head>
  <body class="center">
    <button onclick="openWallet()">Open Wallet</button>
  </body>
</html>

Available Methods

The @metasky/metasky-js library exposes following methods to interact with wallet:

MethodsParametersDescription
open(path: string)Opens the wallet on the specific path
closenoneHides the wallet from UI
on(event: string, handler: Function, options: Object)Registers an event listener
off(event: string, handlerRef: Function)Removes an event listener
do(doOptions: DoOptions)Perform action from set of supported actions

Feedback

If you have any feedback, please reach out to us at metasky-engineering@metasky.ai

Contributions

If you have a feature request, please add it as an issue or make a pull request.

If you have a bug to report, please reproduce the bug in CodeSandbox to help us easily isolate it.

0.0.1

1 year ago