@supanovaapp/sdk 0.2.33 → 0.2.34

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 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
@@ -33,6 +33,10 @@ export interface CantonSubmitRegisterRequestDto {
33
33
  hash: string;
34
34
  /** Base64 signature for provided hash */
35
35
  signature: string;
36
+ /** Optional deduplication period */
37
+ deduplicationPeriod?: {
38
+ value: string;
39
+ };
36
40
  }
37
41
  export interface CantonSubmitTransactionResponseDto {
38
42
  /** Submission ID for tracking completion */
@@ -161,6 +165,8 @@ export interface CantonPrepareTransactionRequestDto {
161
165
  commands: unknown;
162
166
  /** Optional disclosed contracts */
163
167
  disclosedContracts?: unknown;
168
+ /** Optional command ID for idempotency */
169
+ commandId?: string;
164
170
  }
165
171
  /** Canton instrument/token identifier */
166
172
  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,10 @@ 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?: {
23
+ value: string;
24
+ };
19
25
  submitOptions?: CantonSubmitPreparedOptions;
20
26
  }
21
27
  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 as SendTransactionsOptions, TransactionToSend, UseSendMultipleTransactionsReturn } from './useSendMultipleTransactions';
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>;