Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] General updates #1629

Merged
merged 12 commits into from
Nov 12, 2024
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ This repo is constructed using yarn workspaces and consists of the 4 sections:

You will need

- Node (>=18): https://nodejs.org/en/download/
- Node (>=21): https://nodejs.org/en/download/
- Yarn (v1.22.5 or newer): https://classic.yarnpkg.com/en/docs/install

## Build the extension

To simply build a production version of the extension, install the prerequisites then navigate to this root folder in your command line and run these 2 steps:
To simply build a production version of the extension, install the prerequisites then navigate to this root folder (`/freighter`) in your command line and run these 2 steps:

```
yarn install
yarn setup
```

Expand All @@ -47,7 +48,7 @@ This will start up multiple watching builds in parallel:
- The docs, serving on `localhost:3000`
- A dev server with the webapp running in the extension, serving on
`localhost:9000`
- The actual built extension, able to be installed in Chrome, in `build/`
- The actual built extension, able to be installed in Chrome or Firefox, in `build/`

Each of these will build in response to editing their source.

Expand All @@ -70,12 +71,21 @@ an individual workspace.

### Useful URLs:

[Configure the backend](https://github.com/stellar/freighter/blob/master/extension/README.md#configure-the-backend)

[Build the extension and install it on your machine](https://github.com/stellar/freighter/blob/master/extension/README.md#build-the-extension-and-install-it-on-your-machine)

[The popup webapp](http://localhost:9000/#/)

[The `getPublicKey` playground](http://localhost:3000/docs/playground/getPublicKey)
[The `setAllowed` playground](http://localhost:3000/docs/playground/setAllowed)

[The `requestAccess` playground](http://localhost:3000/docs/playground/requestAccess)

[The `getAddress` playground](http://localhost:3000/docs/playground/getAddress)

[The `signTransaction` playground](http://localhost:3000/docs/playground/signTransaction)

It's important to note that these two won't interact with the _dev server_ popup
It's important to note that these last functions won't interact with the _dev server_ popup
UI on `localhost:9000` — you'll need to re-install the unpacked extension each
time you make a change.

Expand Down
3 changes: 1 addition & 2 deletions docs/docs/guide/basics/VersionedUrl.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from "react";
import packageJson from "../../../../@stellar/freighter-api/package.json";

export const VersionedUrl = () => (
<p>
<code>{`<head><script src='https://cdnjs.cloudflare.com/ajax/libs/stellar-freighter-api/${packageJson.version}/index.min.js' /></head>`}</code>
<code>{`<head><script src='https://cdnjs.cloudflare.com/ajax/libs/stellar-freighter-api/{version}/index.min.js' /></head>`}</code>
CassioMG marked this conversation as resolved.
Show resolved Hide resolved
</p>
);
2 changes: 1 addition & 1 deletion docs/docs/guide/developingForSoroban.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
/* For this example, we are assuming the token adheres to the interface documented in SEP-0041 */
const generateTransferXdr =
(contractId, serverUrl, publicKey, destination, amount, fee, networkPassphrase, memo) => {
// the contract id of the the token
// the contract id of the token
const contract = new Contract(contractId);

const server = new SorobanRpc.Server(serverUrl);
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guide/signXdr.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ You can serialize an assembled transaction to a base64 encoded xdr string using

During the transaction/operation review, you can review signing details at different fidelities.

- Summary: The first tab is the summary tab which lays out high level trasnsction/operation details.
- Summary: The first tab is the summary tab which lays out high level transaction/operation details.
- Operation Details: The second tab exposes information about the operations in the transaction and optionally walks through the invocation chain and highlights authorizations.
- Raw XDR: The last tab lets you copy the raw XDR to be used outside of Freighter.
2 changes: 1 addition & 1 deletion docs/docs/guide/usingFreighterWebApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ const response = await server.submitTransaction(transactionToSubmit);

#### `WatchWalletChanges -> new WatchWalletChanges(timeout?: number)`

The class `WatchWalletChanges` provides methods to watch changes from Freighter. To use this class, first instantiate with with an optional `timeout` param to determine how often you want to check for changes in the wallet. The default is `3000` ms.
The class `WatchWalletChanges` provides methods to watch changes from Freighter. To use this class, first instantiate with an optional `timeout` param to determine how often you want to check for changes in the wallet. The default is `3000` ms.

##### `WatchWalletChanges.watch(callback: ({ address: string; network: string; networkPassphrase; string }) => void)`

Expand Down
11 changes: 6 additions & 5 deletions extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,18 @@ To install on Chrome:

4. Click `Load Unpacked` and it will open your file system.

5. Navigate to this folder and click the `build` folder. Hit `Select`. You
should now see an icon for Freighter in Chrome.
5. Navigate to this folder (`/extension`) and click the `build` folder. Hit
`Select`. You should now see an icon for Freighter in Chrome.

To install on Firefox:

1. In Firefox, navigate to about:debugging#/runtime/this-firefox

2. Click `Load Temporary Add-On`

3. Navigate to this folder and open the `build` folder and find `manifest.json`.
Hit `Select`. You should now see an icon for Freighter in Firefox
3. Navigate to this folder (`/extension`) and open the `build` folder and find
`manifest.json`. Hit `Select`. You should now see an icon for Freighter in
Firefox

### Build the extension using production settings

Expand Down Expand Up @@ -148,7 +149,7 @@ of these are located in the `src/` folder:
uninstall/reload). It is run in a headless browser, so it has access to all
Web APIs. It also has accessible dev tools, which can be reached by going to
`chrome://extensions/` or `about:debugging#/runtime/this-firefox` and
clicking `Inspect`
clicking `service worker`

3. The `content script` that allows external sites to send and receive messages
to `background`. Using an event listener, it waits for an application to
Expand Down
5 changes: 5 additions & 0 deletions extension/src/popup/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"Add": "Add",
"Add address": "Add address",
"Add an asset": "Add an asset",
"Add anyway": "Add anyway",
"Add asset": "Add asset",
"Add Asset trustline": "Add Asset trustline",
"Add Asset Trustline": "Add Asset Trustline",
Expand Down Expand Up @@ -200,6 +201,10 @@
"Got it": "Got it",
"Hash": "Hash",
"Help": "Help",
"Hide payments smaller than 0": {
"1 XLM": "Hide payments smaller than 0.1 XLM"
},
"Hide small payments": "Hide small payments",
Copy link
Contributor

@piyalbasu piyalbasu Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure why these translation strings weren't already committed, but no problem adding them now

"High Threshold": "High Threshold",
"History": "History",
"Home": "Home",
Expand Down
5 changes: 5 additions & 0 deletions extension/src/popup/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"Add": "Add",
"Add address": "Add address",
"Add an asset": "Add an asset",
"Add anyway": "Add anyway",
"Add asset": "Add asset",
"Add Asset trustline": "Add Asset trustline",
"Add Asset Trustline": "Add Asset Trustline",
Expand Down Expand Up @@ -200,6 +201,10 @@
"Got it": "Got it",
"Hash": "Hash",
"Help": "Help",
"Hide payments smaller than 0": {
"1 XLM": "Hide payments smaller than 0.1 XLM"
},
"Hide small payments": "Hide small payments",
"High Threshold": "High Threshold",
"History": "History",
"Home": "Home",
Expand Down