@ledgerhq/hw-app-starknet
v2.1.2
Published
Ledger Hardware Wallet Starknet Application API
Downloads
1,296
Readme
STARKNET JS CLIENT
Typescript host client used to interact with Starknet Nano application
Usage
const starknetClient = require('@ledgerhq/hw-app-starknet');
// TODO: DEMONSTRATE API
API
Table of Contents
StarknetClient
Starknet API
Parameters
transport
Transport
Examples
import Stark from "@ledgerhq/hw-app-starknet";
const stark = new StarknetClient(transport)
getAppVersion
get version of Nano Starknet application
Returns Promise<ResponseVersion> an object with a major, minor, patch
getPubKey
get staRknet public key derived from provided derivation path
Parameters
path
string a path in EIP-2645 format (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2645.md)show
boolean (optional, defaulttrue
)
Examples
stark.getPubKey("m/2645'/579218131'/0'/0'").then(o => o.publicKey)
Returns Promise<ResponsePublicKey> an object with publicKey
signHash
sign the given hash over the staRknet elliptic curve
Parameters
path
string Derivation path in EIP-2645 formathash
string Pedersen hash to be signedshow
Show hash on device before signing (optional, defaulttrue
)
Returns Promise<ResponseSign> an object with (r, s, v) signature
signTx
sign a Starknet Invoke transaction (display some relevant Tx fields before signing)
Parameters
path
string Derivation path in EIP-2645 formatcalls
Array<Call> List of calls [(to, entry_point, calldata), (), ...]tx
TxFields Tx fields (account address, maxFee, nonce, version, chain ID)abi
Abi? Targeted contract's abi (optional, for future use)
Returns Promise<ResponseSign> an object with (r, s, v) signature