@venlyfinance/react 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -48,3 +48,42 @@ Initial release.
48
48
  matching `venlyQueries` factories; the account-scoped key shares the
49
49
  `["venly", "account", id]` prefix so account invalidations reach it.
50
50
  - Requires `@venlyfinance/sdk` ^0.5.0 (the `supportedAssets` resource).
51
+
52
+ ## 0.5.0 – 2026-08-21
53
+
54
+ *(Entry backfilled 2026-08-21 – this release shipped without a changelog note.)*
55
+
56
+ - `useTransfersForPeriod(accountId, period)`: every transfer whose `createdAt`
57
+ falls in the period, plus the account's full ledger after paging to
58
+ completion (the list contract has no date filter), so opening/closing
59
+ balances can be walked from the current wallet total. Backed by the exported
60
+ `collectTransfersForPeriod` helper and the `venlyKeys.transfersForPeriod`
61
+ key.
62
+ - New exported types: `TransferPeriod`, `TransfersForPeriodPage`.
63
+
64
+ ## 0.6.0 – 2026-08-21
65
+
66
+ - `usePartyIvVerification(partyId)`: the party's identity-verification state,
67
+ read off the contract operation (`getPartyIvVerification`, sdk 0.7.0).
68
+ `NOT_LINKED` resolves like any other state.
69
+ - Payout read hooks over client methods that already existed but had no hook:
70
+ `usePayouts(accountId, query?)`, `usePayout(accountId, payoutId)`,
71
+ `usePayoutRoutes(accountId, query?)`, `usePayoutBankAccounts(partyId, query?)`.
72
+ - Matching `venlyKeys` / `venlyQueries` factories; the party-scoped keys share
73
+ the `["venly", "party", id]` prefix and the account-scoped keys the
74
+ `["venly", "account", id]` prefix, so existing invalidations reach the new
75
+ reads.
76
+ - New exported types: `PartyIvVerification`, `PayoutsQuery`,
77
+ `PayoutRoutesQuery`, `PayoutBankAccountsQuery`.
78
+ - Write hooks for the send surface: `useCreateFiatTransfer` and
79
+ `useCreateCryptoTransfer` (typed entries into the staged-transfer machine –
80
+ the idempotency key is minted once per staged draft, so a retry replays the
81
+ same record), `useRequestPayout`, `useRegisterPayoutBankAccount`,
82
+ `useCreatePayoutRoute`, `usePreparePayoutOwnershipProof`,
83
+ `useCompletePayoutOwnershipProof`, `useAddPartyRole`; plus the
84
+ `usePartyRoles(accountId, query?)` read with its `venlyKeys` /
85
+ `venlyQueries` factory. New exported types: `PartyRolesQuery`,
86
+ `FiatTransferDraft`, `CryptoTransferDraft`.
87
+ - Requires `@venlyfinance/sdk` ^0.7.0 (the `parties.ivVerification` method).
88
+ The manifest range moves with the publish, alongside the lockfile
89
+ regeneration, per this repo's publish sequencing.
@@ -111,4 +111,32 @@ export declare function useStagedTransfer(options?: StagedTransferOptions): {
111
111
  confirm: () => Promise<void>;
112
112
  reset: () => void;
113
113
  };
114
+ export type FiatTransferDraft = Omit<Extract<TransferDraft, {
115
+ kind: "fiat";
116
+ }>, "kind">;
117
+ export type CryptoTransferDraft = Omit<Extract<TransferDraft, {
118
+ kind: "crypto";
119
+ }>, "kind">;
120
+ /**
121
+ * Create a fiat transfer, wired through the staged-transfer flow: stage()
122
+ * freezes the exact request and pins ONE idempotency key per staged draft;
123
+ * confirm() executes once and polls to a terminal status. However often
124
+ * confirm() is retried on the same staged draft, the API replays the same
125
+ * record instead of moving money twice.
126
+ */
127
+ export declare function useCreateFiatTransfer(options?: StagedTransferOptions): {
128
+ stage: (draft: FiatTransferDraft) => boolean;
129
+ state: StagedTransferState;
130
+ edit: () => void;
131
+ confirm: () => Promise<void>;
132
+ reset: () => void;
133
+ };
134
+ /** The crypto twin of {@link useCreateFiatTransfer}: same machine, same key rule. */
135
+ export declare function useCreateCryptoTransfer(options?: StagedTransferOptions): {
136
+ stage: (draft: CryptoTransferDraft) => boolean;
137
+ state: StagedTransferState;
138
+ edit: () => void;
139
+ confirm: () => Promise<void>;
140
+ reset: () => void;
141
+ };
114
142
  export {};
@@ -186,3 +186,25 @@ export function useStagedTransfer(options) {
186
186
  reset: () => controller.reset(),
187
187
  };
188
188
  }
189
+ /**
190
+ * Create a fiat transfer, wired through the staged-transfer flow: stage()
191
+ * freezes the exact request and pins ONE idempotency key per staged draft;
192
+ * confirm() executes once and polls to a terminal status. However often
193
+ * confirm() is retried on the same staged draft, the API replays the same
194
+ * record instead of moving money twice.
195
+ */
196
+ export function useCreateFiatTransfer(options) {
197
+ const flow = useStagedTransfer(options);
198
+ return {
199
+ ...flow,
200
+ stage: (draft) => flow.stage({ kind: "fiat", ...draft }),
201
+ };
202
+ }
203
+ /** The crypto twin of {@link useCreateFiatTransfer}: same machine, same key rule. */
204
+ export function useCreateCryptoTransfer(options) {
205
+ const flow = useStagedTransfer(options);
206
+ return {
207
+ ...flow,
208
+ stage: (draft) => flow.stage({ kind: "crypto", ...draft }),
209
+ };
210
+ }
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  export { VenlyProvider, useVenly, useVenlyMock, type VenlyClients, type VenlyProviderProps, type VenlyReactEnvironment, } from "./provider.js";
2
2
  export { venlyKeys } from "./keys.js";
3
- export { venlyQueries, type AccountsQuery, type FeeQuoteInput, type PartiesQuery, type RampRequestsQuery, type TransfersQuery, type VirtualBankAccountsQuery, type WalletsQuery, } from "./query-options.js";
4
- export { useAccount, useAccounts, useCompanyFees, useFeeQuote, useParties, useParty, useRampRequest, useRampRequests, useReferenceData, useTransfer, useTransfers, useTransfersForPeriod, collectTransfersForPeriod, type TransferPeriod, type TransfersForPeriodPage, useVirtualBankAccounts, useWallets, useCompanyBankAccount, useCompanyBankAccounts, useCompanyWallets, useBankAccountConfig, useDepositWallets, useRampPairs, useSupportedAssets, useAccountSupportedAssets, } from "./queries.js";
5
- export { useCreateAccount, useCreateParty, useCreatePaymentSession, useCreateRampRequest, useCreateVirtualBankAccount, useCreateCompanyBankAccount, useCreateCompanyWallet, useSetRampAmount, useInitiateRamp, } from "./mutations.js";
6
- export { StagedTransferController, useStagedTransfer, validateDraft, type StagedRequest, type StagedTransferOptions, type StagedTransferState, type TransferDraft, } from "./flows/staged-transfer.js";
3
+ export { venlyQueries, type AccountsQuery, type FeeQuoteInput, type PartiesQuery, type PartyRolesQuery, type PayoutBankAccountsQuery, type PayoutRoutesQuery, type PayoutsQuery, type RampRequestsQuery, type TransfersQuery, type VirtualBankAccountsQuery, type WalletsQuery, } from "./query-options.js";
4
+ export { useAccount, useAccounts, useCompanyFees, useFeeQuote, useParties, useParty, usePartyIvVerification, usePartyRoles, usePayout, usePayoutBankAccounts, usePayoutRoutes, usePayouts, useRampRequest, useRampRequests, useReferenceData, useTransfer, useTransfers, useTransfersForPeriod, collectTransfersForPeriod, type TransferPeriod, type TransfersForPeriodPage, useVirtualBankAccounts, useWallets, useCompanyBankAccount, useCompanyBankAccounts, useCompanyWallets, useBankAccountConfig, useDepositWallets, useRampPairs, useSupportedAssets, useAccountSupportedAssets, useWebhooks, useWebhook, } from "./queries.js";
5
+ export { useCreateAccount, useCreateParty, useCreatePaymentSession, useCreateRampRequest, useCreateVirtualBankAccount, useCreateCompanyBankAccount, useCreateCompanyWallet, useSetRampAmount, useInitiateRamp, useCreateWebhook, useUpdateWebhook, useDeleteWebhook, usePingWebhook, useAddPartyRole, useRegisterPayoutBankAccount, useCreatePayoutRoute, usePreparePayoutOwnershipProof, useCompletePayoutOwnershipProof, useRequestPayout, } from "./mutations.js";
6
+ export { StagedTransferController, useStagedTransfer, useCreateFiatTransfer, useCreateCryptoTransfer, validateDraft, type CryptoTransferDraft, type FiatTransferDraft, type StagedRequest, type StagedTransferOptions, type StagedTransferState, type TransferDraft, } from "./flows/staged-transfer.js";
7
7
  export { approvalCapabilities, interpretApprovalError, useFourEyesApproval, type ApprovalCapability, type ApprovalFailureKind, type FourEyesState, } from "./flows/four-eyes.js";
