Skip to content

Commit

Permalink
Feat/wallet (#156)
Browse files Browse the repository at this point in the history
feat: add wallet functionality (#144)

feat: add wallet overview

feat: sending transactions ui

feat: open settings in tab

feat: add transaction history

feat: reorganize settings and send transactions

fix: wallet ui fixes

fix: transaction send

test: add wallet tests

feat: wallet lock

feat: wallet settings lock

feat: tokens

fix: tokens

chore: upgrade react

fix: token fixes

test: tokens tests

chore: update library readme

feat: wallet improvements (#165)

feat: fetching account info

feat: improve error messages ui

feat: default config (#158)

feat: new swarm settings

feat: configurable bee url (#157)

chore: update readme

fix: balance check on send

feat: add new networks

fix: disable fdp-storage caching
  • Loading branch information
tomicvladan authored Aug 30, 2023
1 parent 009514a commit 4bb7f20
Show file tree
Hide file tree
Showing 117 changed files with 7,871 additions and 3,150 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ To load the extension in Chrome browser:

### Swarm extension

In order to properly use the extension locally or to run tests, the required environment must be executed first.
The Blossom extension can be configured to retrieve Bee URL and Bee debug URL directly from the Swarm extension. That is requred for running tests successfully. Before running tests, the required environment must be executed first.

The [Swarm extension](https://chrome.google.com/webstore/detail/ethereum-swarm-extension/afpgelfcknfbbfnipnomfdbbnbbemnia) must be installed in the same browser as where the Blossom extension. You can install it from the browser's extension store page, or you can build it locally.

Expand All @@ -54,8 +54,6 @@ To build and run a local version of the Swarm extension check [the extension's r
./scripts/compile-swarm-extension.sh
```

> **_NOTE_:** If you plan to run tests, compiling the Swarm extension using this script is required.
This script will generate the `swarm-extension` directory inside the root directory. You can load the compiled Swarm extension the same way as the Blossom extension by loading the `swarm-extension/dist` directory. Check the [Installation](#installation) section for the details how to load the extension.

> **_NOTE_:** If you are running your version of the Swarm extension, the `.env` file should be updated with its extension ID.
Expand Down
55 changes: 53 additions & 2 deletions assets/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@
"TRY_AGAIN": "Try Again",
"COPY_TO_CLIPBOARD_MESSAGE": "Text copied to clipboard",
"INVALID_PASSWORD": "Invalid password.",
"INVALID_USERNAME": "Invalid username.",
"INVALID_USERNAME": "Account on selected network does not exist.",
"GENERAL_ERROR_MESSAGE": "Couldn't complete request at the moment.",
"USERNAME_NOT_AVAILABLE": "Username is not available",
"CANNOT_CHECK_USERNAME": "Cannot check username. Network currently unavailable",
"CONFIRM": "Confirm",
"CANCEL": "Cancel",
"SETTINGS": "Settings",
"SETTINGS_DESCRIPTION": "Extension settings - wallet, connectivity, logs...",
"NETWORK": "Network",
"NETWORK_SETTINGS_DESCRIPTION": "Configure your network settings here, like RPC server...",
"NETWORK_NAME": "Network name",
Expand Down Expand Up @@ -78,5 +79,55 @@
"DISCLAIMER": "Disclaimer: Account integrity persistence and security are not assured. Expect that funds used for account might be lost, as well as any data the account uses.",
"DAPP_SIGN_MESSAGE_MESSAGE": "Dapp with ID {dappId} wants to sign the following message: {message}. Do you want to sign the message?",
"EXTENSION_SIGN_MESSAGE_MESSAGE": "Extension with ID {dappId} wants to sign the following message: {message}. Do you want to sign the message?",
"ERROR_USER_NOT_LOGGED_IN": "User is not logged in"
"ERROR_USER_NOT_LOGGED_IN": "User is not logged in",
"DIALOG_DAPP_TRANSACTION": "dApp with ID {dappId} wants to send a transaction.\nTo address: {to}\nAmount: {amount}\nDo you allow this transaction?",
"WALLET": "Wallet",
"WALLET_DESCRIPTION": "Check your account balance, send transactions, etc.",
"SEND": "Send",
"AMOUNT": "Amount",
"ADDRESS": "Address",
"AMOUNT_ERROR": "Amount must be an integer or a decimal number greater than zero (e.g. 0.123).",
"ADDRESS_ERROR": "Please provide a valid Ethereum address.",
"ESTIMATED_GAS_PRICE": "Estimated gas price",
"GAS_PRICE_DISCLAIMER": "Gas estimation might not be accurate.",
"TRANSACTION_COMPLETE": "Transaction has been processed successfully.",
"SEND_ANOTHER": "Send another",
"BACK": "Back",
"OPEN_PAGE_BUTTON_TITLE": "Open in a tab",
"ACTIVITY": "Activity",
"TOKENS": "Tokens",
"NFTS": "NFTs",
"WALLET_CONFIG_DESCRIPTION": "Wallet configuration.",
"CLEAR_ACTIVITY_DATA": "Clear Activity Data",
"CLEAR_ACTIVITY_DATA_DESCRIPTION": "Clear all wallet logs for current account.",
"CLEAR_ACTIVITY_DATA_CONFIRMATION": "Do you really want to clear all your wallet data?",
"SELECT": "Select",
"SELECT_ADDRESS": "Choose address to send to",
"SELECT_ADDRESS_TOKEN": "Choose address to send {tokenName} to",
"PROCEED": "Proceed",
"SENDING_TO": "Sending to",
"ENABLE_WALLET_LOCK": "Enable wallet lock",
"MINUTES": "Minutes",
"LOCK_INTERVAL": "Lock interval",
"UNLOCK_WALLET": "Enter your account password to unlock wallet.",
"WALLET_SETTINGS_WARNING": "You need to unlock your wallet first in order to change this setting.",
"IMPORT_TOKEN": "Import Token",
"IMPORT_TOKEN_INSTRUCTIONS": "Enter contract address to import token",
"IMPORT_TOKEN_SUCCESS": "Token is successfully imported",
"NOT_ENOUGH_BALANCE": "Your current balance is too low for this transaction",
"USE_SWARM_EXTENSION": "Retrieve Bee URL from Swarm extension",
"BEE_URL": "Bee URL",
"NETWORK_UNAVAILABLE_ERROR": "Network RPC is not reachable.",
"ERROR_DESCRIPTION": "Error description",
"BLOCK_EXPLORER_URL_LABEL": "Block Explorer URL (Optional)",
"TRANSACTION_DETAILS": "Transaction Details",
"RECIPIENT": "Recipient",
"GAS_CONST": "Gas Cost",
"TRANSCTION_HASH": "Transaction hash",
"DATA": "Data",
"TIME": "Time",
"DIALOG_DAPP_ACCOUNT_INFO": "dApp with ID {dappId} asks to access your account information (address and ENS name).\nDo you allow access to your account information?",
"ACCOUNT_INFORMATION_ACCESS": "Account Information Access",
"TOKEN_IMPORT_ERROR": "Couldn't get token data.",
"TRANSACTION_ERROR": "The transaction failed. Click here to see the details."
}
15 changes: 15 additions & 0 deletions library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,21 @@ dApps can sign any data using their default pod's private key.
const signature = await blossom.signer.signMessage(blossom.dappId, 'Data...')
```

### Wallet

Library provides methods for interaction with Blossom wallet. To get balance of currently logged in user:

```typescript
const balanceString = await blossom.wallet.getUserBalance()
console.log(BigNumber.from(balanceString)) // result can be converted to BigNumber object
```

dApp can send funds as well, but the user must allow it:

```typescript
await blossom.wallet.sendTransaction('0x1234...', '1000000000')
```

### Terminating connection

Once when the instance of the Blossom class is not needed anymore, connection with the extension can be
Expand Down
Loading

0 comments on commit 4bb7f20

Please sign in to comment.