Skip to content

Commit

Permalink
Update @satoshipay/stellar-sep-10 (#1104)
Browse files Browse the repository at this point in the history
  • Loading branch information
andywer authored Jun 24, 2020
1 parent cd80f4e commit a7ba3f2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"devDependencies": {
"@material-ui/core": "^4.5.1",
"@material-ui/icons": "^4.5.1",
"@satoshipay/stellar-sep-10": "^0.2.0",
"@satoshipay/stellar-sep-10": "^0.3.0",
"@satoshipay/stellar-transfer": "^0.2.2",
"@satoshipay/worker-plugin": "^3.2.0",
"@storybook/addon-actions": "^5.2.0",
Expand Down
3 changes: 2 additions & 1 deletion src/Generic/hooks/stellar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function useWebAuth() {
network: Networks
) {
const { netWorker } = await workers
const challenge = await netWorker.fetchWebAuthChallenge(endpointURL, serviceSigningKey, localPublicKey)
const challenge = await netWorker.fetchWebAuthChallenge(endpointURL, serviceSigningKey, localPublicKey, network)
return new Transaction(challenge, network)
},

Expand All @@ -89,6 +89,7 @@ export function useWebAuth() {
.toEnvelope()
.toXDR()
.toString("base64")

const { authToken, decoded } = await netWorker.postWebAuthResponse(endpointURL, txXdr, network)

if (localPublicKey) {
Expand Down
5 changes: 3 additions & 2 deletions src/Workers/net-worker/sep-10.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import * as WebAuth from "@satoshipay/stellar-sep-10"
export async function fetchWebAuthChallenge(
endpointURL: string,
serviceSigningKey: string | null,
localPublicKey: string
localPublicKey: string,
network: Networks
) {
const challenge = await WebAuth.fetchChallenge(endpointURL, serviceSigningKey, localPublicKey)
const challenge = await WebAuth.fetchChallenge(endpointURL, serviceSigningKey, localPublicKey, network)
return challenge
.toEnvelope()
.toXDR()
Expand Down

0 comments on commit a7ba3f2

Please sign in to comment.