8
8
  export { describeRampStatus, useRampLifecycle, type RampLifecycleOptions, type RampStatus, type RampStatusDescriptor, } from "./flows/ramp-lifecycle.js";
9
9
  export { proxyClientOptions, VENLY_PROXY_SECRET_SENTINEL, type ProxyClientOptions, } from "./proxy.js";
10
10
  export { FundflowClient, VenlyApiError, VenlyAuthError, VenlyFinanceClient, } from "@venlyfinance/sdk";
11
- export type { Account, Party, RampRequest, Transfer, VirtualBankAccount, WalletBalance, Payout, PayoutRoute, PayoutBankAccount, } from "@venlyfinance/sdk";
11
+ export type { Account, Party, PartyIvVerification, RampRequest, Transfer, VirtualBankAccount, WalletBalance, Payout, PayoutRoute, PayoutBankAccount, Webhook, CreateWebhookRequest, UpdateWebhookRequest, WebhookAuthenticationMethod, MockWebhookDelivery, MockTenantConfig, } from "@venlyfinance/sdk";
package/dist/index.js CHANGED
@@ -4,11 +4,11 @@ export { VenlyProvider, useVenly, useVenlyMock, } from "./provider.js";
4
4
  export { venlyKeys } from "./keys.js";
5
5
  export { venlyQueries, } from "./query-options.js";
6
6
  // Read hooks
7
- export { useAccount, useAccounts, useCompanyFees, useFeeQuote, useParties, useParty, useRampRequest, useRampRequests, useReferenceData, useTransfer, useTransfers, useTransfersForPeriod, collectTransfersForPeriod, useVirtualBankAccounts, useWallets, useCompanyBankAccount, useCompanyBankAccounts, useCompanyWallets, useBankAccountConfig, useDepositWallets, useRampPairs, useSupportedAssets, useAccountSupportedAssets, } from "./queries.js";
7
+ export { useAccount, useAccounts, useCompanyFees, useFeeQuote, useParties, useParty, usePartyIvVerification, usePartyRoles, usePayout, usePayoutBankAccounts, usePayoutRoutes, usePayouts, useRampRequest, useRampRequests, useReferenceData, useTransfer, useTransfers, useTransfersForPeriod, collectTransfersForPeriod, useVirtualBankAccounts, useWallets, useCompanyBankAccount, useCompanyBankAccounts, useCompanyWallets, useBankAccountConfig, useDepositWallets, useRampPairs, useSupportedAssets, useAccountSupportedAssets, useWebhooks, useWebhook, } from "./queries.js";
8
8
  // Write hooks
9
- export { useCreateAccount, useCreateParty, useCreatePaymentSession, useCreateRampRequest, useCreateVirtualBankAccount, useCreateCompanyBankAccount, useCreateCompanyWallet, useSetRampAmount, useInitiateRamp, } from "./mutations.js";
9
+ export { useCreateAccount, useCreateParty, useCreatePaymentSession, useCreateRampRequest, useCreateVirtualBankAccount, useCreateCompanyBankAccount, useCreateCompanyWallet, useSetRampAmount, useInitiateRamp, useCreateWebhook, useUpdateWebhook, useDeleteWebhook, usePingWebhook, useAddPartyRole, useRegisterPayoutBankAccount, useCreatePayoutRoute, usePreparePayoutOwnershipProof, useCompletePayoutOwnershipProof, useRequestPayout, } from "./mutations.js";
10
10
  // Flow machines: the regulated-money lifecycles
11
- export { StagedTransferController, useStagedTransfer, validateDraft, } from "./flows/staged-transfer.js";
11
+ export { StagedTransferController, useStagedTransfer, useCreateFiatTransfer, useCreateCryptoTransfer, validateDraft, } from "./flows/staged-transfer.js";
12
12
  export { approvalCapabilities, interpretApprovalError, useFourEyesApproval, } from "./flows/four-eyes.js";
13
13
  export { describeRampStatus, useRampLifecycle, } from "./flows/ramp-lifecycle.js";
14
14
  // Browser-safe deployment shape
