Skip to content

Commit

Permalink
Update the dapp with CITY address and display result when done
Browse files Browse the repository at this point in the history
  • Loading branch information
sondreb committed Jan 4, 2023
1 parent cd1e8fe commit dedc97f
Showing 2 changed files with 10 additions and 12 deletions.
13 changes: 3 additions & 10 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -312,22 +312,15 @@
<mat-card-title>Send Transaction</mat-card-title>
</mat-card-header>
<mat-card-content>
<!-- <mat-form-field class="input-full-width" appearance="outline">
<mat-label>Basic text</mat-label>
<input matInput type="text" [(ngModel)]="signingText" />
</mat-form-field> -->
<div *ngIf="signedTextSignature">
<p>Signature:<br />{{ signedTextSignature }}</p>
<p>Key/Address:<br />{{ signedTextKey }}</p>
<p>Network:<br />{{ signedTextNetwork }}<br /></p>
<p>Is Signature Valid:<br />{{ signedTextValidSignature }}<br /></p>
<div *ngIf="transactionResult">
<p>Transaction ID:<br />{{ transactionResult.transactionId }}</p>
<p>Transaction HEX:<br />{{ transactionResult.transactionHex }}</p>
</div>
</mat-card-content>
<mat-card-actions>
<button mat-flat-button color="primary" (click)="sendTransaction()">Send Transaction</button>
</mat-card-actions>
</mat-card>

</mat-tab>
</mat-tab-group>

9 changes: 7 additions & 2 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -151,23 +151,28 @@ export class AppComponent implements OnInit {
this.nostrDecrypted = content;
}

transactionResult: any = undefined;

async sendTransaction() {
const result: any = await this.provider!.request({
method: 'transaction.send',
params: [
{
recipients: [
{ hint: 'Swap', address: 'yRZBBWkf4THjC5qqfvoJaV2qn4pLJnkHH9', amount: 100000000 },
{ hint: 'Fee Service', address: 'pRZBBWkf4THjC5qqfvoJaV2qn4pLJnkHH9', amount: 20000000 },
{ hint: 'Swap', address: 'CMrc2rFsPd9VnxPiHvN2wHFVNfNd9vY8Ze', amount: 100000000 },
{ hint: 'Fee Service', address: 'CMrc2rFsPd9VnxPiHvN2wHFVNfNd9vY8Ze', amount: 20000000 },
],
// data: 'op_return',
feeRate: 'medium',
network: this.provider?.indexer.network,
},
],
});

console.log('Result:', result);

this.transactionResult = result;

// this.signedTextKey = result.key;
// this.signedTextSignature = result.response.signature;
// this.signedTextNetwork = result.network;

0 comments on commit dedc97f

Please sign in to comment.