@accesly/react 1.2.0 → 1.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/dist/.tsbuildinfo +1 -1
- package/dist/index.cjs +668 -168
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -5
- package/dist/index.d.ts +85 -5
- package/dist/index.js +653 -153
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -736,12 +736,21 @@ interface WalletStreamBalancePayload {
|
|
|
736
736
|
readonly xlm: string;
|
|
737
737
|
}
|
|
738
738
|
/**
|
|
739
|
-
* Activity
|
|
740
|
-
*
|
|
741
|
-
*
|
|
742
|
-
*
|
|
739
|
+
* Activity tipada lista para renderizar. Cuatro variants:
|
|
740
|
+
*
|
|
741
|
+
* - `wallet-created` — deploy inicial del Smart Account.
|
|
742
|
+
* - `signer-rotated` — rotación de signer (recovery).
|
|
743
|
+
* - `transfer-in` — recibió XLM.
|
|
744
|
+
* - `transfer-out` — envió XLM.
|
|
745
|
+
*
|
|
746
|
+
* Otros eventos on-chain (signer_added/removed internos, ruido) se descartan.
|
|
743
747
|
*/
|
|
744
748
|
type WalletActivityItem = {
|
|
749
|
+
readonly type: 'wallet-created';
|
|
750
|
+
readonly txHash: string;
|
|
751
|
+
readonly ledger: number;
|
|
752
|
+
readonly timestamp: string | null;
|
|
753
|
+
} | {
|
|
745
754
|
readonly type: 'signer-rotated';
|
|
746
755
|
readonly txHash: string;
|
|
747
756
|
readonly ledger: number;
|
|
@@ -808,6 +817,77 @@ interface UseWalletActivityResult {
|
|
|
808
817
|
}
|
|
809
818
|
declare function useWalletActivity(walletAddress?: string | null, opts?: UseWalletActivityOptions): UseWalletActivityResult;
|
|
810
819
|
|
|
820
|
+
/**
|
|
821
|
+
* Cliente y decoder de la **Stellar Expert public API** (indexer free, full
|
|
822
|
+
* retention, CORS abierto). Es la fuente primaria de `useWalletHistory`.
|
|
823
|
+
*
|
|
824
|
+
* Endpoints usados:
|
|
825
|
+
* - GET /contract/{walletAddress}/events — Smart Account events (rotaciones).
|
|
826
|
+
* - GET /contract/{xlmSac}/events?topics=transfer
|
|
827
|
+
* — Todos los transfers del SAC. Filtramos client-side por wallet.
|
|
828
|
+
* - GET /contract/{walletAddress} — Metadata del wallet (creación).
|
|
829
|
+
*
|
|
830
|
+
* Rate limit anonymous: ~1 req/s. Para zaramos cross-tab via BroadcastChannel
|
|
831
|
+
* en el hook que consume este módulo.
|
|
832
|
+
*/
|
|
833
|
+
|
|
834
|
+
type StellarExpertNetwork = 'testnet' | 'mainnet';
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* `useWalletHistory(walletAddress?, opts?)` — historial completo de la wallet
|
|
838
|
+
* con Stellar Expert como indexer primario y opcional Soroban RPC autenticado
|
|
839
|
+
* para tail real-time.
|
|
840
|
+
*
|
|
841
|
+
* Características:
|
|
842
|
+
* - 100% client-side, sin backend custom.
|
|
843
|
+
* - Historia completa (mes+) gracias a la retention de Stellar Expert.
|
|
844
|
+
* - Cache en `localStorage` per-wallet con TTL 12h → return instantáneo entre
|
|
845
|
+
* page reloads y route changes.
|
|
846
|
+
* - Polling cada 30s para nuevos events. Pausa si tab oculta.
|
|
847
|
+
* - `BroadcastChannel` cross-tab para compartir SE rate limit — solo UN tab
|
|
848
|
+
* hace fetch; los demás escuchan el resultado.
|
|
849
|
+
* - Optimistic updates: el SDK puede llamar `historyOptimisticPush(addr, item)`
|
|
850
|
+
* cuando acaba de mandar una tx exitosa para que aparezca inmediato sin
|
|
851
|
+
* esperar el indexing de SE (~30-60s típico).
|
|
852
|
+
* - Override de Soroban RPC: pasa `{ sorobanRpcUrl, sorobanRpcAuth }` para
|
|
853
|
+
* que el tail (últimos eventos) venga via RPC con tu API key — sin lag.
|
|
854
|
+
*/
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Inyecta un item de history "optimistically" — útil cuando acabás de hacer
|
|
858
|
+
* `tx.send` y querés que aparezca al instante sin esperar el indexing de SE.
|
|
859
|
+
* El item queda en memoria hasta que el próximo fetch del hook lo descarte
|
|
860
|
+
* (porque ya está en el feed real) o hasta `clearOptimistic(walletAddress)`.
|
|
861
|
+
*
|
|
862
|
+
* Usado internamente por `tx.send`; expuesto al integrador para casos custom.
|
|
863
|
+
*/
|
|
864
|
+
declare function historyOptimisticPush(walletAddress: string, item: WalletActivityItem): void;
|
|
865
|
+
declare function historyClearOptimistic(walletAddress: string): void;
|
|
866
|
+
interface UseWalletHistoryOptions {
|
|
867
|
+
/** `'testnet'` (default) o `'mainnet'`. */
|
|
868
|
+
readonly network?: StellarExpertNetwork;
|
|
869
|
+
/** Intervalo de poll para nuevos events (ms). Default 30s, 0 desactiva. */
|
|
870
|
+
readonly pollIntervalMs?: number;
|
|
871
|
+
/**
|
|
872
|
+
* Override del Soroban RPC para tail real-time. Si se provee, el hook usa
|
|
873
|
+
* tu RPC autenticado en vez de hacer poll a Stellar Expert para detectar
|
|
874
|
+
* nuevos events. Recomendado para producción.
|
|
875
|
+
*/
|
|
876
|
+
readonly sorobanRpcUrl?: string;
|
|
877
|
+
readonly sorobanRpcAuth?: string;
|
|
878
|
+
/** Cantidad de transfers del XLM_SAC a scan-ear por fetch. Default 50. */
|
|
879
|
+
readonly transferScanLimit?: number;
|
|
880
|
+
}
|
|
881
|
+
interface UseWalletHistoryResult {
|
|
882
|
+
readonly events: readonly WalletActivityItem[];
|
|
883
|
+
readonly isLoading: boolean;
|
|
884
|
+
readonly error: Error | null;
|
|
885
|
+
readonly hasMore: boolean;
|
|
886
|
+
loadMore(): Promise<void>;
|
|
887
|
+
refresh(): Promise<void>;
|
|
888
|
+
}
|
|
889
|
+
declare function useWalletHistory(walletAddress?: string | null, opts?: UseWalletHistoryOptions): UseWalletHistoryResult;
|
|
890
|
+
|
|
811
891
|
/**
|
|
812
892
|
* @accesly/react — React Provider + `useAccesly` hook.
|
|
813
893
|
*
|
|
@@ -832,4 +912,4 @@ declare function useWalletActivity(walletAddress?: string | null, opts?: UseWall
|
|
|
832
912
|
*/
|
|
833
913
|
declare const REACT_ADAPTER_VERSION = "0.0.0";
|
|
834
914
|
|
|
835
|
-
export { AcceslyContext, type AcceslyContextValue, type AcceslyHook, AcceslyProvider, type AcceslyProviderProps, type AuthNamespace, type BootstrapWalletInput, type CreateWalletInput, type CreatedWalletInfo, ENVIRONMENT_DEFAULTS, type EnsureWalletResult, type EnvironmentDefaults, type FinalizeRecoveryInput, type FinalizeRecoveryResult, type KycNamespace, NotImplementedYetError, REACT_ADAPTER_VERSION, type ReconstructedSeed, type RecoveryNamespace, type RemoteWalletInfo, type RetryDeployResult, type SendXlmInput, type SendXlmResult, type SessionNamespace, type SettingsNamespace, type TxNamespace, type UnlockedSigningMaterial, type UseBalanceResult, type UseWalletActivityOptions, type UseWalletActivityResult, type UseWalletStatusResult, type WalletActivityItem, type WalletNamespace, type WalletStatus, type WalletStatusValue, type WalletStreamActivityPayload, type WalletStreamBalancePayload, type WalletStreamEventType, type WalletStreamStatusPayload, type YieldNamespace, closeAllWalletSubscriptions, subscribeToWalletEvent, useAccesly, useBalance, useWalletActivity, useWalletStatus };
|
|
915
|
+
export { AcceslyContext, type AcceslyContextValue, type AcceslyHook, AcceslyProvider, type AcceslyProviderProps, type AuthNamespace, type BootstrapWalletInput, type CreateWalletInput, type CreatedWalletInfo, ENVIRONMENT_DEFAULTS, type EnsureWalletResult, type EnvironmentDefaults, type FinalizeRecoveryInput, type FinalizeRecoveryResult, type KycNamespace, NotImplementedYetError, REACT_ADAPTER_VERSION, type ReconstructedSeed, type RecoveryNamespace, type RemoteWalletInfo, type RetryDeployResult, type SendXlmInput, type SendXlmResult, type SessionNamespace, type SettingsNamespace, type TxNamespace, type UnlockedSigningMaterial, type UseBalanceResult, type UseWalletActivityOptions, type UseWalletActivityResult, type UseWalletHistoryOptions, type UseWalletHistoryResult, type UseWalletStatusResult, type WalletActivityItem, type WalletNamespace, type WalletStatus, type WalletStatusValue, type WalletStreamActivityPayload, type WalletStreamBalancePayload, type WalletStreamEventType, type WalletStreamStatusPayload, type YieldNamespace, closeAllWalletSubscriptions, historyClearOptimistic, historyOptimisticPush, subscribeToWalletEvent, useAccesly, useBalance, useWalletActivity, useWalletHistory, useWalletStatus };
|
package/dist/index.d.ts
CHANGED
|
@@ -736,12 +736,21 @@ interface WalletStreamBalancePayload {
|
|
|
736
736
|
readonly xlm: string;
|
|
737
737
|
}
|
|
738
738
|
/**
|
|
739
|
-
* Activity
|
|
740
|
-
*
|
|
741
|
-
*
|
|
742
|
-
*
|
|
739
|
+
* Activity tipada lista para renderizar. Cuatro variants:
|
|
740
|
+
*
|
|
741
|
+
* - `wallet-created` — deploy inicial del Smart Account.
|
|
742
|
+
* - `signer-rotated` — rotación de signer (recovery).
|
|
743
|
+
* - `transfer-in` — recibió XLM.
|
|
744
|
+
* - `transfer-out` — envió XLM.
|
|
745
|
+
*
|
|
746
|
+
* Otros eventos on-chain (signer_added/removed internos, ruido) se descartan.
|
|
743
747
|
*/
|
|
744
748
|
type WalletActivityItem = {
|
|
749
|
+
readonly type: 'wallet-created';
|
|
750
|
+
readonly txHash: string;
|
|
751
|
+
readonly ledger: number;
|
|
752
|
+
readonly timestamp: string | null;
|
|
753
|
+
} | {
|
|
745
754
|
readonly type: 'signer-rotated';
|
|
746
755
|
readonly txHash: string;
|
|
747
756
|
readonly ledger: number;
|
|
@@ -808,6 +817,77 @@ interface UseWalletActivityResult {
|
|
|
808
817
|
}
|
|
809
818
|
declare function useWalletActivity(walletAddress?: string | null, opts?: UseWalletActivityOptions): UseWalletActivityResult;
|
|
810
819
|
|
|
820
|
+
/**
|
|
821
|
+
* Cliente y decoder de la **Stellar Expert public API** (indexer free, full
|
|
822
|
+
* retention, CORS abierto). Es la fuente primaria de `useWalletHistory`.
|
|
823
|
+
*
|
|
824
|
+
* Endpoints usados:
|
|
825
|
+
* - GET /contract/{walletAddress}/events — Smart Account events (rotaciones).
|
|
826
|
+
* - GET /contract/{xlmSac}/events?topics=transfer
|
|
827
|
+
* — Todos los transfers del SAC. Filtramos client-side por wallet.
|
|
828
|
+
* - GET /contract/{walletAddress} — Metadata del wallet (creación).
|
|
829
|
+
*
|
|
830
|
+
* Rate limit anonymous: ~1 req/s. Para zaramos cross-tab via BroadcastChannel
|
|
831
|
+
* en el hook que consume este módulo.
|
|
832
|
+
*/
|
|
833
|
+
|
|
834
|
+
type StellarExpertNetwork = 'testnet' | 'mainnet';
|
|
835
|
+
|
|
836
|
+
/**
|
|
837
|
+
* `useWalletHistory(walletAddress?, opts?)` — historial completo de la wallet
|
|
838
|
+
* con Stellar Expert como indexer primario y opcional Soroban RPC autenticado
|
|
839
|
+
* para tail real-time.
|
|
840
|
+
*
|
|
841
|
+
* Características:
|
|
842
|
+
* - 100% client-side, sin backend custom.
|
|
843
|
+
* - Historia completa (mes+) gracias a la retention de Stellar Expert.
|
|
844
|
+
* - Cache en `localStorage` per-wallet con TTL 12h → return instantáneo entre
|
|
845
|
+
* page reloads y route changes.
|
|
846
|
+
* - Polling cada 30s para nuevos events. Pausa si tab oculta.
|
|
847
|
+
* - `BroadcastChannel` cross-tab para compartir SE rate limit — solo UN tab
|
|
848
|
+
* hace fetch; los demás escuchan el resultado.
|
|
849
|
+
* - Optimistic updates: el SDK puede llamar `historyOptimisticPush(addr, item)`
|
|
850
|
+
* cuando acaba de mandar una tx exitosa para que aparezca inmediato sin
|
|
851
|
+
* esperar el indexing de SE (~30-60s típico).
|
|
852
|
+
* - Override de Soroban RPC: pasa `{ sorobanRpcUrl, sorobanRpcAuth }` para
|
|
853
|
+
* que el tail (últimos eventos) venga via RPC con tu API key — sin lag.
|
|
854
|
+
*/
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Inyecta un item de history "optimistically" — útil cuando acabás de hacer
|
|
858
|
+
* `tx.send` y querés que aparezca al instante sin esperar el indexing de SE.
|
|
859
|
+
* El item queda en memoria hasta que el próximo fetch del hook lo descarte
|
|
860
|
+
* (porque ya está en el feed real) o hasta `clearOptimistic(walletAddress)`.
|
|
861
|
+
*
|
|
862
|
+
* Usado internamente por `tx.send`; expuesto al integrador para casos custom.
|
|
863
|
+
*/
|
|
864
|
+
declare function historyOptimisticPush(walletAddress: string, item: WalletActivityItem): void;
|
|
865
|
+
declare function historyClearOptimistic(walletAddress: string): void;
|
|
866
|
+
interface UseWalletHistoryOptions {
|
|
867
|
+
/** `'testnet'` (default) o `'mainnet'`. */
|
|
868
|
+
readonly network?: StellarExpertNetwork;
|
|
869
|
+
/** Intervalo de poll para nuevos events (ms). Default 30s, 0 desactiva. */
|
|
870
|
+
readonly pollIntervalMs?: number;
|
|
871
|
+
/**
|
|
872
|
+
* Override del Soroban RPC para tail real-time. Si se provee, el hook usa
|
|
873
|
+
* tu RPC autenticado en vez de hacer poll a Stellar Expert para detectar
|
|
874
|
+
* nuevos events. Recomendado para producción.
|
|
875
|
+
*/
|
|
876
|
+
readonly sorobanRpcUrl?: string;
|
|
877
|
+
readonly sorobanRpcAuth?: string;
|
|
878
|
+
/** Cantidad de transfers del XLM_SAC a scan-ear por fetch. Default 50. */
|
|
879
|
+
readonly transferScanLimit?: number;
|
|
880
|
+
}
|
|
881
|
+
interface UseWalletHistoryResult {
|
|
882
|
+
readonly events: readonly WalletActivityItem[];
|
|
883
|
+
readonly isLoading: boolean;
|
|
884
|
+
readonly error: Error | null;
|
|
885
|
+
readonly hasMore: boolean;
|
|
886
|
+
loadMore(): Promise<void>;
|
|
887
|
+
refresh(): Promise<void>;
|
|
888
|
+
}
|
|
889
|
+
declare function useWalletHistory(walletAddress?: string | null, opts?: UseWalletHistoryOptions): UseWalletHistoryResult;
|
|
890
|
+
|
|
811
891
|
/**
|
|
812
892
|
* @accesly/react — React Provider + `useAccesly` hook.
|
|
813
893
|
*
|
|
@@ -832,4 +912,4 @@ declare function useWalletActivity(walletAddress?: string | null, opts?: UseWall
|
|
|
832
912
|
*/
|
|
833
913
|
declare const REACT_ADAPTER_VERSION = "0.0.0";
|
|
834
914
|
|
|
835
|
-
export { AcceslyContext, type AcceslyContextValue, type AcceslyHook, AcceslyProvider, type AcceslyProviderProps, type AuthNamespace, type BootstrapWalletInput, type CreateWalletInput, type CreatedWalletInfo, ENVIRONMENT_DEFAULTS, type EnsureWalletResult, type EnvironmentDefaults, type FinalizeRecoveryInput, type FinalizeRecoveryResult, type KycNamespace, NotImplementedYetError, REACT_ADAPTER_VERSION, type ReconstructedSeed, type RecoveryNamespace, type RemoteWalletInfo, type RetryDeployResult, type SendXlmInput, type SendXlmResult, type SessionNamespace, type SettingsNamespace, type TxNamespace, type UnlockedSigningMaterial, type UseBalanceResult, type UseWalletActivityOptions, type UseWalletActivityResult, type UseWalletStatusResult, type WalletActivityItem, type WalletNamespace, type WalletStatus, type WalletStatusValue, type WalletStreamActivityPayload, type WalletStreamBalancePayload, type WalletStreamEventType, type WalletStreamStatusPayload, type YieldNamespace, closeAllWalletSubscriptions, subscribeToWalletEvent, useAccesly, useBalance, useWalletActivity, useWalletStatus };
|
|
915
|
+
export { AcceslyContext, type AcceslyContextValue, type AcceslyHook, AcceslyProvider, type AcceslyProviderProps, type AuthNamespace, type BootstrapWalletInput, type CreateWalletInput, type CreatedWalletInfo, ENVIRONMENT_DEFAULTS, type EnsureWalletResult, type EnvironmentDefaults, type FinalizeRecoveryInput, type FinalizeRecoveryResult, type KycNamespace, NotImplementedYetError, REACT_ADAPTER_VERSION, type ReconstructedSeed, type RecoveryNamespace, type RemoteWalletInfo, type RetryDeployResult, type SendXlmInput, type SendXlmResult, type SessionNamespace, type SettingsNamespace, type TxNamespace, type UnlockedSigningMaterial, type UseBalanceResult, type UseWalletActivityOptions, type UseWalletActivityResult, type UseWalletHistoryOptions, type UseWalletHistoryResult, type UseWalletStatusResult, type WalletActivityItem, type WalletNamespace, type WalletStatus, type WalletStatusValue, type WalletStreamActivityPayload, type WalletStreamBalancePayload, type WalletStreamEventType, type WalletStreamStatusPayload, type YieldNamespace, closeAllWalletSubscriptions, historyClearOptimistic, historyOptimisticPush, subscribeToWalletEvent, useAccesly, useBalance, useWalletActivity, useWalletHistory, useWalletStatus };
|