Skip to content

Commit

Permalink
fix: update wallet abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
dolcalmi committed Feb 19, 2024
1 parent b58fb51 commit b6da7ea
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions apps/admin-panel/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ export type Query = {
readonly merchantsPendingApproval: ReadonlyArray<Merchant>;
readonly transactionById?: Maybe<Transaction>;
readonly transactionsByHash?: Maybe<ReadonlyArray<Maybe<Transaction>>>;
readonly transactionsByPaymentRequest?: Maybe<ReadonlyArray<Maybe<Transaction>>>;
readonly wallet: Wallet;
};

Expand Down Expand Up @@ -486,6 +487,11 @@ export type QueryTransactionsByHashArgs = {
};


export type QueryTransactionsByPaymentRequestArgs = {
paymentRequest: Scalars['LnPaymentRequest']['input'];
};


export type QueryWalletArgs = {
walletId: Scalars['WalletId']['input'];
};
Expand Down
1 change: 1 addition & 0 deletions core/api/src/graphql/admin/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ type Query {
merchantsPendingApproval: [Merchant!]!
transactionById(id: ID!): Transaction
transactionsByHash(hash: PaymentHash!): [Transaction]
transactionsByPaymentRequest(paymentRequest: LnPaymentRequest!): [Transaction]
wallet(walletId: WalletId!): Wallet!
}

Expand Down
15 changes: 13 additions & 2 deletions core/api/src/graphql/shared/types/abstract/wallet.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import dedent from "dedent"

import Transaction, { TransactionConnection } from "../object/transaction"
import PaymentHash from "../scalar/payment-hash"
import WalletCurrency from "../scalar/wallet-currency"
import SignedAmount from "../scalar/signed-amount"
import OnChainAddress from "../scalar/on-chain-address"
import PaymentHash from "../scalar/payment-hash"
import LnPaymentRequest from "../scalar/ln-payment-request"
import Transaction, { TransactionConnection } from "../object/transaction"

import IInvoice, { IInvoiceConnection } from "./invoice"

Expand Down Expand Up @@ -96,6 +97,16 @@ const IWallet = GT.Interface({
},
},
},
transactionsByPaymentRequest: {
type: GT.NonNullList(Transaction),
description: "Returns the transactions that include this paymentRequest.",
args: {
paymentRequest: {
type: GT.NonNull(LnPaymentRequest),
description: "Lightning invoice paid in this transaction.",
},
},
},
transactionById: {
type: GT.NonNull(Transaction),
args: {
Expand Down

0 comments on commit b6da7ea

Please sign in to comment.