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
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/gettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ or

#### For browser-based applications

- Install the packaged library via script tag using cdnjs, swapping in the desired version number for `{version}`:
- Install the packaged library via `script` tag using cdnjs, swapping in the [desired version number](https://www.npmjs.com/package/@stellar/freighter-api?activeTab=versions) for `{version}`:

_NOTE:_ You must use version `1.1.2` or above

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.
8 changes: 3 additions & 5 deletions docs/docs/guide/usingFreighterBrowser.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ We now have an extension installed on our machine and a library to interact with

First import the library in the `<head>` tag of your page.

- Install the packaged library via script tag using cdnjs, swapping in the desired version number for `{version}`

_NOTE:_ You must use version `1.1.2` or above

For example, include the `script` in your `head` tag using the following code:
Install the packaged library via `script` tag using cdnjs. For example, use the following code to install the [latest freighter api version](https://www.npmjs.com/package/@stellar/freighter-api?activeTab=versions):

<VersionedUrl />

_NOTE:_ You can swap in another desired version number but you must use at least version `1.1.2` or above.

This will expose a global variable called `window.freighterApi` that will contain our library.

The call signatures will be exactly the same as the [node version](./usingFreighterWebApp), but you will call the methods directly from `window.freighterApi`:
Expand Down
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