package/dist/keys.d.ts CHANGED
@@ -6,13 +6,19 @@ export declare const venlyKeys: {
6
6
  readonly all: readonly ["venly"];
7
7
  readonly parties: (query?: unknown) => readonly ["venly", "parties", {} | null];
8
8
  readonly party: (partyId: string) => readonly ["venly", "party", string];
9
+ readonly partyIvVerification: (partyId: string) => readonly ["venly", "party", string, "iv-verification"];
10
+ readonly payoutBankAccounts: (partyId: string, query?: unknown) => readonly ["venly", "party", string, "payout-bank-accounts", {} | null];
9
11
  readonly accounts: (query?: unknown) => readonly ["venly", "accounts", {} | null];
10
12
  readonly account: (accountId: string) => readonly ["venly", "account", string];
13
+ readonly partyRoles: (accountId: string, query?: unknown) => readonly ["venly", "account", string, "party-roles", {} | null];
11
14
  readonly wallets: (accountId: string, query?: unknown) => readonly ["venly", "account", string, "wallets", {} | null];
12
15
  readonly supportedAssets: () => readonly ["venly", "supported-assets"];
13
16
  readonly accountSupportedAssets: (accountId: string) => readonly ["venly", "account", string, "supported-assets"];
14
17
  readonly virtualBankAccounts: (accountId: string, query?: unknown) => readonly ["venly", "account", string, "virtual-bank-accounts", {} | null];
15
18
  readonly transfers: (accountId: string, query?: unknown) => readonly ["venly", "account", string, "transfers", {} | null];
19
+ readonly payouts: (accountId: string, query?: unknown) => readonly ["venly", "account", string, "payouts", {} | null];
20
+ readonly payout: (accountId: string, payoutId: string) => readonly ["venly", "account", string, "payout", string];
21
+ readonly payoutRoutes: (accountId: string, query?: unknown) => readonly ["venly", "account", string, "payout-routes", {} | null];
16
22
  readonly transfersForPeriod: (accountId: string, period: {
17
23
  start: string;
18
24
  end: string;
@@ -20,6 +26,8 @@ export declare const venlyKeys: {
20
26
  readonly transfer: (accountId: string, transferId: string) => readonly ["venly", "account", string, "transfer", string];
21
27
  readonly rampRequests: (query?: unknown) => readonly ["venly", "ramp-requests", {} | null];
22
28
  readonly rampRequest: (id: string) => readonly ["venly", "ramp-request", string];
29
+ readonly webhooks: () => readonly ["venly", "webhooks"];
30
+ readonly webhook: (webhookId: string) => readonly ["venly", "webhook", string];
23
31
  readonly referenceData: () => readonly ["venly", "reference-data"];
24
32
  readonly companyBankAccounts: (query?: unknown) => readonly ["venly", "company-bank-accounts", {} | null];
25
33
  readonly companyBankAccount: (id: string) => readonly ["venly", "company-bank-account", string];
package/dist/keys.js CHANGED
@@ -6,17 +6,26 @@ export const venlyKeys = {
6
6
  all: ["venly"],
7
7
  parties: (query) => ["venly", "parties", query ?? null],
8
8
  party: (partyId) => ["venly", "party", partyId],
9
+ // Shares the ["venly","party",id] prefix so a party invalidation reaches it.
10
+ partyIvVerification: (partyId) => ["venly", "party", partyId, "iv-verification"],
11
+ payoutBankAccounts: (partyId, query) => ["venly", "party", partyId, "payout-bank-accounts", query ?? null],
9
12
  accounts: (query) => ["venly", "accounts", query ?? null],
10
13
  account: (accountId) => ["venly", "account", accountId],
14
+ partyRoles: (accountId, query) => ["venly", "account", accountId, "party-roles", query ?? null],
11
15
  wallets: (accountId, query) => ["venly", "account", accountId, "wallets", query ?? null],
12
16
  supportedAssets: () => ["venly", "supported-assets"],
13
17
  accountSupportedAssets: (accountId) => ["venly", "account", accountId, "supported-assets"],
14
18
  virtualBankAccounts: (accountId, query) => ["venly", "account", accountId, "virtual-bank-accounts", query ?? null],
15
19
  transfers: (accountId, query) => ["venly", "account", accountId, "transfers", query ?? null],
20
+ payouts: (accountId, query) => ["venly", "account", accountId, "payouts", query ?? null],
21
+ payout: (accountId, payoutId) => ["venly", "account", accountId, "payout", payoutId],
22
+ payoutRoutes: (accountId, query) => ["venly", "account", accountId, "payout-routes", query ?? null],
16
23
  transfersForPeriod: (accountId, period) => ["venly", "account", accountId, "transfers-for-period", period.start, period.end],
17
24
  transfer: (accountId, transferId) => ["venly", "account", accountId, "transfer", transferId],
18
25
  rampRequests: (query) => ["venly", "ramp-requests", query ?? null],
19
26
  rampRequest: (id) => ["venly", "ramp-request", id],
27
+ webhooks: () => ["venly", "webhooks"],
28
+ webhook: (webhookId) => ["venly", "webhook", webhookId],
20
29
  referenceData: () => ["venly", "reference-data"],
21
30
  companyBankAccounts: (query) => ["venly", "company-bank-accounts", query ?? null],
22
31
  companyBankAccount: (id) => ["venly", "company-bank-account", id],
@@ -125,6 +125,115 @@ export declare function useCreateRampRequest(): import("@tanstack/react-query").
125
125
  fiatCurrencyId: string;
126
126
  cryptoCurrencyId: string;
127
127
  }, unknown>;
128
+ type AddPartyRoleBody = Parameters<VenlyFinanceClient["accounts"]["addPartyRole"]>[1];
129
+ type RegisterPayoutBankAccountBody = Parameters<VenlyFinanceClient["payoutBankAccounts"]["register"]>[1];
130
+ type CreatePayoutRouteBody = Parameters<VenlyFinanceClient["payoutRoutes"]["create"]>[1];
131
+ type CompleteOwnershipProofBody = Parameters<VenlyFinanceClient["payoutRoutes"]["completeOwnershipProof"]>[2];
132
+ type RequestPayoutBody = Parameters<VenlyFinanceClient["payouts"]["request"]>[1];
133
+ /**
134
+ * Attach a party to an account with a role (PAYOUT_RECIPIENT for saved
135
+ * third-party recipients), then refresh the account's role list.
136
+ */
137
+ export declare function useAddPartyRole(): import("@tanstack/react-query").UseMutationResult<{
138
+ partyId?: string;
139
+ roleType?: "ACCOUNT_HOLDER" | "PAYOUT_RECIPIENT";
140
+ status?: "ACTIVE" | "INACTIVE";
141
+ createdAt?: string;
142
+ updatedAt?: string;
143
+ }, Error, {
144
+ accountId: string;
145
+ body: AddPartyRoleBody;
146
+ }, unknown>;
147
+ /**
148
+ * Register a beneficiary bank account on a party. The response's details
149
+ * come back masked server-side (last4, BIC) - render those, never re-ask.
150
+ * A new account starts PENDING until reviewed.
151
+ */
152
+ export declare function useRegisterPayoutBankAccount(): import("@tanstack/react-query").UseMutationResult<{
153
+ id?: string;
154
+ partyId?: string;
155
+ rail?: "US_ACH" | "SEPA";
156
+ fiatCurrency?: string;
157
+ label?: string;
158
+ accountHolderName?: string;
159
+ details?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["MaskedRailDetailsDto"];
160
+ bankName?: string;
161
+ beneficiaryEmail?: string;
162
+ beneficiaryPhoneNumber?: string;
163
+ bankAddress?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["BankAddressDto"];
164
+ status?: "PENDING" | "ACTIVE" | "DISABLED";
165
+ createdAt?: string;
166
+ updatedAt?: string;
167
+ }, Error, {
168
+ partyId: string;
169
+ body: RegisterPayoutBankAccountBody;
170
+ }, unknown>;
171
+ /**
172
+ * Bind a beneficiary bank account to an account and a deposit asset. The
173
+ * route activates only after wallet-ownership proof completes.
174
+ */
175
+ export declare function useCreatePayoutRoute(): import("@tanstack/react-query").UseMutationResult<{
176
+ id?: string;
177
+ status?: "PENDING" | "REGISTERING" | "AWAITING_OWNERSHIP_PROOF" | "ACTIVE" | "REJECTED";
178
+ depositAsset?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["DepositAssetDto"];
179
+ fiatCurrency?: string;
180
+ depositAddress?: string;
181
+ createdAt?: string;
182
+ updatedAt?: string;
183
+ }, Error, {
184
+ accountId: string;
185
+ body: CreatePayoutRouteBody;
186
+ }, unknown>;
187
+ /**
188
+ * Fetch the message the route's funding wallet must sign. The server derives
189
+ * wallet and chain from the route; there is no request body.
190
+ */
191
+ export declare function usePreparePayoutOwnershipProof(): import("@tanstack/react-query").UseMutationResult<{
192
+ walletAddress?: string;
193
+ blockchain?: string;
194
+ message?: string;
195
+ signedOnUtc?: string;
196
+ }, Error, {
197
+ accountId: string;
198
+ routeId: string;
199
+ }, unknown>;
200
+ /** Submit the signed message; on success the route becomes ACTIVE. */
201
+ export declare function useCompletePayoutOwnershipProof(): import("@tanstack/react-query").UseMutationResult<{
202
+ id?: string;
203
+ status?: "PENDING" | "REGISTERING" | "AWAITING_OWNERSHIP_PROOF" | "ACTIVE" | "REJECTED";
204
+ depositAsset?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["DepositAssetDto"];
205
+ fiatCurrency?: string;
206
+ depositAddress?: string;
207
+ createdAt?: string;
208
+ updatedAt?: string;
209
+ }, Error, {
210
+ accountId: string;
211
+ routeId: string;
212
+ body: CompleteOwnershipProofBody;
213
+ }, unknown>;
214
+ /**
215
+ * Request a third-party payout over an ACTIVE route. The body's
216
+ * idempotencyKey is the replay guard: mint it ONCE per staged draft and
217
+ * reuse it on every retry of the same draft - the API then executes the
218
+ * movement at most once and a replay returns the original record.
219
+ */
220
+ export declare function useRequestPayout(): import("@tanstack/react-query").UseMutationResult<{
221
+ id?: string;
222
+ accountId?: string;
223
+ payoutRoute?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["PayoutRouteInfoDto"];
224
+ rail?: "US_ACH" | "SEPA";
225
+ cryptoAmount?: number;
226
+ settledFiatAmount?: number;
227
+ fundingMode?: "PULL" | "PUSH";
228
+ status?: "REQUESTED" | "SENDING" | "PROVIDER_PROCESSING" | "COMPLETED" | "REJECTED" | "FAILED" | "RETURNED";
229
+ sendTxHash?: string;
230
+ requestedAt?: string;
231
+ completedAt?: string;
232
+ failureReason?: string;
233
+ }, Error, {
234
+ accountId: string;
235
+ body: RequestPayoutBody;
236
+ }, unknown>;
128
237
  type SetRampAmountBody = Parameters<FundflowClient["rampRequests"]["setAmount"]>[1];
129
238
  type InitiateRampBody = Parameters<FundflowClient["rampRequests"]["initiate"]>[1];
130
239
  /** Whitelist a company bank account (created PENDING, verified out-of-band). */
@@ -210,4 +319,42 @@ export declare function useInitiateRamp(): import("@tanstack/react-query").UseMu
210
319
  id: string;
211
320
  body: InitiateRampBody;
212
321
  }, unknown>;
322
+ type UpdateWebhookBody = Parameters<VenlyFinanceClient["webhooks"]["update"]>[1];
323
+ /** Register a webhook endpoint, then refresh the webhook list. */
324
+ export declare function useCreateWebhook(): import("@tanstack/react-query").UseMutationResult<{
325
+ id?: string;
326
+ url?: string;
327
+ name?: string;
328
+ authenticationMethod?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["ApiKeyAuthenticationMethod"] | import("@venlyfinance/sdk").FinanceComponents["schemas"]["BasicAuthenticationMethod"];
329
+ status?: "ACTIVE";
330
+ }, Error, {
331
+ url: string;
332
+ name?: string;
333
+ authenticationMethod: import("@venlyfinance/sdk").FinanceComponents["schemas"]["ApiKeyAuthenticationMethod"] | import("@venlyfinance/sdk").FinanceComponents["schemas"]["BasicAuthenticationMethod"];
334
+ }, unknown>;
335
+ /** Replace a webhook's url/name/authentication (PUT semantics). */
336
+ export declare function useUpdateWebhook(): import("@tanstack/react-query").UseMutationResult<{
337
+ id?: string;
338
+ url?: string;
339
+ name?: string;
340
+ authenticationMethod?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["ApiKeyAuthenticationMethod"] | import("@venlyfinance/sdk").FinanceComponents["schemas"]["BasicAuthenticationMethod"];
341
+ status?: "ACTIVE";
342
+ }, Error, {
343
+ webhookId: string;
344
+ body: UpdateWebhookBody;
345
+ }, unknown>;
346
+ /** Delete a webhook registration; deliveries to it stop. */
347
+ export declare function useDeleteWebhook(): import("@tanstack/react-query").UseMutationResult<void, Error, string, unknown>;
348
+ /**
349
+ * Fire a test delivery at the endpoint. Resolves the contract's void
350
+ * envelope so a surface can render the outcome verbatim; invalidates
351
+ * nothing - a ping changes no resource.
352
+ */
353
+ export declare function usePingWebhook(): import("@tanstack/react-query").UseMutationResult<{
354
+ pagination?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["Pagination"];
355
+ sort?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["Sort"];
356
+ success?: boolean;
357
+ result?: unknown;
358
+ errors?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["ErrorBody"][];
359
+ }, Error, string, unknown>;
213
360
  export {};
package/dist/mutations.js CHANGED
@@ -56,6 +56,103 @@ export function useCreateRampRequest() {
56
56
  },
57
57
  });
58
58
  }
59
+ /**
60
+ * Attach a party to an account with a role (PAYOUT_RECIPIENT for saved
61
+ * third-party recipients), then refresh the account's role list.
62
+ */
63
+ export function useAddPartyRole() {
64
+ const { finance } = useVenly();
65
+ const queryClient = useQueryClient();
66
+ return useMutation({
67
+ mutationFn: (input) => finance.accounts.addPartyRole(input.accountId, input.body),
68
+ onSuccess: (_role, input) => {
69
+ void queryClient.invalidateQueries({
70
+ queryKey: ["venly", "account", input.accountId, "party-roles"],
71
+ });
72
+ },
73
+ });
74
+ }
75
+ /**
76
+ * Register a beneficiary bank account on a party. The response's details
77
+ * come back masked server-side (last4, BIC) - render those, never re-ask.
78
+ * A new account starts PENDING until reviewed.
79
+ */
80
+ export function useRegisterPayoutBankAccount() {
81
+ const { finance } = useVenly();
82
+ const queryClient = useQueryClient();
83
+ return useMutation({
84
+ mutationFn: (input) => finance.payoutBankAccounts.register(input.partyId, input.body),
85
+ onSuccess: (_account, input) => {
86
+ void queryClient.invalidateQueries({
87
+ queryKey: ["venly", "party", input.partyId, "payout-bank-accounts"],
88
+ });
89
+ },
90
+ });
91
+ }
92
+ /**
93
+ * Bind a beneficiary bank account to an account and a deposit asset. The
94
+ * route activates only after wallet-ownership proof completes.
95
+ */
96
+ export function useCreatePayoutRoute() {
97
+ const { finance } = useVenly();
98
+ const queryClient = useQueryClient();
99
+ return useMutation({
100
+ mutationFn: (input) => finance.payoutRoutes.create(input.accountId, input.body),
101
+ onSuccess: (_route, input) => {
102
+ void queryClient.invalidateQueries({
103
+ queryKey: ["venly", "account", input.accountId, "payout-routes"],
104
+ });
105
+ },
106
+ });
107
+ }
108
+ /**
109
+ * Fetch the message the route's funding wallet must sign. The server derives
110
+ * wallet and chain from the route; there is no request body.
111
+ */
112
+ export function usePreparePayoutOwnershipProof() {
113
+ const { finance } = useVenly();
114
+ return useMutation({
115
+ mutationFn: (input) => finance.payoutRoutes.prepareOwnershipProof(input.accountId, input.routeId),
116
+ });
117
+ }
118
+ /** Submit the signed message; on success the route becomes ACTIVE. */
119
+ export function useCompletePayoutOwnershipProof() {
120
+ const { finance } = useVenly();
121
+ const queryClient = useQueryClient();
122
+ return useMutation({
123
+ mutationFn: (input) => finance.payoutRoutes.completeOwnershipProof(input.accountId, input.routeId, input.body),
124
+ onSuccess: (_route, input) => {
125
+ void queryClient.invalidateQueries({
126
+ queryKey: ["venly", "account", input.accountId, "payout-routes"],
127
+ });
128
+ },
129
+ });
130
+ }
131
+ /**
132
+ * Request a third-party payout over an ACTIVE route. The body's
133
+ * idempotencyKey is the replay guard: mint it ONCE per staged draft and
134
+ * reuse it on every retry of the same draft - the API then executes the
135
+ * movement at most once and a replay returns the original record.
136
+ */
137
+ export function useRequestPayout() {
138
+ const { finance } = useVenly();
139
+ const queryClient = useQueryClient();
140
+ return useMutation({
141
+ mutationFn: (input) => finance.payouts.request(input.accountId, input.body),
142
+ onSuccess: (payout, input) => {
143
+ if (payout.id) {
144
+ queryClient.setQueryData(venlyKeys.payout(input.accountId, payout.id), payout);
145
+ }
146
+ void queryClient.invalidateQueries({
147
+ queryKey: ["venly", "account", input.accountId, "payouts"],
148
+ });
149
+ // The request reserves funds, so the wallet rows moved too.
150
+ void queryClient.invalidateQueries({
151
+ queryKey: ["venly", "account", input.accountId, "wallets"],
152
+ });
153
+ },
154
+ });
155
+ }
59
156
  /** Whitelist a company bank account (created PENDING, verified out-of-band). */
60
157
  export function useCreateCompanyBankAccount() {
61
158
  const { fundflow } = useVenly();
@@ -104,3 +201,51 @@ export function useInitiateRamp() {
104
201
  },
105
202
  });
106
203
  }
204
+ /** Register a webhook endpoint, then refresh the webhook list. */
205
+ export function useCreateWebhook() {
206
+ const { finance } = useVenly();
207
+ const queryClient = useQueryClient();
208
+ return useMutation({
209
+ mutationFn: (body) => finance.webhooks.create(body),
210
+ onSuccess: (webhook) => {
211
+ if (webhook.id)
212
+ queryClient.setQueryData(venlyKeys.webhook(webhook.id), webhook);
213
+ void queryClient.invalidateQueries({ queryKey: venlyKeys.webhooks() });
214
+ },
215
+ });
216
+ }
217
+ /** Replace a webhook's url/name/authentication (PUT semantics). */
218
+ export function useUpdateWebhook() {
219
+ const { finance } = useVenly();
220
+ const queryClient = useQueryClient();
221
+ return useMutation({
222
+ mutationFn: (input) => finance.webhooks.update(input.webhookId, input.body),
223
+ onSuccess: (webhook, input) => {
224
+ queryClient.setQueryData(venlyKeys.webhook(input.webhookId), webhook);
225
+ void queryClient.invalidateQueries({ queryKey: venlyKeys.webhooks() });
226
+ },
227
+ });
228
+ }
229
+ /** Delete a webhook registration; deliveries to it stop. */
230
+ export function useDeleteWebhook() {
231
+ const { finance } = useVenly();
232
+ const queryClient = useQueryClient();
233
+ return useMutation({
234
+ mutationFn: (webhookId) => finance.webhooks.delete(webhookId),
235
+ onSuccess: (_void, webhookId) => {
236
+ queryClient.removeQueries({ queryKey: venlyKeys.webhook(webhookId) });
237
+ void queryClient.invalidateQueries({ queryKey: venlyKeys.webhooks() });
238
+ },
239
+ });
240
+ }
241
+ /**
242
+ * Fire a test delivery at the endpoint. Resolves the contract's void
243
+ * envelope so a surface can render the outcome verbatim; invalidates
244
+ * nothing - a ping changes no resource.
245
+ */
246
+ export function usePingWebhook() {
247
+ const { finance } = useVenly();
248
+ return useMutation({
249
+ mutationFn: (webhookId) => finance.webhooks.ping(webhookId),
250
+ });
251
+ }
package/dist/queries.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type UseQueryOptions } from "@tanstack/react-query";
2
2
  import { type Page, type Transfer as TransferRow } from "@venlyfinance/sdk";
3
- import { venlyQueries, type AccountsQuery, type FeeQuoteInput, type PartiesQuery, type RampRequestsQuery, type TransfersQuery, type VirtualBankAccountsQuery, type WalletsQuery, type CompanyBankAccountsQuery, type CompanyWalletsQuery, type DepositWalletsQuery } from "./query-options.js";
3
+ import { venlyQueries, type AccountsQuery, type FeeQuoteInput, type PartiesQuery, type PartyRolesQuery, type PayoutBankAccountsQuery, type PayoutRoutesQuery, type PayoutsQuery, type RampRequestsQuery, type TransfersQuery, type VirtualBankAccountsQuery, type WalletsQuery, type CompanyBankAccountsQuery, type CompanyWalletsQuery, type DepositWalletsQuery } from "./query-options.js";
4
4
  type Tune<T> = Omit<UseQueryOptions<T, Error>, "queryKey" | "queryFn">;
