Socket
Socket
Sign inDemoInstall

@keystonehq/aptossnap

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keystonehq/aptossnap

Aptos - Metamask snap to interact with Aptos.


Version published
Weekly downloads
2
Maintainers
4
Weekly downloads
 
Created
Source

Aptos Snap

npm version

Aptos Snap is the application allowing users to directly manage Aptos within the MetaMask interface. Since Snaps is pre-release software, the alpha version of Aptos Snap is currently live on Metamask Flask only, a canary distribution for developers that provides access to upcoming features.

*Note: MetaMask Flask is an experimental playground for developers and is not to be confused with the normal MetaMask wallet app.

MetaMask Snaps Introduction

Snaps is a system that allows developers to safely build and expand the capabilities of MetaMask. It is a program that is run in an isolated environment with a limited set of capabilities, that can customize and modify MetaMask's wallet experience for end users. For example, a snap can add new APIs to MetaMask thus adding support for different blockchains or modify existing functionalities using internal APIs.

Additional information can be found here.

Usage

  1. Enable Aptos Snap in your dapp
const result: boolean = await ethereum.request({
    method: 'wallet_enable',
    params: [
        {
            wallet_snap: {'npm:@keystonehq/aptossnap': {}},
        },
    ],
});
  1. Get an Aptos Public Account
const result: string = await ethereum.request({
    method: 'wallet_invokeSnap',
    params: [
        "npm:@keystonehq/aptossnap",
        {
            method: 'aptso_getAccount'
        },
    ],
});
  1. Sign Transaction
const result: { txId: string, txHex: string } = await ethereum.request({
    method: 'wallet_invokeSnap',
    params: [
        snapId,
        {
            method: 'aptos_signTransaction',
            params: {
                rawTransaction: bcsBytes // bcs serialized raw transaction bytes
            },
        },
    ],
})

Building

Build the snap and test it locally with the following command:

yarn build

Live Example

If you would like to integrate Aptos Snap into your dapp, you can use the following codes here.

Keywords

FAQs

Package last updated on 30 Sep 2022

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