diff --git a/packages/backend/src/entity/Project.ts b/packages/backend/src/entity/Project.ts index 9edfdfd5..aa622dd7 100644 --- a/packages/backend/src/entity/Project.ts +++ b/packages/backend/src/entity/Project.ts @@ -66,6 +66,12 @@ export class Project { @Column('varchar', { nullable: true }) framework!: string | null; + @Column('varchar') + paymentAddress!: string; + + @Column('varchar') + txHash!: string; + @Column({ type: 'simple-array' }) diff --git a/packages/backend/src/schema.gql b/packages/backend/src/schema.gql index 5cead09e..e51c1310 100644 --- a/packages/backend/src/schema.gql +++ b/packages/backend/src/schema.gql @@ -77,6 +77,8 @@ type Project { fundsReleased: Boolean template: String framework: String + paymentAddress: String! + txHash: String! webhooks: [String!] members: [ProjectMember!] environmentVariables: [EnvironmentVariable!] diff --git a/packages/frontend/src/components/projects/create/Configure.tsx b/packages/frontend/src/components/projects/create/Configure.tsx index 058d18c7..54a67a40 100644 --- a/packages/frontend/src/components/projects/create/Configure.tsx +++ b/packages/frontend/src/components/projects/create/Configure.tsx @@ -66,6 +66,8 @@ const Configure = () => { const createProject = async ( data: FieldValues, envVariables: AddEnvironmentVariableInput[], + senderAddress: string, + txHash: string ): Promise => { setIsLoading(true); let projectId: string | null = null; @@ -90,6 +92,8 @@ const Configure = () => { owner, name, isPrivate, + paymentAddress: senderAddress, + txHash }; const { addProjectFromTemplate } = await client.addProjectFromTemplate( @@ -109,6 +113,8 @@ const Configure = () => { prodBranch: defaultBranch!, repository: fullName!, template: 'webapp', + paymentAddress: senderAddress, + txHash }, lrn, auctionParams, @@ -138,6 +144,11 @@ const Configure = () => { const handleFormSubmit = useCallback( async (createFormData: FieldValues) => { + // Send tx request to wallet -> amount = createFormData.maxPrice * createFormData.numProviders + // Get address of sender account(from wallet connect session) and txHash(result.signature) + const senderAddress = 'address'; + const txHash = 'txHash'; + const environmentVariables = createFormData.variables.map( (variable: any) => { return { @@ -153,6 +164,8 @@ const Configure = () => { const projectId = await createProject( createFormData, environmentVariables, + senderAddress, + txHash ); await client.getEnvironmentVariables(projectId); diff --git a/packages/frontend/src/stories/MockStoriesData.ts b/packages/frontend/src/stories/MockStoriesData.ts index 49e67885..09959838 100644 --- a/packages/frontend/src/stories/MockStoriesData.ts +++ b/packages/frontend/src/stories/MockStoriesData.ts @@ -134,6 +134,8 @@ export const project: Project = { deployerLrn: 'lrn://deployer.apps.snowballtools.com ', }, ], + paymentAddress: '0x657868687686rb4787987br8497298r79284797487', + txHash: '74btygeuydguygf838gcergurcbhuedbcjhu', webhooks: ['beepboop'], icon: 'Icon', fundsReleased: true, diff --git a/packages/gql-client/src/queries.ts b/packages/gql-client/src/queries.ts index a1ac2af2..e3274827 100644 --- a/packages/gql-client/src/queries.ts +++ b/packages/gql-client/src/queries.ts @@ -29,6 +29,8 @@ query ($projectId: String!) { deployerId deployerApiUrl } + paymentAddress + txHash fundsReleased framework repository @@ -85,6 +87,8 @@ query ($organizationSlug: String!) { deployerId deployerApiUrl } + paymentAddress + txHash fundsReleased prodBranch webhooks @@ -212,6 +216,8 @@ query ($searchText: String!) { deployerId deployerApiUrl } + paymentAddress + txHash fundsReleased prodBranch webhooks diff --git a/packages/gql-client/src/types.ts b/packages/gql-client/src/types.ts index a7c24aa3..2e879913 100644 --- a/packages/gql-client/src/types.ts +++ b/packages/gql-client/src/types.ts @@ -177,6 +177,8 @@ export type Project = { framework: string; deployers: [Deployer] auctionId: string; + paymentAddress: string; + txHash: string; fundsReleased: boolean; webhooks: string[]; members: ProjectMember[]; @@ -306,6 +308,8 @@ export type AddProjectFromTemplateInput = { owner: string; name: string; isPrivate: boolean; + paymentAddress: string; + txHash: string; }; export type AddProjectInput = { @@ -313,6 +317,8 @@ export type AddProjectInput = { repository: string; prodBranch: string; template?: string; + paymentAddress: string; + txHash: string; }; export type UpdateProjectInput = {