5
5
  export declare function useParties(query?: PartiesQuery, options?: Tune<PartiesPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<Page<{
6
6
  id?: string;
@@ -36,6 +36,18 @@ export declare function useParty(partyId: string | undefined, options?: Tune<Par
36
36
  version?: number;
37
37
  }>, Error>;
38
38
  type Party = Awaited<ReturnType<ReturnType<typeof venlyQueries.party>["queryFn"]>>;
39
+ /**
40
+ * The party's identity-verification state, from the contract operation
41
+ * (`getPartyIvVerification`). `NOT_LINKED` resolves like any other state -
42
+ * identity verification is a state every party has, not a resource some lack.
43
+ */
44
+ export declare function usePartyIvVerification(partyId: string | undefined, options?: Tune<PartyIvVerification>): import("@tanstack/react-query").UseQueryResult<NoInfer<{
45
+ partyId?: string;
46
+ ivCaseReference?: string;
47
+ status?: "NOT_LINKED" | "SUBMITTED" | "FORWARDED" | "ACCEPTED" | "COMPLETED" | "FAILED";
48
+ linkedAt?: string;
49
+ }>, Error>;
50
+ type PartyIvVerification = Awaited<ReturnType<ReturnType<typeof venlyQueries.partyIvVerification>["queryFn"]>>;
39
51
  export declare function useAccounts(query?: AccountsQuery, options?: Tune<AccountsPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<Page<{
40
52
  id?: string;
41
53
  externalId?: string;
@@ -56,6 +68,18 @@ export declare function useAccount(accountId: string | undefined, options?: Tune
56
68
  version?: number;
57
69
  }>, Error>;
58
70
  type Account = Awaited<ReturnType<ReturnType<typeof venlyQueries.account>["queryFn"]>>;
71
+ /**
72
+ * The parties attached to an account with their role type and status.
73
+ * Saved payout recipients are the PAYOUT_RECIPIENT rows of this read.
74
+ */
75
+ export declare function usePartyRoles(accountId: string | undefined, query?: PartyRolesQuery, options?: Tune<PartyRolesPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<Page<{
76
+ partyId?: string;
77
+ roleType?: "ACCOUNT_HOLDER" | "PAYOUT_RECIPIENT";
78
+ status?: "ACTIVE" | "INACTIVE";
79
+ createdAt?: string;
80
+ updatedAt?: string;
81
+ }>>, Error>;
82
+ type PartyRolesPage = Awaited<ReturnType<ReturnType<typeof venlyQueries.partyRoles>["queryFn"]>>;
59
83
  export declare function useWallets(accountId: string | undefined, query?: WalletsQuery, options?: Tune<WalletsPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<Page<{
60
84
  asset?: string;
61
85
  contractAddress?: string;
@@ -162,6 +186,63 @@ export declare function useTransfer(accountId: string | undefined, transferId: s
162
186
  updatedAt?: string;
163
187
  }>, Error>;
164
188
  type Transfer = Awaited<ReturnType<ReturnType<typeof venlyQueries.transfer>["queryFn"]>>;
189
+ export declare function usePayouts(accountId: string | undefined, query?: PayoutsQuery, options?: Tune<PayoutsPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<Page<{
190
+ id?: string;
191
+ accountId?: string;
192
+ payoutRoute?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["PayoutRouteInfoDto"];
193
+ rail?: "US_ACH" | "SEPA";
194
+ cryptoAmount?: number;
195
+ settledFiatAmount?: number;
196
+ fundingMode?: "PULL" | "PUSH";
197
+ status?: "REQUESTED" | "SENDING" | "PROVIDER_PROCESSING" | "COMPLETED" | "REJECTED" | "FAILED" | "RETURNED";
198
+ sendTxHash?: string;
199
+ requestedAt?: string;
200
+ completedAt?: string;
201
+ failureReason?: string;
202
+ }>>, Error>;
203
+ type PayoutsPage = Awaited<ReturnType<ReturnType<typeof venlyQueries.payouts>["queryFn"]>>;
204
+ export declare function usePayout(accountId: string | undefined, payoutId: string | undefined, options?: Tune<PayoutDetail>): import("@tanstack/react-query").UseQueryResult<NoInfer<{
205
+ id?: string;
206
+ accountId?: string;
207
+ payoutRoute?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["PayoutRouteInfoDto"];
208
+ rail?: "US_ACH" | "SEPA";
209
+ cryptoAmount?: number;
210
+ settledFiatAmount?: number;
211
+ fundingMode?: "PULL" | "PUSH";
212
+ status?: "REQUESTED" | "SENDING" | "PROVIDER_PROCESSING" | "COMPLETED" | "REJECTED" | "FAILED" | "RETURNED";
213
+ sendTxHash?: string;
214
+ requestedAt?: string;
215
+ completedAt?: string;
216
+ failureReason?: string;
217
+ }>, Error>;
218
+ type PayoutDetail = Awaited<ReturnType<ReturnType<typeof venlyQueries.payout>["queryFn"]>>;
219
+ export declare function usePayoutRoutes(accountId: string | undefined, query?: PayoutRoutesQuery, options?: Tune<PayoutRoutesList>): import("@tanstack/react-query").UseQueryResult<NoInfer<{
220
+ id?: string;
221
+ status?: "PENDING" | "REGISTERING" | "AWAITING_OWNERSHIP_PROOF" | "ACTIVE" | "REJECTED";
222
+ depositAsset?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["DepositAssetDto"];
223
+ fiatCurrency?: string;
224
+ depositAddress?: string;
225
+ createdAt?: string;
226
+ updatedAt?: string;
227
+ }[]>, Error>;
228
+ type PayoutRoutesList = Awaited<ReturnType<ReturnType<typeof venlyQueries.payoutRoutes>["queryFn"]>>;
229
+ export declare function usePayoutBankAccounts(partyId: string | undefined, query?: PayoutBankAccountsQuery, options?: Tune<PayoutBankAccountsPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<Page<{
230
+ id?: string;
231
+ partyId?: string;
232
+ rail?: "US_ACH" | "SEPA";
233
+ fiatCurrency?: string;
234
+ label?: string;
235
+ accountHolderName?: string;
236
+ details?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["MaskedRailDetailsDto"];
237
+ bankName?: string;
238
+ beneficiaryEmail?: string;
239
+ beneficiaryPhoneNumber?: string;
240
+ bankAddress?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["BankAddressDto"];
241
+ status?: "PENDING" | "ACTIVE" | "DISABLED";
242
+ createdAt?: string;
243
+ updatedAt?: string;
244
+ }>>, Error>;
245
+ type PayoutBankAccountsPage = Awaited<ReturnType<ReturnType<typeof venlyQueries.payoutBankAccounts>["queryFn"]>>;
165
246
  export declare function useRampRequests(query?: RampRequestsQuery, options?: Tune<RampPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<Page<{
166
247
  id?: string;
167
248
  paymentReference?: string;
@@ -226,6 +307,23 @@ export declare function useReferenceData(options?: Tune<ReferenceData>): import(
226
307
  }[];
227
308
  }>, Error>;
228
309
  type ReferenceData = Awaited<ReturnType<ReturnType<typeof venlyQueries.referenceData>["queryFn"]>>;
310
+ /** The tenant's registered webhook endpoints. */
311
+ export declare function useWebhooks(options?: Tune<WebhooksPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<Page<{
312
+ id?: string;
313
+ url?: string;
314
+ name?: string;
315
+ authenticationMethod?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["ApiKeyAuthenticationMethod"] | import("@venlyfinance/sdk").FinanceComponents["schemas"]["BasicAuthenticationMethod"];
316
+ status?: "ACTIVE";
317
+ }>>, Error>;
318
+ type WebhooksPage = Awaited<ReturnType<ReturnType<typeof venlyQueries.webhooks>["queryFn"]>>;
319
+ export declare function useWebhook(webhookId: string | undefined, options?: Tune<WebhookItem>): import("@tanstack/react-query").UseQueryResult<NoInfer<{
320
+ id?: string;
321
+ url?: string;
322
+ name?: string;
323
+ authenticationMethod?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["ApiKeyAuthenticationMethod"] | import("@venlyfinance/sdk").FinanceComponents["schemas"]["BasicAuthenticationMethod"];
324
+ status?: "ACTIVE";
325
+ }>, Error>;
326
+ type WebhookItem = Awaited<ReturnType<ReturnType<typeof venlyQueries.webhook>["queryFn"]>>;
229
327
  export declare function useCompanyFees(options?: Tune<CompanyFees>): import("@tanstack/react-query").UseQueryResult<NoInfer<{
230
328
  id?: string;
231
329
  companyId?: string;
package/dist/queries.js CHANGED
@@ -15,6 +15,19 @@ export function useParty(partyId, options) {
15
15
  ...options,
16
16
  });
17
17
  }
18
+ /**
19
+ * The party's identity-verification state, from the contract operation
20
+ * (`getPartyIvVerification`). `NOT_LINKED` resolves like any other state -
21
+ * identity verification is a state every party has, not a resource some lack.
22
+ */
23
+ export function usePartyIvVerification(partyId, options) {
24
+ const clients = useVenly();
25
+ return useQuery({
26
+ ...venlyQueries.partyIvVerification(clients, partyId ?? ""),
27
+ enabled: Boolean(partyId) && (options?.enabled ?? true),
28
+ ...options,
29
+ });
30
+ }
18
31
  export function useAccounts(query, options) {
19
32
  const clients = useVenly();
20
33
  return useQuery({ ...venlyQueries.accounts(clients, query), ...options });
@@ -27,6 +40,18 @@ export function useAccount(accountId, options) {
27
40
  ...options,
28
41
  });
29
42
  }
43
+ /**
44
+ * The parties attached to an account with their role type and status.
45
+ * Saved payout recipients are the PAYOUT_RECIPIENT rows of this read.
46
+ */
47
+ export function usePartyRoles(accountId, query, options) {
48
+ const clients = useVenly();
49
+ return useQuery({
50
+ ...venlyQueries.partyRoles(clients, accountId ?? "", query),
51
+ enabled: Boolean(accountId) && (options?.enabled ?? true),
52
+ ...options,
53
+ });
54
+ }
30
55
  export function useWallets(accountId, query, options) {
31
56
  const clients = useVenly();
32
57
  return useQuery({
@@ -111,6 +136,38 @@ export function useTransfer(accountId, transferId, options) {
111
136
  ...options,
112
137
  });
113
138
  }
139
+ export function usePayouts(accountId, query, options) {
140
+ const clients = useVenly();
141
+ return useQuery({
142
+ ...venlyQueries.payouts(clients, accountId ?? "", query),
143
+ enabled: Boolean(accountId) && (options?.enabled ?? true),
144
+ ...options,
145
+ });
146
+ }
147
+ export function usePayout(accountId, payoutId, options) {
148
+ const clients = useVenly();
149
+ return useQuery({
150
+ ...venlyQueries.payout(clients, accountId ?? "", payoutId ?? ""),
151
+ enabled: Boolean(accountId && payoutId) && (options?.enabled ?? true),
152
+ ...options,
153
+ });
154
+ }
155
+ export function usePayoutRoutes(accountId, query, options) {
156
+ const clients = useVenly();
157
+ return useQuery({
158
+ ...venlyQueries.payoutRoutes(clients, accountId ?? "", query),
159
+ enabled: Boolean(accountId) && (options?.enabled ?? true),
160
+ ...options,
161
+ });
162
+ }
163
+ export function usePayoutBankAccounts(partyId, query, options) {
164
+ const clients = useVenly();
165
+ return useQuery({
166
+ ...venlyQueries.payoutBankAccounts(clients, partyId ?? "", query),
167
+ enabled: Boolean(partyId) && (options?.enabled ?? true),
168
+ ...options,
169
+ });
170
+ }
114
171
  export function useRampRequests(query, options) {
115
172
  const clients = useVenly();
116
173
  return useQuery({ ...venlyQueries.rampRequests(clients, query), ...options });
@@ -131,6 +188,19 @@ export function useReferenceData(options) {
131
188
  ...options,
132
189
  });
133
190
  }
191
+ /** The tenant's registered webhook endpoints. */
192
+ export function useWebhooks(options) {
193
+ const clients = useVenly();
194
+ return useQuery({ ...venlyQueries.webhooks(clients), ...options });
195
+ }
196
+ export function useWebhook(webhookId, options) {
197
+ const clients = useVenly();
198
+ return useQuery({
199
+ ...venlyQueries.webhook(clients, webhookId ?? ""),
200
+ enabled: Boolean(webhookId) && (options?.enabled ?? true),
201
+ ...options,
202
+ });
203
+ }
134
204
  export function useCompanyFees(options) {
135
205
  const clients = useVenly();
136
206
  return useQuery({ ...venlyQueries.companyFees(clients), ...options });
@@ -3,8 +3,12 @@ import type { VenlyClients } from "./provider.js";
3
3
  export type PartiesQuery = NonNullable<Parameters<VenlyFinanceClient["parties"]["list"]>[0]>;
4
4
  export type AccountsQuery = NonNullable<Parameters<VenlyFinanceClient["accounts"]["list"]>[0]>;
5
5
  export type WalletsQuery = NonNullable<Parameters<VenlyFinanceClient["wallets"]["list"]>[1]>;
6
+ export type PartyRolesQuery = NonNullable<Parameters<VenlyFinanceClient["accounts"]["listPartyRoles"]>[1]>;
6
7
  export type VirtualBankAccountsQuery = NonNullable<Parameters<VenlyFinanceClient["virtualBankAccounts"]["list"]>[1]>;
7
8
  export type TransfersQuery = NonNullable<Parameters<VenlyFinanceClient["transfers"]["list"]>[1]>;
9
+ export type PayoutsQuery = NonNullable<Parameters<VenlyFinanceClient["payouts"]["list"]>[1]>;
10
+ export type PayoutRoutesQuery = NonNullable<Parameters<VenlyFinanceClient["payoutRoutes"]["list"]>[1]>;
11
+ export type PayoutBankAccountsQuery = NonNullable<Parameters<VenlyFinanceClient["payoutBankAccounts"]["list"]>[1]>;
8
12
  export type RampRequestsQuery = NonNullable<Parameters<FundflowClient["rampRequests"]["list"]>[0]>;
9
13
  export type FeeQuoteInput = Parameters<FundflowClient["fees"]["calculate"]>[0];
10
14
  export type CompanyBankAccountsQuery = NonNullable<Parameters<FundflowClient["bankAccounts"]["list"]>[0]>;
@@ -54,6 +58,21 @@ export declare const venlyQueries: {
54
58
  version?: number;
55
59
  }>;
56
60
  };
61
+ /**
62
+ * The party's identity-verification state, read off the contract operation
63
+ * (`getPartyIvVerification`) - never off the mock's internals, so the same
64
+ * read works against every environment. `NOT_LINKED` is a state, not an
65
+ * error: an unlinked party resolves rather than rejecting.
66
+ */
67
+ readonly partyIvVerification: (clients: VenlyClients, partyId: string) => {
68
+ queryKey: readonly ["venly", "party", string, "iv-verification"];
69
+ queryFn: () => Promise<{
70
+ partyId?: string;
71
+ ivCaseReference?: string;
72
+ status?: "NOT_LINKED" | "SUBMITTED" | "FORWARDED" | "ACCEPTED" | "COMPLETED" | "FAILED";
73
+ linkedAt?: string;
74
+ }>;
75
+ };
57
76
  readonly accounts: (clients: VenlyClients, query?: AccountsQuery) => {
58
77
  queryKey: readonly ["venly", "accounts", {} | null];
59
78
  queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
@@ -78,6 +97,21 @@ export declare const venlyQueries: {
78
97
  version?: number;
79
98
  }>;
80
99
  };
100
+ /**
101
+ * The parties attached to an account, each with a role type
102
+ * (ACCOUNT_HOLDER | PAYOUT_RECIPIENT) and a status. The payout-recipient
103
+ * rows are the account's saved third-party recipients.
104
+ */
105
+ readonly partyRoles: (clients: VenlyClients, accountId: string, query?: PartyRolesQuery) => {
106
+ queryKey: readonly ["venly", "account", string, "party-roles", {} | null];
107
+ queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
108
+ partyId?: string;
109
+ roleType?: "ACCOUNT_HOLDER" | "PAYOUT_RECIPIENT";
110
+ status?: "ACTIVE" | "INACTIVE";
111
+ createdAt?: string;
112
+ updatedAt?: string;
113
+ }>>;
114
+ };
81
115
  readonly wallets: (clients: VenlyClients, accountId: string, query?: WalletsQuery) => {
82
116
  queryKey: readonly ["venly", "account", string, "wallets", {} | null];
83
117
  queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
@@ -169,6 +203,92 @@ export declare const venlyQueries: {
169
203
  updatedAt?: string;
170
204
  }>;
171
205
  };
206
+ readonly payouts: (clients: VenlyClients, accountId: string, query?: PayoutsQuery) => {
207
+ queryKey: readonly ["venly", "account", string, "payouts", {} | null];
208
+ queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
209
+ id?: string;
210
+ accountId?: string;
211
+ payoutRoute?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["PayoutRouteInfoDto"];
212
+ rail?: "US_ACH" | "SEPA";
213
+ cryptoAmount?: number;
214
+ settledFiatAmount?: number;
215
+ fundingMode?: "PULL" | "PUSH";
216
+ status?: "REQUESTED" | "SENDING" | "PROVIDER_PROCESSING" | "COMPLETED" | "REJECTED" | "FAILED" | "RETURNED";
217
+ sendTxHash?: string;
218
+ requestedAt?: string;
219
+ completedAt?: string;
220
+ failureReason?: string;
221
+ }>>;
222
+ };
223
+ readonly payout: (clients: VenlyClients, accountId: string, payoutId: string) => {
224
+ queryKey: readonly ["venly", "account", string, "payout", string];
225
+ queryFn: () => Promise<{
226
+ id?: string;
227
+ accountId?: string;
228
+ payoutRoute?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["PayoutRouteInfoDto"];
229
+ rail?: "US_ACH" | "SEPA";
230
+ cryptoAmount?: number;
231
+ settledFiatAmount?: number;
232
+ fundingMode?: "PULL" | "PUSH";
233
+ status?: "REQUESTED" | "SENDING" | "PROVIDER_PROCESSING" | "COMPLETED" | "REJECTED" | "FAILED" | "RETURNED";
234
+ sendTxHash?: string;
235
+ requestedAt?: string;
236
+ completedAt?: string;
237
+ failureReason?: string;
238
+ }>;
239
+ };
240
+ readonly payoutRoutes: (clients: VenlyClients, accountId: string, query?: PayoutRoutesQuery) => {
241
+ queryKey: readonly ["venly", "account", string, "payout-routes", {} | null];
242
+ queryFn: () => Promise<{
243
+ id?: string;
244
+ status?: "PENDING" | "REGISTERING" | "AWAITING_OWNERSHIP_PROOF" | "ACTIVE" | "REJECTED";
245
+ depositAsset?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["DepositAssetDto"];
246
+ fiatCurrency?: string;
247
+ depositAddress?: string;
248
+ createdAt?: string;
249
+ updatedAt?: string;
250
+ }[]>;
251
+ };
252
+ readonly payoutBankAccounts: (clients: VenlyClients, partyId: string, query?: PayoutBankAccountsQuery) => {
253
+ queryKey: readonly ["venly", "party", string, "payout-bank-accounts", {} | null];
254
+ queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
255
+ id?: string;
256
+ partyId?: string;
257
+ rail?: "US_ACH" | "SEPA";
258
+ fiatCurrency?: string;
259
+ label?: string;
260
+ accountHolderName?: string;
261
+ details?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["MaskedRailDetailsDto"];
262
+ bankName?: string;
263
+ beneficiaryEmail?: string;
264
+ beneficiaryPhoneNumber?: string;
265
+ bankAddress?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["BankAddressDto"];
266
+ status?: "PENDING" | "ACTIVE" | "DISABLED";
267
+ createdAt?: string;
268
+ updatedAt?: string;
269
+ }>>;
270
+ };
271
+ /** Registered webhook endpoints (bare array on the wire; Page for resultPresent). */
272
+ readonly webhooks: (clients: VenlyClients) => {
273
+ queryKey: readonly ["venly", "webhooks"];
274
+ queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
275
+ id?: string;
276
+ url?: string;
277
+ name?: string;
278
+ authenticationMethod?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["ApiKeyAuthenticationMethod"] | import("@venlyfinance/sdk").FinanceComponents["schemas"]["BasicAuthenticationMethod"];
279
+ status?: "ACTIVE";
280
+ }>>;
281
+ };
282
+ readonly webhook: (clients: VenlyClients, webhookId: string) => {
283
+ queryKey: readonly ["venly", "webhook", string];
284
+ queryFn: () => Promise<{
285
+ id?: string;
286
+ url?: string;
287
+ name?: string;
288
+ authenticationMethod?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["ApiKeyAuthenticationMethod"] | import("@venlyfinance/sdk").FinanceComponents["schemas"]["BasicAuthenticationMethod"];
289
+ status?: "ACTIVE";
290
+ }>;
291
+ };
172
292
  readonly rampRequests: (clients: VenlyClients, query?: RampRequestsQuery) => {
173
293
  queryKey: readonly ["venly", "ramp-requests", {} | null];
174
294
  queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
@@ -13,6 +13,16 @@ export const venlyQueries = {
13
13
  queryKey: venlyKeys.party(partyId),
14
14
  queryFn: () => clients.finance.parties.get(partyId),
15
15
  }),
16
+ /**
17
+ * The party's identity-verification state, read off the contract operation
18
+ * (`getPartyIvVerification`) - never off the mock's internals, so the same
19
+ * read works against every environment. `NOT_LINKED` is a state, not an
20
+ * error: an unlinked party resolves rather than rejecting.
21
+ */
22
+ partyIvVerification: (clients, partyId) => ({
23
+ queryKey: venlyKeys.partyIvVerification(partyId),
24
+ queryFn: () => clients.finance.parties.ivVerification(partyId),
25
+ }),
16
26
  accounts: (clients, query) => ({
17
27
  queryKey: venlyKeys.accounts(query),
18
28
  queryFn: () => clients.finance.accounts.list(query),
@@ -21,6 +31,15 @@ export const venlyQueries = {
21
31
  queryKey: venlyKeys.account(accountId),
22
32
  queryFn: () => clients.finance.accounts.get(accountId),
23
33
  }),
34
+ /**
35
+ * The parties attached to an account, each with a role type
36
+ * (ACCOUNT_HOLDER | PAYOUT_RECIPIENT) and a status. The payout-recipient
37
+ * rows are the account's saved third-party recipients.
38
+ */
39
+ partyRoles: (clients, accountId, query) => ({
40
+ queryKey: venlyKeys.partyRoles(accountId, query),
41
+ queryFn: () => clients.finance.accounts.listPartyRoles(accountId, query),
42
+ }),
24
43
  wallets: (clients, accountId, query) => ({
25
44
  queryKey: venlyKeys.wallets(accountId, query),
26
45
  queryFn: () => clients.finance.wallets.list(accountId, query),
@@ -47,6 +66,31 @@ export const venlyQueries = {
47
66
  queryKey: venlyKeys.transfer(accountId, transferId),
48
67
  queryFn: () => clients.finance.transfers.get(accountId, transferId),
49
68
  }),
69
+ payouts: (clients, accountId, query) => ({
70
+ queryKey: venlyKeys.payouts(accountId, query),
71
+ queryFn: () => clients.finance.payouts.list(accountId, query),
72
+ }),
73
+ payout: (clients, accountId, payoutId) => ({
74
+ queryKey: venlyKeys.payout(accountId, payoutId),
75
+ queryFn: () => clients.finance.payouts.get(accountId, payoutId),
76
+ }),
77
+ payoutRoutes: (clients, accountId, query) => ({
78
+ queryKey: venlyKeys.payoutRoutes(accountId, query),
79
+ queryFn: () => clients.finance.payoutRoutes.list(accountId, query),
80
+ }),
81
+ payoutBankAccounts: (clients, partyId, query) => ({
82
+ queryKey: venlyKeys.payoutBankAccounts(partyId, query),
83
+ queryFn: () => clients.finance.payoutBankAccounts.list(partyId, query),
84
+ }),
85
+ /** Registered webhook endpoints (bare array on the wire; Page for resultPresent). */
86
+ webhooks: (clients) => ({
87
+ queryKey: venlyKeys.webhooks(),
88
+ queryFn: () => clients.finance.webhooks.list(),
89
+ }),
90
+ webhook: (clients, webhookId) => ({
91
+ queryKey: venlyKeys.webhook(webhookId),
92
+ queryFn: () => clients.finance.webhooks.get(webhookId),
93
+ }),
50
94
  rampRequests: (clients, query) => ({
51
95
  queryKey: venlyKeys.rampRequests(query),
52
96
  queryFn: () => clients.fundflow.rampRequests.list(query),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venlyfinance/react",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Headless React layer for the Venly Finance and Fundflow APIs: provider, TanStack Query hooks, and flow state machines for regulated money movement. Runs with zero credentials in mock mode.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -30,7 +30,7 @@
30
30
  "node": ">=20"
31
31
  },
32
32
  "dependencies": {
33
- "@venlyfinance/sdk": "^0.5.0"
33
+ "@venlyfinance/sdk": "^0.7.0"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@tanstack/react-query": "^5.0.0",