in order to instiate the the class you must provide a provider and the address which is currently connected to the dapp. Once the class is instiated you won't have to iniate a ethers provider.
API
EnrollL2Account()
> enrolls the user into Ancon Protocol, once the user has been enrolled he can interact with the protocol.
parameters
Name
Type
Description
cid
string
metadata cid
proof
any
the proof object. must be passed through abi proof
returns
Name
Type
Description
enroll
object
transaction receipt
getNetwork()
> returns the network the user is currently in
getPubKey
> returns an array with [recoveredAddress, transaction.from, pubkey]
parameters
Name
Type
Description
transactionHash
string
any transaction hash made by the user
postProof()
> handles the post requests to the Dag Store
parameters
Name
Type
Description
proofEndPoint
string
the endpoint to made the post ex: dagjson
requestOptions
any
the whole object to send. must use method post
enrolling?
boolean
send true if you are making a post to enroll a user
returns
Name
Type
Description
contentCid
string
metadata cid
proofKey
string
proof key from the recent change
proofHeight
string
proof height from the recent change
proofCid
string
proof cid that can be used to fetch the proof posted
ipfs
string
shows the ipfs cids
getProof()
> fetch the proof, passes it trough abi proof and return it ready to be used
parameters
Name
Type
Description
key
string
the proof key returned by post proof
height
string
the proof height returned by post proof
returns
Name
Type
Description
contentCid
string
metadata cid
proofKey
string
proof key from the recent change
proofHeight
string
proof height from the recent change
proofCid
string
proof cid that can be used to fetch the proof posted
ipfs
string
shows the ipfs cids
fetchDag()
> fetch the dag store with a cid
parameters
Name
Type
Description
cid
string
cid to fetch
returns
Name
Type
Description
cid
string
metadata cid
proofKey
string
proof key from that cid change
proofHeight
string
proof height from that cid change
getPastEvents()
> event waiter for the relayer, returns true once it was completed