1.0.12 • Published 4 years ago

@cerbymask/cerbymask-lib v1.0.12

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

🔥 Install

$ npm install @cerbymask/cerbymask-lib

🐺 Getting Started

This library is a wrapper to the object window.cerbymask that is made available in webpage load time.

⚡ Install dependencies

After cloning the project, navigate to the root folder and run:

$ npm install

⚡ Build

In order to build the extension, execute:

$ npm run build

🎄 API

The following table describes the interface containing the functions which are injected in runtime - these functions are accessible by simply using the instance of window.cerbymask

⚡ Callbacks

Every function call returns an event in case the specific function/method has been fully performed - e.g. onClientConnect is called once the user has allowed the web application to connect(). These events are emitted using NodeJS Event Emitter

⚡ Middleware

In case the web applications performs a function call without having explicit permission, the background worker replies back with false as response.

Checkout an example here.

⚡ Functions

FunctionEvent CallbackDescription
connectonClientConnectPerforms a request to the extension to allow the current client to communicate to the background worker
validateWalletonValidateWalletValidate if the user contains a wallet, we recommend to display 'Connect' whenever validation returns false
submitTransactiononApproveTransactionPerform a transaction via CerbyMask
getPublicAddressesonPublicAddressesGet client available public addresses
events-NodeJS Event Emitter object where you attach .on("<event callback>") from previous function calls
1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago