Skip to content

Commit

Permalink
adds starting balance to payments queries
Browse files Browse the repository at this point in the history
  • Loading branch information
aristidesstaffieri committed Nov 30, 2023
1 parent 1321cae commit e8b6c6b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/service/mercury/helpers/transformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,15 @@ interface MercuryAccountHistory {
edges: {
node: {
destination: string;
startingBalance: string;
};
}[];
};
createAccountToPublicKey: {
edges: {
node: {
destination: string;
startingBalance: string;
};
}[];
};
Expand Down Expand Up @@ -758,7 +760,7 @@ const transformAccountHistory = async (
(edge) =>
({
destination: edge.node.destination,
starting_balance: "", // TODO: need from Mercury
starting_balance: edge.node.startingBalance,
} as Partial<Horizon.ServerApi.CreateAccountOperationRecord>)
);

Expand All @@ -768,6 +770,7 @@ const transformAccountHistory = async (
(edge) =>
({
destination: edge.node.destination,
starting_balance: edge.node.startingBalance,
} as Partial<Horizon.ServerApi.CreateAccountOperationRecord>)
);

Expand Down
4 changes: 4 additions & 0 deletions src/service/mercury/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,17 @@ export const query = {
edges {
node {
destination
startingBalance
}
}
}
createAccountToPublicKey(publicKeyText: $pubKey) {
edges {
node {
destination
startingBalance
}
}
}
Expand Down

0 comments on commit e8b6c6b

Please sign in to comment.