@@ -23,12 +23,14 @@ import { createContractActions } from '@/utils/contract';
2323import httpClient from '@/utils/http' ;
2424import { parseTokenUnits } from '@/utils/web3' ;
2525
26+ import type { Address } from '@wagmi/core' ;
27+
2628import { getContractAddress } from './helper' ;
2729import bountyAbi from './helper/abi' ;
2830
29- const { writeActions : { createTask, withdraw : withdrawFromAbi } } = createContractActions ( bountyAbi ) ;
31+ const { writeActions : { createTask : createTaskFromAbi , withdraw : withdrawFromAbi } } = createContractActions ( bountyAbi ) ;
3032
31- function resolveSkipped ( page , size = PAGE_SIZE ) {
33+ function resolveSkipped ( page : number | string , size : number = PAGE_SIZE ) {
3234 let resolved = Number ( page ) ;
3335
3436 if ( ! isInteger ( resolved ) || resolved < 1 ) {
@@ -87,6 +89,10 @@ async function requestTermination(id, data) {
8789 return httpClient . post ( `/build/creator/bounties/${ id } /status/termination/propose` , data ) ;
8890}
8991
92+ async function createTask ( args : [ bigint , Address , Address , bigint ] ) {
93+ return createTaskFromAbi ( getContractAddress ( ) , args ) ;
94+ }
95+
9096async function withdraw ( walletClient , chainId , taskId , amount , deadline , signature ) {
9197 try {
9298 const { hash } = await withdrawFromAbi ( getContractAddress ( chainId ) , [
0 commit comments