0xMiden / 0xMiden/wallet-adapter

Clarify `recipientAddress` in `CustomTransaction`

Offen
#59 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
2
Forks
9
Ø Merge
25 Min.
Gemergte PRs (30 T.)
1

Beschreibung

There is the notion of `CustomTransaction` in the wallet adapter:

```tsx
export class CustomTransaction implements MidenCustomTransaction {
address: string;
recipientAddress: string;
transactionRequest: string;
inputNoteIds?: string[];
importNotes?: string[];

constructor(
address: string,
recipientAddress: string,
transactionRequest: TransactionRequest,
inputNotesIds?: string[],
inputNoteBytes?: Uint8Array[]
) {
this.address = address;
this.recipientAddress = recipientAddress;
const requestBytes = transactionRequest.serialize();
const base64 = u8ToB64(requestBytes);
this.transactionRequest = base64;
this.inputNoteIds = inputNotesIds;
this.importNotes = inputNoteBytes?.map((note) => u8ToB64(note));
}
}
```

The readme contains

```tsx

#### Custom Transaction

import { useWallet, CustomTransaction } from '@demox-labs/miden-wallet-adapter';

function CustomTransactionComponent() {
const { wallet, address, requestTransaction } = useWallet();

const handleCustomTransaction = async () => {
if (!wallet || !address) return;

const customTransaction = new CustomTransaction(
address,
transactionRequest // TransactionRequest from Miden Web SDK
);

await requestTransaction(customTransaction);
};

return Execute Custom Transaction;
}
```

Here, what is the `recipientAddress` and how does it play into the transaction itself? `TransactionRequest` can already express different metadata about the transaction itself (for example, multiple output P2ID notes for multiple different accounts), so I'm wondering if the `recipientAddress` has any effect or is for bookkeeping mostly.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.