ChangePubkey(
int chainId,
int accountId,
int subAccountId,
String newPubkeyHash,
int feeToken,
String fee,
int nonce,
String? ethSignature,
int? ts,
)
String getEthSignMsg(int nonce, int accountId)
void sign(ZkLinkSigner zkLinkSigner)
func toEip712RequestPayload
String toEip712RequestPayload(int chainId, String address)
void setEthAuthData(String sig)
var zklinkSigner = ZkLinkSigner.ethSig(sig: "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001");
String pubkeyHash = zklinkSigner.getPubkeyHash();
print(pubkeyHash);
var tx = ChangePubKey(
chainId: 1,
accountId: 2,
subAccountId: 4,
newPubkeyHash: pubkeyHash,
feeToken: 1,
fee: "100",
nonce: 100
);
tx.sign(zkLinkSigner: zklinkSigner);
print(tx.toEip712RequestPayload(chainId: 1, address: "0xa97153dd89c6f8F3BeA66190a6e62020aC7213de"));
String ethSignMsg = tx.getEthSignMsg(nonce: 100, accountId: 1);
tx.setEthAuthData(sig: "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001b");
print(tx.toJson());