Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
44e13b4
added await in async function calls (#467)
MarcoCiaramella May 3, 2022
6e89092
adding first attempt at beta pipeline (#483)
piyalbasu May 12, 2022
925500e
change workflow names
piyalbasu May 12, 2022
b608a26
rm duped id
piyalbasu May 12, 2022
a8d81ef
rm analytics and change naming
piyalbasu May 12, 2022
fde73d1
don't bother creating a PR
piyalbasu May 12, 2022
0bcc11b
update naming and use a different version for FF
piyalbasu May 13, 2022
667c523
publish chrome to testers and rename FF artifact
piyalbasu May 13, 2022
29dd096
upgrade chrome upload to allow publish target
piyalbasu May 13, 2022
78a78ec
just run chrome upload
piyalbasu May 13, 2022
68fc0ee
try new secret keys
piyalbasu May 17, 2022
a24441b
try the whole thing
piyalbasu May 18, 2022
ffe296c
change file path for chrome upload
piyalbasu May 18, 2022
d1c3281
change version naming and set publish to true
piyalbasu May 19, 2022
265a8a7
add `beta` to version for Firefox
piyalbasu May 23, 2022
68c0646
update stellar-sdk for Protocol 19 (#466)
piyalbasu Apr 29, 2022
4de0b4c
add additional tracking for payments and manage assets (#482)
piyalbasu May 11, 2022
19a2f1c
when fetching balances filter out liquidity pool shares (#484)
acharb May 12, 2022
b569b25
use asset canonical ID for key in cache (#495)
acharb May 17, 2022
e3e9581
use recommended tx fee by default (#506)
acharb May 23, 2022
756e32b
use mode of max fee instead of fee charged mode (#507)
piyalbasu May 23, 2022
cdec380
use recommended fee for `changeTrust` operation (#510)
piyalbasu May 24, 2022
2241947
update version in Settings (#511)
piyalbasu May 24, 2022
d226474
docs(): bumping release to 2.1.2 (#513)
github-actions[bot] May 24, 2022
f23644e
Merge commit 'd226474d72a8ea83915f302e6eace2986c4e3f89' into release/…
piyalbasu May 24, 2022
29964d0
Merge commit 'd226474d72a8ea83915f302e6eace2986c4e3f89' into merge-ma…
piyalbasu May 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .github/workflows/submitBeta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Beta Deployment
on:
workflow_dispatch:
inputs:
release:
description: Release Number
default: "2.0.0"
required: true
version:
description: Beta version
default: "0"
required: true
jobs:
bump-version:
name: Bump Package Version and Submit Extension
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: release/${{ github.event.inputs.release }}
- name: Update manifest.json name
uses: jossef/action-set-json-field@6e6d7e639f24b3955ef682815317b5613ac6ca12 #v1
with:
file: ./extension/public/static/manifest.json
field: name
value: Freighter BETA
- name: Update manifest.json version_name
uses: jossef/action-set-json-field@6e6d7e639f24b3955ef682815317b5613ac6ca12 #v1
with:
file: ./extension/public/static/manifest.json
field: version_name
value: ${{ github.event.inputs.release }}-beta.${{ github.event.inputs.version }}
- name: Update manifest.json version for Chrome
uses: jossef/action-set-json-field@6e6d7e639f24b3955ef682815317b5613ac6ca12 #v1
with:
file: ./extension/public/static/manifest.json
field: version
value: ${{ github.event.inputs.release }}.${{ github.event.inputs.version }}
- name: Build extension
uses: actions/setup-node@v1
with:
node-version: "12"
- run: yarn install && yarn build:freighter-api && yarn build:extension:production
- name: Install zip
uses: montudor/action-zip@c25e01d7489d0274569440a2f0281b4569df16bc #v0.1.1
- name: Zip extension build
run: zip -qq -r ./build.zip *
working-directory: ./extension/build
# - name: Create GitHub Release

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this commented out code still needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'm keeping this disabled for now because I need to confirm that just the "Submit extension to Chrome" bit works before I enable the whole pipeline.

I'm testing some new creds and didn't want to deal with creating new Firefox builds and releases if the whole thing was going to ultimately fail at "Submit extension to Chrome"

# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# tag_name: ${{ github.event.inputs.release }}-beta.${{ github.event.inputs.version }}
# release_name: ${{ github.event.inputs.release }}-beta.${{ github.event.inputs.version }}
# body: ${{ github.event.inputs.release }}-beta.${{ github.event.inputs.version }}
# draft: false
# prerelease: true
# - name: Upload Release Asset
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./extension/build/build.zip
# asset_name: build-${{ github.event.inputs.release }}-beta.${{ github.event.inputs.version }}.zip
# asset_content_type: application/zip
# - name: Update built manifest.json version for Firefox
# uses: jossef/action-set-json-field@6e6d7e639f24b3955ef682815317b5613ac6ca12 #v1
# with:
# file: ./extension/build/manifest.json
# field: version
# value: ${{ github.event.inputs.release }}beta${{ github.event.inputs.version }}
# - name: Build xpi for Firefox
# id: firefox-build
# uses: kewisch/action-web-ext@20ee9837f7352d4770b93868a0aa59292eb43d8c #v1
# with:
# cmd: build
# source: ./extension/build
# filename: ${{ github.event.inputs.release }}-beta.${{ github.event.inputs.version }}.xpi
# - name: Sign extension for Firefox
# id: firefox-sign
# uses: kewisch/action-web-ext@20ee9837f7352d4770b93868a0aa59292eb43d8c #v1
# with:
# cmd: sign
# source: ${{ steps.firefox-build.outputs.target }}
# channel: unlisted
# apiKey: ${{ secrets.AMO_SIGN_KEY }}
# apiSecret: ${{ secrets.AMO_SIGN_SECRET }}
# timeout: 1800000
# - name: Upload Firefox xpi
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ${{ steps.firefox-sign.outputs.target }}
# asset_name: ${{ github.event.inputs.release }}-${{ github.event.inputs.version }}.xpi
# asset_content_type: application/xpi
- name: Submit extension to Chrome
uses: mnao305/chrome-extension-upload@4061bc03cde1feaec8b153654495c88857fb76c3 #v2.2.0
with:
file-path: ./extension/build/build.zip
extension-id: "kcigoalhjaghfigblagmiopnefgenfjb"
client-id: ${{ secrets.EXTENSION_CLIENT_ID_V2 }}
refresh-token: ${{ secrets.EXTENSION_REFRESH_TOKEN_V2 }}
publish: true
publish-target: trustedTesters
- name: Slack Notification
uses: rtCamp/action-slack-notify@4d4ce0d91186ffe6633a8cda645146d38e88228b #v2
env:
MSG_MINIMAL: true
SLACK_CHANNEL: proj-freighter
SLACK_COLOR: "#391EDA"
SLACK_ICON: https://github.com/stellar/freighter/blob/master/docs/static/images/logo.png?size=48
SLACK_MESSAGE: "https://github.com/stellar/freighter/releases/tag/{{ github.event.inputs.release }}-beta.${{ github.event.inputs.version }}"
SLACK_TITLE: Freighter v${{ github.event.inputs.release }}-beta.${{ github.event.inputs.version }} has been submitted for testing!
SLACK_USERNAME: Freighter Administrative Assistant
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Submit extension to browser store
name: Production Deployment
on:
workflow_dispatch:
inputs:
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/guide/usingFreighterBrowser.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const retrievePublicKey = async () => {
return publicKey;
};

const result = retrievePublicKey();
const result = await retrievePublicKey();
```

### getNetwork
Expand Down Expand Up @@ -96,7 +96,7 @@ const retrieveNetwork = async () => {
return network;
};

const result = retrieveNetwork();
const result = await retrieveNetwork();
```

### signTransaction
Expand Down Expand Up @@ -135,7 +135,7 @@ const retrievePublicKey = async () => {
return publicKey;
};

const retrievedPublicKey = retrievePublicKey();
const retrievedPublicKey = await retrievePublicKey();

const userSignTransaction = async (xdr: string, network: string) => {
let signedTransaction = "";
Expand All @@ -155,7 +155,7 @@ const userSignTransaction = async (xdr: string, network: string) => {
};

const xdr = ""; // replace this with an xdr string of the transaction you want to sign
const userSignedTransaction = userSignTransaction(xdr, "TESTNET");
const userSignedTransaction = await userSignTransaction(xdr, "TESTNET");
```

freighter-api will return a signed transaction xdr. Below is an example of how you might submit this signed transaction to Horizon using `stellar-sdk` (https://github.com/stellar/js-stellar-sdk):
Expand All @@ -180,7 +180,7 @@ const userSignTransaction = async (xdr: string, network: string) => {

const xdr = ""; // replace this with an xdr string of the transaction you want to sign

const userSignedTransaction = userSignTransaction(xdr, "TESTNET");
const userSignedTransaction = await userSignTransaction(xdr, "TESTNET");

const SERVER_URL = "https://horizon-testnet.stellar.org";

Expand Down
2 changes: 1 addition & 1 deletion extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "extension",
"version": "2.0.0",
"version": "2.1.2",
"license": "Apache-2.0",
"prettier": "@stellar/prettier-config",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions extension/public/static/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Freighter",
"version": "2.0.0",
"version_name": "2.0.0",
"version": "2.1.2",
"version_name": "2.1.2",
"description": "Freighter is a non-custodial wallet extension that enables you to sign Stellar transactions via your browser.",
"browser_specific_settings": {
"gecko": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import { AppDispatch } from "popup/App";

import { emitMetric } from "helpers/metrics";
import { navigateTo } from "popup/helpers/navigate";
import { getCanonicalFromAsset, formatDomain } from "helpers/stellar";
import { useNetworkFees } from "popup/helpers/useNetworkFees";
import {
formatDomain,
getCanonicalFromAsset,
xlmToStroop,
} from "helpers/stellar";

import { PillButton } from "popup/basics/buttons/PillButton";

Expand Down Expand Up @@ -53,6 +58,7 @@ export const ManageAssetRows = ({
} = useSelector(transactionSubmissionSelector);
const [assetSubmitting, setAssetSubmitting] = useState("");
const dispatch: AppDispatch = useDispatch();
const { recommendedFee } = useNetworkFees();

const server = new StellarSdk.Server(networkDetails.networkUrl);

Expand All @@ -68,7 +74,7 @@ export const ManageAssetRows = ({
setAssetSubmitting(canonicalAsset);

const transactionXDR = new StellarSdk.TransactionBuilder(sourceAccount, {
fee: StellarSdk.BASE_FEE,
fee: xlmToStroop(recommendedFee).toString(),
networkPassphrase: networkDetails.networkPassphrase,
})
.addOperation(
Expand Down
4 changes: 2 additions & 2 deletions extension/src/popup/helpers/useNetworkFees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export const useNetworkFees = () => {
try {
const server = new StellarSdk.Server(networkUrl);
const {
fee_charged: feeCharged,
max_fee: maxFee,
ledger_capacity_usage: ledgerCapacityUsage,
} = await server.feeStats();
setRecommendedFee(stroopToXlm(feeCharged.mode).toString());
setRecommendedFee(stroopToXlm(maxFee.mode).toString());
if (ledgerCapacityUsage > 0.5 && ledgerCapacityUsage <= 0.75) {
setNetworkCongestion(NetworkCongestion.MEDIUM);
} else if (ledgerCapacityUsage > 0.75) {
Expand Down
2 changes: 1 addition & 1 deletion extension/src/popup/views/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const Settings = () => {
<Heading5>Settings</Heading5>
<div className="Settings__version">
{/* TODO: Make this dynamic */}
v2.0.0
v2.1.2
</div>
</div>
<ListNavLinkWrapper>
Expand Down