Skip to content

Commit

Permalink
SEP-24: pass language to GET transaction call (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
quietbits authored May 28, 2024
1 parent da48a4f commit f6362c6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/demo-wallet-client/src/ducks/sep24DepositAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export const depositAssetAction = createAsyncThunk<
sep24TransferServerUrl: tomlResponse.TRANSFER_SERVER_SEP0024,
trustAssetCallback,
custodialMemoId: generatedMemoId,
sep9Fields,
});

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export const withdrawAssetAction = createAsyncThunk<
networkUrl: networkConfig.url,
assetCode,
assetIssuer,
sep9Fields,
});

return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getErrorMessage } from "../../helpers/getErrorMessage";
import { log } from "../../helpers/log";
import { TransactionStatus } from "../../types/types";
import { AnyObject, TransactionStatus } from "../../types/types";

export const pollDepositUntilComplete = async ({
popup,
Expand All @@ -9,19 +9,23 @@ export const pollDepositUntilComplete = async ({
sep24TransferServerUrl,
trustAssetCallback,
custodialMemoId,
sep9Fields,
}: {
popup: any;
transactionId: string;
token: string;
sep24TransferServerUrl: string;
trustAssetCallback: () => Promise<string>;
custodialMemoId?: string;
sep9Fields?: AnyObject;
}) => {
let currentStatus = TransactionStatus.INCOMPLETE;
let trustedAssetAdded;

const transactionUrl = new URL(
`${sep24TransferServerUrl}/transaction?id=${transactionId}`,
`${sep24TransferServerUrl}/transaction?id=${transactionId}&lang=${
sep9Fields?.lang || "en"
}`,
);
log.instruction({
title: `Polling for updates \`${transactionUrl.toString()}\``,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from "@stellar/stellar-sdk";
import { log } from "../../helpers/log";
import { createMemoFromType } from "../createMemoFromType";
import { TransactionStatus } from "../../types/types";
import { AnyObject, TransactionStatus } from "../../types/types";
import { getNetworkConfig } from "../../helpers/getNetworkConfig";

export const pollWithdrawUntilComplete = async ({
Expand All @@ -21,6 +21,7 @@ export const pollWithdrawUntilComplete = async ({
networkUrl,
assetCode,
assetIssuer,
sep9Fields,
}: {
secretKey: string;
popup: any;
Expand All @@ -31,13 +32,16 @@ export const pollWithdrawUntilComplete = async ({
networkUrl: string;
assetCode: string;
assetIssuer: string;
sep9Fields?: AnyObject;
}) => {
const keypair = Keypair.fromSecret(secretKey);
const server = new Horizon.Server(networkUrl);
let currentStatus = TransactionStatus.INCOMPLETE;

const transactionUrl = new URL(
`${sep24TransferServerUrl}/transaction?id=${transactionId}`,
`${sep24TransferServerUrl}/transaction?id=${transactionId}&lang=${
sep9Fields?.lang || "en"
}`,
);
log.instruction({
title: `Polling for updates \`${transactionUrl.toString()}\``,
Expand Down

0 comments on commit f6362c6

Please sign in to comment.