-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15593 from brave/feat-solana-dapps-tx
feat(wallet): implement solana dapps send tx
- Loading branch information
Showing
28 changed files
with
783 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...oid/java/org/chromium/chrome/browser/crypto_wallet/fragments/SolanaTxDetailsFragment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* Copyright (c) 2022 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
package org.chromium.chrome.browser.crypto_wallet.fragments; | ||
|
||
import android.content.Context; | ||
|
||
import androidx.fragment.app.Fragment; | ||
|
||
import org.chromium.brave_wallet.mojom.SolanaInstruction; | ||
import org.chromium.brave_wallet.mojom.TransactionInfo; | ||
import org.chromium.chrome.browser.crypto_wallet.adapters.TwoLineItemRecyclerViewAdapter; | ||
import org.chromium.chrome.browser.crypto_wallet.presenters.SolanaInstructionPresenter; | ||
import org.chromium.chrome.browser.crypto_wallet.util.TransactionUtils; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class SolanaTxDetailsFragment { | ||
public static Fragment newInstance(TransactionInfo txInfo, Context context) { | ||
List<TwoLineItemRecyclerViewAdapter.TwoLineItem> details = new ArrayList<>(); | ||
SolanaInstruction[] instructions = | ||
TransactionUtils.safeSolData(txInfo.txDataUnion).instructions; | ||
details.add(new TwoLineItemRecyclerViewAdapter.TwoLineItemText( | ||
context.getString(TransactionUtils.getTxType(txInfo)))); | ||
|
||
for (SolanaInstruction solanaInstruction : instructions) { | ||
SolanaInstructionPresenter solanaInstructionPresenter = | ||
new SolanaInstructionPresenter(solanaInstruction); | ||
details.addAll(solanaInstructionPresenter.toTwoLineList(context)); | ||
if (instructions.length > 1) { | ||
details.add(new TwoLineItemRecyclerViewAdapter.TwoLineItemDivider()); | ||
} | ||
} | ||
return new TwoLineItemFragment(details); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.