signTransaction, signMessage and sendTransaction functions are implemented
import { sendTransaction, signTransaction, signMessage } from '@ramper/zksync'
try {
sendTransaction({
from: wallet?.publicKey as string,
data: '0x',
gasLimit: gasLimit.toString(),
nonce,
to: transaction.receiver,
value: transaction.amount,
})
signTransaction({
from: wallet?.publicKey as string,
data: '0x',
gasLimit: gasLimit.toString(),
nonce,
to: transaction.receiver,
value: transaction.amount,
})
signMessage(message)
} catch (e) {
console.log(e)
}
We highly recommend you use Promise for the fields that need network access to be determined, such as nonce and gasLimit, etc.
If sendTransaction is triggered by a button, for example, and you perform all the accesses before actually calling sendTransaction, we've noticed the popup window for the user confirmation can be blocked by Safari.
Sign out
Users can log out or disconnect their wallet with:
import { signOut } from '@ramper/zksync'
await signOut()
Yup, it really is just that easy!
If there's any feature you would like to see or design patterns you would like for the Ramper team to adopt, come chat with us.
Last updated
Once you have obtained a Signer, you can use the familiar ethers.js functions to write your DApp. See for reference if you aren't already familiar with ethers.js