@subscrypts/subscrypts-sdk-react 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2140 -0
- package/dist/components/buttons/SubscryptsButton.d.ts +19 -0
- package/dist/components/buttons/SubscryptsButton.d.ts.map +1 -0
- package/dist/components/buttons/index.d.ts +5 -0
- package/dist/components/buttons/index.d.ts.map +1 -0
- package/dist/components/checkout/CheckoutWizard.d.ts +22 -0
- package/dist/components/checkout/CheckoutWizard.d.ts.map +1 -0
- package/dist/components/checkout/ConfigurationStep.d.ts +15 -0
- package/dist/components/checkout/ConfigurationStep.d.ts.map +1 -0
- package/dist/components/checkout/TransactionStep.d.ts +15 -0
- package/dist/components/checkout/TransactionStep.d.ts.map +1 -0
- package/dist/components/checkout/index.d.ts +7 -0
- package/dist/components/checkout/index.d.ts.map +1 -0
- package/dist/components/guards/SubscriptionGuard.d.ts +25 -0
- package/dist/components/guards/SubscriptionGuard.d.ts.map +1 -0
- package/dist/components/guards/index.d.ts +5 -0
- package/dist/components/guards/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +20 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/merchant/MerchantDashboard.d.ts +24 -0
- package/dist/components/merchant/MerchantDashboard.d.ts.map +1 -0
- package/dist/components/merchant/index.d.ts +6 -0
- package/dist/components/merchant/index.d.ts.map +1 -0
- package/dist/components/pricing/PlanCard.d.ts +45 -0
- package/dist/components/pricing/PlanCard.d.ts.map +1 -0
- package/dist/components/pricing/PricingTable.d.ts +68 -0
- package/dist/components/pricing/PricingTable.d.ts.map +1 -0
- package/dist/components/pricing/index.d.ts +10 -0
- package/dist/components/pricing/index.d.ts.map +1 -0
- package/dist/components/shared/ErrorDisplay.d.ts +34 -0
- package/dist/components/shared/ErrorDisplay.d.ts.map +1 -0
- package/dist/components/shared/LoadingSpinner.d.ts +5 -0
- package/dist/components/shared/LoadingSpinner.d.ts.map +1 -0
- package/dist/components/shared/Modal.d.ts +12 -0
- package/dist/components/shared/Modal.d.ts.map +1 -0
- package/dist/components/shared/NetworkSwitchPrompt.d.ts +33 -0
- package/dist/components/shared/NetworkSwitchPrompt.d.ts.map +1 -0
- package/dist/components/shared/SubscryptsErrorBoundary.d.ts +41 -0
- package/dist/components/shared/SubscryptsErrorBoundary.d.ts.map +1 -0
- package/dist/components/subscription/ConfirmDialog.d.ts +44 -0
- package/dist/components/subscription/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/subscription/ManageSubscriptionModal.d.ts +35 -0
- package/dist/components/subscription/ManageSubscriptionModal.d.ts.map +1 -0
- package/dist/components/subscription/SubscriptionCard.d.ts +35 -0
- package/dist/components/subscription/SubscriptionCard.d.ts.map +1 -0
- package/dist/components/subscription/SubscriptionDashboard.d.ts +40 -0
- package/dist/components/subscription/SubscriptionDashboard.d.ts.map +1 -0
- package/dist/components/subscription/index.d.ts +12 -0
- package/dist/components/subscription/index.d.ts.map +1 -0
- package/dist/components/wallet/ConnectWalletModal.d.ts +29 -0
- package/dist/components/wallet/ConnectWalletModal.d.ts.map +1 -0
- package/dist/components/wallet/index.d.ts +6 -0
- package/dist/components/wallet/index.d.ts.map +1 -0
- package/dist/constants/index.d.ts +16 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/context/SubscryptsContext.d.ts +36 -0
- package/dist/context/SubscryptsContext.d.ts.map +1 -0
- package/dist/context/SubscryptsProvider.d.ts +28 -0
- package/dist/context/SubscryptsProvider.d.ts.map +1 -0
- package/dist/context/index.d.ts +7 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/contract/abis/Subscrypts.d.ts +2917 -0
- package/dist/contract/abis/Subscrypts.d.ts.map +1 -0
- package/dist/contract/abis/dexFactoryABI.d.ts +184 -0
- package/dist/contract/abis/dexFactoryABI.d.ts.map +1 -0
- package/dist/contract/abis/dexPairABI.d.ts +775 -0
- package/dist/contract/abis/dexPairABI.d.ts.map +1 -0
- package/dist/contract/abis/dexPositionManagerABI.d.ts +948 -0
- package/dist/contract/abis/dexPositionManagerABI.d.ts.map +1 -0
- package/dist/contract/abis/dexQuoterABI.d.ts +206 -0
- package/dist/contract/abis/dexQuoterABI.d.ts.map +1 -0
- package/dist/contract/abis/dexRouterABI.d.ts +439 -0
- package/dist/contract/abis/dexRouterABI.d.ts.map +1 -0
- package/dist/contract/abis/dexUSDCABI.d.ts +132 -0
- package/dist/contract/abis/dexUSDCABI.d.ts.map +1 -0
- package/dist/contract/abis/index.d.ts +15 -0
- package/dist/contract/abis/index.d.ts.map +1 -0
- package/dist/contract/config.d.ts +40 -0
- package/dist/contract/config.d.ts.map +1 -0
- package/dist/contract/index.d.ts +12 -0
- package/dist/contract/index.d.ts.map +1 -0
- package/dist/contract/methods.d.ts +305 -0
- package/dist/contract/methods.d.ts.map +1 -0
- package/dist/hooks/events/index.d.ts +6 -0
- package/dist/hooks/events/index.d.ts.map +1 -0
- package/dist/hooks/events/useSubscryptsEvents.d.ts +63 -0
- package/dist/hooks/events/useSubscryptsEvents.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +12 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/merchant/index.d.ts +10 -0
- package/dist/hooks/merchant/index.d.ts.map +1 -0
- package/dist/hooks/merchant/useMerchantPlans.d.ts +30 -0
- package/dist/hooks/merchant/useMerchantPlans.d.ts.map +1 -0
- package/dist/hooks/merchant/useMerchantRevenue.d.ts +59 -0
- package/dist/hooks/merchant/useMerchantRevenue.d.ts.map +1 -0
- package/dist/hooks/merchant/useMerchantSubscribers.d.ts +54 -0
- package/dist/hooks/merchant/useMerchantSubscribers.d.ts.map +1 -0
- package/dist/hooks/plans/index.d.ts +12 -0
- package/dist/hooks/plans/index.d.ts.map +1 -0
- package/dist/hooks/plans/usePlan.d.ts +33 -0
- package/dist/hooks/plans/usePlan.d.ts.map +1 -0
- package/dist/hooks/plans/usePlans.d.ts +36 -0
- package/dist/hooks/plans/usePlans.d.ts.map +1 -0
- package/dist/hooks/plans/usePlansByMerchant.d.ts +35 -0
- package/dist/hooks/plans/usePlansByMerchant.d.ts.map +1 -0
- package/dist/hooks/pricing/index.d.ts +10 -0
- package/dist/hooks/pricing/index.d.ts.map +1 -0
- package/dist/hooks/pricing/usePlanPrice.d.ts +59 -0
- package/dist/hooks/pricing/usePlanPrice.d.ts.map +1 -0
- package/dist/hooks/pricing/useSUBSPrice.d.ts +39 -0
- package/dist/hooks/pricing/useSUBSPrice.d.ts.map +1 -0
- package/dist/hooks/subscriptions/index.d.ts +12 -0
- package/dist/hooks/subscriptions/index.d.ts.map +1 -0
- package/dist/hooks/subscriptions/useManageSubscription.d.ts +39 -0
- package/dist/hooks/subscriptions/useManageSubscription.d.ts.map +1 -0
- package/dist/hooks/subscriptions/useMySubscriptions.d.ts +53 -0
- package/dist/hooks/subscriptions/useMySubscriptions.d.ts.map +1 -0
- package/dist/hooks/subscriptions/useSubscribe.d.ts +58 -0
- package/dist/hooks/subscriptions/useSubscribe.d.ts.map +1 -0
- package/dist/hooks/subscriptions/useSubscriptionStatus.d.ts +34 -0
- package/dist/hooks/subscriptions/useSubscriptionStatus.d.ts.map +1 -0
- package/dist/hooks/tokens/index.d.ts +6 -0
- package/dist/hooks/tokens/index.d.ts.map +1 -0
- package/dist/hooks/tokens/useTokenBalance.d.ts +36 -0
- package/dist/hooks/tokens/useTokenBalance.d.ts.map +1 -0
- package/dist/hooks/wallet/index.d.ts +6 -0
- package/dist/hooks/wallet/index.d.ts.map +1 -0
- package/dist/hooks/wallet/useWallet.d.ts +40 -0
- package/dist/hooks/wallet/useWallet.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7850 -0
- package/dist/index.js.map +1 -0
- package/dist/services/cache.service.d.ts +89 -0
- package/dist/services/cache.service.d.ts.map +1 -0
- package/dist/services/index.d.ts +7 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/token.service.d.ts +43 -0
- package/dist/services/token.service.d.ts.map +1 -0
- package/dist/services/wallet.service.d.ts +46 -0
- package/dist/services/wallet.service.d.ts.map +1 -0
- package/dist/style.css +3 -0
- package/dist/styles.d.ts +2 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/types/component.types.d.ts +192 -0
- package/dist/types/component.types.d.ts.map +1 -0
- package/dist/types/contract.types.d.ts +81 -0
- package/dist/types/contract.types.d.ts.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/subscription.types.d.ts +65 -0
- package/dist/types/subscription.types.d.ts.map +1 -0
- package/dist/types/wallet.types.d.ts +53 -0
- package/dist/types/wallet.types.d.ts.map +1 -0
- package/dist/utils/errorMessages.d.ts +44 -0
- package/dist/utils/errorMessages.d.ts.map +1 -0
- package/dist/utils/errors.d.ts +60 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/formatters.d.ts +44 -0
- package/dist/utils/formatters.d.ts.map +1 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +80 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/permit.utils.d.ts +52 -0
- package/dist/utils/permit.utils.d.ts.map +1 -0
- package/dist/utils/subscriptionHelpers.d.ts +67 -0
- package/dist/utils/subscriptionHelpers.d.ts.map +1 -0
- package/dist/utils/subscriptionStatus.d.ts +48 -0
- package/dist/utils/subscriptionStatus.d.ts.map +1 -0
- package/dist/utils/validators.d.ts +76 -0
- package/dist/utils/validators.d.ts.map +1 -0
- package/dist/wallet/ExternalConnector.d.ts +32 -0
- package/dist/wallet/ExternalConnector.d.ts.map +1 -0
- package/dist/wallet/InjectedConnector.d.ts +55 -0
- package/dist/wallet/InjectedConnector.d.ts.map +1 -0
- package/dist/wallet/index.d.ts +9 -0
- package/dist/wallet/index.d.ts.map +1 -0
- package/dist/wallet/sessionStore.d.ts +28 -0
- package/dist/wallet/sessionStore.d.ts.map +1 -0
- package/dist/wallet/types.d.ts +66 -0
- package/dist/wallet/types.d.ts.map +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { WalletConnector, ConnectResult } from './types';
|
|
2
|
+
|
|
3
|
+
export declare class InjectedConnector implements WalletConnector {
|
|
4
|
+
readonly id: "injected";
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly icon?: string;
|
|
7
|
+
private provider;
|
|
8
|
+
private accountsHandler;
|
|
9
|
+
private chainHandler;
|
|
10
|
+
constructor(options?: {
|
|
11
|
+
name?: string;
|
|
12
|
+
icon?: string;
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Detect the installed wallet name from window.ethereum
|
|
16
|
+
*/
|
|
17
|
+
private detectWalletName;
|
|
18
|
+
/**
|
|
19
|
+
* Check if a browser wallet is available
|
|
20
|
+
*/
|
|
21
|
+
isAvailable(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Connect to the browser wallet
|
|
24
|
+
*/
|
|
25
|
+
connect(): Promise<ConnectResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Disconnect (reset internal state)
|
|
28
|
+
*/
|
|
29
|
+
disconnect(): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Silent reconnect: check if already authorized without popup
|
|
32
|
+
*/
|
|
33
|
+
reconnect(): Promise<ConnectResult | null>;
|
|
34
|
+
/**
|
|
35
|
+
* Listen to account changes
|
|
36
|
+
*/
|
|
37
|
+
onAccountsChanged(callback: (accounts: string[]) => void): void;
|
|
38
|
+
/**
|
|
39
|
+
* Listen to chain changes
|
|
40
|
+
*/
|
|
41
|
+
onChainChanged(callback: (chainId: number) => void): void;
|
|
42
|
+
/**
|
|
43
|
+
* Remove all event listeners
|
|
44
|
+
*/
|
|
45
|
+
removeListeners(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Switch to a specific network
|
|
48
|
+
*/
|
|
49
|
+
switchNetwork(chainId: number): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Add a network to the wallet
|
|
52
|
+
*/
|
|
53
|
+
private addNetwork;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=InjectedConnector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InjectedConnector.d.ts","sourceRoot":"","sources":["../../src/wallet/InjectedConnector.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAKzD,qBAAa,iBAAkB,YAAW,eAAe;IACvD,QAAQ,CAAC,EAAE,EAAG,UAAU,CAAU;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,eAAe,CAA+C;IACtE,OAAO,CAAC,YAAY,CAA+C;gBAEvD,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;IAKtD;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAOxB;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC;IAiCvC;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAKjC;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IA2BhD;;OAEG;IACH,iBAAiB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,GAAG,IAAI;IAS/D;;OAEG;IACH,cAAc,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAUzD;;OAEG;IACH,eAAe,IAAI,IAAI;IAavB;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBnD;;OAEG;YACW,UAAU;CAyBzB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet module exports
|
|
3
|
+
*/
|
|
4
|
+
export type { WalletConnector, ConnectorId, ConnectResult } from './types';
|
|
5
|
+
export { InjectedConnector } from './InjectedConnector';
|
|
6
|
+
export { ExternalConnector } from './ExternalConnector';
|
|
7
|
+
export { saveSession, loadSession, clearSession, isSessionStale } from './sessionStore';
|
|
8
|
+
export type { WalletSession } from './sessionStore';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/wallet/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,cAAc,EACf,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ConnectorId } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Stored wallet session data
|
|
5
|
+
*/
|
|
6
|
+
export interface WalletSession {
|
|
7
|
+
connectorId: ConnectorId;
|
|
8
|
+
address: string;
|
|
9
|
+
timestamp: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Save a wallet session to localStorage
|
|
13
|
+
*/
|
|
14
|
+
export declare function saveSession(connectorId: ConnectorId, address: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* Load a wallet session from localStorage
|
|
17
|
+
* Returns null if no session exists or session is invalid
|
|
18
|
+
*/
|
|
19
|
+
export declare function loadSession(): WalletSession | null;
|
|
20
|
+
/**
|
|
21
|
+
* Clear the stored wallet session
|
|
22
|
+
*/
|
|
23
|
+
export declare function clearSession(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Check if a session is stale (older than max age)
|
|
26
|
+
*/
|
|
27
|
+
export declare function isSessionStale(session: WalletSession): boolean;
|
|
28
|
+
//# sourceMappingURL=sessionStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionStore.d.ts","sourceRoot":"","sources":["../../src/wallet/sessionStore.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAKtC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAW3E;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,aAAa,GAAG,IAAI,CAkBlD;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAMnC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAE9D"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { BrowserProvider, Signer } from 'ethers';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Connector identifier type.
|
|
5
|
+
* Built-in: 'injected' (MetaMask/browser), 'external' (Wagmi/RainbowKit).
|
|
6
|
+
* Custom connectors can use any string.
|
|
7
|
+
*/
|
|
8
|
+
export type ConnectorId = 'injected' | 'external' | (string & {});
|
|
9
|
+
/**
|
|
10
|
+
* Result of a successful wallet connection
|
|
11
|
+
*/
|
|
12
|
+
export interface ConnectResult {
|
|
13
|
+
provider: BrowserProvider;
|
|
14
|
+
signer: Signer;
|
|
15
|
+
address: string;
|
|
16
|
+
chainId: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Wallet Connector Interface
|
|
20
|
+
*
|
|
21
|
+
* Implement this interface to create a custom wallet connector
|
|
22
|
+
* for use with the Subscrypts SDK.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import { WalletConnector, ConnectResult } from '@subscrypts/subscrypts-sdk-react';
|
|
27
|
+
*
|
|
28
|
+
* class PrivyConnector implements WalletConnector {
|
|
29
|
+
* readonly id = 'privy';
|
|
30
|
+
* readonly name = 'Email/Social Login';
|
|
31
|
+
* isAvailable() { return true; }
|
|
32
|
+
* async connect(): Promise<ConnectResult> {
|
|
33
|
+
* // Use Privy SDK to login and get ethers provider/signer
|
|
34
|
+
* }
|
|
35
|
+
* async disconnect() { /* privy logout *\/ }
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export interface WalletConnector {
|
|
40
|
+
/** Unique connector identifier */
|
|
41
|
+
readonly id: ConnectorId;
|
|
42
|
+
/** Human-readable connector name (e.g. 'MetaMask', 'WalletConnect') */
|
|
43
|
+
readonly name: string;
|
|
44
|
+
/** Optional icon URL or data URI */
|
|
45
|
+
readonly icon?: string;
|
|
46
|
+
/** Check if this connector is available (e.g. MetaMask installed?) */
|
|
47
|
+
isAvailable(): boolean;
|
|
48
|
+
/** Connect the wallet. Shows popup/modal as needed. */
|
|
49
|
+
connect(): Promise<ConnectResult>;
|
|
50
|
+
/** Disconnect the wallet */
|
|
51
|
+
disconnect(): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Silent reconnect without popup (for session persistence).
|
|
54
|
+
* Returns null if reconnection is not possible.
|
|
55
|
+
*/
|
|
56
|
+
reconnect?(): Promise<ConnectResult | null>;
|
|
57
|
+
/** Listen to account changes */
|
|
58
|
+
onAccountsChanged?(callback: (accounts: string[]) => void): void;
|
|
59
|
+
/** Listen to chain/network changes */
|
|
60
|
+
onChainChanged?(callback: (chainId: number) => void): void;
|
|
61
|
+
/** Remove all event listeners */
|
|
62
|
+
removeListeners?(): void;
|
|
63
|
+
/** Switch to a specific network */
|
|
64
|
+
switchNetwork?(chainId: number): Promise<void>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/wallet/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEjD;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,eAAe,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,QAAQ,CAAC,EAAE,EAAE,WAAW,CAAC;IACzB,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB,sEAAsE;IACtE,WAAW,IAAI,OAAO,CAAC;IAEvB,uDAAuD;IACvD,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IAElC,4BAA4B;IAC5B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5B;;;OAGG;IACH,SAAS,CAAC,IAAI,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAE5C,gCAAgC;IAChC,iBAAiB,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,GAAG,IAAI,CAAC;IAEjE,sCAAsC;IACtC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;IAE3D,iCAAiC;IACjC,eAAe,CAAC,IAAI,IAAI,CAAC;IAEzB,mCAAmC;IACnC,aAAa,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@subscrypts/subscrypts-sdk-react",
|
|
3
|
+
"version": "1.6.0",
|
|
4
|
+
"description": "Official React SDK for Subscrypts - Decentralized subscriptions on Arbitrum",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"./styles": "./dist/style.css",
|
|
21
|
+
"./hooks": {
|
|
22
|
+
"import": "./dist/hooks/index.js",
|
|
23
|
+
"require": "./dist/hooks/index.cjs",
|
|
24
|
+
"types": "./dist/hooks/index.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"./components": {
|
|
27
|
+
"import": "./dist/components/index.js",
|
|
28
|
+
"require": "./dist/components/index.cjs",
|
|
29
|
+
"types": "./dist/components/index.d.ts"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"README.md",
|
|
35
|
+
"LICENSE"
|
|
36
|
+
],
|
|
37
|
+
"sideEffects": [
|
|
38
|
+
"*.css"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"dev": "vite",
|
|
42
|
+
"build": "tsc && vite build && npm run build:css",
|
|
43
|
+
"build:css": "tailwindcss -i ./src/styles/index.css -o ./dist/style.css --minify",
|
|
44
|
+
"typecheck": "tsc --noEmit",
|
|
45
|
+
"lint": "eslint src --ext ts,tsx",
|
|
46
|
+
"test": "vitest",
|
|
47
|
+
"test:ui": "vitest --ui",
|
|
48
|
+
"test:coverage": "vitest --coverage",
|
|
49
|
+
"prepublishOnly": "npm run build"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
53
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
54
|
+
"ethers": "^6.0.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/react": "^18.3.12",
|
|
58
|
+
"@types/react-dom": "^18.3.1",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
60
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
61
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
62
|
+
"@vitest/ui": "^1.2.0",
|
|
63
|
+
"@testing-library/react": "^14.1.0",
|
|
64
|
+
"@testing-library/jest-dom": "^6.2.0",
|
|
65
|
+
"@testing-library/user-event": "^14.5.0",
|
|
66
|
+
"autoprefixer": "^10.4.20",
|
|
67
|
+
"eslint": "^8.57.0",
|
|
68
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
69
|
+
"happy-dom": "^12.10.0",
|
|
70
|
+
"postcss": "^8.4.49",
|
|
71
|
+
"tailwindcss": "^3.4.17",
|
|
72
|
+
"typescript": "^5.6.0",
|
|
73
|
+
"vite": "^5.4.11",
|
|
74
|
+
"vite-plugin-dts": "^3.9.1",
|
|
75
|
+
"vitest": "^1.2.0"
|
|
76
|
+
},
|
|
77
|
+
"dependencies": {},
|
|
78
|
+
"keywords": [
|
|
79
|
+
"subscrypts",
|
|
80
|
+
"subscription",
|
|
81
|
+
"web3",
|
|
82
|
+
"arbitrum",
|
|
83
|
+
"react",
|
|
84
|
+
"sdk",
|
|
85
|
+
"ethers",
|
|
86
|
+
"blockchain",
|
|
87
|
+
"crypto"
|
|
88
|
+
],
|
|
89
|
+
"author": "Subscrypts",
|
|
90
|
+
"license": "MIT",
|
|
91
|
+
"repository": {
|
|
92
|
+
"type": "git",
|
|
93
|
+
"url": "git+https://github.com/Subscrypts/subscrypts-sdk-react.git"
|
|
94
|
+
},
|
|
95
|
+
"bugs": {
|
|
96
|
+
"url": "https://github.com/Subscrypts/subscrypts-sdk-react/issues"
|
|
97
|
+
},
|
|
98
|
+
"homepage": "https://subscrypts.com"
|
|
99
|
+
}
|