Starkware ABI Encoder Library
import StarkwareAbiEncoder from '@authereum/starkware-abiEncoder'
const abiEncoder = new StarkwareAbiEncoder()
const encodedData = await abiEncoder.registerUser({
ethKey,
starkKey,
operatorSignature,
})
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,
})