Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@infinex/wallet

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@infinex/wallet

iframe hosted web wallet for ethereum

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

@infinex/wallet - Wallet App

iframe-hosted web wallet for ethereum

Usage

npx @infinex/wallet [serve|build] \
  --output-directory=dist-wallet \
  --identifier-strategy=jwt \
  --identifier-strategy-jwt-claim=id \
  --identifier-strategy-jwt-jwks={} \
  --redirect-url=http://localhost
  • Run build and upload the resulting HTML/JS output to a static web host.
  • Use @infinex/wallet-sdk to communicate with the wallet.
  • For security, both the wallet and the parent app must be on separate origins.
  • These can be different ports and/or different domains or subdomains.

postMessage API

Unlock Wallet

// Send 'unlock' method to iframe
{ "id": 1234, "method": "unlock", "args": { "identifier": "jwt_or_other_identifier..." } }

// Return message - Unlock was successful
{ "id": 1234, "result": { "address": "0xabc123bef987" } }

// Return message - Error while unlocking
{ "id": 1234, "error": { "message": "No wallet with the provided identifier" } }

Sign Message

// Send 'signmessage' method to iframe
{ "id": 5678, "method": "signMessage", "args": { "message": "my message" } }<

// Return message - Message signing was successful
{ "id": 5678, "result": { "signature": "abc123bef987" } }

// Return message - Error while signing message
{ "id": 5678, "error": { "message": "Wallet is locked" } }

Sign Transaction

// Send 'signTransaction' method to iframe - `transaction` should be a raw transaction string.
// for ethers, use `transaction.unsignedSerialized`
{
  "id": 9012,
  "method": "signTransaction",
  "args": { "transaction": "raw-transaction" }
}

Lock Wallet

// Send 'lock' method to iframe
{ "id": 3456, "method": "lock" }

// Return message - Wallet lock was successful
{ "id": 3456, "result": {} }

// Return message - Error while locking wallet
{ "id": 3456, "error": { "message": "Wallet is already locked" } }

Clear Wallet Storage

// Send 'clearStorage' method to iframe
{ "id": 7890, "method": "clearStorage" }

// Return mesage - wallet lock was successful
{ "id": 7890, "result": {} }

// Return message - Error while clearing storage
{ "id": 7890, "error": { "message": "Wallet app is not initialised" } }

FAQs

Package last updated on 14 Aug 2023

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