Skip to content

Commit c287430

Browse files
committed
app shutdown
1 parent c28e789 commit c287430

File tree

7 files changed

+52
-114
lines changed

7 files changed

+52
-114
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## The old Daimo app is shutting down
2+
3+
Please withdraw funds. [For details, see this post.](https://daimo.com/app-shutdown)
4+
5+
--
6+
17
<img alt="Screenshot" src="https://github.com/daimo-eth/daimo/assets/169280/3207b2bf-f93d-4c26-b56f-1545e4e7c182">
28

39
### Daimo is a universal cash app

apps/daimo-mobile/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"build:prod-ios": "eas build -p ios --profile=production --auto-submit --non-interactive --no-wait",
1313
"build:prod-android": "eas build -p android --profile=production --auto-submit --non-interactive --no-wait",
1414
"dev": "DAIMO_APP_API_URL=http://`ipconfig getifaddr en0`:3000 expo start --dev-client --clear -i",
15+
"dev:bare": "DAIMO_APP_API_URL=https://api.daimo.xyz expo start --dev-client --clear -i",
1516
"dev:android": "expo start --dev-client --clear -a",
1617
"dev:tunnel": "expo start --dev-client --clear --tunnel",
17-
"dev:bare": "expo start --dev-client --clear",
1818
"prebuild": "expo prebuild --clean",
1919
"android": "expo run:android --no-build-cache",
2020
"ios": "expo run:ios --no-build-cache",

apps/daimo-web/src/app/[...topLevelPage]/route.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ export async function GET(request: Request) {
2323

2424
// Rewrite /_next/... URLs to superSo/_next/...
2525
const ct = res.headers.get("content-type") || "";
26-
let retBody = resBody as Blob | string;
26+
let retBody: string | Uint8Array;
2727
if (ct.includes("text/html")) {
2828
console.log(`[WEB] rewriting /_next/ URLs in ${upstreamUrl}`);
2929
const initHtml = await resBody.text();
3030
retBody = initHtml.replace(/\/_next\//g, `${superSo}/_next/`);
31+
} else {
32+
retBody = await resBody.bytes();
3133
}
3234

3335
const headers = new Headers();
@@ -37,7 +39,13 @@ export async function GET(request: Request) {
3739
headers.set(key, value);
3840
}
3941

40-
return new Response(retBody, {
42+
const bodyLength =
43+
typeof retBody === "string"
44+
? new TextEncoder().encode(retBody).byteLength
45+
: retBody.byteLength;
46+
console.log(`[WEB] response ${ct || "unknown"} ${bodyLength}b`);
47+
48+
return new Response(retBody as BodyInit, {
4149
status: res.status,
4250
statusText: res.statusText,
4351
headers,

packages/daimo-api/src/api/getAccountHistory.ts

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
RecommendedExchange,
1313
SuggestedAction,
1414
TransferClog,
15-
appStoreLinks,
1615
assert,
1716
assertNotNull,
1817
daimoDomainAddress,
@@ -22,7 +21,6 @@ import {
2221
hasAccountName,
2322
} from "@daimo/common";
2423
import semver from "semver";
25-
import semverLt from "semver/functions/lt";
2624
import { Address } from "viem";
2725

2826
import { FeatFlag } from "./featureFlag";
@@ -48,7 +46,6 @@ import { addLandlineTransfers } from "../landline/landlineClogMatcher";
4846
import { ViemClient } from "../network/viemClient";
4947
import { InviteCodeTracker } from "../offchain/inviteCodeTracker";
5048
import { InviteGraph } from "../offchain/inviteGraph";
51-
import { getAppVersionTracker } from "../server/appVersion";
5249
import { TrpcRequestContext } from "../server/trpc";
5350

5451
export interface AccountHistoryResult {
@@ -310,28 +307,12 @@ function getSuggestedActions(
310307
const ret: SuggestedAction[] = [];
311308
const t = i18n(lang).suggestedActions;
312309

313-
// Not on latest version? Ask them to upgrade.
314-
const latestVersion = getAppVersionTracker().getLatestVersion();
315-
const { daimoPlatform, daimoVersion } = ctx;
316-
const appVersion = daimoVersion.split(" ")[0];
317-
if (appVersion && latestVersion && semverLt(appVersion, latestVersion)) {
318-
ret.push({
319-
id: `2024-02-update-${appVersion}-to-${latestVersion}`,
320-
title: t.upgrade.title(),
321-
subtitle: t.upgrade.subtitle(latestVersion),
322-
url: appStoreLinks[daimoPlatform.startsWith("ios") ? "ios" : "android"],
323-
});
324-
}
325-
326-
// If account is not backed up, asked them to create a backup
327-
if (hist.accountKeys.length === 1) {
328-
ret.push({
329-
id: "2024-02-passkey-backup",
330-
title: t.backup.title(),
331-
subtitle: t.backup.subtitle(),
332-
url: `daimo://settings/add-passkey`,
333-
});
334-
}
310+
ret.push({
311+
id: "2025-11-shutdown",
312+
title: t.shutdown.title(),
313+
subtitle: t.shutdown.subtitle(),
314+
url: "https://daimo.com/app-shutdown",
315+
});
335316

336317
return ret;
337318
}

packages/daimo-api/src/i18n/languages/en.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,10 @@ export const en = {
1717

1818
// SuggestedActions
1919
suggestedActions: {
20-
upgrade: {
21-
title: () => "Upgrade Available",
22-
subtitle: (latestVersion: string) => `Tap to update to ${latestVersion}`,
23-
},
24-
backup: {
25-
title: () => "Secure Your Account",
26-
subtitle: () => "Keep your account safe with a passkey backup",
27-
},
28-
feedback: {
29-
title: () => "Feedback? Ideas?",
30-
subtitle: () => "Join our Telegram group.",
20+
shutdown: {
21+
title: () => "Shutdown Notice",
22+
subtitle: () =>
23+
"We are sunsetting the Daimo app on Jan 31, 2026. Please withdraw funds. Tap for details.",
3124
},
3225
},
3326
};

packages/daimo-api/src/i18n/languages/es.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,10 @@ export const es: LanguageDefinition = {
1919

2020
// SuggestedActions
2121
suggestedActions: {
22-
upgrade: {
23-
title: () => "Actualización Disponible",
24-
subtitle: (latestVersion: string) =>
25-
`Toca para actualizar a ${latestVersion}`,
26-
},
27-
backup: {
28-
title: () => "Asegura Tu Cuenta",
22+
shutdown: {
23+
title: () => "Aviso de cierre",
2924
subtitle: () =>
30-
"Mantén tu cuenta segura con una copia de seguridad de tu clave de acceso",
31-
},
32-
feedback: {
33-
title: () => "¿Sugerencias? ¿Ideas?",
34-
subtitle: () => "Únete a nuestro grupo de Telegram.",
25+
"Cerramos la app Daimo el 31 de enero de 2026. Por favor retira tus fondos. Toca para más detalles.",
3526
},
3627
},
3728
};

packages/daimo-api/src/network/viemClient.ts

Lines changed: 22 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import {
66
Address,
77
Block,
88
Chain,
9-
ContractFunctionArgs,
10-
ContractFunctionName,
119
EstimateContractGasParameters,
1210
GetContractReturnType,
1311
Hex,
@@ -34,6 +32,18 @@ import { Telemetry } from "../server/telemetry";
3432
import { lazyCache } from "../utils/cache";
3533
import { memoize } from "../utils/func";
3634

35+
type ViemWriteContractParameters<
36+
TAbi extends Abi | readonly unknown[],
37+
TFunctionName extends string,
38+
TChainOverride extends Chain | undefined = undefined,
39+
> = WriteContractParameters<
40+
TAbi,
41+
TFunctionName,
42+
Chain,
43+
Account,
44+
TChainOverride
45+
>;
46+
3747
const GAS_LIMIT_RESCALE_PERCENT = 150; // Scale gas limit to 150% of estimate
3848
const BASE_FEE_RESCALE_PERCENT = 200; // Scale base fee to 200% of original in maxFeePerGas calculation
3949
const PRIO_FEE_SCALE_RESCALE_PERCENT = 120; // Scale priority fee to 120% of original
@@ -107,14 +117,11 @@ export class ViemClient {
107117
) {
108118
this.account = this.walletClient.account;
109119
const { waitForTransactionReceipt } = publicClient;
110-
publicClient.waitForTransactionReceipt = (args) => {
111-
// Viem's default is 6 = ~24s
112-
return waitForTransactionReceipt({
120+
publicClient.waitForTransactionReceipt = (args) =>
121+
waitForTransactionReceipt({
113122
...args,
114-
retryCount: 10,
115123
timeout: 60_000, // Wait at most 1 minute for a tx to confirm
116124
});
117-
};
118125
}
119126

120127
getEnsAddress = memoize(
@@ -243,23 +250,11 @@ export class ViemClient {
243250
/** Estimate the gas limit for a tx with a defensive buffer. */
244251
async getGasLimit<
245252
const TAbi extends Abi | readonly unknown[],
246-
TFunctionName extends ContractFunctionName<TAbi, "payable" | "nonpayable">,
247-
TArgs extends ContractFunctionArgs<
248-
TAbi,
249-
"payable" | "nonpayable",
250-
TFunctionName
251-
>,
253+
TFunctionName extends string,
252254
TChainOverride extends Chain | undefined = undefined,
253255
>(
254256
block: Block,
255-
args: WriteContractParameters<
256-
TAbi,
257-
TFunctionName,
258-
TArgs,
259-
Chain,
260-
Account,
261-
TChainOverride
262-
>
257+
args: ViemWriteContractParameters<TAbi, TFunctionName, TChainOverride>
263258
): Promise<bigint> {
264259
try {
265260
// Don't retry. estimateContractGas usually fails because of reverts
@@ -289,23 +284,11 @@ export class ViemClient {
289284
*/
290285
async setOverrideParams<
291286
const TAbi extends Abi | readonly unknown[],
292-
TFunctionName extends ContractFunctionName<TAbi, "payable" | "nonpayable">,
293-
TArgs extends ContractFunctionArgs<
294-
TAbi,
295-
"payable" | "nonpayable",
296-
TFunctionName
297-
>,
287+
TFunctionName extends string,
298288
TChainOverride extends Chain | undefined = undefined,
299289
>(
300290
localTxId: number,
301-
args: WriteContractParameters<
302-
TAbi,
303-
TFunctionName,
304-
TArgs,
305-
Chain,
306-
Account,
307-
TChainOverride
308-
>,
291+
args: ViemWriteContractParameters<TAbi, TFunctionName, TChainOverride>,
309292
prevGasFees: { maxFeePerGas: bigint; maxPriorityFeePerGas: bigint }
310293
): Promise<void> {
311294
const block = await this.publicClient.getBlock({ blockTag: "latest" });
@@ -362,23 +345,11 @@ export class ViemClient {
362345

363346
private getWriteContractLogMessage<
364347
const TAbi extends Abi | readonly unknown[],
365-
TFunctionName extends ContractFunctionName<TAbi, "payable" | "nonpayable">,
366-
TArgs extends ContractFunctionArgs<
367-
TAbi,
368-
"payable" | "nonpayable",
369-
TFunctionName
370-
>,
348+
TFunctionName extends string,
371349
TChainOverride extends Chain | undefined = undefined,
372350
>(
373351
localTxId: number,
374-
args: WriteContractParameters<
375-
TAbi,
376-
TFunctionName,
377-
TArgs,
378-
Chain,
379-
Account,
380-
TChainOverride
381-
>
352+
args: ViemWriteContractParameters<TAbi, TFunctionName, TChainOverride>
382353
) {
383354
return `[VIEM] txId ${localTxId} from ${this.walletClient.account.address}: ${args.functionName} on ${args.address} chain ${this.publicClient.chain.id}`;
384355
}
@@ -388,22 +359,10 @@ export class ViemClient {
388359
*/
389360
async writeContractAndGetReceipt<
390361
const TAbi extends Abi | readonly unknown[],
391-
TFunctionName extends ContractFunctionName<TAbi, "payable" | "nonpayable">,
392-
TArgs extends ContractFunctionArgs<
393-
TAbi,
394-
"payable" | "nonpayable",
395-
TFunctionName
396-
>,
362+
TFunctionName extends string,
397363
TChainOverride extends Chain | undefined = undefined,
398364
>(
399-
args: WriteContractParameters<
400-
TAbi,
401-
TFunctionName,
402-
TArgs,
403-
Chain,
404-
Account,
405-
TChainOverride
406-
>
365+
args: ViemWriteContractParameters<TAbi, TFunctionName, TChainOverride>
407366
): Promise<{ txHash: Hex; receipt: TransactionReceipt }> {
408367
const startMs = performance.now();
409368
const localTxId = Math.floor(Math.random() * 1e6);

0 commit comments

Comments
 (0)