Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/wasm-solana/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export type {
CustomTxKey,
SolanaIntent,
StakePoolConfig,
Recipient,
BuildFromIntentParams,
BuildFromIntentResult,
GeneratedKeypair,
Expand Down
34 changes: 14 additions & 20 deletions packages/wasm-solana/js/intentBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,22 @@ export interface BaseIntent {
memo?: string;
}

/** A recipient in a transaction — native SOL or SPL token transfer */
export interface Recipient {
address?: { address: string };
amount?: { value: bigint; symbol?: string };
/** Mint address (base58) — if set, this is an SPL token transfer */
tokenAddress?: string;
/** Token program ID (defaults to SPL Token Program) */
tokenProgramId?: string;
/** Decimal places for the token (required for transfer_checked) */
decimalPlaces?: number;
}

/** Payment intent */
export interface PaymentIntent extends BaseIntent {
intentType: "payment";
recipients?: Array<{
address?: { address: string };
amount?: { value: bigint; symbol?: string };
/** Mint address (base58) — if set, this is an SPL token transfer */
tokenAddress?: string;
/** Token program ID (defaults to SPL Token Program) */
tokenProgramId?: string;
/** Decimal places for the token (required for transfer_checked) */
decimalPlaces?: number;
}>;
recipients?: Recipient[];
}

/** Stake intent */
Expand Down Expand Up @@ -176,16 +179,7 @@ export interface ConsolidateIntent extends BaseIntent {
/** The child address to consolidate from (sender) */
receiveAddress: string;
/** Recipients (root address for native SOL, wallet ATAs for tokens) */
recipients?: Array<{
address?: { address: string };
amount?: { value: bigint; symbol?: string };
/** Mint address (base58) — if set, this is an SPL token transfer */
tokenAddress?: string;
/** Token program ID (defaults to SPL Token Program) */
tokenProgramId?: string;
/** Decimal places for the token (required for transfer_checked) */
decimalPlaces?: number;
}>;
recipients?: Recipient[];
}

/** Authorize intent - pre-built transaction message */
Expand Down
Loading