Implement payments for app deployments #17

Merged
nabarun merged 27 commits from iv-integrate-payments into main 2024-10-28 09:46:19 +00:00
6 changed files with 35 additions and 0 deletions
Showing only changes of commit bae0d1323a - Show all commits

View File

@ -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'
})

View File

@ -77,6 +77,8 @@ type Project {
fundsReleased: Boolean
template: String
framework: String
paymentAddress: String!
txHash: String!
webhooks: [String!]
members: [ProjectMember!]
environmentVariables: [EnvironmentVariable!]

View File

@ -66,6 +66,8 @@ const Configure = () => {
const createProject = async (
data: FieldValues,
envVariables: AddEnvironmentVariableInput[],
senderAddress: string,
txHash: string
): Promise<string> => {
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);

View File

@ -134,6 +134,8 @@ export const project: Project = {
deployerLrn: 'lrn://deployer.apps.snowballtools.com ',
},
],
paymentAddress: '0x657868687686rb4787987br8497298r79284797487',
txHash: '74btygeuydguygf838gcergurcbhuedbcjhu',
webhooks: ['beepboop'],
icon: 'Icon',
fundsReleased: true,

View File

@ -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

View File

@ -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 = {