From baa96543989fd4fef33575302d2940ed8b68e0e2 Mon Sep 17 00:00:00 2001 From: Dave Creaser Date: Wed, 26 Jun 2024 23:24:03 +0100 Subject: [PATCH 1/2] Chain id is int --- .../function/bridgeXYZMutation/src/handlers/checkKyc.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/amplify/backend/function/bridgeXYZMutation/src/handlers/checkKyc.js b/amplify/backend/function/bridgeXYZMutation/src/handlers/checkKyc.js index 12b99230380..eb8dc849e3b 100644 --- a/amplify/backend/function/bridgeXYZMutation/src/handlers/checkKyc.js +++ b/amplify/backend/function/bridgeXYZMutation/src/handlers/checkKyc.js @@ -132,8 +132,6 @@ const checkKYCHandler = async ( const hasLiquidationAddress = colonyUser.liquidationAddresses.items.length > 0; - console.log(colonyUser.liquidationAddresses[0]); - if (firstAccount && !hasLiquidationAddress) { // They have external accounts. Create a liquidation address const liquidationAddressCreation = await fetch( @@ -157,13 +155,14 @@ const checkKYCHandler = async ( if (liquidationAddressCreation.status === 200) { const liquidationAddressCreationRes = await liquidationAddressCreation.json(); + console.log(liquidationAddressCreationRes); const liquidationAddress = liquidationAddressCreationRes.address; - - await graphqlRequest( + console.log(liquidationAddress, checksummedWalletAddress); + const r = await graphqlRequest( createLiquidationAddress, { input: { - chainId: '42161', + chainId: 42161, liquidationAddress, userAddress: checksummedWalletAddress, }, From 9ea7e2d98f3dd33ebc6a9d24b351dba74b967129 Mon Sep 17 00:00:00 2001 From: Romeo Ledesma Date: Wed, 26 Jun 2024 23:28:42 +0100 Subject: [PATCH 2/2] hackathon: fix bank details --- .../partials/BankDetailsModal/index.tsx | 7 ++++++ src/graphql/generated.ts | 24 ++++++++++++++++--- src/graphql/mutations/bridgeXYZ.graphql | 18 ++++++++++++++ 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/components/frame/v5/pages/UserCryptoToFiatPage/partials/BankDetailsModal/index.tsx b/src/components/frame/v5/pages/UserCryptoToFiatPage/partials/BankDetailsModal/index.tsx index 7255b0d2995..55fd1308083 100644 --- a/src/components/frame/v5/pages/UserCryptoToFiatPage/partials/BankDetailsModal/index.tsx +++ b/src/components/frame/v5/pages/UserCryptoToFiatPage/partials/BankDetailsModal/index.tsx @@ -274,6 +274,13 @@ export const BankDetailsModal: FC = ({ lastName, taxIdNumber, email, + currency: 'eur', + iban: { + // eslint-disable-next-line camelcase + account_number: '12345', + bic: 'bicbic', + country: 'GBR', + }, address: { city, country, diff --git a/src/graphql/generated.ts b/src/graphql/generated.ts index 4069ed04d38..de6d6862aef 100644 --- a/src/graphql/generated.ts +++ b/src/graphql/generated.ts @@ -8926,6 +8926,8 @@ export type UpdateBridgeCustomerMutationVariables = Exact<{ taxIdNumber: Scalars['String']; signedAgreementId: Scalars['String']; email: Scalars['String']; + currency: Scalars['String']; + iban?: InputMaybe; }>; @@ -8934,7 +8936,7 @@ export type UpdateBridgeCustomerMutation = { __typename?: 'Mutation', bridgeXYZM export type CheckKycStatusMutationVariables = Exact<{ [key: string]: never; }>; -export type CheckKycStatusMutation = { __typename?: 'Mutation', bridgeXYZMutation?: { __typename?: 'BridgeXYZMutationReturn', kyc_status?: string | null, kyc_link?: string | null, success?: boolean | null } | null }; +export type CheckKycStatusMutation = { __typename?: 'Mutation', bridgeXYZMutation?: { __typename?: 'BridgeXYZMutationReturn', kyc_status?: string | null, kyc_link?: string | null, success?: boolean | null, country?: string | null, bankAccount?: { __typename?: 'BridgeXYZBankAccount', currency: string, bankName: string, iban?: { __typename?: 'BridgeXYZIbanBankAccount', bic: string, country: string, last4: string } | null, usAccount?: { __typename?: 'BridgeXYZUSBankAccount', last4: string, routingNumber: string } | null } | null } | null }; export type CreateColonyEtherealMetadataMutationVariables = Exact<{ input: CreateColonyEtherealMetadataInput; @@ -10562,9 +10564,9 @@ export type CreateKycLinksMutationHookResult = ReturnType; export type CreateKycLinksMutationOptions = Apollo.BaseMutationOptions; export const UpdateBridgeCustomerDocument = gql` - mutation UpdateBridgeCustomer($firstName: String!, $lastName: String!, $address: BridgeXYZMutationAddressInput, $birthDate: String!, $taxIdNumber: String!, $signedAgreementId: String!, $email: String!) { + mutation UpdateBridgeCustomer($firstName: String!, $lastName: String!, $address: BridgeXYZMutationAddressInput, $birthDate: String!, $taxIdNumber: String!, $signedAgreementId: String!, $email: String!, $currency: String!, $iban: BridgeXYZMutationIbanInput) { bridgeXYZMutation( - input: {path: "v0/customers/{customerID}", body: {first_name: $firstName, last_name: $lastName, address: $address, birth_date: $birthDate, tax_identification_number: $taxIdNumber, signed_agreement_id: $signedAgreementId, email: $email}} + input: {path: "v0/customers/{customerID}", body: {first_name: $firstName, last_name: $lastName, address: $address, birth_date: $birthDate, tax_identification_number: $taxIdNumber, signed_agreement_id: $signedAgreementId, email: $email, currency: $currency, iban: $iban}} ) { success } @@ -10592,6 +10594,8 @@ export type UpdateBridgeCustomerMutationFn = Apollo.MutationFunction