@supanovaapp/sdk 0.2.38 → 0.2.40
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 +21 -0
- package/dist/core/types.d.ts +34 -2
- package/dist/index.cjs.js +256 -256
- package/dist/index.d.ts +5 -0
- package/dist/index.esm.js +2889 -2864
- package/dist/providers/canton/types.d.ts +8 -3
- package/dist/services/cantonService.d.ts +9 -4
- package/dist/utils/canton.d.ts +12 -0
- package/package.json +66 -66
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { CantonService, CantonSubmitPreparedOptions } from '../../services/cantonService';
|
|
3
|
-
import { CantonMeResponseDto,
|
|
3
|
+
import { CantonMeResponseDto, CantonQueryCompletionResponseDto, CantonWalletBalancesResponseDto, CantonIncomingTransferDto, CantonTransactionDto, CantonTransactionsParams, CantonPriceInterval, CantonPriceCandleDto, CantonPrepareTransferRequestDto, CantonCalculateTransferFeeResponseDto } from '../../core/types';
|
|
4
4
|
import { CantonWallet } from '../../utils/wallet';
|
|
5
5
|
export interface CantonSendCoinOptions extends CantonSubmitPreparedOptions {
|
|
6
6
|
/** Skip confirmation modal. Default: false */
|
|
@@ -31,8 +31,13 @@ export interface CantonContextValue {
|
|
|
31
31
|
cantonUser: CantonMeResponseDto | null;
|
|
32
32
|
/** Get Canton user info */
|
|
33
33
|
getMe: () => Promise<CantonMeResponseDto>;
|
|
34
|
-
/** Get active contracts with optional filtering */
|
|
35
|
-
getActiveContracts: (templateIds?: string[]
|
|
34
|
+
/** Get active contracts with optional filtering and pagination */
|
|
35
|
+
getActiveContracts: (templateIds?: string[], pagination?: {
|
|
36
|
+
limit: number;
|
|
37
|
+
offset?: number;
|
|
38
|
+
} | {
|
|
39
|
+
limit?: number;
|
|
40
|
+
}) => Promise<any>;
|
|
36
41
|
/** Canton wallet balances */
|
|
37
42
|
cantonBalances: CantonWalletBalancesResponseDto | null;
|
|
38
43
|
/** Get Canton wallet balances */
|
|
@@ -101,11 +101,16 @@ export declare class CantonService {
|
|
|
101
101
|
*/
|
|
102
102
|
getMe(force?: boolean): Promise<CantonMeResponseDto>;
|
|
103
103
|
/**
|
|
104
|
-
* Get active contracts with optional template filtering
|
|
105
|
-
* Returns array of active contract items with full contract details
|
|
104
|
+
* Get active contracts with optional template filtering and pagination
|
|
106
105
|
* @param templateIds Optional array of template IDs to filter by
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
* @param pagination Optional pagination: limit, offset (offset requires limit)
|
|
107
|
+
*/
|
|
108
|
+
getActiveContracts(templateIds?: string[], pagination?: {
|
|
109
|
+
limit: number;
|
|
110
|
+
offset?: number;
|
|
111
|
+
} | {
|
|
112
|
+
limit?: number;
|
|
113
|
+
}): Promise<any>;
|
|
109
114
|
/**
|
|
110
115
|
* Sign text message (client-side only, no backend call)
|
|
111
116
|
* Converts text to bytes and signs with Stellar wallet
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities for working with Canton active contracts.
|
|
3
|
+
* Supports both flat (new) and legacy (wrapped) response formats.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Type guard: checks if item is in legacy wrapped format
|
|
7
|
+
*/
|
|
8
|
+
export declare function isLegacyContractItem(item: any): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Normalizes a contract item from either format into a consistent shape.
|
|
11
|
+
*/
|
|
12
|
+
export declare function normalizeContractItem(item: any): any;
|
package/package.json
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
2
|
+
"name": "@supanovaapp/sdk",
|
|
3
|
+
"version": "0.2.40",
|
|
4
|
+
"description": "React SDK for Supa Backend + Privy.io integration with Canton Network and EVM Smart Wallets support",
|
|
5
|
+
"main": "./dist/index.cjs.js",
|
|
6
|
+
"module": "./dist/index.esm.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.esm.js",
|
|
12
|
+
"require": "./dist/index.cjs.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "vite",
|
|
20
|
+
"build": "vite build",
|
|
21
|
+
"build:prod": "vite build --mode production",
|
|
22
|
+
"preview": "vite preview",
|
|
23
|
+
"type-check": "tsc --noEmit"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"supa",
|
|
27
|
+
"privy",
|
|
28
|
+
"canton",
|
|
29
|
+
"stellar",
|
|
30
|
+
"web3",
|
|
31
|
+
"react",
|
|
32
|
+
"sdk"
|
|
33
|
+
],
|
|
34
|
+
"author": "npm@supanova.app",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
38
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependenciesMeta": {
|
|
41
|
+
"@solana-program/compute-budget": {
|
|
42
|
+
"optional": true
|
|
43
|
+
},
|
|
44
|
+
"@solana-program/token-2022": {
|
|
45
|
+
"optional": true
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@headlessui/react": "^2.2.0",
|
|
50
|
+
"@privy-io/react-auth": "^3.3.0",
|
|
51
|
+
"@solana-program/memo": "^0.8.0",
|
|
52
|
+
"@solana-program/system": "^0.8.0",
|
|
53
|
+
"@solana-program/token": "^0.6.0",
|
|
54
|
+
"@solana/kit": "^3.0.3",
|
|
55
|
+
"axios": "^1.7.9",
|
|
56
|
+
"buffer": "^6.0.3",
|
|
57
|
+
"ox": "^0.8.0",
|
|
58
|
+
"permissionless": "^0.2.24",
|
|
59
|
+
"viem": "^2.21.54"
|
|
43
60
|
},
|
|
44
|
-
"
|
|
45
|
-
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@types/node": "^22.10.2",
|
|
63
|
+
"@types/react": "^19.0.2",
|
|
64
|
+
"@types/react-dom": "^19.0.2",
|
|
65
|
+
"@vitejs/plugin-react": "^5.0.4",
|
|
66
|
+
"typescript": "^5.9.3",
|
|
67
|
+
"vite": "^7.1.11",
|
|
68
|
+
"vite-plugin-dts": "^4.5.4"
|
|
46
69
|
}
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"@headlessui/react": "^2.2.0",
|
|
50
|
-
"@privy-io/react-auth": "^3.3.0",
|
|
51
|
-
"@solana-program/memo": "^0.8.0",
|
|
52
|
-
"@solana-program/system": "^0.8.0",
|
|
53
|
-
"@solana-program/token": "^0.6.0",
|
|
54
|
-
"@solana/kit": "^3.0.3",
|
|
55
|
-
"axios": "^1.7.9",
|
|
56
|
-
"buffer": "^6.0.3",
|
|
57
|
-
"ox": "^0.8.0",
|
|
58
|
-
"permissionless": "^0.2.24",
|
|
59
|
-
"viem": "^2.21.54"
|
|
60
|
-
},
|
|
61
|
-
"devDependencies": {
|
|
62
|
-
"@types/node": "^22.10.2",
|
|
63
|
-
"@types/react": "^19.0.2",
|
|
64
|
-
"@types/react-dom": "^19.0.2",
|
|
65
|
-
"@vitejs/plugin-react": "^5.0.4",
|
|
66
|
-
"typescript": "^5.9.3",
|
|
67
|
-
"vite": "^7.1.11",
|
|
68
|
-
"vite-plugin-dts": "^4.5.4"
|
|
69
|
-
}
|
|
70
70
|
}
|