@arianee/core
TypeScript icon, indicating that this package has built-in type declarations

1.51.0 • Public • Published

@arianee/core

The Core class is a TypeScript class that provides an interface for signing messages and transactions on the Ethereum blockchain. It uses the ethers library, which is a popular library for interacting with Ethereum.

Usage

You can instantiate core with :

  • Mnemonic
  • Passphrase
  • PrivateKey

Example :

import { Core } from '@arianee/core';
Core.fromMnemonic(mnemonic);
Core.fromPassPhrase(passphrase);
Core.fromPrivateKey(privateKey);
Core.fromRandom();

The returned instance will have 4 methods (see TransactionLike):

signMessage(message:string)

signTransaction(transaction: TransactionLike))

sendTransaction(transaction: TransactionRequest) : Promise<TransactionResponse | { skipResponse: true }>

getAddress():string

Note: If you are using sendTransaction in an asynchronous context (e.g. adding the transaction to a queue instead of sending it directly), you must return { skipResponse: true } instead of a TransactionResponse so that the @arianee/* packages won't try to fetch the transaction receipt.

If you need to implement core with an external wallet (like metamask), you need to instantiate the class with 3 functions:

import { Core } from '@arianee/core';
const core = new Core(signMessage, signTransaction, getAddress);

Readme

Keywords

none

Package Sidebar

Install

npm i @arianee/core

Weekly Downloads

599

Version

1.51.0

License

none

Unpacked Size

7.66 kB

Total Files

6

Last publish

Collaborators

  • benjamin.darthout
  • 6ssou
  • 0xwhiteleaf.eth
  • max.teiger
  • gnarco
  • stefdelecjs
  • mvaullerin
  • arianeetech