[email protected]
version:getStarkKey():Promise<string>
Returns the Stark key.
Promise<string>
: Returns a promise with stark key string.getPublicKey():Promise<string>
Returns the Stark public key.
Promise<string>
: Returns a promise with stark public key string.setContractAddress(contractAddress):Promise<void>
contractAddress
Promise<void>
getContractAddress():Promise<string>
Returns the StarkEx contract address.
Promise<string>
: Returns a promise with contract address.registerUser(ethKey, operatorSignature):Promise<string>
Submits a transaction to register the Stark key.
ethKey
operatorSignature
Promise<string>:
Returns a promise with transaction hash.depositEth(vaultId, amount, quantum):Promise<string>
Submits a transaction to deposit ETH to vault.
vaultId
15
)amount
1000000000000000
)quantum
10
)Promise<string>:
Returns a promise with transaction hash.depositErc20(vaultId, amount, quantum, token):Promise<string>
Submits a transaction to deposit ERC20 token to vault.
vaultId
15
)amount
6
, to deposit 0.42
it would be 420000
)quantum
1000
)token
Promise<>:
Returns a promise with transaction hash.depositErc721(vaultId, tokenId, token):Promise<string>
Submits a transaction to deposit ERC721 NFT to vault.
vaultId
15
)tokenId
452
)token
Promise<string>:
Returns a promise with transaction hash.cancelDeposit(vaultId, assetType):Promise<string>
Submits transaction to cancel deposit.
assetType
vauldId
15
)Promise<string>:
Returns a promise with transaction hash.reclaimDeposit(vaultId, assetType):Promise<string>
Submits transaction to reclaim deposit after cancelling deposit.
assetType
vaultId
15
)Promise<string>:
Returns a promise with transaction hash.withdrawEth(quantum, recipient?):Promise<string>
quantum
10
)recipient
Promise<string>:
Returns a promise with transaction hash.withdrawErc20(quantum, token, recipient?):Promise<string>
quantum
1000
)token
recipient
Promise<string>:
Returns a promise with transaction hash.withdrawErc721(tokenId, token, recipient?):Promise<string>
tokenId
1000
)token
452
)recipient
Promise<string>:
Returns a promise with transaction hash.fullWithdrawalRequest(vaultId):Promise<string>
Submits transaction to do a request to withdraw all tokens from vault.
vaultId
15
)Promise<string>:
Returns a promise with transaction hash.freezeRequest(vaultId):Promise<string>
Submits transaction to freeze vault.
vaultId
15
)Promise<string>:
Returns a promise with transaction hash.escape(vaultId, assetType, quantizedAmount):Promise<string>
Submits transaction to request escape from frozen contract.
vaultId
15
)assetType
quantizedAmount
amount / quantum
)Promise<string>:
Returns a promise with object containing transaction hash.transfer({object}):Promise<string>
Transfer ETH, ERC20, or ERC721 to a stark account. Returns signature.
from
to
asset
amount
nonce
expirationTimestamp
condition
conditionalTransferAddress
condition
hash is set)conditionalTransferFact
condition
hash is set)Asset
type
ETH
, ERC20
, ERC721)
data
AssetData
quantum
ETH
or ERC20
tokenAddress
ERC20
or ERC721
tokenId
ERC721
TransferParams
vaultId
starkKey
Promise<string>:
Returns a promise with transfer stark signature.transferEth({object}):Promise<string>
Transfer ETH to a stark account. Returns signature.
senderVaultId
receiverVaultId
receiverKey
nonce
expirationTimestamp
condition
quantum
amount
Promise<string>:
Returns a promise with transfer stark signature.transferErc20({object}):Promise<string>
Transfer ERC20 token to a stark account. Returns signature.
senderVaultId
receiverVaultId
receiverKey
nonce
expirationTimestamp
condition
assetContractAddress
quantum
amount
Promise<string>:
Returns a promise with transfer stark signature.transferErc721({object}):Promise<string>
Transfer ERC721 token to a stark account. Returns signature.
senderVaultId
receiverVaultId
receiverKey
nonce
expirationTimestamp
condition
assetContractAddress
tokenId
Promise<string>:
Returns a promise with transfer stark signature.createOrder({object}):Promise<string>
Create a buy or sell limit order. Returns a signature
sell
buy
nonce
expirationTimestamp
OrderParams
type
ETH
, ERC20
, ERC721)
data
amount
vaultId
AssetData
quantum
ETH
or ERC20
tokenAddress
ERC20
or ERC721
tokenId
ERC721
Promise<string>:
Returns a promise with transfer stark signature.r
and s
values of serialized signature.signature
Promise<{r, s, recoveryParam?}>:
Returns objectr
r value
v
v
valuerecoveryParam
Promise<string>: Returns serialized signature as hex string.
send(method, params):Promise<object>
Call StarkWare JSON RPC method with payload.
method
stark_transfer
)params
Promise<{id, result}>:
Returns promise with object containing response result.getAssetType({assetStandard, assetContractAddress?, quantum?, amount?}):Promise<string>
Returns asset type hash.
TODO
starkSignMessage(msg):Promise<string>
Signs message with stark key.
TODO
signMessage(msg):Promise<string>
Signs message with ethereum key.
TODO
signPersonalMessage(msg):Promise<string>
Signs personal message with ethereum key.
TODO
signTransaction(tx):Promise<string>
Sign transaction.
TODO
sendTransaction(tx):Promise<string>
Send transaction.
TODO
estimateGas(tx):Promise<string>
Estimate gas.
TODO