@venlyfinance/react 0.1.1 → 0.3.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/README.md +3 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/keys.d.ts +6 -0
- package/dist/keys.js +6 -0
- package/dist/mutations.d.ts +107 -17
- package/dist/mutations.js +48 -0
- package/dist/provider.d.ts +1 -1
- package/dist/queries.d.ts +108 -31
- package/dist/queries.js +37 -0
- package/dist/query-options.d.ts +93 -30
- package/dist/query-options.js +26 -0
- package/package.json +3 -3
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/README.md
CHANGED
|
@@ -42,7 +42,7 @@ Mock mode needs zero credentials and makes zero network calls: every hook answer
|
|
|
42
42
|
| `useFourEyesApproval` | Approve/reject/cancel with the optimistic-locking `version` carried through; 409 surfaces as `"stale-version"` (refetch and re-decide, never auto-retry) |
|
|
43
43
|
| `useRampLifecycle` | One ramp request, polled until terminal, with a status descriptor answering: must I act, who is it waiting on, what still works |
|
|
44
44
|
| `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 |
|
|
45
|
+
| `useVenlyMock` | The mock controls (call log, `failNext`, `respondNext`, `delayNext`, `advanceVerification`, `advanceTransfer`) – defined only in mock mode |
|
|
46
46
|
| `proxyClientOptions` | Browser-safe production wiring (below) |
|
|
47
47
|
|
|
48
48
|
## The flow machines
|
|
@@ -126,4 +126,6 @@ npm test # node:test, zero network
|
|
|
126
126
|
npm run build
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
+
See it assembled end to end: [`examples/mock-bank`](../examples/mock-bank/) runs a full account experience on these hooks in mock mode – `npm install && npm run dev`, fake data, zero credentials.
|
|
130
|
+
|
|
129
131
|
MIT. Part of the [venly-settlement-sdk](https://github.com/Venly/venly-settlement-sdk) monorepo alongside `@venlyfinance/sdk` and `@venlyfinance/settlement-mcp`.
|
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, } from "./queries.js";
|
|
5
|
-
export { useCreateAccount, useCreateParty, useCreatePaymentSession, useCreateRampRequest, useCreateVirtualBankAccount, } from "./mutations.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";
|
|
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,9 +4,9 @@ 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, } from "./queries.js";
|
|
7
|
+
export { useAccount, useAccounts, useCompanyFees, useFeeQuote, useParties, useParty, useRampRequest, useRampRequests, useReferenceData, useTransfer, useTransfers, useVirtualBankAccounts, useWallets, useCompanyBankAccount, useCompanyBankAccounts, useCompanyWallets, useBankAccountConfig, useDepositWallets, useRampPairs, } from "./queries.js";
|
|
8
8
|
// Write hooks
|
|
9
|
-
export { useCreateAccount, useCreateParty, useCreatePaymentSession, useCreateRampRequest, useCreateVirtualBankAccount, } from "./mutations.js";
|
|
9
|
+
export { useCreateAccount, useCreateParty, useCreatePaymentSession, useCreateRampRequest, useCreateVirtualBankAccount, useCreateCompanyBankAccount, useCreateCompanyWallet, useSetRampAmount, useInitiateRamp, } from "./mutations.js";
|
|
10
10
|
// Flow machines: the regulated-money lifecycles
|
|
11
11
|
export { StagedTransferController, useStagedTransfer, validateDraft, } from "./flows/staged-transfer.js";
|
|
12
12
|
export { approvalCapabilities, interpretApprovalError, useFourEyesApproval, } from "./flows/four-eyes.js";
|
package/dist/keys.d.ts
CHANGED
|
@@ -15,6 +15,12 @@ export declare const venlyKeys: {
|
|
|
15
15
|
readonly rampRequests: (query?: unknown) => readonly ["venly", "ramp-requests", {} | null];
|
|
16
16
|
readonly rampRequest: (id: string) => readonly ["venly", "ramp-request", string];
|
|
17
17
|
readonly referenceData: () => readonly ["venly", "reference-data"];
|
|
18
|
+
readonly companyBankAccounts: (query?: unknown) => readonly ["venly", "company-bank-accounts", {} | null];
|
|
19
|
+
readonly companyBankAccount: (id: string) => readonly ["venly", "company-bank-account", string];
|
|
20
|
+
readonly companyWallets: (query?: unknown) => readonly ["venly", "company-wallets", {} | null];
|
|
21
|
+
readonly bankAccountConfig: () => readonly ["venly", "bank-account-config"];
|
|
22
|
+
readonly depositWallets: (query?: unknown) => readonly ["venly", "deposit-wallets", {} | null];
|
|
23
|
+
readonly rampPairs: (direction: "on" | "off") => readonly ["venly", "ramp-pairs", "on" | "off"];
|
|
18
24
|
readonly companyFees: () => readonly ["venly", "company-fees"];
|
|
19
25
|
readonly feeQuote: (input: unknown) => readonly ["venly", "fee-quote", unknown];
|
|
20
26
|
};
|
package/dist/keys.js
CHANGED
|
@@ -15,6 +15,12 @@ export const venlyKeys = {
|
|
|
15
15
|
rampRequests: (query) => ["venly", "ramp-requests", query ?? null],
|
|
16
16
|
rampRequest: (id) => ["venly", "ramp-request", id],
|
|
17
17
|
referenceData: () => ["venly", "reference-data"],
|
|
18
|
+
companyBankAccounts: (query) => ["venly", "company-bank-accounts", query ?? null],
|
|
19
|
+
companyBankAccount: (id) => ["venly", "company-bank-account", id],
|
|
20
|
+
companyWallets: (query) => ["venly", "company-wallets", query ?? null],
|
|
21
|
+
bankAccountConfig: () => ["venly", "bank-account-config"],
|
|
22
|
+
depositWallets: (query) => ["venly", "deposit-wallets", query ?? null],
|
|
23
|
+
rampPairs: (direction) => ["venly", "ramp-pairs", direction],
|
|
18
24
|
companyFees: () => ["venly", "company-fees"],
|
|
19
25
|
feeQuote: (input) => ["venly", "fee-quote", input],
|
|
20
26
|
};
|
package/dist/mutations.d.ts
CHANGED
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
import type { VenlyFinanceClient } from "@venlyfinance/sdk";
|
|
1
|
+
import type { FundflowClient, VenlyFinanceClient } from "@venlyfinance/sdk";
|
|
2
2
|
type CreateVibaBody = Parameters<VenlyFinanceClient["virtualBankAccounts"]["create"]>[1];
|
|
3
3
|
type CreatePaymentSessionBody = Parameters<VenlyFinanceClient["paymentSessions"]["create"]>[1];
|
|
4
4
|
/** Create a party (individual or organisation), then refresh party lists. */
|
|
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?: {
|
|
@@ -120,4 +125,89 @@ export declare function useCreateRampRequest(): import("@tanstack/react-query").
|
|
|
120
125
|
fiatCurrencyId: string;
|
|
121
126
|
cryptoCurrencyId: string;
|
|
122
127
|
}, unknown>;
|
|
128
|
+
type SetRampAmountBody = Parameters<FundflowClient["rampRequests"]["setAmount"]>[1];
|
|
129
|
+
type InitiateRampBody = Parameters<FundflowClient["rampRequests"]["initiate"]>[1];
|
|
130
|
+
/** Whitelist a company bank account (created PENDING, verified out-of-band). */
|
|
131
|
+
export declare function useCreateCompanyBankAccount(): import("@tanstack/react-query").UseMutationResult<import("@venlyfinance/sdk").CompanyBankAccountDetails, Error, import("@venlyfinance/sdk").CreateCompanyBankAccountInput, unknown>;
|
|
132
|
+
/** Whitelist a company wallet (created PENDING; prove ownership out-of-band). */
|
|
133
|
+
export declare function useCreateCompanyWallet(): import("@tanstack/react-query").UseMutationResult<{
|
|
134
|
+
id?: string;
|
|
135
|
+
companyId?: string;
|
|
136
|
+
description?: string;
|
|
137
|
+
address?: string;
|
|
138
|
+
chain?: "ETHEREUM" | "POLYGON" | "BASE" | "ARBITRUM" | "SUI";
|
|
139
|
+
verificationStatus?: "PENDING" | "VERIFIED" | "DENIED";
|
|
140
|
+
verifiedAt?: string;
|
|
141
|
+
createdAt?: string;
|
|
142
|
+
updatedAt?: string;
|
|
143
|
+
version?: number;
|
|
144
|
+
}, Error, {
|
|
145
|
+
description?: string;
|
|
146
|
+
address: string;
|
|
147
|
+
chain: "ETHEREUM" | "POLYGON" | "BASE" | "ARBITRUM" | "SUI";
|
|
148
|
+
}, unknown>;
|
|
149
|
+
/** Edit a ramp amount while AWAITING_APPROVAL; carries the optimistic lock. */
|
|
150
|
+
export declare function useSetRampAmount(): import("@tanstack/react-query").UseMutationResult<{
|
|
151
|
+
id?: string;
|
|
152
|
+
companyId?: string;
|
|
153
|
+
companyName?: string;
|
|
154
|
+
rampType?: "ON_RAMP" | "OFF_RAMP";
|
|
155
|
+
status?: "AWAITING_APPROVAL" | "AWAITING_FUNDS" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "BLOCKED" | "DENIED" | "REJECTED" | "CANCELLED";
|
|
156
|
+
amount?: number;
|
|
157
|
+
netAmount?: number;
|
|
158
|
+
fiatAmount?: number;
|
|
159
|
+
fiatNetAmount?: number;
|
|
160
|
+
cryptoAmount?: number;
|
|
161
|
+
fiatFeeAmount?: number;
|
|
162
|
+
exchangeRate?: number;
|
|
163
|
+
feePercentage?: number;
|
|
164
|
+
paymentReference?: string;
|
|
165
|
+
paymentReceived?: boolean;
|
|
166
|
+
blockchainTransactionHash?: string;
|
|
167
|
+
createdAt?: string;
|
|
168
|
+
companyBankAccount?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["EurSepaCompanyBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["GbpChapsCompanyBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["GbpFpsCompanyBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["OtherCurrencySwiftCompanyBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["UsAchCompanyBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["UsSwiftCompanyBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["UsWireCompanyBankAccountDto"];
|
|
169
|
+
companyWallet?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["CompanyWalletDto"];
|
|
170
|
+
depositBankAccount?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["EurSepaDepositBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["GbpChapsDepositBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["GbpFpsDepositBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["OtherCurrencySwiftDepositBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["UsAchDepositBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["UsSwiftDepositBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["UsWireDepositBankAccountDto"];
|
|
171
|
+
depositWallet?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["DepositWalletDto"];
|
|
172
|
+
fiatCurrency?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["FiatCurrencyDto"];
|
|
173
|
+
cryptoCurrency?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["CryptoCurrencyDto"];
|
|
174
|
+
events?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["RampRequestEventDto"][];
|
|
175
|
+
version?: number;
|
|
176
|
+
amountReceived?: number;
|
|
177
|
+
}, Error, {
|
|
178
|
+
id: string;
|
|
179
|
+
body: SetRampAmountBody;
|
|
180
|
+
}, unknown>;
|
|
181
|
+
/** Report the off-ramp crypto leg's transaction hash (initiates processing). */
|
|
182
|
+
export declare function useInitiateRamp(): import("@tanstack/react-query").UseMutationResult<{
|
|
183
|
+
id?: string;
|
|
184
|
+
companyId?: string;
|
|
185
|
+
companyName?: string;
|
|
186
|
+
rampType?: "ON_RAMP" | "OFF_RAMP";
|
|
187
|
+
status?: "AWAITING_APPROVAL" | "AWAITING_FUNDS" | "PROCESSING" | "SUCCEEDED" | "FAILED" | "BLOCKED" | "DENIED" | "REJECTED" | "CANCELLED";
|
|
188
|
+
amount?: number;
|
|
189
|
+
netAmount?: number;
|
|
190
|
+
fiatAmount?: number;
|
|
191
|
+
fiatNetAmount?: number;
|
|
192
|
+
cryptoAmount?: number;
|
|
193
|
+
fiatFeeAmount?: number;
|
|
194
|
+
exchangeRate?: number;
|
|
195
|
+
feePercentage?: number;
|
|
196
|
+
paymentReference?: string;
|
|
197
|
+
paymentReceived?: boolean;
|
|
198
|
+
blockchainTransactionHash?: string;
|
|
199
|
+
createdAt?: string;
|
|
200
|
+
companyBankAccount?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["EurSepaCompanyBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["GbpChapsCompanyBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["GbpFpsCompanyBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["OtherCurrencySwiftCompanyBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["UsAchCompanyBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["UsSwiftCompanyBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["UsWireCompanyBankAccountDto"];
|
|
201
|
+
companyWallet?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["CompanyWalletDto"];
|
|
202
|
+
depositBankAccount?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["EurSepaDepositBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["GbpChapsDepositBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["GbpFpsDepositBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["OtherCurrencySwiftDepositBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["UsAchDepositBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["UsSwiftDepositBankAccountDto"] | import("@venlyfinance/sdk").FundflowComponents["schemas"]["UsWireDepositBankAccountDto"];
|
|
203
|
+
depositWallet?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["DepositWalletDto"];
|
|
204
|
+
fiatCurrency?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["FiatCurrencyDto"];
|
|
205
|
+
cryptoCurrency?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["CryptoCurrencyDto"];
|
|
206
|
+
events?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["RampRequestEventDto"][];
|
|
207
|
+
version?: number;
|
|
208
|
+
amountReceived?: number;
|
|
209
|
+
}, Error, {
|
|
210
|
+
id: string;
|
|
211
|
+
body: InitiateRampBody;
|
|
212
|
+
}, unknown>;
|
|
123
213
|
export {};
|
package/dist/mutations.js
CHANGED
|
@@ -56,3 +56,51 @@ export function useCreateRampRequest() {
|
|
|
56
56
|
},
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
+
/** Whitelist a company bank account (created PENDING, verified out-of-band). */
|
|
60
|
+
export function useCreateCompanyBankAccount() {
|
|
61
|
+
const { fundflow } = useVenly();
|
|
62
|
+
const queryClient = useQueryClient();
|
|
63
|
+
return useMutation({
|
|
64
|
+
mutationFn: (body) => fundflow.bankAccounts.create(body),
|
|
65
|
+
onSuccess: (account) => {
|
|
66
|
+
if (account.id)
|
|
67
|
+
queryClient.setQueryData(venlyKeys.companyBankAccount(account.id), account);
|
|
68
|
+
void queryClient.invalidateQueries({ queryKey: ["venly", "company-bank-accounts"] });
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/** Whitelist a company wallet (created PENDING; prove ownership out-of-band). */
|
|
73
|
+
export function useCreateCompanyWallet() {
|
|
74
|
+
const { fundflow } = useVenly();
|
|
75
|
+
const queryClient = useQueryClient();
|
|
76
|
+
return useMutation({
|
|
77
|
+
mutationFn: (body) => fundflow.companyWallets.create(body),
|
|
78
|
+
onSuccess: () => {
|
|
79
|
+
void queryClient.invalidateQueries({ queryKey: ["venly", "company-wallets"] });
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/** Edit a ramp amount while AWAITING_APPROVAL; carries the optimistic lock. */
|
|
84
|
+
export function useSetRampAmount() {
|
|
85
|
+
const { fundflow } = useVenly();
|
|
86
|
+
const queryClient = useQueryClient();
|
|
87
|
+
return useMutation({
|
|
88
|
+
mutationFn: (input) => fundflow.rampRequests.setAmount(input.id, input.body),
|
|
89
|
+
onSuccess: (ramp, input) => {
|
|
90
|
+
queryClient.setQueryData(venlyKeys.rampRequest(input.id), ramp);
|
|
91
|
+
void queryClient.invalidateQueries({ queryKey: ["venly", "ramp-requests"] });
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/** Report the off-ramp crypto leg's transaction hash (initiates processing). */
|
|
96
|
+
export function useInitiateRamp() {
|
|
97
|
+
const { fundflow } = useVenly();
|
|
98
|
+
const queryClient = useQueryClient();
|
|
99
|
+
return useMutation({
|
|
100
|
+
mutationFn: (input) => fundflow.rampRequests.initiate(input.id, input.body),
|
|
101
|
+
onSuccess: (ramp, input) => {
|
|
102
|
+
queryClient.setQueryData(venlyKeys.rampRequest(input.id), ramp);
|
|
103
|
+
void queryClient.invalidateQueries({ queryKey: ["venly", "ramp-requests"] });
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
}
|
package/dist/provider.d.ts
CHANGED
|
@@ -62,5 +62,5 @@ export declare function useVenly(): VenlyClients;
|
|
|
62
62
|
*/
|
|
63
63
|
export declare function useVenlyMock(): {
|
|
64
64
|
finance: import("@venlyfinance/sdk").VenlyFinanceMock | undefined;
|
|
65
|
-
fundflow: import("@venlyfinance/sdk").
|
|
65
|
+
fundflow: import("@venlyfinance/sdk").VenlyFundflowMock | undefined;
|
|
66
66
|
};
|
package/dist/queries.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { type UseQueryOptions } from "@tanstack/react-query";
|
|
2
|
-
import { venlyQueries, type AccountsQuery, type FeeQuoteInput, type PartiesQuery, type RampRequestsQuery, type TransfersQuery, type VirtualBankAccountsQuery, type WalletsQuery } from "./query-options.js";
|
|
2
|
+
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
3
|
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,34 @@ 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"]>>;
|
|
67
64
|
export declare function useVirtualBankAccounts(accountId: string | undefined, query?: VirtualBankAccountsQuery, options?: Tune<VibaPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<import("@venlyfinance/sdk").Page<{
|
|
68
65
|
id?: string;
|
|
69
66
|
accountId?: string;
|
|
70
|
-
bankAccountType?:
|
|
67
|
+
bankAccountType?: "EUR_SEPA" | "USD_ACH";
|
|
71
68
|
name?: string;
|
|
72
|
-
status?:
|
|
73
|
-
currency?:
|
|
74
|
-
targetCryptocurrency?:
|
|
69
|
+
status?: "PENDING" | "ACTIVE" | "CLOSED";
|
|
70
|
+
currency?: string;
|
|
71
|
+
targetCryptocurrency?: string;
|
|
75
72
|
iban?: string;
|
|
76
73
|
bic?: string;
|
|
74
|
+
accountNumber?: string;
|
|
75
|
+
routingNumber?: string;
|
|
77
76
|
bankName?: string;
|
|
78
77
|
beneficiaryName?: string;
|
|
79
78
|
referenceCode?: string;
|
|
79
|
+
depositRails?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["ProviderDepositRail"][];
|
|
80
80
|
createdAt?: string;
|
|
81
81
|
updatedAt?: string;
|
|
82
82
|
}>>, Error>;
|
|
@@ -85,14 +85,14 @@ export declare function useTransfers(accountId: string | undefined, query?: Tran
|
|
|
85
85
|
id?: string;
|
|
86
86
|
senderAccountId?: string;
|
|
87
87
|
receiverAccountId?: string;
|
|
88
|
-
chain?:
|
|
88
|
+
chain?: "AVALANCHE" | "BASE" | "ETHEREUM" | "POLYGON" | "SOLANA";
|
|
89
89
|
asset?: string;
|
|
90
90
|
amount?: number;
|
|
91
|
-
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["
|
|
91
|
+
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["FiatOriginDto"];
|
|
92
92
|
description?: string;
|
|
93
93
|
merchantReference?: string;
|
|
94
94
|
idempotencyKey?: string;
|
|
95
|
-
status?:
|
|
95
|
+
status?: "PENDING" | "COMPLETED" | "FAILED";
|
|
96
96
|
transactionHash?: string;
|
|
97
97
|
errorMessage?: string;
|
|
98
98
|
createdAt?: string;
|
|
@@ -103,14 +103,14 @@ export declare function useTransfer(accountId: string | undefined, transferId: s
|
|
|
103
103
|
id?: string;
|
|
104
104
|
senderAccountId?: string;
|
|
105
105
|
receiverAccountId?: string;
|
|
106
|
-
chain?:
|
|
106
|
+
chain?: "AVALANCHE" | "BASE" | "ETHEREUM" | "POLYGON" | "SOLANA";
|
|
107
107
|
asset?: string;
|
|
108
108
|
amount?: number;
|
|
109
|
-
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["
|
|
109
|
+
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["FiatOriginDto"];
|
|
110
110
|
description?: string;
|
|
111
111
|
merchantReference?: string;
|
|
112
112
|
idempotencyKey?: string;
|
|
113
|
-
status?:
|
|
113
|
+
status?: "PENDING" | "COMPLETED" | "FAILED";
|
|
114
114
|
transactionHash?: string;
|
|
115
115
|
errorMessage?: string;
|
|
116
116
|
createdAt?: string;
|
|
@@ -197,4 +197,81 @@ export declare function useFeeQuote(input: FeeQuoteInput | undefined, options?:
|
|
|
197
197
|
percentage?: number;
|
|
198
198
|
}>, Error>;
|
|
199
199
|
type FeeQuote = Awaited<ReturnType<ReturnType<typeof venlyQueries.feeQuote>["queryFn"]>>;
|
|
200
|
+
export declare function useCompanyBankAccounts(query?: CompanyBankAccountsQuery, options?: Tune<BankAccountsPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<import("@venlyfinance/sdk").Page<{
|
|
201
|
+
id?: string;
|
|
202
|
+
name?: string;
|
|
203
|
+
bankName?: string;
|
|
204
|
+
bankCountry?: string;
|
|
205
|
+
bankAccountType?: "EUR_SEPA" | "USD_WIRE" | "USD_ACH" | "USD_SWIFT" | "GBP_FPS" | "GBP_CHAPS" | "OTHER_SWIFT";
|
|
206
|
+
supportedRampType?: "ON_RAMP" | "OFF_RAMP" | "ON_AND_OFF_RAMP";
|
|
207
|
+
verificationStatus?: "PENDING" | "VERIFIED" | "DENIED";
|
|
208
|
+
createdAt?: string;
|
|
209
|
+
updatedAt?: string;
|
|
210
|
+
}>>, Error>;
|
|
211
|
+
type BankAccountsPage = Awaited<ReturnType<ReturnType<typeof venlyQueries.companyBankAccounts>["queryFn"]>>;
|
|
212
|
+
export declare function useCompanyBankAccount(id: string | undefined, options?: Tune<BankAccountDetail>): import("@tanstack/react-query").UseQueryResult<NoInfer<{
|
|
213
|
+
id?: string;
|
|
214
|
+
companyId?: string;
|
|
215
|
+
name?: string;
|
|
216
|
+
bankName?: string;
|
|
217
|
+
companyName?: string;
|
|
218
|
+
email?: string;
|
|
219
|
+
phoneNumber?: string;
|
|
220
|
+
bankCountry?: string;
|
|
221
|
+
beneficiaryAddressLine1?: string;
|
|
222
|
+
beneficiaryAddressLine2?: string;
|
|
223
|
+
beneficiaryCity?: string;
|
|
224
|
+
beneficiaryState?: string;
|
|
225
|
+
beneficiaryPostalCode?: string;
|
|
226
|
+
beneficiaryCountry?: string;
|
|
227
|
+
bankAccountType?: "EUR_SEPA" | "USD_WIRE" | "USD_ACH" | "USD_SWIFT" | "GBP_FPS" | "GBP_CHAPS" | "OTHER_SWIFT";
|
|
228
|
+
supportedRampType?: "ON_RAMP" | "OFF_RAMP" | "ON_AND_OFF_RAMP";
|
|
229
|
+
verificationStatus?: "PENDING" | "VERIFIED" | "DENIED";
|
|
230
|
+
verifiedAt?: string;
|
|
231
|
+
createdAt?: string;
|
|
232
|
+
updatedAt?: string;
|
|
233
|
+
version?: number;
|
|
234
|
+
} & {
|
|
235
|
+
iban?: string;
|
|
236
|
+
bic?: string;
|
|
237
|
+
intermediaryBic?: string;
|
|
238
|
+
intermediaryBankName?: string;
|
|
239
|
+
accountNumber?: string;
|
|
240
|
+
sortCode?: string;
|
|
241
|
+
routingNumber?: string;
|
|
242
|
+
bankStreetAddress?: string;
|
|
243
|
+
bankCity?: string;
|
|
244
|
+
bankPostalCode?: string;
|
|
245
|
+
currency?: string;
|
|
246
|
+
}>, Error>;
|
|
247
|
+
type BankAccountDetail = Awaited<ReturnType<ReturnType<typeof venlyQueries.companyBankAccount>["queryFn"]>>;
|
|
248
|
+
export declare function useCompanyWallets(query?: CompanyWalletsQuery, options?: Tune<WalletsListPage>): import("@tanstack/react-query").UseQueryResult<NoInfer<import("@venlyfinance/sdk").Page<{
|
|
249
|
+
id?: string;
|
|
250
|
+
description?: string;
|
|
251
|
+
address?: string;
|
|
252
|
+
chain?: "ETHEREUM" | "POLYGON" | "BASE" | "ARBITRUM" | "SUI";
|
|
253
|
+
verificationStatus?: "PENDING" | "VERIFIED" | "DENIED";
|
|
254
|
+
createdAt?: string;
|
|
255
|
+
updatedAt?: string;
|
|
256
|
+
}>>, Error>;
|
|
257
|
+
type WalletsListPage = Awaited<ReturnType<ReturnType<typeof venlyQueries.companyWallets>["queryFn"]>>;
|
|
258
|
+
export declare function useBankAccountConfig(options?: Tune<BankAccountConfigData>): import("@tanstack/react-query").UseQueryResult<NoInfer<{
|
|
259
|
+
enabledAccountTypes?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["BankAccountTypeDto"][];
|
|
260
|
+
supportedCountries?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["CountryDto"][];
|
|
261
|
+
supportedCurrencies?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["CurrencyItemDto"][];
|
|
262
|
+
}>, Error>;
|
|
263
|
+
type BankAccountConfigData = Awaited<ReturnType<ReturnType<typeof venlyQueries.bankAccountConfig>["queryFn"]>>;
|
|
264
|
+
export declare function useDepositWallets(query?: DepositWalletsQuery, options?: Tune<DepositWalletsData>): import("@tanstack/react-query").UseQueryResult<NoInfer<{
|
|
265
|
+
id?: string;
|
|
266
|
+
address?: string;
|
|
267
|
+
chain?: "ETHEREUM" | "POLYGON" | "BASE" | "ARBITRUM" | "SUI";
|
|
268
|
+
label?: string;
|
|
269
|
+
isDefault?: boolean;
|
|
270
|
+
isActive?: boolean;
|
|
271
|
+
version?: number;
|
|
272
|
+
}[]>, Error>;
|
|
273
|
+
type DepositWalletsData = Awaited<ReturnType<ReturnType<typeof venlyQueries.depositWallets>["queryFn"]>>;
|
|
274
|
+
/** Supported on/off-ramp currency pairs, for destination/asset pickers. */
|
|
275
|
+
export declare function useRampPairs(direction: "on" | "off", options?: Tune<RampPairsData>): import("@tanstack/react-query").UseQueryResult<NoInfer<RampPairsData>, Error>;
|
|
276
|
+
type RampPairsData = Awaited<ReturnType<ReturnType<typeof venlyQueries.rampPairs>["queryFn"]>>;
|
|
200
277
|
export {};
|
package/dist/queries.js
CHANGED
|
@@ -89,3 +89,40 @@ export function useFeeQuote(input, options) {
|
|
|
89
89
|
...options,
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
+
export function useCompanyBankAccounts(query, options) {
|
|
93
|
+
const clients = useVenly();
|
|
94
|
+
return useQuery({ ...venlyQueries.companyBankAccounts(clients, query), ...options });
|
|
95
|
+
}
|
|
96
|
+
export function useCompanyBankAccount(id, options) {
|
|
97
|
+
const clients = useVenly();
|
|
98
|
+
return useQuery({
|
|
99
|
+
...venlyQueries.companyBankAccount(clients, id ?? ""),
|
|
100
|
+
enabled: Boolean(id) && (options?.enabled ?? true),
|
|
101
|
+
...options,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
export function useCompanyWallets(query, options) {
|
|
105
|
+
const clients = useVenly();
|
|
106
|
+
return useQuery({ ...venlyQueries.companyWallets(clients, query), ...options });
|
|
107
|
+
}
|
|
108
|
+
export function useBankAccountConfig(options) {
|
|
109
|
+
const clients = useVenly();
|
|
110
|
+
return useQuery({
|
|
111
|
+
...venlyQueries.bankAccountConfig(clients),
|
|
112
|
+
staleTime: Infinity, // enabled types/countries change on deploys, not minutes
|
|
113
|
+
...options,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
export function useDepositWallets(query, options) {
|
|
117
|
+
const clients = useVenly();
|
|
118
|
+
return useQuery({ ...venlyQueries.depositWallets(clients, query), ...options });
|
|
119
|
+
}
|
|
120
|
+
/** Supported on/off-ramp currency pairs, for destination/asset pickers. */
|
|
121
|
+
export function useRampPairs(direction, options) {
|
|
122
|
+
const clients = useVenly();
|
|
123
|
+
return useQuery({
|
|
124
|
+
...venlyQueries.rampPairs(clients, direction),
|
|
125
|
+
staleTime: Infinity,
|
|
126
|
+
...options,
|
|
127
|
+
});
|
|
128
|
+
}
|
package/dist/query-options.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ export type VirtualBankAccountsQuery = NonNullable<Parameters<VenlyFinanceClient
|
|
|
7
7
|
export type TransfersQuery = NonNullable<Parameters<VenlyFinanceClient["transfers"]["list"]>[1]>;
|
|
8
8
|
export type RampRequestsQuery = NonNullable<Parameters<FundflowClient["rampRequests"]["list"]>[0]>;
|
|
9
9
|
export type FeeQuoteInput = Parameters<FundflowClient["fees"]["calculate"]>[0];
|
|
10
|
+
export type CompanyBankAccountsQuery = NonNullable<Parameters<FundflowClient["bankAccounts"]["list"]>[0]>;
|
|
11
|
+
export type CompanyWalletsQuery = NonNullable<Parameters<FundflowClient["companyWallets"]["list"]>[0]>;
|
|
12
|
+
export type DepositWalletsQuery = NonNullable<Parameters<FundflowClient["referenceData"]["depositWallets"]>[0]>;
|
|
10
13
|
/**
|
|
11
14
|
* Pure `{ queryKey, queryFn }` factories, one per read. The hooks in
|
|
12
15
|
* queries.ts are one-line wrappers over these; anything that needs the same
|
|
@@ -18,15 +21,15 @@ export declare const venlyQueries: {
|
|
|
18
21
|
queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
|
|
19
22
|
id?: string;
|
|
20
23
|
externalId?: string;
|
|
21
|
-
partyType?:
|
|
22
|
-
status?:
|
|
24
|
+
partyType?: "INDIVIDUAL" | "ORGANISATION";
|
|
25
|
+
status?: "ACTIVE" | "SUSPENDED" | "BLOCKED";
|
|
26
|
+
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["AddressDto"];
|
|
23
27
|
firstName?: string;
|
|
24
28
|
lastName?: string;
|
|
25
|
-
kycStatus?:
|
|
29
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "REJECTED";
|
|
26
30
|
name?: string;
|
|
27
31
|
vatNumber?: string;
|
|
28
|
-
kybStatus?:
|
|
29
|
-
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["Address"];
|
|
32
|
+
kybStatus?: "PENDING" | "VERIFIED" | "DENIED";
|
|
30
33
|
createdAt?: string;
|
|
31
34
|
updatedAt?: string;
|
|
32
35
|
version?: number;
|
|
@@ -37,15 +40,15 @@ export declare const venlyQueries: {
|
|
|
37
40
|
queryFn: () => Promise<{
|
|
38
41
|
id?: string;
|
|
39
42
|
externalId?: string;
|
|
40
|
-
partyType?:
|
|
41
|
-
status?:
|
|
43
|
+
partyType?: "INDIVIDUAL" | "ORGANISATION";
|
|
44
|
+
status?: "ACTIVE" | "SUSPENDED" | "BLOCKED";
|
|
45
|
+
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["AddressDto"];
|
|
42
46
|
firstName?: string;
|
|
43
47
|
lastName?: string;
|
|
44
|
-
kycStatus?:
|
|
48
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "REJECTED";
|
|
45
49
|
name?: string;
|
|
46
50
|
vatNumber?: string;
|
|
47
|
-
kybStatus?:
|
|
48
|
-
address?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["Address"];
|
|
51
|
+
kybStatus?: "PENDING" | "VERIFIED" | "DENIED";
|
|
49
52
|
createdAt?: string;
|
|
50
53
|
updatedAt?: string;
|
|
51
54
|
version?: number;
|
|
@@ -57,8 +60,8 @@ export declare const venlyQueries: {
|
|
|
57
60
|
id?: string;
|
|
58
61
|
externalId?: string;
|
|
59
62
|
name?: string;
|
|
60
|
-
kycStatus?:
|
|
61
|
-
status?:
|
|
63
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "NOT_REQUIRED" | "REJECTED";
|
|
64
|
+
status?: "ACTIVE" | "SUSPENDED" | "CLOSED";
|
|
62
65
|
createdAt?: string;
|
|
63
66
|
version?: number;
|
|
64
67
|
}>>;
|
|
@@ -69,8 +72,8 @@ export declare const venlyQueries: {
|
|
|
69
72
|
id?: string;
|
|
70
73
|
externalId?: string;
|
|
71
74
|
name?: string;
|
|
72
|
-
kycStatus?:
|
|
73
|
-
status?:
|
|
75
|
+
kycStatus?: "VERIFICATION_PENDING" | "VERIFIED" | "NOT_REQUIRED" | "REJECTED";
|
|
76
|
+
status?: "ACTIVE" | "SUSPENDED" | "CLOSED";
|
|
74
77
|
createdAt?: string;
|
|
75
78
|
version?: number;
|
|
76
79
|
}>;
|
|
@@ -78,12 +81,9 @@ export declare const venlyQueries: {
|
|
|
78
81
|
readonly wallets: (clients: VenlyClients, accountId: string, query?: WalletsQuery) => {
|
|
79
82
|
queryKey: readonly ["venly", "account", string, "wallets", {} | null];
|
|
80
83
|
queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
address?: string;
|
|
85
|
-
balances?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["TokenBalance"][];
|
|
86
|
-
amlStatus?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["AmlStatus"];
|
|
84
|
+
asset?: string;
|
|
85
|
+
contractAddress?: string;
|
|
86
|
+
amount?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["CryptoBalanceSummaryDto"];
|
|
87
87
|
}>>;
|
|
88
88
|
};
|
|
89
89
|
readonly virtualBankAccounts: (clients: VenlyClients, accountId: string, query?: VirtualBankAccountsQuery) => {
|
|
@@ -91,16 +91,19 @@ export declare const venlyQueries: {
|
|
|
91
91
|
queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
|
|
92
92
|
id?: string;
|
|
93
93
|
accountId?: string;
|
|
94
|
-
bankAccountType?:
|
|
94
|
+
bankAccountType?: "EUR_SEPA" | "USD_ACH";
|
|
95
95
|
name?: string;
|
|
96
|
-
status?:
|
|
97
|
-
currency?:
|
|
98
|
-
targetCryptocurrency?:
|
|
96
|
+
status?: "PENDING" | "ACTIVE" | "CLOSED";
|
|
97
|
+
currency?: string;
|
|
98
|
+
targetCryptocurrency?: string;
|
|
99
99
|
iban?: string;
|
|
100
100
|
bic?: string;
|
|
101
|
+
accountNumber?: string;
|
|
102
|
+
routingNumber?: string;
|
|
101
103
|
bankName?: string;
|
|
102
104
|
beneficiaryName?: string;
|
|
103
105
|
referenceCode?: string;
|
|
106
|
+
depositRails?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["ProviderDepositRail"][];
|
|
104
107
|
createdAt?: string;
|
|
105
108
|
updatedAt?: string;
|
|
106
109
|
}>>;
|
|
@@ -111,14 +114,14 @@ export declare const venlyQueries: {
|
|
|
111
114
|
id?: string;
|
|
112
115
|
senderAccountId?: string;
|
|
113
116
|
receiverAccountId?: string;
|
|
114
|
-
chain?:
|
|
117
|
+
chain?: "AVALANCHE" | "BASE" | "ETHEREUM" | "POLYGON" | "SOLANA";
|
|
115
118
|
asset?: string;
|
|
116
119
|
amount?: number;
|
|
117
|
-
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["
|
|
120
|
+
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["FiatOriginDto"];
|
|
118
121
|
description?: string;
|
|
119
122
|
merchantReference?: string;
|
|
120
123
|
idempotencyKey?: string;
|
|
121
|
-
status?:
|
|
124
|
+
status?: "PENDING" | "COMPLETED" | "FAILED";
|
|
122
125
|
transactionHash?: string;
|
|
123
126
|
errorMessage?: string;
|
|
124
127
|
createdAt?: string;
|
|
@@ -131,14 +134,14 @@ export declare const venlyQueries: {
|
|
|
131
134
|
id?: string;
|
|
132
135
|
senderAccountId?: string;
|
|
133
136
|
receiverAccountId?: string;
|
|
134
|
-
chain?:
|
|
137
|
+
chain?: "AVALANCHE" | "BASE" | "ETHEREUM" | "POLYGON" | "SOLANA";
|
|
135
138
|
asset?: string;
|
|
136
139
|
amount?: number;
|
|
137
|
-
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["
|
|
140
|
+
fiatOrigin?: import("@venlyfinance/sdk").FinanceComponents["schemas"]["FiatOriginDto"];
|
|
138
141
|
description?: string;
|
|
139
142
|
merchantReference?: string;
|
|
140
143
|
idempotencyKey?: string;
|
|
141
|
-
status?:
|
|
144
|
+
status?: "PENDING" | "COMPLETED" | "FAILED";
|
|
142
145
|
transactionHash?: string;
|
|
143
146
|
errorMessage?: string;
|
|
144
147
|
createdAt?: string;
|
|
@@ -241,4 +244,64 @@ export declare const venlyQueries: {
|
|
|
241
244
|
percentage?: number;
|
|
242
245
|
}>;
|
|
243
246
|
};
|
|
247
|
+
readonly companyBankAccounts: (clients: VenlyClients, query?: CompanyBankAccountsQuery) => {
|
|
248
|
+
queryKey: readonly ["venly", "company-bank-accounts", {} | null];
|
|
249
|
+
queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
|
|
250
|
+
id?: string;
|
|
251
|
+
name?: string;
|
|
252
|
+
bankName?: string;
|
|
253
|
+
bankCountry?: string;
|
|
254
|
+
bankAccountType?: "EUR_SEPA" | "USD_WIRE" | "USD_ACH" | "USD_SWIFT" | "GBP_FPS" | "GBP_CHAPS" | "OTHER_SWIFT";
|
|
255
|
+
supportedRampType?: "ON_RAMP" | "OFF_RAMP" | "ON_AND_OFF_RAMP";
|
|
256
|
+
verificationStatus?: "PENDING" | "VERIFIED" | "DENIED";
|
|
257
|
+
createdAt?: string;
|
|
258
|
+
updatedAt?: string;
|
|
259
|
+
}>>;
|
|
260
|
+
};
|
|
261
|
+
readonly companyBankAccount: (clients: VenlyClients, id: string) => {
|
|
262
|
+
queryKey: readonly ["venly", "company-bank-account", string];
|
|
263
|
+
queryFn: () => Promise<import("@venlyfinance/sdk").CompanyBankAccountDetails>;
|
|
264
|
+
};
|
|
265
|
+
readonly companyWallets: (clients: VenlyClients, query?: CompanyWalletsQuery) => {
|
|
266
|
+
queryKey: readonly ["venly", "company-wallets", {} | null];
|
|
267
|
+
queryFn: () => Promise<import("@venlyfinance/sdk").Page<{
|
|
268
|
+
id?: string;
|
|
269
|
+
description?: string;
|
|
270
|
+
address?: string;
|
|
271
|
+
chain?: "ETHEREUM" | "POLYGON" | "BASE" | "ARBITRUM" | "SUI";
|
|
272
|
+
verificationStatus?: "PENDING" | "VERIFIED" | "DENIED";
|
|
273
|
+
createdAt?: string;
|
|
274
|
+
updatedAt?: string;
|
|
275
|
+
}>>;
|
|
276
|
+
};
|
|
277
|
+
readonly bankAccountConfig: (clients: VenlyClients) => {
|
|
278
|
+
queryKey: readonly ["venly", "bank-account-config"];
|
|
279
|
+
queryFn: () => Promise<{
|
|
280
|
+
enabledAccountTypes?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["BankAccountTypeDto"][];
|
|
281
|
+
supportedCountries?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["CountryDto"][];
|
|
282
|
+
supportedCurrencies?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["CurrencyItemDto"][];
|
|
283
|
+
}>;
|
|
284
|
+
};
|
|
285
|
+
readonly depositWallets: (clients: VenlyClients, query?: DepositWalletsQuery) => {
|
|
286
|
+
queryKey: readonly ["venly", "deposit-wallets", {} | null];
|
|
287
|
+
queryFn: () => Promise<{
|
|
288
|
+
id?: string;
|
|
289
|
+
address?: string;
|
|
290
|
+
chain?: "ETHEREUM" | "POLYGON" | "BASE" | "ARBITRUM" | "SUI";
|
|
291
|
+
label?: string;
|
|
292
|
+
isDefault?: boolean;
|
|
293
|
+
isActive?: boolean;
|
|
294
|
+
version?: number;
|
|
295
|
+
}[]>;
|
|
296
|
+
};
|
|
297
|
+
readonly rampPairs: (clients: VenlyClients, direction: "on" | "off") => {
|
|
298
|
+
queryKey: readonly ["venly", "ramp-pairs", "on" | "off"];
|
|
299
|
+
queryFn: () => Promise<{
|
|
300
|
+
from?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["FiatPairItem"];
|
|
301
|
+
to?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["CryptoPairItem"];
|
|
302
|
+
}[]> | Promise<{
|
|
303
|
+
from?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["CryptoPairItem"];
|
|
304
|
+
to?: import("@venlyfinance/sdk").FundflowComponents["schemas"]["FiatPairItem"];
|
|
305
|
+
}[]>;
|
|
306
|
+
};
|
|
244
307
|
};
|
package/dist/query-options.js
CHANGED
|
@@ -70,4 +70,30 @@ export const venlyQueries = {
|
|
|
70
70
|
queryKey: venlyKeys.feeQuote(input),
|
|
71
71
|
queryFn: () => clients.fundflow.fees.calculate(input),
|
|
72
72
|
}),
|
|
73
|
+
companyBankAccounts: (clients, query) => ({
|
|
74
|
+
queryKey: venlyKeys.companyBankAccounts(query),
|
|
75
|
+
queryFn: () => clients.fundflow.bankAccounts.list(query),
|
|
76
|
+
}),
|
|
77
|
+
companyBankAccount: (clients, id) => ({
|
|
78
|
+
queryKey: venlyKeys.companyBankAccount(id),
|
|
79
|
+
queryFn: () => clients.fundflow.bankAccounts.get(id),
|
|
80
|
+
}),
|
|
81
|
+
companyWallets: (clients, query) => ({
|
|
82
|
+
queryKey: venlyKeys.companyWallets(query),
|
|
83
|
+
queryFn: () => clients.fundflow.companyWallets.list(query),
|
|
84
|
+
}),
|
|
85
|
+
bankAccountConfig: (clients) => ({
|
|
86
|
+
queryKey: venlyKeys.bankAccountConfig(),
|
|
87
|
+
queryFn: () => clients.fundflow.referenceData.bankAccountConfig(),
|
|
88
|
+
}),
|
|
89
|
+
depositWallets: (clients, query) => ({
|
|
90
|
+
queryKey: venlyKeys.depositWallets(query),
|
|
91
|
+
queryFn: () => clients.fundflow.referenceData.depositWallets(query),
|
|
92
|
+
}),
|
|
93
|
+
rampPairs: (clients, direction) => ({
|
|
94
|
+
queryKey: venlyKeys.rampPairs(direction),
|
|
95
|
+
queryFn: () => direction === "on"
|
|
96
|
+
? clients.fundflow.rampRequests.onRampPairs()
|
|
97
|
+
: clients.fundflow.rampRequests.offRampPairs(),
|
|
98
|
+
}),
|
|
73
99
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venlyfinance/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.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.4.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@tanstack/react-query": "^5.0.0",
|
|
@@ -62,4 +62,4 @@
|
|
|
62
62
|
"directory": "react"
|
|
63
63
|
},
|
|
64
64
|
"homepage": "https://github.com/Venly/venly-settlement-sdk/tree/main/react#readme"
|
|
65
|
-
}
|
|
65
|
+
}
|