Create job

The ees-sdk makes it easy to create jobs.

const transactionReceipt: `0x${string}` = await eesSDK.createJob(jobSpecification, sponsor, sponsorSignature, hasSponsorship, index);

Here jobSpecification has type JobSpecification. The sponsor field has type `0x{string}` and is the sponsor address of the job. The sponsorSignature has type `0x{string}` and is an EIP-712 signature of jobSpecification signed by the sponsor. Next, hasSponsorship has type boolean and is a flag that indicates whether the job should be created with a sponsorship. Finally, index is the index in the jobs array in which the job should be created. The function returns transactionReceipt of viem's type TransactionReceipt containing information about the transaction.

Note: If hasSponsorship is set to true, the sponsor and sponsorSignature will not be considered and arbitrary values can be given. The same is true for the nonce and deadline fields of the jobSpecification object.

Last updated