Barz

class Barz

Barz functions

Functions

Link copied to clipboard
open fun getAuthorizationHash(chainId: Array<Byte>, contractAddress: String, nonce: Array<Byte>): Array<Byte>
Computes an Authorization hash in [EIP-7702 format](https://eips.ethereum.org/EIPS/eip-7702) `keccak256('0x05' || rlp([chain_id, address, nonce]))`.
Link copied to clipboard
Calculate a counterfactual address for the smart contract wallet
Link copied to clipboard
open fun getDiamondCutCode(input: Array<Byte>): Array<Byte>
Returns the encoded diamondCut function call for Barz contract upgrades
Link copied to clipboard
open fun getEncodedHash(chainId: Array<Byte>, codeAddress: String, codeName: String, codeVersion: String, typeHash: String, domainSeparatorHash: String, sender: String, userOpHash: String): Array<Byte>
Returns the encoded hash of the user operation
Link copied to clipboard
open fun getFormattedSignature(signature: Array<Byte>, challenge: Array<Byte>, authenticatorData: Array<Byte>, clientDataJSON: String): Array<Byte>
Converts the original ASN-encoded signature from webauthn to the format accepted by Barz
Link copied to clipboard
open fun getInitCode(factory: String, publicKey: PublicKey, verificationFacet: String, salt: Int): Array<Byte>
Returns the init code parameter of ERC-4337 User Operation
Link copied to clipboard
open fun getPrefixedMsgHash(msgHash: Array<Byte>, barzAddress: String, chainId: Int): Array<Byte>
Returns the final hash to be signed by Barz for signing messages &typed data
Link copied to clipboard
open fun getSignedHash(hash: String, privateKey: String): Array<Byte>
Signs a message using the private key
Link copied to clipboard
open fun signAuthorization(chainId: Array<Byte>, contractAddress: String, nonce: Array<Byte>, privateKey: String): String
Returns the signed authorization hash