@venlyfinance/react 0.2.0 → 0.4.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/AGENTS.md +11 -0
- package/CHANGELOG.md +34 -0
- package/README.md +4 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/keys.d.ts +2 -0
- package/dist/keys.js +2 -0
- package/dist/mutations.d.ts +21 -16
- package/dist/queries.d.ts +53 -30
- package/dist/queries.js +24 -0
- package/dist/query-options.d.ts +51 -30
- package/dist/query-options.js +10 -0
- package/package.json +2 -2
package/AGENTS.md
CHANGED
|
@@ -17,6 +17,17 @@ You are building a financial product UI on `@venlyfinance/react`. These rules ex
|
|
|
17
17
|
- Amounts: tabular figures, currency code after the amount, and never render a debit in red as the only signal. Empty numeric cells are an em dash, not 0.
|
|
18
18
|
- Terminal failure states show the reason from the record; the status field is the explanation field.
|
|
19
19
|
|
|
20
|
+
## Bring your own auth
|
|
21
|
+
|
|
22
|
+
The Venly APIs authenticate machines (OAuth2 client credentials), not people: there is no end-user login, sign-up, session, password, or MFA endpoint in either API, by design. **The Venly APIs never see end-user credentials.** End-user auth is your identity layer's job; the sanctioned browser shape is a backend proxy that inherits YOUR app's session (`proxyClientOptions()`), never Venly's.
|
|
23
|
+
|
|
24
|
+
The UI kit's auth and team blocks therefore render against two adapter interfaces, `AuthAdapter` and `TeamAdapter`, instead of an SDK client:
|
|
25
|
+
|
|
26
|
+
- **Real implementations** wrap what you already run: OAuth/OIDC, Better Auth, Auth0, Clerk, Keycloak, or a plain session cookie. Implement `signIn`/`verifyTotp`/`signUp`/`session`/`signOut` (and the team CRUD) over your provider's SDK.
|
|
27
|
+
- **Session-expiry contract:** `session()` returns `null` once the session has expired for any reason. The shell treats null as signed-out and redirects to sign-in; no other expiry signal exists in the interface.
|
|
28
|
+
- **Mock adapters ship with the blocks** (`createMockAuthAdapter`, `createMockTeamAdapter`): zero credentials, deterministic 2FA code `000000`, an `expireSession()` driver, and invites that mint a display-only link – the mock never claims an email was sent.
|
|
29
|
+
- Password reset, SSO buttons, and passkeys are provider features: point users at your provider's flow rather than rebuilding it behind the adapter.
|
|
30
|
+
|
|
20
31
|
## Demo choreography (mock mode)
|
|
21
32
|
|
|
22
33
|
`useVenlyMock()` exposes the store controls. A credible end-to-end demo:
|
package/CHANGELOG.md
CHANGED
|
@@ -14,3 +14,37 @@ Initial release.
|
|
|
14
14
|
## 0.1.1
|
|
15
15
|
|
|
16
16
|
- Fix: `useStagedTransfer` stuck in "submitting" under React StrictMode – the hook cleanup's `dispose()` left the controller permanently dead for the remount, so `confirm()`'s continuation dropped its state updates. A new subscription now revives the controller. Found by driving the flow in a real browser; regression test added.
|
|
17
|
+
|
|
18
|
+
## 0.2.0 – 2026-08-07
|
|
19
|
+
|
|
20
|
+
*(Entry backfilled 2026-08-15 – this release shipped without a changelog note.)*
|
|
21
|
+
|
|
22
|
+
- Read hooks for the fundflow company surface: `useCompanyBankAccounts`,
|
|
23
|
+
`useCompanyBankAccount`, `useCompanyWallets`, `useBankAccountConfig`,
|
|
24
|
+
`useDepositWallets`, `useRampPairs`, `useCompanyFees`.
|
|
25
|
+
- Write hooks with cache invalidation: `useCreateCompanyBankAccount`,
|
|
26
|
+
`useCreateCompanyWallet`, `useSetRampAmount`, `useInitiateRamp`.
|
|
27
|
+
- Matching `venlyKeys` / `venlyQueries` factories for every new read.
|
|
28
|
+
|
|
29
|
+
## 0.3.0 – 2026-08-14
|
|
30
|
+
|
|
31
|
+
*(Entry backfilled 2026-08-15 – this release shipped without a changelog note.)*
|
|
32
|
+
|
|
33
|
+
- **BREAKING (inherited from `@venlyfinance/sdk` 0.4.0 / contract 1.3.0):**
|
|
34
|
+
the `Wallet` type no longer exists – `wallets.list` returns per-asset
|
|
35
|
+
`WalletBalance` rows and this package re-exports `WalletBalance` instead.
|
|
36
|
+
Monetary amounts are JSON numbers.
|
|
37
|
+
- Re-exports the payout types (`Payout`, `PayoutRoute`, `PayoutBankAccount`)
|
|
38
|
+
shipped by sdk 0.4.0.
|
|
39
|
+
- Requires `@venlyfinance/sdk` ^0.4.0.
|
|
40
|
+
|
|
41
|
+
## 0.4.0 – 2026-08-15
|
|
42
|
+
|
|
43
|
+
- New read hooks: `useSupportedAssets()` (tenant-wide assets, each with its
|
|
44
|
+
on-chain `decimals` – the render contract for amounts; cached hard) and
|
|
45
|
+
`useAccountSupportedAssets(accountId)` (adds per-asset `permitStatus`,
|
|
46
|
+
not frozen because status moves while an asset activates).
|
|
47
|
+
- `venlyKeys.supportedAssets()` / `venlyKeys.accountSupportedAssets(id)` and
|
|
48
|
+
matching `venlyQueries` factories; the account-scoped key shares the
|
|
49
|
+
`["venly", "account", id]` prefix so account invalidations reach it.
|
|
50
|
+
- Requires `@venlyfinance/sdk` ^0.5.0 (the `supportedAssets` resource).
|
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ Headless React layer for the [Venly Finance and Fundflow APIs](https://github.co
|
|
|
6
6
|
|
|
7
7
|
No components, no CSS. This package owns data and state; your UI (or the one your coding agent assembles) owns the pixels. The full behaviour is covered by a node:test suite that runs with zero network.
|
|
8
8
|
|
|
9
|
+
Building with a coding agent? Start from [AGENTS.md](AGENTS.md).
|
|
10
|
+
|
|
9
11
|
## Try it in 0 minutes (mock mode)
|
|
10
12
|
|
|
11
13
|
```bash
|
|
@@ -36,13 +38,13 @@ Mock mode needs zero credentials and makes zero network calls: every hook answer
|
|
|
36
38
|
| Export | What it does |
|
|
37
39
|
|---|---|
|
|
38
40
|
| `<VenlyProvider>` | Constructs the Finance + Fundflow clients for `mock`, `staging`, or `production`; brings its own QueryClient if the app has none |
|
|
39
|
-
| `useParties` `useAccounts` `useWallets` `useVirtualBankAccounts` `useTransfers` `useRampRequests` `useReferenceData` `useFeeQuote` … | Read hooks, one per API resource, cache keys managed for you |
|
|
41
|
+
| `useParties` `useAccounts` `useWallets` `useSupportedAssets` `useAccountSupportedAssets` `useVirtualBankAccounts` `useTransfers` `useRampRequests` `useReferenceData` `useFeeQuote` … | Read hooks, one per API resource, cache keys managed for you |
|
|
40
42
|
| `useCreateParty` `useCreateAccount` `useCreateVirtualBankAccount` `useCreatePaymentSession` `useCreateRampRequest` | Write hooks with cache invalidation wired |
|
|
41
43
|
| `useStagedTransfer` | Stage-then-confirm machine: validate → freeze the exact request with a pinned idempotency key → execute once → poll to terminal |
|
|
42
44
|
| `useFourEyesApproval` | Approve/reject/cancel with the optimistic-locking `version` carried through; 409 surfaces as `"stale-version"` (refetch and re-decide, never auto-retry) |
|
|
43
45
|
| `useRampLifecycle` | One ramp request, polled until terminal, with a status descriptor answering: must I act, who is it waiting on, what still works |
|
|
44
46
|
| `venlyKeys` / `venlyQueries` | Query-key factory and pure `{queryKey, queryFn}` factories for prefetching, route loaders, and tests |
|
|
45
|
-
| `useVenlyMock` | The mock controls (call log, `failNext`, `advanceVerification`, `advanceTransfer`) – defined only in mock mode |
|
|
47
|
+
| `useVenlyMock` | The mock controls (call log, `failNext`, `respondNext`, `delayNext`, `advanceVerification`, `advanceTransfer`) – defined only in mock mode |
|
|
46
48
|
| `proxyClientOptions` | Browser-safe production wiring (below) |
|
|
47
49
|
|
|
48
50
|
## The flow machines
|
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
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, useVirtualBankAccounts, useWallets, useCompanyBankAccount, useCompanyBankAccounts, useCompanyWallets, useBankAccountConfig, useDepositWallets, useRampPairs, } from "./queries.js";
|
|
4
|
+
export { useAccount, useAccounts, useCompanyFees, useFeeQuote, useParties, useParty, useRampRequest, useRampRequests, useReferenceData, useTransfer, useTransfers, useVirtualBankAccounts, useWallets, useCompanyBankAccount, useCompanyBankAccounts, useCompanyWallets, useBankAccountConfig, useDepositWallets, useRampPairs, useSupportedAssets, useAccountSupportedAssets, } from "./queries.js";
|
|
5
5
|
export { useCreateAccount, useCreateParty, useCreatePaymentSession, useCreateRampRequest, useCreateVirtualBankAccount, useCreateCompanyBankAccount, useCreateCompanyWallet, useSetRampAmount, useInitiateRamp, } from "./mutations.js";
|
|
6
6
|
export { StagedTransferController, useStagedTransfer, validateDraft, 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,
|
|
11
|
+
export type { Account, Party, RampRequest, Transfer, VirtualBankAccount, WalletBalance, Payout, PayoutRoute, PayoutBankAccount, } from "@venlyfinance/sdk";
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ 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, useVirtualBankAccounts, useWallets, useCompanyBankAccount, useCompanyBankAccounts, useCompanyWallets, useBankAccountConfig, useDepositWallets, useRampPairs, } from "./queries.js";
|
|
7
|
+
export { useAccount, useAccounts, useCompanyFees, useFeeQuote, useParties, useParty, useRampRequest, useRampRequests, useReferenceData, useTransfer, useTransfers, useVirtualBankAccounts, useWallets, useCompanyBankAccount, useCompanyBankAccounts, useCompanyWallets, useBankAccountConfig, useDepositWallets, useRampPairs, useSupportedAssets, useAccountSupportedAssets, } from "./queries.js";
|
|
8
8
|
// Write hooks
|
|
9
9
|
export { useCreateAccount, useCreateParty, useCreatePaymentSession, useCreateRampRequest, useCreateVirtualBankAccount, useCreateCompanyBankAccount, useCreateCompanyWallet, useSetRampAmount, useInitiateRamp, } from "./mutations.js";
|
|
10
10
|
// Flow machines: the regulated-money lifecycles
|
package/dist/keys.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export declare const venlyKeys: {
|
|
|
9
9
|
readonly accounts: (query?: unknown) => readonly ["venly", "accounts", {} | null];
|
|
10
10
|
readonly account: (accountId: string) => readonly ["venly", "account", string];
|
|
11
11
|
readonly wallets: (accountId: string, query?: unknown) => readonly ["venly", "account", string, "wallets", {} | null];
|
|
12
|
+
readonly supportedAssets: () => readonly ["venly", "supported-assets"];
|
|
13
|
+
readonly accountSupportedAssets: (accountId: string) => readonly ["venly", "account", string, "supported-assets"];
|
|
12
14
|
readonly virtualBankAccounts: (accountId: string, query?: unknown) => readonly ["venly", "account", string, "virtual-bank-accounts", {} | null];
|
|
13
15
|
readonly transfers: (accountId: string, query?: unknown) => readonly ["venly", "account", string, "transfers", {} | null];
|
|
14
16
|
readonly transfer: (accountId: string, transferId: string) => readonly ["venly", "account", string, "transfer", string];
|
package/dist/keys.js
CHANGED
|
@@ -9,6 +9,8 @@ export const venlyKeys = {
|
|
|
9
9
|
accounts: (query) => ["venly", "accounts", query ?? null],
|
|
10
10
|
account: (accountId) => ["venly", "account", accountId],
|
|
11
11
|
wallets: (accountId, query) => ["venly", "account", accountId, "wallets", query ?? null],
|
|
12
|
+
supportedAssets: () => ["venly", "supported-assets"],
|
|
13
|
+
accountSupportedAssets: (accountId) => ["venly", "account", accountId, "supported-assets"],
|
|
12
14
|
virtualBankAccounts: (accountId, query) => ["venly", "account", accountId, "virtual-bank-accounts", query ?? null],
|
|
13
15
|
transfers: (accountId, query) => ["venly", "account", accountId, "transfers", query ?? null],
|
|
14
16
|
transfer: (accountId, transferId) => ["venly", "account", accountId, "transfer", transferId],
|
package/dist/mutations.d.ts
CHANGED
|
@@ -5,40 +5,42 @@ type CreatePaymentSessionBody = Parameters<VenlyFinanceClient["paymentSessions"]
|
|
|
5
5
|
export declare function useCreateParty(): import("@tanstack/react-query").UseMutationResult<{
|
|
6
6
|
id?: string;
|
|
7
7
|
externalId?: string;
|
|
8
|
-
partyType?:
|
|
9
|
-
status?:
|
|
8
|
+
partyType?: "INDIVIDUAL" | "ORGANISATION";
|
|
9
|
+
status?: "ACTIVE" | "SUSPENDED" | "BLOCKED";
|
|
10
|
+
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["AddressDto"];
|
|
10
11
|
firstName?: string;
|
|
11
12
|
lastName?: string;
|
|
12
|
-
kycStatus?:
|
|
13
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "REJECTED";
|
|
13
14
|
name?: string;
|
|
14
15
|
vatNumber?: string;
|
|
15
|
-
kybStatus?:
|
|
16
|
-
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["Address"];
|
|
16
|
+
kybStatus?: "PENDING" | "VERIFIED" | "DENIED";
|
|
17
17
|
createdAt?: string;
|
|
18
18
|
updatedAt?: string;
|
|
19
19
|
version?: number;
|
|
20
20
|
}, Error, {
|
|
21
|
-
partyType:
|
|
21
|
+
partyType: "INDIVIDUAL" | "ORGANISATION";
|
|
22
22
|
externalId?: string;
|
|
23
23
|
firstName?: string;
|
|
24
24
|
lastName?: string;
|
|
25
25
|
name?: string;
|
|
26
26
|
vatNumber?: string;
|
|
27
|
-
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["
|
|
27
|
+
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["AddressDto"];
|
|
28
|
+
sumsubToken?: string;
|
|
28
29
|
}, unknown>;
|
|
29
30
|
export declare function useCreateAccount(): import("@tanstack/react-query").UseMutationResult<{
|
|
30
31
|
id?: string;
|
|
31
32
|
externalId?: string;
|
|
32
33
|
name?: string;
|
|
33
|
-
kycStatus?:
|
|
34
|
-
status?:
|
|
34
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "NOT_REQUIRED" | "REJECTED";
|
|
35
|
+
status?: "ACTIVE" | "SUSPENDED" | "CLOSED";
|
|
35
36
|
createdAt?: string;
|
|
36
37
|
version?: number;
|
|
37
38
|
}, Error, {
|
|
38
39
|
externalId: string;
|
|
39
40
|
name?: string;
|
|
40
|
-
chain:
|
|
41
|
+
chain: "AVALANCHE" | "BASE" | "ETHEREUM" | "POLYGON" | "SOLANA";
|
|
41
42
|
address?: string;
|
|
43
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "NOT_REQUIRED" | "REJECTED";
|
|
42
44
|
partyId?: string;
|
|
43
45
|
party?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["CreatePartyRequest"];
|
|
44
46
|
cardProviderReference?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["CardProviderReference"];
|
|
@@ -46,16 +48,19 @@ export declare function useCreateAccount(): import("@tanstack/react-query").UseM
|
|
|
46
48
|
export declare function useCreateVirtualBankAccount(): import("@tanstack/react-query").UseMutationResult<{
|
|
47
49
|
id?: string;
|
|
48
50
|
accountId?: string;
|
|
49
|
-
bankAccountType?:
|
|
51
|
+
bankAccountType?: "EUR_SEPA" | "USD_ACH";
|
|
50
52
|
name?: string;
|
|
51
|
-
status?:
|
|
52
|
-
currency?:
|
|
53
|
-
targetCryptocurrency?:
|
|
53
|
+
status?: "PENDING" | "ACTIVE" | "CLOSED";
|
|
54
|
+
currency?: string;
|
|
55
|
+
targetCryptocurrency?: string;
|
|
54
56
|
iban?: string;
|
|
55
57
|
bic?: string;
|
|
58
|
+
accountNumber?: string;
|
|
59
|
+
routingNumber?: string;
|
|
56
60
|
bankName?: string;
|
|
57
61
|
beneficiaryName?: string;
|
|
58
62
|
referenceCode?: string;
|
|
63
|
+
depositRails?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["ProviderDepositRail"][];
|
|
59
64
|
createdAt?: string;
|
|
60
65
|
updatedAt?: string;
|
|
61
66
|
}, Error, {
|
|
@@ -65,14 +70,14 @@ export declare function useCreateVirtualBankAccount(): import("@tanstack/react-q
|
|
|
65
70
|
export declare function useCreatePaymentSession(): import("@tanstack/react-query").UseMutationResult<{
|
|
66
71
|
id?: string;
|
|
67
72
|
accountId?: string;
|
|
68
|
-
status?:
|
|
73
|
+
status?: "CREATED" | "PENDING_PAYMENT" | "PAYMENT_RECEIVED" | "CONVERTING" | "MINTING" | "COMPLETED" | "FAILED" | "EXPIRED" | "CANCELLED" | "REFUNDING" | "REFUNDED";
|
|
69
74
|
inAmount?: number;
|
|
70
75
|
inCurrency?: string;
|
|
71
76
|
outCryptocurrency?: string;
|
|
72
77
|
paymentUrl?: string;
|
|
73
78
|
externalRef?: string;
|
|
74
79
|
walletId?: string;
|
|
75
|
-
blockchainTxId?: string
|
|
80
|
+
blockchainTxId?: string;
|
|
76
81
|
cancellable?: boolean;
|
|
77
82
|
expiresAt?: string;
|
|
78
83
|
metadata?: {
|
package/dist/queries.d.ts
CHANGED
|
@@ -4,15 +4,15 @@ type Tune<T> = Omit<UseQueryOptions<T, Error>, "queryKey" | "queryFn">;
|
|
|
4
4
|
export declare function useParties(query?: PartiesQuery, options?: Tune<PartiesPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<import("@venlyfinance/sdk").Page<{
|
|
5
5
|
id?: string;
|
|
6
6
|
externalId?: string;
|
|
7
|
-
partyType?:
|
|
8
|
-
status?:
|
|
7
|
+
partyType?: "INDIVIDUAL" | "ORGANISATION";
|
|
8
|
+
status?: "ACTIVE" | "SUSPENDED" | "BLOCKED";
|
|
9
|
+
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["AddressDto"];
|
|
9
10
|
firstName?: string;
|
|
10
11
|
lastName?: string;
|
|
11
|
-
kycStatus?:
|
|
12
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "REJECTED";
|
|
12
13
|
name?: string;
|
|
13
14
|
vatNumber?: string;
|
|
14
|
-
kybStatus?:
|
|
15
|
-
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["Address"];
|
|
15
|
+
kybStatus?: "PENDING" | "VERIFIED" | "DENIED";
|
|
16
16
|
createdAt?: string;
|
|
17
17
|
updatedAt?: string;
|
|
18
18
|
version?: number;
|
|
@@ -21,15 +21,15 @@ type PartiesPage = Awaited<ReturnType<ReturnType<typeof venlyQueries.parties>["q
|
|
|
21
21
|
export declare function useParty(partyId: string | undefined, options?: Tune<Party>): import("@tanstack/react-query").UseQueryResult<NoInfer<{
|
|
22
22
|
id?: string;
|
|
23
23
|
externalId?: string;
|
|
24
|
-
partyType?:
|
|
25
|
-
status?:
|
|
24
|
+
partyType?: "INDIVIDUAL" | "ORGANISATION";
|
|
25
|
+
status?: "ACTIVE" | "SUSPENDED" | "BLOCKED";
|
|
26
|
+
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["AddressDto"];
|
|
26
27
|
firstName?: string;
|
|
27
28
|
lastName?: string;
|
|
28
|
-
kycStatus?:
|
|
29
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "REJECTED";
|
|
29
30
|
name?: string;
|
|
30
31
|
vatNumber?: string;
|
|
31
|
-
kybStatus?:
|
|
32
|
-
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["Address"];
|
|
32
|
+
kybStatus?: "PENDING" | "VERIFIED" | "DENIED";
|
|
33
33
|
createdAt?: string;
|
|
34
34
|
updatedAt?: string;
|
|
35
35
|
version?: number;
|
|
@@ -39,8 +39,8 @@ export declare function useAccounts(query?: AccountsQuery, options?: Tune<Accoun
|
|
|
39
39
|
id?: string;
|
|
40
40
|
externalId?: string;
|
|
41
41
|
name?: string;
|
|
42
|
-
kycStatus?:
|
|
43
|
-
status?:
|
|
42
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "NOT_REQUIRED" | "REJECTED";
|
|
43
|
+
status?: "ACTIVE" | "SUSPENDED" | "CLOSED";
|
|
44
44
|
createdAt?: string;
|
|
45
45
|
version?: number;
|
|
46
46
|
}>>, Error>;
|
|
@@ -49,34 +49,57 @@ export declare function useAccount(accountId: string | undefined, options?: Tune
|
|
|
49
49
|
id?: string;
|
|
50
50
|
externalId?: string;
|
|
51
51
|
name?: string;
|
|
52
|
-
kycStatus?:
|
|
53
|
-
status?:
|
|
52
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "NOT_REQUIRED" | "REJECTED";
|
|
53
|
+
status?: "ACTIVE" | "SUSPENDED" | "CLOSED";
|
|
54
54
|
createdAt?: string;
|
|
55
55
|
version?: number;
|
|
56
56
|
}>, Error>;
|
|
57
57
|
type Account = Awaited<ReturnType<ReturnType<typeof venlyQueries.account>["queryFn"]>>;
|
|
58
58
|
export declare function useWallets(accountId: string | undefined, query?: WalletsQuery, options?: Tune<WalletsPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<import("@venlyfinance/sdk").Page<{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
address?: string;
|
|
63
|
-
balances?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["TokenBalance"][];
|
|
64
|
-
amlStatus?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["AmlStatus"];
|
|
59
|
+
asset?: string;
|
|
60
|
+
contractAddress?: string;
|
|
61
|
+
amount?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["CryptoBalanceSummaryDto"];
|
|
65
62
|
}>>, Error>;
|
|
66
63
|
type WalletsPage = Awaited<ReturnType<ReturnType<typeof venlyQueries.wallets>["queryFn"]>>;
|
|
64
|
+
/**
|
|
65
|
+
* Tenant-wide supported assets. `decimals` per asset is the render contract
|
|
66
|
+
* for amounts; cached hard (the asset set changes on deploys, not minutes).
|
|
67
|
+
*/
|
|
68
|
+
export declare function useSupportedAssets(options?: Tune<SupportedAssetsPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<import("@venlyfinance/sdk").Page<{
|
|
69
|
+
chain?: "AVALANCHE" | "BASE" | "ETHEREUM" | "POLYGON" | "SOLANA";
|
|
70
|
+
cryptoCurrency?: string;
|
|
71
|
+
decimals?: number;
|
|
72
|
+
contractAddress?: string;
|
|
73
|
+
}>>, Error>;
|
|
74
|
+
type SupportedAssetsPage = Awaited<ReturnType<ReturnType<typeof venlyQueries.supportedAssets>["queryFn"]>>;
|
|
75
|
+
/**
|
|
76
|
+
* Account-scoped supported assets (adds `permitStatus`). Not frozen:
|
|
77
|
+
* permit status moves while an asset activates.
|
|
78
|
+
*/
|
|
79
|
+
export declare function useAccountSupportedAssets(accountId: string | undefined, options?: Tune<AccountSupportedAssetsPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<import("@venlyfinance/sdk").Page<{
|
|
80
|
+
chain?: "AVALANCHE" | "BASE" | "ETHEREUM" | "POLYGON" | "SOLANA";
|
|
81
|
+
cryptoCurrency?: string;
|
|
82
|
+
decimals?: number;
|
|
83
|
+
contractAddress?: string;
|
|
84
|
+
permitStatus?: "READY" | "ACTIVATING" | "ACTION_REQUIRED" | "PENDING" | "FAILED" | "NO_WALLET";
|
|
85
|
+
}>>, Error>;
|
|
86
|
+
type AccountSupportedAssetsPage = Awaited<ReturnType<ReturnType<typeof venlyQueries.accountSupportedAssets>["queryFn"]>>;
|
|
67
87
|
export declare function useVirtualBankAccounts(accountId: string | undefined, query?: VirtualBankAccountsQuery, options?: Tune<VibaPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<import("@venlyfinance/sdk").Page<{
|
|
68
88
|
id?: string;
|
|
69
89
|
accountId?: string;
|
|
70
|
-
bankAccountType?:
|
|
90
|
+
bankAccountType?: "EUR_SEPA" | "USD_ACH";
|
|
71
91
|
name?: string;
|
|
72
|
-
status?:
|
|
73
|
-
currency?:
|
|
74
|
-
targetCryptocurrency?:
|
|
92
|
+
status?: "PENDING" | "ACTIVE" | "CLOSED";
|
|
93
|
+
currency?: string;
|
|
94
|
+
targetCryptocurrency?: string;
|
|
75
95
|
iban?: string;
|
|
76
96
|
bic?: string;
|
|
97
|
+
accountNumber?: string;
|
|
98
|
+
routingNumber?: string;
|
|
77
99
|
bankName?: string;
|
|
78
100
|
beneficiaryName?: string;
|
|
79
101
|
referenceCode?: string;
|
|
102
|
+
depositRails?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["ProviderDepositRail"][];
|
|
80
103
|
createdAt?: string;
|
|
81
104
|
updatedAt?: string;
|
|
82
105
|
}>>, Error>;
|
|
@@ -85,14 +108,14 @@ export declare function useTransfers(accountId: string | undefined, query?: Tran
|
|
|
85
108
|
id?: string;
|
|
86
109
|
senderAccountId?: string;
|
|
87
110
|
receiverAccountId?: string;
|
|
88
|
-
chain?:
|
|
111
|
+
chain?: "AVALANCHE" | "BASE" | "ETHEREUM" | "POLYGON" | "SOLANA";
|
|
89
112
|
asset?: string;
|
|
90
113
|
amount?: number;
|
|
91
|
-
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["
|
|
114
|
+
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["FiatOriginDto"];
|
|
92
115
|
description?: string;
|
|
93
116
|
merchantReference?: string;
|
|
94
117
|
idempotencyKey?: string;
|
|
95
|
-
status?:
|
|
118
|
+
status?: "PENDING" | "COMPLETED" | "FAILED";
|
|
96
119
|
transactionHash?: string;
|
|
97
120
|
errorMessage?: string;
|
|
98
121
|
createdAt?: string;
|
|
@@ -103,14 +126,14 @@ export declare function useTransfer(accountId: string | undefined, transferId: s
|
|
|
103
126
|
id?: string;
|
|
104
127
|
senderAccountId?: string;
|
|
105
128
|
receiverAccountId?: string;
|
|
106
|
-
chain?:
|
|
129
|
+
chain?: "AVALANCHE" | "BASE" | "ETHEREUM" | "POLYGON" | "SOLANA";
|
|
107
130
|
asset?: string;
|
|
108
131
|
amount?: number;
|
|
109
|
-
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["
|
|
132
|
+
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["FiatOriginDto"];
|
|
110
133
|
description?: string;
|
|
111
134
|
merchantReference?: string;
|
|
112
135
|
idempotencyKey?: string;
|
|
113
|
-
status?:
|
|
136
|
+
status?: "PENDING" | "COMPLETED" | "FAILED";
|
|
114
137
|
transactionHash?: string;
|
|
115
138
|
errorMessage?: string;
|
|
116
139
|
createdAt?: string;
|
package/dist/queries.js
CHANGED
|
@@ -33,6 +33,30 @@ export function useWallets(accountId, query, options) {
|
|
|
33
33
|
...options,
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Tenant-wide supported assets. `decimals` per asset is the render contract
|
|
38
|
+
* for amounts; cached hard (the asset set changes on deploys, not minutes).
|
|
39
|
+
*/
|
|
40
|
+
export function useSupportedAssets(options) {
|
|
41
|
+
const clients = useVenly();
|
|
42
|
+
return useQuery({
|
|
43
|
+
...venlyQueries.supportedAssets(clients),
|
|
44
|
+
staleTime: Infinity,
|
|
45
|
+
...options,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Account-scoped supported assets (adds `permitStatus`). Not frozen:
|
|
50
|
+
* permit status moves while an asset activates.
|
|
51
|
+
*/
|
|
52
|
+
export function useAccountSupportedAssets(accountId, options) {
|
|
53
|
+
const clients = useVenly();
|
|
54
|
+
return useQuery({
|
|
55
|
+
...venlyQueries.accountSupportedAssets(clients, accountId ?? ""),
|
|
56
|
+
enabled: Boolean(accountId) && (options?.enabled ?? true),
|
|
57
|
+
...options,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
36
60
|
export function useVirtualBankAccounts(accountId, query, options) {
|
|
37
61
|
const clients = useVenly();
|
|
38
62
|
return useQuery({
|
package/dist/query-options.d.ts
CHANGED
|
@@ -21,15 +21,15 @@ export declare const venlyQueries: {
|
|
|
21
21
|
queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
|
|
22
22
|
id?: string;
|
|
23
23
|
externalId?: string;
|
|
24
|
-
partyType?:
|
|
25
|
-
status?:
|
|
24
|
+
partyType?: "INDIVIDUAL" | "ORGANISATION";
|
|
25
|
+
status?: "ACTIVE" | "SUSPENDED" | "BLOCKED";
|
|
26
|
+
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["AddressDto"];
|
|
26
27
|
firstName?: string;
|
|
27
28
|
lastName?: string;
|
|
28
|
-
kycStatus?:
|
|
29
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "REJECTED";
|
|
29
30
|
name?: string;
|
|
30
31
|
vatNumber?: string;
|
|
31
|
-
kybStatus?:
|
|
32
|
-
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["Address"];
|
|
32
|
+
kybStatus?: "PENDING" | "VERIFIED" | "DENIED";
|
|
33
33
|
createdAt?: string;
|
|
34
34
|
updatedAt?: string;
|
|
35
35
|
version?: number;
|
|
@@ -40,15 +40,15 @@ export declare const venlyQueries: {
|
|
|
40
40
|
queryFn: () => Promise<{
|
|
41
41
|
id?: string;
|
|
42
42
|
externalId?: string;
|
|
43
|
-
partyType?:
|
|
44
|
-
status?:
|
|
43
|
+
partyType?: "INDIVIDUAL" | "ORGANISATION";
|
|
44
|
+
status?: "ACTIVE" | "SUSPENDED" | "BLOCKED";
|
|
45
|
+
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["AddressDto"];
|
|
45
46
|
firstName?: string;
|
|
46
47
|
lastName?: string;
|
|
47
|
-
kycStatus?:
|
|
48
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "REJECTED";
|
|
48
49
|
name?: string;
|
|
49
50
|
vatNumber?: string;
|
|
50
|
-
kybStatus?:
|
|
51
|
-
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["Address"];
|
|
51
|
+
kybStatus?: "PENDING" | "VERIFIED" | "DENIED";
|
|
52
52
|
createdAt?: string;
|
|
53
53
|
updatedAt?: string;
|
|
54
54
|
version?: number;
|
|
@@ -60,8 +60,8 @@ export declare const venlyQueries: {
|
|
|
60
60
|
id?: string;
|
|
61
61
|
externalId?: string;
|
|
62
62
|
name?: string;
|
|
63
|
-
kycStatus?:
|
|
64
|
-
status?:
|
|
63
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "NOT_REQUIRED" | "REJECTED";
|
|
64
|
+
status?: "ACTIVE" | "SUSPENDED" | "CLOSED";
|
|
65
65
|
createdAt?: string;
|
|
66
66
|
version?: number;
|
|
67
67
|
}>>;
|
|
@@ -72,8 +72,8 @@ export declare const venlyQueries: {
|
|
|
72
72
|
id?: string;
|
|
73
73
|
externalId?: string;
|
|
74
74
|
name?: string;
|
|
75
|
-
kycStatus?:
|
|
76
|
-
status?:
|
|
75
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "NOT_REQUIRED" | "REJECTED";
|
|
76
|
+
status?: "ACTIVE" | "SUSPENDED" | "CLOSED";
|
|
77
77
|
createdAt?: string;
|
|
78
78
|
version?: number;
|
|
79
79
|
}>;
|
|
@@ -81,12 +81,30 @@ export declare const venlyQueries: {
|
|
|
81
81
|
readonly wallets: (clients: VenlyClients, accountId: string, query?: WalletsQuery) => {
|
|
82
82
|
queryKey: readonly ["venly", "account", string, "wallets", {} | null];
|
|
83
83
|
queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
asset?: string;
|
|
85
|
+
contractAddress?: string;
|
|
86
|
+
amount?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["CryptoBalanceSummaryDto"];
|
|
87
|
+
}>>;
|
|
88
|
+
};
|
|
89
|
+
/** Tenant-wide supported assets, each with its on-chain `decimals`. */
|
|
90
|
+
readonly supportedAssets: (clients: VenlyClients) => {
|
|
91
|
+
queryKey: readonly ["venly", "supported-assets"];
|
|
92
|
+
queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
|
|
93
|
+
chain?: "AVALANCHE" | "BASE" | "ETHEREUM" | "POLYGON" | "SOLANA";
|
|
94
|
+
cryptoCurrency?: string;
|
|
95
|
+
decimals?: number;
|
|
96
|
+
contractAddress?: string;
|
|
97
|
+
}>>;
|
|
98
|
+
};
|
|
99
|
+
/** Account-scoped rows: the same assets plus per-asset `permitStatus`. */
|
|
100
|
+
readonly accountSupportedAssets: (clients: VenlyClients, accountId: string) => {
|
|
101
|
+
queryKey: readonly ["venly", "account", string, "supported-assets"];
|
|
102
|
+
queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
|
|
103
|
+
chain?: "AVALANCHE" | "BASE" | "ETHEREUM" | "POLYGON" | "SOLANA";
|
|
104
|
+
cryptoCurrency?: string;
|
|
105
|
+
decimals?: number;
|
|
106
|
+
contractAddress?: string;
|
|
107
|
+
permitStatus?: "READY" | "ACTIVATING" | "ACTION_REQUIRED" | "PENDING" | "FAILED" | "NO_WALLET";
|
|
90
108
|
}>>;
|
|
91
109
|
};
|
|
92
110
|
readonly virtualBankAccounts: (clients: VenlyClients, accountId: string, query?: VirtualBankAccountsQuery) => {
|
|
@@ -94,16 +112,19 @@ export declare const venlyQueries: {
|
|
|
94
112
|
queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
|
|
95
113
|
id?: string;
|
|
96
114
|
accountId?: string;
|
|
97
|
-
bankAccountType?:
|
|
115
|
+
bankAccountType?: "EUR_SEPA" | "USD_ACH";
|
|
98
116
|
name?: string;
|
|
99
|
-
status?:
|
|
100
|
-
currency?:
|
|
101
|
-
targetCryptocurrency?:
|
|
117
|
+
status?: "PENDING" | "ACTIVE" | "CLOSED";
|
|
118
|
+
currency?: string;
|
|
119
|
+
targetCryptocurrency?: string;
|
|
102
120
|
iban?: string;
|
|
103
121
|
bic?: string;
|
|
122
|
+
accountNumber?: string;
|
|
123
|
+
routingNumber?: string;
|
|
104
124
|
bankName?: string;
|
|
105
125
|
beneficiaryName?: string;
|
|
106
126
|
referenceCode?: string;
|
|
127
|
+
depositRails?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["ProviderDepositRail"][];
|
|
107
128
|
createdAt?: string;
|
|
108
129
|
updatedAt?: string;
|
|
109
130
|
}>>;
|
|
@@ -114,14 +135,14 @@ export declare const venlyQueries: {
|
|
|
114
135
|
id?: string;
|
|
115
136
|
senderAccountId?: string;
|
|
116
137
|
receiverAccountId?: string;
|
|
117
|
-
chain?:
|
|
138
|
+
chain?: "AVALANCHE" | "BASE" | "ETHEREUM" | "POLYGON" | "SOLANA";
|
|
118
139
|
asset?: string;
|
|
119
140
|
amount?: number;
|
|
120
|
-
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["
|
|
141
|
+
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["FiatOriginDto"];
|
|
121
142
|
description?: string;
|
|
122
143
|
merchantReference?: string;
|
|
123
144
|
idempotencyKey?: string;
|
|
124
|
-
status?:
|
|
145
|
+
status?: "PENDING" | "COMPLETED" | "FAILED";
|
|
125
146
|
transactionHash?: string;
|
|
126
147
|
errorMessage?: string;
|
|
127
148
|
createdAt?: string;
|
|
@@ -134,14 +155,14 @@ export declare const venlyQueries: {
|
|
|
134
155
|
id?: string;
|
|
135
156
|
senderAccountId?: string;
|
|
136
157
|
receiverAccountId?: string;
|
|
137
|
-
chain?:
|
|
158
|
+
chain?: "AVALANCHE" | "BASE" | "ETHEREUM" | "POLYGON" | "SOLANA";
|
|
138
159
|
asset?: string;
|
|
139
160
|
amount?: number;
|
|
140
|
-
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["
|
|
161
|
+
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["FiatOriginDto"];
|
|
141
162
|
description?: string;
|
|
142
163
|
merchantReference?: string;
|
|
143
164
|
idempotencyKey?: string;
|
|
144
|
-
status?:
|
|
165
|
+
status?: "PENDING" | "COMPLETED" | "FAILED";
|
|
145
166
|
transactionHash?: string;
|
|
146
167
|
errorMessage?: string;
|
|
147
168
|
createdAt?: string;
|
package/dist/query-options.js
CHANGED
|
@@ -25,6 +25,16 @@ export const venlyQueries = {
|
|
|
25
25
|
queryKey: venlyKeys.wallets(accountId, query),
|
|
26
26
|
queryFn: () => clients.finance.wallets.list(accountId, query),
|
|
27
27
|
}),
|
|
28
|
+
/** Tenant-wide supported assets, each with its on-chain `decimals`. */
|
|
29
|
+
supportedAssets: (clients) => ({
|
|
30
|
+
queryKey: venlyKeys.supportedAssets(),
|
|
31
|
+
queryFn: () => clients.finance.supportedAssets.list(),
|
|
32
|
+
}),
|
|
33
|
+
/** Account-scoped rows: the same assets plus per-asset `permitStatus`. */
|
|
34
|
+
accountSupportedAssets: (clients, accountId) => ({
|
|
35
|
+
queryKey: venlyKeys.accountSupportedAssets(accountId),
|
|
36
|
+
queryFn: () => clients.finance.supportedAssets.listForAccount(accountId),
|
|
37
|
+
}),
|
|
28
38
|
virtualBankAccounts: (clients, accountId, query) => ({
|
|
29
39
|
queryKey: venlyKeys.virtualBankAccounts(accountId, query),
|
|
30
40
|
queryFn: () => clients.finance.virtualBankAccounts.list(accountId, query),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venlyfinance/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.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.
|
|
33
|
+
"@venlyfinance/sdk": "^0.5.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@tanstack/react-query": "^5.0.0",
|