@supanovaapp/sdk 0.2.33 → 0.2.35
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 +11 -0
- package/dist/core/types.d.ts +4 -0
- package/dist/hooks/useSendMultipleTransactions.d.ts +4 -0
- package/dist/hooks/useSendTransaction.d.ts +2 -0
- package/dist/hooks/useSendTransactions.d.ts +2 -1
- package/dist/index.cjs.js +39 -39
- package/dist/index.esm.js +2629 -2617
- package/dist/services/cantonService.d.ts +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,17 @@ Supa SDK allows dApps to connect to Canton Network with Privy.io authentication
|
|
|
6
6
|
|
|
7
7
|
For a quick overview of the code, check out the demo application in the `/demo` folder.
|
|
8
8
|
|
|
9
|
+
## Release Notes
|
|
10
|
+
|
|
11
|
+
### 0.2.34
|
|
12
|
+
|
|
13
|
+
- Added optional `commandId` parameter to `prepareTransaction` for idempotent command submission
|
|
14
|
+
- Added optional `deduplicationPeriod` parameter (`{ value: string }`, e.g. `"PT60S"`) to `submitPrepared` and `submitMultiplePrepared`
|
|
15
|
+
- Updated `CantonSubmitPreparedOptions` with `commandId` and `deduplicationPeriod` fields — these are threaded through `sendTransaction` (provider), `useSendTransaction`, and `useSendMultipleTransactions`
|
|
16
|
+
- Updated `SendTransactionOptions` with `commandId` field
|
|
17
|
+
- Updated `TransactionToSend` with per-transaction `commandId` field
|
|
18
|
+
- Updated `SendMultipleTransactionsOptions` with shared `deduplicationPeriod` field
|
|
19
|
+
|
|
9
20
|
## Key Features
|
|
10
21
|
|
|
11
22
|
- **Privy.io Authentication** - Email, wallet, and social login methods
|
package/dist/core/types.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ export interface CantonSubmitRegisterRequestDto {
|
|
|
33
33
|
hash: string;
|
|
34
34
|
/** Base64 signature for provided hash */
|
|
35
35
|
signature: string;
|
|
36
|
+
/** Optional deduplication period */
|
|
37
|
+
deduplicationPeriod?: any;
|
|
36
38
|
}
|
|
37
39
|
export interface CantonSubmitTransactionResponseDto {
|
|
38
40
|
/** Submission ID for tracking completion */
|
|
@@ -161,6 +163,8 @@ export interface CantonPrepareTransactionRequestDto {
|
|
|
161
163
|
commands: unknown;
|
|
162
164
|
/** Optional disclosed contracts */
|
|
163
165
|
disclosedContracts?: unknown;
|
|
166
|
+
/** Optional command ID for idempotency */
|
|
167
|
+
commandId?: string;
|
|
164
168
|
}
|
|
165
169
|
/** Canton instrument/token identifier */
|
|
166
170
|
export interface CantonInstrumentIdDto {
|
|
@@ -4,6 +4,8 @@ import { CantonWallet } from '../utils/wallet';
|
|
|
4
4
|
export interface TransactionToSend {
|
|
5
5
|
commands: unknown;
|
|
6
6
|
disclosedContracts?: unknown;
|
|
7
|
+
/** Optional command ID for idempotency */
|
|
8
|
+
commandId?: string;
|
|
7
9
|
}
|
|
8
10
|
export interface SendMultipleTransactionsOptions {
|
|
9
11
|
onSuccess?: (results: CantonQueryCompletionResponseDto[]) => void;
|
|
@@ -16,6 +18,8 @@ export interface SendMultipleTransactionsOptions {
|
|
|
16
18
|
modalRejectText?: string;
|
|
17
19
|
/** Show technical transaction details (commands, disclosedContracts, hash) as JSON. Default: false */
|
|
18
20
|
showTechnicalDetails?: boolean;
|
|
21
|
+
/** Optional deduplication period (shared across all transactions in the batch) */
|
|
22
|
+
deduplicationPeriod?: any;
|
|
19
23
|
submitOptions?: CantonSubmitPreparedOptions;
|
|
20
24
|
}
|
|
21
25
|
export interface UseSendMultipleTransactionsReturn {
|
|
@@ -13,6 +13,8 @@ export interface SendTransactionOptions {
|
|
|
13
13
|
modalDisplayContent?: string;
|
|
14
14
|
/** Show technical transaction details (command, contracts, hash) as JSON. Default: false */
|
|
15
15
|
showTechnicalDetails?: boolean;
|
|
16
|
+
/** Optional command ID for idempotency */
|
|
17
|
+
commandId?: string;
|
|
16
18
|
submitOptions?: CantonSubmitPreparedOptions;
|
|
17
19
|
}
|
|
18
20
|
export interface UseSendTransactionReturn {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { SendMultipleTransactionsOptions
|
|
1
|
+
import { SendMultipleTransactionsOptions, TransactionToSend, UseSendMultipleTransactionsReturn } from './useSendMultipleTransactions';
|
|
2
2
|
import { CantonQueryCompletionResponseDto } from '../core/types';
|
|
3
|
+
export type SendTransactionsOptions = SendMultipleTransactionsOptions;
|
|
3
4
|
export interface UseSendTransactionsReturn {
|
|
4
5
|
/** Sign and send multiple Canton transactions with a single confirmation modal */
|
|
5
6
|
sendTransactions: (txs: TransactionToSend[], options?: SendTransactionsOptions) => Promise<CantonQueryCompletionResponseDto[] | null>;
|