-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* API signTransaction accepts arbitrary blobs (#912) * adds signBlob workflows and allows for signTransaction to take a b64 blob * cleans up SignTransaction and splits blob and tx signing review * cleans up SignTransaction and splits blob and tx signing review * Added translations * add domain to blob signing, split blob and tx signing body components * Added translations * refactors SignTransaction to abstract common state to parent * adds new api, signBlob * splits out sign blob and sign tx bodies * restore var name in signTransaction * adds blob warning and blob preview to sign blob flow * Added translations * fixes data blob styling and placement * Added translations * manually format changes * fixes grammar in signing warning * Added translations * Feature/wal 509 remove domain connection (#911) * update slack notify as old version was erroring * add UI to remove connected domains * Added translations * add a separate service for saveAllowList and add an empty state * clean up allowList value that UI receives * fixes bad references to request/response keys in the listener layer * renames args, drops unused args, and splits Request interfaces for tx and blobs * renames forgotten reference in response handler * makes options optional for signBlob * bump freighter-api version for next release (#925) * set current account after accountMap has been generated (#927) * set current account after accountMap has been generated * de-dupe accountsMap logic --------- Co-authored-by: aristides <[email protected]>
- Loading branch information
1 parent
7946a03
commit 42a5dc0
Showing
37 changed files
with
1,239 additions
and
363 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
Binary file not shown.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@stellar/freighter-api", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"license": "Apache-2.0", | ||
"author": "Stellar Development Foundation <[email protected]>", | ||
"description": "Utility functions to interact with Freighter extension", | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as apiExternal from "@shared/api/external"; | ||
import { signBlob } from "../signBlob"; | ||
|
||
describe("signBlob", () => { | ||
it("returns a signed blob", async () => { | ||
const TEST_BLOB = atob("AAA"); | ||
apiExternal.submitBlob = jest.fn().mockReturnValue(TEST_BLOB); | ||
const blob = await signBlob(); | ||
expect(blob).toBe(TEST_BLOB); | ||
}); | ||
it("throws a generic error", () => { | ||
const TEST_ERROR = "Error!"; | ||
apiExternal.submitBlob = jest.fn().mockImplementation(() => { | ||
throw TEST_ERROR; | ||
}); | ||
expect(signBlob).toThrowError(TEST_ERROR); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { submitBlob } from "@shared/api/external"; | ||
import { isBrowser } from "."; | ||
|
||
export const signBlob = ( | ||
blob: string, | ||
opts?: { | ||
accountToSign?: string; | ||
} | ||
): Promise<string> => | ||
isBrowser ? submitBlob(blob, opts) : Promise.resolve(""); |
Binary file not shown.
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.