New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@xlabs-libs/wallet-aggregator-core

Package Overview
Dependencies
Maintainers
5
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xlabs-libs/wallet-aggregator-core

Basic Wallet abstractions to interact with blockchains.

  • 0.0.1-alpha.22
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

Wallet Aggregator - Core

Basic Wallet abstractions to interact with blockchains.

In order to implement a wallet for a given chain through the sdk, simply import the Wallet class and extend from it. The abstraction defines a set of generic arguments to define the types the methods it will expect and interact with (e.g. a transaction request type, a message to sign, the result of submitting a tx to network, etc).

The Wallet class implements the EventEmitter interface, letting the client subscribe to the following events:

EventDescription
connectSignals the wallet has succesfully connected
disconnectSignals the wallet has succesfully disconnected
networkChangedSignals whether a change in the network was detected. Useful for working with EVM wallets.

New events can be added by extending the WalletEvents class.

Example:

import { Wallet, WalletEvents } from "@xlabs/wallet-aggregator-core";

// define types
type MyUnsignedTransactionType = // ...
// ...
interface MyEventsType extends WalletEvents {
  // ...
}

class MyBlockchainWallet extends Wallet<
  MyUnsignedTransactionType,
  MySignedTransactionType,
  MySignedTransactionType,
  MySubmitTransactionResultType,
  MyNetworkInfoType,
  MyMessageType,
  MyMessageResultType,
  MyEventsType
> {
  // code...
}

The blockchain IDs follow those of Wormhole. A constants file is provided with said chain ids.

Refer to the Wormhole documentation if you wish to know more about the project.

FAQs

Package last updated on 10 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc