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

SEP-24: pass language to GET transaction call #350

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading