@capxul/sdk-react 0.1.0-alpha.8 → 0.1.0-alpha.9
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 +19 -0
- package/dist/index.cjs +7 -0
- package/dist/index.d.cts +99 -2
- package/dist/index.d.ts +99 -2
- package/dist/index.js +7 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @capxul/sdk-react
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.9
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add the canonical auth bootstrap flow.
|
|
8
|
+
|
|
9
|
+
`verifyOtp()` now resolves a verified email session into either an
|
|
10
|
+
`existing_member` identity or a `bootstrap_required` continuation. New and
|
|
11
|
+
incomplete members continue through `completeBootstrap()`, which validates a
|
|
12
|
+
server-issued bootstrap token, claims the username, provisions the account/Safe
|
|
13
|
+
through the backend bootstrap path, and returns the authenticated product
|
|
14
|
+
identity. The React SDK adds `useAuthBootstrapFlow()` as the typed first-run
|
|
15
|
+
flow wrapper.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
- @capxul/sdk@0.1.0-alpha.9
|
|
21
|
+
|
|
3
22
|
## 0.1.0-alpha.8
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -601,6 +601,12 @@ function useAuthFlow() {
|
|
|
601
601
|
const [snapshot, send] = react$1.useActor(machine);
|
|
602
602
|
return { snapshot, send };
|
|
603
603
|
}
|
|
604
|
+
function useAuthBootstrapFlow() {
|
|
605
|
+
const client = useCapxul();
|
|
606
|
+
const machine = react.useMemo(() => client.flows.authBootstrap(), [client]);
|
|
607
|
+
const [snapshot, send] = react$1.useActor(machine);
|
|
608
|
+
return { snapshot, send };
|
|
609
|
+
}
|
|
604
610
|
function useOnboardingFlow() {
|
|
605
611
|
const client = useCapxul();
|
|
606
612
|
const machine = react.useMemo(() => client.flows.onboarding(), [client]);
|
|
@@ -718,6 +724,7 @@ exports.localPrivateKeyConnector = localPrivateKeyConnector;
|
|
|
718
724
|
exports.useAccount = useAccount;
|
|
719
725
|
exports.useApiKey = useApiKey;
|
|
720
726
|
exports.useApiKeys = useApiKeys;
|
|
727
|
+
exports.useAuthBootstrapFlow = useAuthBootstrapFlow;
|
|
721
728
|
exports.useAuthFlow = useAuthFlow;
|
|
722
729
|
exports.useBalanceLedger = useBalanceLedger;
|
|
723
730
|
exports.useBalanceLedgerEntry = useBalanceLedgerEntry;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import * as _capxul_sdk from '@capxul/sdk';
|
|
2
3
|
import { HttpTransport, TransportState, BrowserCapxulConfig, AuthSessionStore, AccountId, OrganizationId, ApiKeyId, BalanceLedgerEntryId, ExternalAccountId, MemberId, Account, ApiKey, BalanceLedgerEntry, DocumentId, Document, ExternalAccount, KybProfile, KycProfile, CapxulError as CapxulError$1, Member, OperationId, Operation, Organization, PaymentId, Payment, SafeId, Safe, SubAccountId, SubAccount, TokenTransfer, TransferId, Transfer, Treasury, VirtualAccountId, VirtualAccount, VirtualCardId, VirtualCard, WebhookEndpointId, WebhookEndpoint, WebhookEventId, WebhookEvent, WithdrawalId, Withdrawal, List, TokenTransfersListInput, TokenTransfersListPage, LocalPrivateKeySignerProvider } from '@capxul/sdk';
|
|
3
|
-
export { AuthFlowContext, AuthFlowEvent, BrowserCapxulConfig, OnboardingFlowContext, OnboardingFlowEvent, ProvisioningFlowContext, ProvisioningFlowEvent } from '@capxul/sdk';
|
|
4
|
+
export { AuthBootstrapFlowContext, AuthBootstrapFlowEvent, AuthFlowContext, AuthFlowEvent, BrowserCapxulConfig, OnboardingFlowContext, OnboardingFlowEvent, ProvisioningFlowContext, ProvisioningFlowEvent } from '@capxul/sdk';
|
|
4
5
|
import { QueryClient, UseQueryResult } from '@tanstack/react-query';
|
|
5
6
|
import { CapxulClient } from '@capxul/sdk/client';
|
|
6
7
|
import { CapxulError } from '@capxul/sdk/errors';
|
|
@@ -444,10 +445,106 @@ declare function useApiKeys(_organizationId: OrganizationId): QueryResult<List<A
|
|
|
444
445
|
*/
|
|
445
446
|
declare function useWebhookEndpoints(): QueryResult<List<WebhookEndpoint>>;
|
|
446
447
|
|
|
448
|
+
/**
|
|
449
|
+
* Lowercased, shape-validated email address. Brand prevents swapping
|
|
450
|
+
* with `phoneNumber`, `username`, or other string identifiers (per
|
|
451
|
+
* `CANON.md` §4.54 and `sdk-surface.md` §5h).
|
|
452
|
+
*/
|
|
453
|
+
type Email = string & {
|
|
454
|
+
readonly __capxulEmailBrand: "Email";
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* Public Capxul username. 3–30 chars, letter-first, lowercased,
|
|
458
|
+
* remaining chars from `[a-z0-9_-]` (per `CANON.md` §4.54 and
|
|
459
|
+
* `sdk-surface.md` §5h). Constructor lowercases before validating so
|
|
460
|
+
* mixed-case input canonicalizes cleanly when the first char is a
|
|
461
|
+
* letter; purely invalid shapes (too short, illegal chars, digit-first)
|
|
462
|
+
* still throw.
|
|
463
|
+
*/
|
|
464
|
+
type Username = string & {
|
|
465
|
+
readonly __capxulUsernameBrand: "Username";
|
|
466
|
+
};
|
|
467
|
+
|
|
447
468
|
declare function useAuthFlow(): {
|
|
448
469
|
readonly snapshot: xstate.MachineSnapshot<any, any, any, any, any, any, any, any>;
|
|
449
470
|
readonly send: (event: any) => void;
|
|
450
471
|
};
|
|
472
|
+
declare function useAuthBootstrapFlow(): {
|
|
473
|
+
readonly snapshot: xstate.MachineSnapshot<_capxul_sdk.AuthBootstrapFlowContext, {
|
|
474
|
+
readonly type: "ENTER_EMAIL";
|
|
475
|
+
readonly email: Email;
|
|
476
|
+
} | {
|
|
477
|
+
readonly type: "REQUEST_OTP";
|
|
478
|
+
} | {
|
|
479
|
+
readonly type: "ENTER_OTP";
|
|
480
|
+
readonly code: string;
|
|
481
|
+
} | {
|
|
482
|
+
readonly type: "VERIFY_OTP";
|
|
483
|
+
} | {
|
|
484
|
+
readonly type: "ENTER_USERNAME";
|
|
485
|
+
readonly username: Username;
|
|
486
|
+
} | {
|
|
487
|
+
readonly type: "ENTER_SIGNER_PROVIDER";
|
|
488
|
+
readonly signerProvider: _capxul_sdk.LocalPrivateKeySignerProvider;
|
|
489
|
+
} | {
|
|
490
|
+
readonly type: "COMPLETE_BOOTSTRAP";
|
|
491
|
+
} | {
|
|
492
|
+
readonly type: "BACK";
|
|
493
|
+
} | {
|
|
494
|
+
readonly type: "RESET";
|
|
495
|
+
} | {
|
|
496
|
+
readonly type: "SIGN_OUT";
|
|
497
|
+
}, {
|
|
498
|
+
[x: string]: xstate.ActorRefFromLogic<xstate.PromiseActorLogic<void, void, xstate.EventObject>> | xstate.ActorRefFromLogic<xstate.PromiseActorLogic<_capxul_sdk.CompleteBootstrapResult, {
|
|
499
|
+
bootstrapToken: _capxul_sdk.AuthBootstrapToken;
|
|
500
|
+
username: Username;
|
|
501
|
+
signerProvider: _capxul_sdk.LocalPrivateKeySignerProvider;
|
|
502
|
+
}, xstate.EventObject>> | xstate.ActorRefFromLogic<xstate.PromiseActorLogic<void, {
|
|
503
|
+
email: Email;
|
|
504
|
+
}, xstate.EventObject>> | xstate.ActorRefFromLogic<xstate.PromiseActorLogic<_capxul_sdk.VerifyOtpResult, {
|
|
505
|
+
email: Email;
|
|
506
|
+
code: string;
|
|
507
|
+
}, xstate.EventObject>> | undefined;
|
|
508
|
+
}, "email" | "error" | "bootstrap_required" | "authenticated" | "sending_otp" | "otp_requested" | "signing_out" | "verifying_otp" | "completing_bootstrap", string, xstate.NonReducibleUnknown, xstate.MetaObject, {
|
|
509
|
+
id: "authBootstrap";
|
|
510
|
+
states: {
|
|
511
|
+
readonly email: {};
|
|
512
|
+
readonly sending_otp: {};
|
|
513
|
+
readonly otp_requested: {};
|
|
514
|
+
readonly verifying_otp: {};
|
|
515
|
+
readonly bootstrap_required: {};
|
|
516
|
+
readonly completing_bootstrap: {};
|
|
517
|
+
readonly authenticated: {};
|
|
518
|
+
readonly signing_out: {};
|
|
519
|
+
readonly error: {};
|
|
520
|
+
};
|
|
521
|
+
}>;
|
|
522
|
+
readonly send: (event: {
|
|
523
|
+
readonly type: "ENTER_EMAIL";
|
|
524
|
+
readonly email: Email;
|
|
525
|
+
} | {
|
|
526
|
+
readonly type: "REQUEST_OTP";
|
|
527
|
+
} | {
|
|
528
|
+
readonly type: "ENTER_OTP";
|
|
529
|
+
readonly code: string;
|
|
530
|
+
} | {
|
|
531
|
+
readonly type: "VERIFY_OTP";
|
|
532
|
+
} | {
|
|
533
|
+
readonly type: "ENTER_USERNAME";
|
|
534
|
+
readonly username: Username;
|
|
535
|
+
} | {
|
|
536
|
+
readonly type: "ENTER_SIGNER_PROVIDER";
|
|
537
|
+
readonly signerProvider: _capxul_sdk.LocalPrivateKeySignerProvider;
|
|
538
|
+
} | {
|
|
539
|
+
readonly type: "COMPLETE_BOOTSTRAP";
|
|
540
|
+
} | {
|
|
541
|
+
readonly type: "BACK";
|
|
542
|
+
} | {
|
|
543
|
+
readonly type: "RESET";
|
|
544
|
+
} | {
|
|
545
|
+
readonly type: "SIGN_OUT";
|
|
546
|
+
}) => void;
|
|
547
|
+
};
|
|
451
548
|
declare function useOnboardingFlow(): {
|
|
452
549
|
readonly snapshot: xstate.MachineSnapshot<any, any, any, any, any, any, any, any>;
|
|
453
550
|
readonly send: (event: any) => void;
|
|
@@ -538,4 +635,4 @@ declare function injectedConnector(options?: InjectedConnectorOptions): CapxulCo
|
|
|
538
635
|
*/
|
|
539
636
|
declare function localPrivateKeyConnector(options: LocalPrivateKeyConnectorOptions): CapxulConnector;
|
|
540
637
|
|
|
541
|
-
export { CapxulClientProvider, type CapxulClientProviderProps, type CapxulConnector, type CapxulConnectorKind, type CapxulConnectorSession, CapxulProvider, type CapxulProviderProps, CapxulTransportProvider, type CapxulTransportProviderProps, type DocumentsFilters, type InjectedConnectorOptions, type LocalPrivateKeyConnectorOptions, type OrgDocumentsFilters, type OrgScopedFilters, type OwnerRef, type OwnerScopedFilters, type PaginationFilters, type PaymentsFilters, type QueryResult, type TransfersFilters, type UseApiKeyArgs, type UseBalanceLedgerEntryArgs, type UseExternalAccountArgs, type UseMemberArgs, type UseTokenTransferArgs, type VirtualAccountsFilters, type VirtualCardsFilters, type WithdrawalsFilters, createCapxulConfig, injectedConnector, localPrivateKeyConnector, useAccount, useApiKey, useApiKeys, useAuthFlow, useBalanceLedger, useBalanceLedgerEntry, useCapxul, useCapxulStatus, useDocument, useDocuments, useExternalAccount, useExternalAccounts, useKybProfile, useKycProfile, useMe, useMember, useMembers, useOnboardingFlow, useOperation, useOrgDocuments, useOrgPayments, useOrgTransfers, useOrgWithdrawals, useOrganization, useOrganizations, usePayment, usePayments, useProvisioningFlow, useSafe, useSubAccount, useSubAccounts, useTokenTransfer, useTokenTransfers, useTransfer, useTransfers, useTreasury, useVirtualAccount, useVirtualAccounts, useVirtualCard, useVirtualCards, useWebhookEndpoint, useWebhookEndpoints, useWebhookEvent, useWithdrawal, useWithdrawals };
|
|
638
|
+
export { CapxulClientProvider, type CapxulClientProviderProps, type CapxulConnector, type CapxulConnectorKind, type CapxulConnectorSession, CapxulProvider, type CapxulProviderProps, CapxulTransportProvider, type CapxulTransportProviderProps, type DocumentsFilters, type InjectedConnectorOptions, type LocalPrivateKeyConnectorOptions, type OrgDocumentsFilters, type OrgScopedFilters, type OwnerRef, type OwnerScopedFilters, type PaginationFilters, type PaymentsFilters, type QueryResult, type TransfersFilters, type UseApiKeyArgs, type UseBalanceLedgerEntryArgs, type UseExternalAccountArgs, type UseMemberArgs, type UseTokenTransferArgs, type VirtualAccountsFilters, type VirtualCardsFilters, type WithdrawalsFilters, createCapxulConfig, injectedConnector, localPrivateKeyConnector, useAccount, useApiKey, useApiKeys, useAuthBootstrapFlow, useAuthFlow, useBalanceLedger, useBalanceLedgerEntry, useCapxul, useCapxulStatus, useDocument, useDocuments, useExternalAccount, useExternalAccounts, useKybProfile, useKycProfile, useMe, useMember, useMembers, useOnboardingFlow, useOperation, useOrgDocuments, useOrgPayments, useOrgTransfers, useOrgWithdrawals, useOrganization, useOrganizations, usePayment, usePayments, useProvisioningFlow, useSafe, useSubAccount, useSubAccounts, useTokenTransfer, useTokenTransfers, useTransfer, useTransfers, useTreasury, useVirtualAccount, useVirtualAccounts, useVirtualCard, useVirtualCards, useWebhookEndpoint, useWebhookEndpoints, useWebhookEvent, useWithdrawal, useWithdrawals };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import * as _capxul_sdk from '@capxul/sdk';
|
|
2
3
|
import { HttpTransport, TransportState, BrowserCapxulConfig, AuthSessionStore, AccountId, OrganizationId, ApiKeyId, BalanceLedgerEntryId, ExternalAccountId, MemberId, Account, ApiKey, BalanceLedgerEntry, DocumentId, Document, ExternalAccount, KybProfile, KycProfile, CapxulError as CapxulError$1, Member, OperationId, Operation, Organization, PaymentId, Payment, SafeId, Safe, SubAccountId, SubAccount, TokenTransfer, TransferId, Transfer, Treasury, VirtualAccountId, VirtualAccount, VirtualCardId, VirtualCard, WebhookEndpointId, WebhookEndpoint, WebhookEventId, WebhookEvent, WithdrawalId, Withdrawal, List, TokenTransfersListInput, TokenTransfersListPage, LocalPrivateKeySignerProvider } from '@capxul/sdk';
|
|
3
|
-
export { AuthFlowContext, AuthFlowEvent, BrowserCapxulConfig, OnboardingFlowContext, OnboardingFlowEvent, ProvisioningFlowContext, ProvisioningFlowEvent } from '@capxul/sdk';
|
|
4
|
+
export { AuthBootstrapFlowContext, AuthBootstrapFlowEvent, AuthFlowContext, AuthFlowEvent, BrowserCapxulConfig, OnboardingFlowContext, OnboardingFlowEvent, ProvisioningFlowContext, ProvisioningFlowEvent } from '@capxul/sdk';
|
|
4
5
|
import { QueryClient, UseQueryResult } from '@tanstack/react-query';
|
|
5
6
|
import { CapxulClient } from '@capxul/sdk/client';
|
|
6
7
|
import { CapxulError } from '@capxul/sdk/errors';
|
|
@@ -444,10 +445,106 @@ declare function useApiKeys(_organizationId: OrganizationId): QueryResult<List<A
|
|
|
444
445
|
*/
|
|
445
446
|
declare function useWebhookEndpoints(): QueryResult<List<WebhookEndpoint>>;
|
|
446
447
|
|
|
448
|
+
/**
|
|
449
|
+
* Lowercased, shape-validated email address. Brand prevents swapping
|
|
450
|
+
* with `phoneNumber`, `username`, or other string identifiers (per
|
|
451
|
+
* `CANON.md` §4.54 and `sdk-surface.md` §5h).
|
|
452
|
+
*/
|
|
453
|
+
type Email = string & {
|
|
454
|
+
readonly __capxulEmailBrand: "Email";
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* Public Capxul username. 3–30 chars, letter-first, lowercased,
|
|
458
|
+
* remaining chars from `[a-z0-9_-]` (per `CANON.md` §4.54 and
|
|
459
|
+
* `sdk-surface.md` §5h). Constructor lowercases before validating so
|
|
460
|
+
* mixed-case input canonicalizes cleanly when the first char is a
|
|
461
|
+
* letter; purely invalid shapes (too short, illegal chars, digit-first)
|
|
462
|
+
* still throw.
|
|
463
|
+
*/
|
|
464
|
+
type Username = string & {
|
|
465
|
+
readonly __capxulUsernameBrand: "Username";
|
|
466
|
+
};
|
|
467
|
+
|
|
447
468
|
declare function useAuthFlow(): {
|
|
448
469
|
readonly snapshot: xstate.MachineSnapshot<any, any, any, any, any, any, any, any>;
|
|
449
470
|
readonly send: (event: any) => void;
|
|
450
471
|
};
|
|
472
|
+
declare function useAuthBootstrapFlow(): {
|
|
473
|
+
readonly snapshot: xstate.MachineSnapshot<_capxul_sdk.AuthBootstrapFlowContext, {
|
|
474
|
+
readonly type: "ENTER_EMAIL";
|
|
475
|
+
readonly email: Email;
|
|
476
|
+
} | {
|
|
477
|
+
readonly type: "REQUEST_OTP";
|
|
478
|
+
} | {
|
|
479
|
+
readonly type: "ENTER_OTP";
|
|
480
|
+
readonly code: string;
|
|
481
|
+
} | {
|
|
482
|
+
readonly type: "VERIFY_OTP";
|
|
483
|
+
} | {
|
|
484
|
+
readonly type: "ENTER_USERNAME";
|
|
485
|
+
readonly username: Username;
|
|
486
|
+
} | {
|
|
487
|
+
readonly type: "ENTER_SIGNER_PROVIDER";
|
|
488
|
+
readonly signerProvider: _capxul_sdk.LocalPrivateKeySignerProvider;
|
|
489
|
+
} | {
|
|
490
|
+
readonly type: "COMPLETE_BOOTSTRAP";
|
|
491
|
+
} | {
|
|
492
|
+
readonly type: "BACK";
|
|
493
|
+
} | {
|
|
494
|
+
readonly type: "RESET";
|
|
495
|
+
} | {
|
|
496
|
+
readonly type: "SIGN_OUT";
|
|
497
|
+
}, {
|
|
498
|
+
[x: string]: xstate.ActorRefFromLogic<xstate.PromiseActorLogic<void, void, xstate.EventObject>> | xstate.ActorRefFromLogic<xstate.PromiseActorLogic<_capxul_sdk.CompleteBootstrapResult, {
|
|
499
|
+
bootstrapToken: _capxul_sdk.AuthBootstrapToken;
|
|
500
|
+
username: Username;
|
|
501
|
+
signerProvider: _capxul_sdk.LocalPrivateKeySignerProvider;
|
|
502
|
+
}, xstate.EventObject>> | xstate.ActorRefFromLogic<xstate.PromiseActorLogic<void, {
|
|
503
|
+
email: Email;
|
|
504
|
+
}, xstate.EventObject>> | xstate.ActorRefFromLogic<xstate.PromiseActorLogic<_capxul_sdk.VerifyOtpResult, {
|
|
505
|
+
email: Email;
|
|
506
|
+
code: string;
|
|
507
|
+
}, xstate.EventObject>> | undefined;
|
|
508
|
+
}, "email" | "error" | "bootstrap_required" | "authenticated" | "sending_otp" | "otp_requested" | "signing_out" | "verifying_otp" | "completing_bootstrap", string, xstate.NonReducibleUnknown, xstate.MetaObject, {
|
|
509
|
+
id: "authBootstrap";
|
|
510
|
+
states: {
|
|
511
|
+
readonly email: {};
|
|
512
|
+
readonly sending_otp: {};
|
|
513
|
+
readonly otp_requested: {};
|
|
514
|
+
readonly verifying_otp: {};
|
|
515
|
+
readonly bootstrap_required: {};
|
|
516
|
+
readonly completing_bootstrap: {};
|
|
517
|
+
readonly authenticated: {};
|
|
518
|
+
readonly signing_out: {};
|
|
519
|
+
readonly error: {};
|
|
520
|
+
};
|
|
521
|
+
}>;
|
|
522
|
+
readonly send: (event: {
|
|
523
|
+
readonly type: "ENTER_EMAIL";
|
|
524
|
+
readonly email: Email;
|
|
525
|
+
} | {
|
|
526
|
+
readonly type: "REQUEST_OTP";
|
|
527
|
+
} | {
|
|
528
|
+
readonly type: "ENTER_OTP";
|
|
529
|
+
readonly code: string;
|
|
530
|
+
} | {
|
|
531
|
+
readonly type: "VERIFY_OTP";
|
|
532
|
+
} | {
|
|
533
|
+
readonly type: "ENTER_USERNAME";
|
|
534
|
+
readonly username: Username;
|
|
535
|
+
} | {
|
|
536
|
+
readonly type: "ENTER_SIGNER_PROVIDER";
|
|
537
|
+
readonly signerProvider: _capxul_sdk.LocalPrivateKeySignerProvider;
|
|
538
|
+
} | {
|
|
539
|
+
readonly type: "COMPLETE_BOOTSTRAP";
|
|
540
|
+
} | {
|
|
541
|
+
readonly type: "BACK";
|
|
542
|
+
} | {
|
|
543
|
+
readonly type: "RESET";
|
|
544
|
+
} | {
|
|
545
|
+
readonly type: "SIGN_OUT";
|
|
546
|
+
}) => void;
|
|
547
|
+
};
|
|
451
548
|
declare function useOnboardingFlow(): {
|
|
452
549
|
readonly snapshot: xstate.MachineSnapshot<any, any, any, any, any, any, any, any>;
|
|
453
550
|
readonly send: (event: any) => void;
|
|
@@ -538,4 +635,4 @@ declare function injectedConnector(options?: InjectedConnectorOptions): CapxulCo
|
|
|
538
635
|
*/
|
|
539
636
|
declare function localPrivateKeyConnector(options: LocalPrivateKeyConnectorOptions): CapxulConnector;
|
|
540
637
|
|
|
541
|
-
export { CapxulClientProvider, type CapxulClientProviderProps, type CapxulConnector, type CapxulConnectorKind, type CapxulConnectorSession, CapxulProvider, type CapxulProviderProps, CapxulTransportProvider, type CapxulTransportProviderProps, type DocumentsFilters, type InjectedConnectorOptions, type LocalPrivateKeyConnectorOptions, type OrgDocumentsFilters, type OrgScopedFilters, type OwnerRef, type OwnerScopedFilters, type PaginationFilters, type PaymentsFilters, type QueryResult, type TransfersFilters, type UseApiKeyArgs, type UseBalanceLedgerEntryArgs, type UseExternalAccountArgs, type UseMemberArgs, type UseTokenTransferArgs, type VirtualAccountsFilters, type VirtualCardsFilters, type WithdrawalsFilters, createCapxulConfig, injectedConnector, localPrivateKeyConnector, useAccount, useApiKey, useApiKeys, useAuthFlow, useBalanceLedger, useBalanceLedgerEntry, useCapxul, useCapxulStatus, useDocument, useDocuments, useExternalAccount, useExternalAccounts, useKybProfile, useKycProfile, useMe, useMember, useMembers, useOnboardingFlow, useOperation, useOrgDocuments, useOrgPayments, useOrgTransfers, useOrgWithdrawals, useOrganization, useOrganizations, usePayment, usePayments, useProvisioningFlow, useSafe, useSubAccount, useSubAccounts, useTokenTransfer, useTokenTransfers, useTransfer, useTransfers, useTreasury, useVirtualAccount, useVirtualAccounts, useVirtualCard, useVirtualCards, useWebhookEndpoint, useWebhookEndpoints, useWebhookEvent, useWithdrawal, useWithdrawals };
|
|
638
|
+
export { CapxulClientProvider, type CapxulClientProviderProps, type CapxulConnector, type CapxulConnectorKind, type CapxulConnectorSession, CapxulProvider, type CapxulProviderProps, CapxulTransportProvider, type CapxulTransportProviderProps, type DocumentsFilters, type InjectedConnectorOptions, type LocalPrivateKeyConnectorOptions, type OrgDocumentsFilters, type OrgScopedFilters, type OwnerRef, type OwnerScopedFilters, type PaginationFilters, type PaymentsFilters, type QueryResult, type TransfersFilters, type UseApiKeyArgs, type UseBalanceLedgerEntryArgs, type UseExternalAccountArgs, type UseMemberArgs, type UseTokenTransferArgs, type VirtualAccountsFilters, type VirtualCardsFilters, type WithdrawalsFilters, createCapxulConfig, injectedConnector, localPrivateKeyConnector, useAccount, useApiKey, useApiKeys, useAuthBootstrapFlow, useAuthFlow, useBalanceLedger, useBalanceLedgerEntry, useCapxul, useCapxulStatus, useDocument, useDocuments, useExternalAccount, useExternalAccounts, useKybProfile, useKycProfile, useMe, useMember, useMembers, useOnboardingFlow, useOperation, useOrgDocuments, useOrgPayments, useOrgTransfers, useOrgWithdrawals, useOrganization, useOrganizations, usePayment, usePayments, useProvisioningFlow, useSafe, useSubAccount, useSubAccounts, useTokenTransfer, useTokenTransfers, useTransfer, useTransfers, useTreasury, useVirtualAccount, useVirtualAccounts, useVirtualCard, useVirtualCards, useWebhookEndpoint, useWebhookEndpoints, useWebhookEvent, useWithdrawal, useWithdrawals };
|
package/dist/index.js
CHANGED
|
@@ -599,6 +599,12 @@ function useAuthFlow() {
|
|
|
599
599
|
const [snapshot, send] = useActor(machine);
|
|
600
600
|
return { snapshot, send };
|
|
601
601
|
}
|
|
602
|
+
function useAuthBootstrapFlow() {
|
|
603
|
+
const client = useCapxul();
|
|
604
|
+
const machine = useMemo(() => client.flows.authBootstrap(), [client]);
|
|
605
|
+
const [snapshot, send] = useActor(machine);
|
|
606
|
+
return { snapshot, send };
|
|
607
|
+
}
|
|
602
608
|
function useOnboardingFlow() {
|
|
603
609
|
const client = useCapxul();
|
|
604
610
|
const machine = useMemo(() => client.flows.onboarding(), [client]);
|
|
@@ -707,4 +713,4 @@ function validateAndNormalizeEvmAddress(field, raw) {
|
|
|
707
713
|
}
|
|
708
714
|
}
|
|
709
715
|
|
|
710
|
-
export { CapxulClientProvider, CapxulProvider, CapxulTransportProvider, createCapxulConfig, injectedConnector, localPrivateKeyConnector, useAccount, useApiKey, useApiKeys, useAuthFlow, useBalanceLedger, useBalanceLedgerEntry, useCapxul, useCapxulStatus, useDocument, useDocuments, useExternalAccount, useExternalAccounts, useKybProfile, useKycProfile, useMe, useMember, useMembers, useOnboardingFlow, useOperation, useOrgDocuments, useOrgPayments, useOrgTransfers, useOrgWithdrawals, useOrganization, useOrganizations, usePayment, usePayments, useProvisioningFlow, useSafe, useSubAccount, useSubAccounts, useTokenTransfer, useTokenTransfers, useTransfer, useTransfers, useTreasury, useVirtualAccount, useVirtualAccounts, useVirtualCard, useVirtualCards, useWebhookEndpoint, useWebhookEndpoints, useWebhookEvent, useWithdrawal, useWithdrawals };
|
|
716
|
+
export { CapxulClientProvider, CapxulProvider, CapxulTransportProvider, createCapxulConfig, injectedConnector, localPrivateKeyConnector, useAccount, useApiKey, useApiKeys, useAuthBootstrapFlow, useAuthFlow, useBalanceLedger, useBalanceLedgerEntry, useCapxul, useCapxulStatus, useDocument, useDocuments, useExternalAccount, useExternalAccounts, useKybProfile, useKycProfile, useMe, useMember, useMembers, useOnboardingFlow, useOperation, useOrgDocuments, useOrgPayments, useOrgTransfers, useOrgWithdrawals, useOrganization, useOrganizations, usePayment, usePayments, useProvisioningFlow, useSafe, useSubAccount, useSubAccounts, useTokenTransfer, useTokenTransfers, useTransfer, useTransfers, useTreasury, useVirtualAccount, useVirtualAccounts, useVirtualCard, useVirtualCards, useWebhookEndpoint, useWebhookEndpoints, useWebhookEvent, useWithdrawal, useWithdrawals };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capxul/sdk-react",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.9",
|
|
4
4
|
"description": "React provider + hooks for the @capxul/sdk headless client.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@capxul/sdk": "0.1.0-alpha.
|
|
49
|
+
"@capxul/sdk": "0.1.0-alpha.9"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@tanstack/react-query": "^5",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"typescript": "5.9.2",
|
|
71
71
|
"viem": "2.47.10",
|
|
72
72
|
"vitest": "^4.1.2",
|
|
73
|
-
"@repo/config": "0.0.0",
|
|
74
73
|
"@repo/observability": "0.0.0",
|
|
74
|
+
"@repo/config": "0.0.0",
|
|
75
75
|
"@repo/platform-kernel": "0.0.0",
|
|
76
76
|
"@repo/typescript-config": "0.0.0"
|
|
77
77
|
},
|