@supanovaapp/sdk 0.2.11 → 0.2.13
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/README.md +81 -0
- package/dist/components/ConfirmationModal.d.ts +43 -0
- package/dist/core/client.d.ts +23 -0
- package/dist/core/types.d.ts +533 -0
- package/dist/hooks/useAPI.d.ts +142 -0
- package/dist/hooks/useAuth.d.ts +45 -0
- package/dist/hooks/useCanton.d.ts +19 -0
- package/dist/hooks/useConfirmModal.d.ts +15 -0
- package/dist/hooks/useSendTransaction.d.ts +27 -0
- package/dist/hooks/useSignMessage.d.ts +25 -0
- package/dist/hooks/useSignRawHashWithModal.d.ts +22 -0
- package/dist/hooks/useSmartWallets.d.ts +16 -0
- package/dist/hooks/useStellarWallet.d.ts +6 -0
- package/dist/hooks/useSupa.d.ts +61 -0
- package/dist/index.cjs.js +155 -155
- package/dist/index.d.ts +149 -0
- package/dist/index.esm.js +5163 -5162
- package/dist/providers/CantonProvider.d.ts +64 -0
- package/dist/providers/SupaProvider.d.ts +82 -0
- package/dist/services/apiService.d.ts +163 -0
- package/dist/services/cantonService.d.ts +156 -0
- package/dist/utils/converters.d.ts +67 -0
- package/dist/utils/stellar.d.ts +90 -0
- package/package.json +1 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supa SDK
|
|
3
|
+
*
|
|
4
|
+
* React SDK for seamless integration with Supa Backend API and Privy.io authentication,
|
|
5
|
+
* featuring full Canton Network support with Ed25519 signing via Stellar wallets.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* Basic setup
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { SupaProvider, useAuth, useCanton } from '@supa/sdk';
|
|
13
|
+
*
|
|
14
|
+
* function App() {
|
|
15
|
+
* return (
|
|
16
|
+
* <SupaProvider config={{ privyAppId: 'your_app_id' }}>
|
|
17
|
+
* <Dashboard />
|
|
18
|
+
* </SupaProvider>
|
|
19
|
+
* );
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* function Dashboard() {
|
|
23
|
+
* const { login, authenticated } = useAuth();
|
|
24
|
+
* const { registerCanton, isRegistered } = useCanton();
|
|
25
|
+
*
|
|
26
|
+
* if (!authenticated) {
|
|
27
|
+
* return <button onClick={login}>Login</button>;
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* if (!isRegistered) {
|
|
31
|
+
* return <button onClick={registerCanton}>Register Canton</button>;
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* return <div>Ready to use Canton Network!</div>;
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @see {@link https://github.com/your-repo/supa-sdk | GitHub Repository}
|
|
39
|
+
* @see {@link https://docs.privy.io | Privy Documentation}
|
|
40
|
+
* @see {@link https://canton.network | Canton Network}
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* Main provider component that wraps your application
|
|
44
|
+
* Includes built-in confirmation modals for signing operations
|
|
45
|
+
* @see {@link SupaProvider}
|
|
46
|
+
*/
|
|
47
|
+
export { SupaProvider, useSupaContext } from './providers/SupaProvider';
|
|
48
|
+
export type { SupaConfig, SupaContextValue, SupaProviderProps, ConfirmModalOptions, SignMessageModalOptions, SignTransactionOptions as SignTransactionModalOptions, ModalResult, } from './providers/SupaProvider';
|
|
49
|
+
/**
|
|
50
|
+
* Canton Provider for shared state (automatically included in SupaProvider)
|
|
51
|
+
* @see {@link CantonProvider}
|
|
52
|
+
*/
|
|
53
|
+
export { CantonProvider, useCantonContext } from './providers/CantonProvider';
|
|
54
|
+
export type { CantonContextValue, CantonProviderProps, CantonSendCoinOptions } from './providers/CantonProvider';
|
|
55
|
+
/**
|
|
56
|
+
* Primary hook combining all SDK functionality
|
|
57
|
+
* @see {@link useSupa}
|
|
58
|
+
*/
|
|
59
|
+
export { useSupa } from './hooks/useSupa';
|
|
60
|
+
export type { UseSupaReturn } from './hooks/useSupa';
|
|
61
|
+
export { useSupa as useWalletino } from './hooks/useSupa';
|
|
62
|
+
export type { UseSupaReturn as UseWalletinoReturn } from './hooks/useSupa';
|
|
63
|
+
/**
|
|
64
|
+
* Authentication hook for Privy integration
|
|
65
|
+
* @see {@link useAuth}
|
|
66
|
+
*/
|
|
67
|
+
export { useAuth } from './hooks/useAuth';
|
|
68
|
+
export type { UseAuthReturn } from './hooks/useAuth';
|
|
69
|
+
/**
|
|
70
|
+
* Canton Network operations hook
|
|
71
|
+
* @see {@link useCanton}
|
|
72
|
+
*/
|
|
73
|
+
export { useCanton } from './hooks/useCanton';
|
|
74
|
+
export type { UseCantonReturn } from './hooks/useCanton';
|
|
75
|
+
/**
|
|
76
|
+
* Sign message hook with confirmation modal
|
|
77
|
+
* @see {@link useSignMessage}
|
|
78
|
+
*/
|
|
79
|
+
export { useSignMessage } from './hooks/useSignMessage';
|
|
80
|
+
export type { UseSignMessageReturn, SignMessageOptions } from './hooks/useSignMessage';
|
|
81
|
+
/**
|
|
82
|
+
* Send transaction hook with confirmation modal
|
|
83
|
+
* @see {@link useSendTransaction}
|
|
84
|
+
*/
|
|
85
|
+
export { useSendTransaction } from './hooks/useSendTransaction';
|
|
86
|
+
export type { UseSendTransactionReturn, SendTransactionOptions } from './hooks/useSendTransaction';
|
|
87
|
+
/**
|
|
88
|
+
* Sign raw hash with automatic confirmation modal
|
|
89
|
+
* @see {@link useSignRawHashWithModal}
|
|
90
|
+
*/
|
|
91
|
+
export { useSignRawHashWithModal } from './hooks/useSignRawHashWithModal';
|
|
92
|
+
export type { UseSignRawHashWithModalReturn, SignRawHashModalOptions } from './hooks/useSignRawHashWithModal';
|
|
93
|
+
/**
|
|
94
|
+
* Confirmation modal hook
|
|
95
|
+
* @see {@link useConfirmModal}
|
|
96
|
+
*/
|
|
97
|
+
export { useConfirmModal } from './hooks/useConfirmModal';
|
|
98
|
+
export type { UseConfirmModalReturn } from './hooks/useConfirmModal';
|
|
99
|
+
/**
|
|
100
|
+
* Stellar wallet hook
|
|
101
|
+
* @see {@link useStellarWallet}
|
|
102
|
+
*/
|
|
103
|
+
export { useStellarWallet } from './hooks/useStellarWallet';
|
|
104
|
+
export type { UseStellarWalletReturn } from './hooks/useStellarWallet';
|
|
105
|
+
/**
|
|
106
|
+
* Smart Wallets hook (EVM)
|
|
107
|
+
* @see {@link useSmartWallets}
|
|
108
|
+
*/
|
|
109
|
+
export { useSmartWallets } from './hooks/useSmartWallets';
|
|
110
|
+
export type { UseSmartWalletsReturn } from './hooks/useSmartWallets';
|
|
111
|
+
/**
|
|
112
|
+
* Confirmation modal components (for custom usage)
|
|
113
|
+
* @see {@link ConfirmationModal}, {@link SignMessageModal}, {@link SignTransactionModal}
|
|
114
|
+
*/
|
|
115
|
+
export { ConfirmationModal, SignMessageModal, SignTransactionModal } from './components/ConfirmationModal';
|
|
116
|
+
export type { ConfirmationModalProps, SignMessageModalProps, SignTransactionModalProps } from './components/ConfirmationModal';
|
|
117
|
+
/**
|
|
118
|
+
* All DTO types generated from Swagger specification
|
|
119
|
+
* Includes types for User, Dialog, Message, Canton, Token, etc.
|
|
120
|
+
*/
|
|
121
|
+
export * from './core/types';
|
|
122
|
+
/**
|
|
123
|
+
* Format conversion utilities (hex ↔ base64)
|
|
124
|
+
* Required for Canton Network integration
|
|
125
|
+
* @see {@link hexToBase64}, {@link base64ToHex}, {@link privyPublicKeyToCantonBase64}
|
|
126
|
+
*/
|
|
127
|
+
export * from './utils/converters';
|
|
128
|
+
/**
|
|
129
|
+
* Stellar wallet utilities for Canton Network
|
|
130
|
+
* @see {@link getStellarWallets}, {@link getPublicKeyBase64}, {@link isStellarWallet}
|
|
131
|
+
*/
|
|
132
|
+
export * from './utils/stellar';
|
|
133
|
+
/**
|
|
134
|
+
* Canton Network service for direct API access (advanced usage)
|
|
135
|
+
* @see {@link CantonService}
|
|
136
|
+
*/
|
|
137
|
+
export { CantonService, getCantonService } from './services/cantonService';
|
|
138
|
+
export type { CantonRegisterParams, CantonTapParams, CantonSubmitPreparedOptions } from './services/cantonService';
|
|
139
|
+
/**
|
|
140
|
+
* Backend API service for direct access (advanced usage)
|
|
141
|
+
* @see {@link ApiService}
|
|
142
|
+
*/
|
|
143
|
+
export { ApiService, getApiService } from './services/apiService';
|
|
144
|
+
/**
|
|
145
|
+
* HTTP client for custom API calls (advanced usage)
|
|
146
|
+
* @see {@link ApiClient}, {@link createApiClient}
|
|
147
|
+
*/
|
|
148
|
+
export { ApiClient, createApiClient, getApiClient } from './core/client';
|
|
149
|
+
export type { ClientConfig } from './core/client';
|