diff --git a/amplify/backend/api/colonycdapp/schema/bridge.graphql b/amplify/backend/api/colonycdapp/schema/bridge.graphql
index de7f8ce1127..315e16399c3 100644
--- a/amplify/backend/api/colonycdapp/schema/bridge.graphql
+++ b/amplify/backend/api/colonycdapp/schema/bridge.graphql
@@ -30,7 +30,7 @@ type BridgeDrain {
currency: String!
state: String!
createdAt: String!
- receipt: BridgeDrainReceipt!
+ receipt: BridgeDrainReceipt
}
type BridgeIbanBankAccount {
diff --git a/amplify/backend/function/bridgeXYZMutation/src/handlers/getDrainsHistory.js b/amplify/backend/function/bridgeXYZMutation/src/handlers/getDrainsHistory.js
index 3bb672ce016..81600a26848 100644
--- a/amplify/backend/function/bridgeXYZMutation/src/handlers/getDrainsHistory.js
+++ b/amplify/backend/function/bridgeXYZMutation/src/handlers/getDrainsHistory.js
@@ -1,11 +1,7 @@
const fetch = require('cross-fetch');
const { graphqlRequest } = require('../utils');
-/*
- * @TODO This needs to be imported properly into the project (maybe?)
- * So that we can always ensure it follows the latest schema
- * (currently it's just saved statically)
- */
const { getUser } = require('../graphql');
+const { getLiquidationAddresses } = require('./utils');
const getDrainsHistoryHandler = async (
event,
@@ -25,26 +21,17 @@ const getDrainsHistoryHandler = async (
const bridgeCustomerId = colonyUser?.bridgeCustomerId;
- const res = await fetch(
- `${apiUrl}/v0/customers/${bridgeCustomerId}/liquidation_addresses`,
- {
- headers: {
- 'Content-Type': 'application/json',
- 'Api-Key': apiKey,
- },
- method: 'GET',
- },
+ const liquidationAddresses = await getLiquidationAddresses(
+ apiUrl,
+ apiKey,
+ bridgeCustomerId,
);
- const liquidationAddressResult = await res.json();
-
- if (!liquidationAddressResult.count) {
+ if (!liquidationAddresses.length) {
return [];
}
- const liquidationAddressIds = liquidationAddressResult.data.map(
- (item) => item.id,
- );
+ const liquidationAddressIds = liquidationAddresses.map((item) => item.id);
const drains = [];
@@ -68,9 +55,11 @@ const getDrainsHistoryHandler = async (
currency: drain.currency,
state: drain.state,
createdAt: drain.created_at,
- receipt: {
- url: drain.receipt.url,
- },
+ receipt: drain.receipt
+ ? {
+ url: drain.receipt.url,
+ }
+ : null,
}));
drains.push(...mappedDrains);
diff --git a/amplify/backend/function/bridgeXYZMutation/src/handlers/utils.js b/amplify/backend/function/bridgeXYZMutation/src/handlers/utils.js
index ddaee172c34..a3cb0826af5 100644
--- a/amplify/backend/function/bridgeXYZMutation/src/handlers/utils.js
+++ b/amplify/backend/function/bridgeXYZMutation/src/handlers/utils.js
@@ -45,7 +45,7 @@ const createExternalAccount = async (
const getLiquidationAddresses = async (apiUrl, apiKey, bridgeCustomerId) => {
const liquidationAddressesRes = await fetch(
- `${apiUrl}/v0/customers/${bridgeCustomerId}/liquidation_addresses`,
+ `${apiUrl}/v0/customers/${bridgeCustomerId}/liquidation_addresses?limit=100`,
{
headers: {
'Content-Type': 'application/json',
diff --git a/src/components/frame/v5/pages/UserCryptoToFiatPage/partials/FiatTransfersTable/hooks.tsx b/src/components/frame/v5/pages/UserCryptoToFiatPage/partials/FiatTransfersTable/hooks.tsx
index 481ba1ac9e7..c64d8b62729 100644
--- a/src/components/frame/v5/pages/UserCryptoToFiatPage/partials/FiatTransfersTable/hooks.tsx
+++ b/src/components/frame/v5/pages/UserCryptoToFiatPage/partials/FiatTransfersTable/hooks.tsx
@@ -133,6 +133,15 @@ export const useFiatTransfersTableColumns = (
if (loading) {
return
;
}
+
+ if (!row.original.receipt) {
+ return (
+
+ {formatText({ id: 'table.content.receiptGenerating' })}
+
+ );
+ }
+
return (
;
state: Scalars['String'];
};
@@ -9679,7 +9679,7 @@ export type ColonyMultiSigFragment = { __typename?: 'ColonyMultiSig', id: string
export type BridgeBankAccountFragment = { __typename?: 'BridgeBankAccount', id: string, currency: string, bankName: string, accountOwner: string, iban?: { __typename?: 'BridgeIbanBankAccount', bic: string, country: string, last4: string } | null, usAccount?: { __typename?: 'BridgeUsBankAccount', last4: string, routingNumber: string } | null };
-export type BridgeDrainFragment = { __typename?: 'BridgeDrain', id: string, amount: string, currency: string, state: string, createdAt: string, receipt: { __typename?: 'BridgeDrainReceipt', url: string } };
+export type BridgeDrainFragment = { __typename?: 'BridgeDrain', id: string, amount: string, currency: string, state: string, createdAt: string, receipt?: { __typename?: 'BridgeDrainReceipt', url: string } | null };
export type ColonyFragment = { __typename?: 'Colony', name: string, version: number, reputation?: string | null, expendituresGlobalClaimDelay?: string | null, private?: boolean | null, lastUpdatedContributorsWithReputation?: string | null, colonyAddress: string, nativeToken: { __typename?: 'Token', decimals: number, name: string, symbol: string, type?: TokenType | null, avatar?: string | null, thumbnail?: string | null, tokenAddress: string }, status?: { __typename?: 'ColonyStatus', recovery?: boolean | null, nativeToken?: { __typename?: 'NativeTokenStatus', mintable?: boolean | null, unlockable?: boolean | null, unlocked?: boolean | null } | null } | null, chainMetadata: { __typename?: 'ChainMetadata', chainId: string, network?: Network | null }, tokens?: { __typename?: 'ModelColonyTokensConnection', items: Array<{ __typename?: 'ColonyTokens', colonyTokensId: string, token: { __typename?: 'Token', decimals: number, name: string, symbol: string, type?: TokenType | null, avatar?: string | null, thumbnail?: string | null, tokenAddress: string } } | null> } | null, motionsWithUnclaimedStakes?: Array<{ __typename?: 'ColonyUnclaimedStake', motionId: string, unclaimedRewards: Array<{ __typename?: 'StakerRewards', address: string, rewards: { __typename?: 'MotionStakeValues', nay: string, yay: string } }> }> | null, domains?: { __typename?: 'ModelDomainConnection', items: Array<{ __typename?: 'Domain', id: string, nativeId: number, isRoot: boolean, nativeFundingPotId: number, nativeSkillId: string, reputation?: string | null, reputationPercentage?: string | null, metadata?: { __typename?: 'DomainMetadata', name: string, color: DomainColor, description?: string | null, id: string, changelog?: Array<{ __typename?: 'DomainMetadataChangelog', transactionHash: string, oldName: string, newName: string, oldColor: DomainColor, newColor: DomainColor, oldDescription?: string | null, newDescription?: string | null }> | null } | null } | null> } | null, balances?: { __typename?: 'ColonyBalances', items?: Array<{ __typename?: 'ColonyBalance', id: string, balance: string, domain?: { __typename?: 'Domain', id: string, nativeId: number, isRoot: boolean, nativeFundingPotId: number, nativeSkillId: string, reputation?: string | null, reputationPercentage?: string | null, metadata?: { __typename?: 'DomainMetadata', name: string, color: DomainColor, description?: string | null, id: string, changelog?: Array<{ __typename?: 'DomainMetadataChangelog', transactionHash: string, oldName: string, newName: string, oldColor: DomainColor, newColor: DomainColor, oldDescription?: string | null, newDescription?: string | null }> | null } | null } | null, token: { __typename?: 'Token', decimals: number, name: string, symbol: string, type?: TokenType | null, avatar?: string | null, thumbnail?: string | null, tokenAddress: string } } | null> | null } | null, fundsClaims?: { __typename?: 'ModelColonyFundsClaimConnection', items: Array<{ __typename?: 'ColonyFundsClaim', id: string, createdAtBlock: number, createdAt: string, amount: string, isClaimed?: boolean | null, token: { __typename?: 'Token', decimals: number, name: string, symbol: string, type?: TokenType | null, avatar?: string | null, thumbnail?: string | null, tokenAddress: string } } | null> } | null, chainFundsClaim?: { __typename?: 'ColonyChainFundsClaim', id: string, createdAtBlock: number, createdAt: string, amount: string, isClaimed?: boolean | null } | null, metadata?: { __typename?: 'ColonyMetadata', displayName: string, avatar?: string | null, description?: string | null, thumbnail?: string | null, externalLinks?: Array<{ __typename?: 'ExternalLink', name: ExternalLinks, link: string }> | null, objective?: { __typename?: 'ColonyObjective', title: string, description: string, progress: number } | null, changelog?: Array<{ __typename?: 'ColonyMetadataChangelog', transactionHash: string, newDisplayName: string, oldDisplayName: string, hasAvatarChanged: boolean, hasDescriptionChanged?: boolean | null, haveExternalLinksChanged?: boolean | null, hasObjectiveChanged?: boolean | null, newSafes?: Array<{ __typename?: 'Safe', name: string, address: string, chainId: string, moduleContractAddress: string }> | null, oldSafes?: Array<{ __typename?: 'Safe', name: string, address: string, chainId: string, moduleContractAddress: string }> | null }> | null, safes?: Array<{ __typename?: 'Safe', name: string, address: string, chainId: string, moduleContractAddress: string }> | null } | null, roles?: { __typename?: 'ModelColonyRoleConnection', items: Array<{ __typename?: 'ColonyRole', id: string, targetAddress: string, role_0?: boolean | null, role_1?: boolean | null, role_2?: boolean | null, role_3?: boolean | null, role_5?: boolean | null, role_6?: boolean | null, isMultiSig?: boolean | null, domain: { __typename?: 'Domain', id: string, nativeId: number } } | null> } | null, colonyMemberInvite?: { __typename?: 'ColonyMemberInvite', id: string, invitesRemaining: number } | null };
@@ -10019,7 +10019,7 @@ export type SearchActionsQuery = { __typename?: 'Query', searchColonyActions?: {
export type GetUserDrainsQueryVariables = Exact<{ [key: string]: never; }>;
-export type GetUserDrainsQuery = { __typename?: 'Query', bridgeGetDrainsHistory?: Array<{ __typename?: 'BridgeDrain', id: string, amount: string, currency: string, state: string, createdAt: string, receipt: { __typename?: 'BridgeDrainReceipt', url: string } }> | null };
+export type GetUserDrainsQuery = { __typename?: 'Query', bridgeGetDrainsHistory?: Array<{ __typename?: 'BridgeDrain', id: string, amount: string, currency: string, state: string, createdAt: string, receipt?: { __typename?: 'BridgeDrainReceipt', url: string } | null }> | null };
export type CheckKycStatusQueryVariables = Exact<{ [key: string]: never; }>;
diff --git a/src/i18n/en.json b/src/i18n/en.json
index d2b3d026d15..f4e37362222 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -1446,6 +1446,7 @@
"table.row.asset": "Asset",
"table.row.balance": "Balance",
"table.content.viewReceipt": "View receipt",
+ "table.content.receiptGenerating": "Generating...",
"user.not.verified.warning": "This member has not yet been verified. Ensure you know who this member and the address is correct.",
"actionSidebar.distribution": "Distribution",
"actionSidebar.distributionPlaceholder": "Select split type",