@authereum/starkware-abi-encoder
TypeScript icon, indicating that this package has built-in type declarations

1.8.0-beta.5 • Public • Published

starkware-abi-encoder npm version

Starkware ABI Encoder Library

Getting started

import StarkwareAbiEncoder from '@authereum/starkware-abiEncoder'

const abiEncoder = new StarkwareAbiEncoder()

const encodedData = await abiEncoder.registerUser({
  ethKey,
  starkKey,
  operatorSignature,
})

Examples

Deposit calldata:

const encodedData = await abiEncoder.deposit({
  starkKey,
  assetType,
  vaultId,
})

Deposit NFT calldata:

const encodedData = await abiEncoder.depositNft({
  starkKey,
  assetType,
  vaultId,
  tokenId,
})

Deposit cancel calldata:

const encodedData = await abiEncoder.depositCancel({
  starkKey,
  assetType,
  vaultId,
})

Withdraw calldata:

const encodedData = await abiEncoder.withdrawTo({
  starkKey,
  assetType,
  recipient,
})

Transfer message hash:

const messageHash = await abiEncoder.transfer({
  quantizedAmount,
  nonce,
  senderVaultId,
  assetId,
  targetVaultId,
  targetKey,
  expirationTimestamp,
})

Limit order message hash:

const messageHash = await abiEncoder.createOrder({
  sellVaultId,
  buyVaultId,
  sellQuantizedAmount,
  buyQuantizedAmount,
  sellAssetId,
  buyAssetId,
  nonce,
  expirationTimestamp,
})

Package Sidebar

Install

npm i @authereum/starkware-abi-encoder

Weekly Downloads

1

Version

1.8.0-beta.5

License

Apache-2.0

Unpacked Size

2.61 MB

Total Files

21

Last publish

Collaborators

  • miguelmota
  • shanefontaine
  • cwhinfrey