Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@cometh/hosted-sdk

Package Overview
Dependencies
Maintainers
5
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cometh/hosted-sdk

SDK Cometh Hosted-Connect

latest
Source
npmnpm
Version
0.3.2
Version published
Maintainers
5
Created
Source

Connect Hosted SDK

Installing Wallet SDK

npm install @cometh/connect-hosted-sdk

Initialize Wallet SDK

import { ComethWallet, ComethProvider, ComethSigner } from '@cometh/connect-hosted-sdk'

Smart Wallet

Initialize

It is required to call this function before any others.

This function initialize the communication with the Cometh Connect wallet and verify that the wallet exist. In order to create a wallet, the user must register on Cometh OIDC.

const wallet = new ComethWallet(apiKey)
await wallet.connect()

Get Address

wallet.getAddress()

This function returns the address of the wallet.

Send Transaction

const txParams = { to: DESTINATION, value: VALUE, data: DATA }
const tx = await wallet.sendTransaction(txParams)

This function relays the transaction data to the target address. The transaction fees can be sponsored. The function returns the safeTxHash of the transaction which can be used to wait for the Transaction receipt.

Get Transaction receipt

const txReceipt = await provider.waitTransaction(tx.safeTxHash)

This function relays the transaction data to the target address. The transaction fees can be sponsored.

Sign Message

const signature = await wallet.signMessage('hello')

Sign the given message using the EOA, owner of the smart wallet.

FAQs

Package last updated on 20 Nov 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