tapimo 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/dist/ApiKey.d.ts +12 -11
- package/dist/ApiKey.d.ts.map +1 -1
- package/dist/ApiKey.js +10 -12
- package/dist/ApiKey.js.map +1 -1
- package/dist/ApiKeys.d.ts +139 -0
- package/dist/ApiKeys.d.ts.map +1 -0
- package/dist/ApiKeys.js +166 -0
- package/dist/ApiKeys.js.map +1 -0
- package/dist/App.d.ts +920 -910
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +36 -12
- package/dist/App.js.map +1 -1
- package/dist/Handler.d.ts +86 -0
- package/dist/Handler.d.ts.map +1 -0
- package/dist/Handler.js +83 -0
- package/dist/Handler.js.map +1 -0
- package/dist/Scope.d.ts +4 -1
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +5 -1
- package/dist/Scope.js.map +1 -1
- package/dist/Webhooks.d.ts +3 -5
- package/dist/Webhooks.d.ts.map +1 -1
- package/dist/Webhooks.js +9 -2
- package/dist/Webhooks.js.map +1 -1
- package/dist/admin/Access.d.ts +1 -3
- package/dist/admin/Access.d.ts.map +1 -1
- package/dist/admin/Access.js +1 -3
- package/dist/admin/Access.js.map +1 -1
- package/dist/admin/App.d.ts +98 -209
- package/dist/admin/App.d.ts.map +1 -1
- package/dist/admin/App.js +2 -4
- package/dist/admin/App.js.map +1 -1
- package/dist/admin/apps/api-keys.d.ts +7 -5
- package/dist/admin/apps/api-keys.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.js +8 -9
- package/dist/admin/apps/api-keys.js.map +1 -1
- package/dist/admin/apps/scopes.d.ts +3 -0
- package/dist/admin/apps/scopes.d.ts.map +1 -1
- package/dist/admin/apps/verified-tokens.d.ts +101 -215
- package/dist/admin/apps/verified-tokens.d.ts.map +1 -1
- package/dist/admin/apps/verified-tokens.js +17 -38
- package/dist/admin/apps/verified-tokens.js.map +1 -1
- package/dist/admin/ui.generated.d.ts +1 -1
- package/dist/admin/ui.generated.js +1 -1
- package/dist/apps/balances.d.ts +2 -2
- package/dist/apps/receipts.d.ts +43 -43
- package/dist/apps/tokens.d.ts +454 -454
- package/dist/apps/transactions.d.ts +43 -43
- package/dist/apps/transfers.d.ts +29 -29
- package/dist/apps/webhooks.d.ts +5 -2
- package/dist/apps/webhooks.d.ts.map +1 -1
- package/dist/apps/webhooks.js +38 -34
- package/dist/apps/webhooks.js.map +1 -1
- package/dist/{Cli.d.ts → cli/Cli.d.ts} +13 -2
- package/dist/cli/Cli.d.ts.map +1 -0
- package/dist/cli/Cli.js +19 -0
- package/dist/cli/Cli.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +4 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/admin.d.ts +15 -0
- package/dist/cli/commands/admin.d.ts.map +1 -0
- package/dist/cli/commands/admin.js +60 -0
- package/dist/cli/commands/admin.js.map +1 -0
- package/dist/cloudflare.d.ts +7 -0
- package/dist/cloudflare.d.ts.map +1 -1
- package/dist/cloudflare.js +9 -0
- package/dist/cloudflare.js.map +1 -1
- package/dist/db/Db.d.ts +103 -0
- package/dist/db/Db.d.ts.map +1 -0
- package/dist/db/Db.js +274 -0
- package/dist/db/Db.js.map +1 -0
- package/dist/db/Schema.d.ts +88 -0
- package/dist/db/Schema.d.ts.map +1 -0
- package/dist/db/Schema.js +130 -0
- package/dist/db/Schema.js.map +1 -0
- package/dist/db/tables/organizations.d.ts +79 -0
- package/dist/db/tables/organizations.d.ts.map +1 -0
- package/dist/db/tables/organizations.js +81 -0
- package/dist/db/tables/organizations.js.map +1 -0
- package/dist/db/tables/verifiedTokens.d.ts +53 -0
- package/dist/db/tables/verifiedTokens.d.ts.map +1 -0
- package/dist/db/tables/verifiedTokens.js +74 -0
- package/dist/db/tables/verifiedTokens.js.map +1 -0
- package/dist/db/tables/webhookDeliveries.d.ts +71 -0
- package/dist/db/tables/webhookDeliveries.d.ts.map +1 -0
- package/dist/db/tables/webhookDeliveries.js +119 -0
- package/dist/db/tables/webhookDeliveries.js.map +1 -0
- package/dist/db/tables/webhookSubscriptions.d.ts +158 -0
- package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -0
- package/dist/db/tables/webhookSubscriptions.js +272 -0
- package/dist/db/tables/webhookSubscriptions.js.map +1 -0
- package/dist/handlers/internal/executionError.d.ts +25 -0
- package/dist/handlers/internal/executionError.d.ts.map +1 -0
- package/dist/handlers/internal/executionError.js +184 -0
- package/dist/handlers/internal/executionError.js.map +1 -0
- package/dist/handlers/internal/multisig.d.ts +237 -0
- package/dist/handlers/internal/multisig.d.ts.map +1 -0
- package/dist/handlers/internal/multisig.js +567 -0
- package/dist/handlers/internal/multisig.js.map +1 -0
- package/dist/handlers/internal/requestListener.d.ts +124 -0
- package/dist/handlers/internal/requestListener.d.ts.map +1 -0
- package/dist/handlers/internal/requestListener.js +173 -0
- package/dist/handlers/internal/requestListener.js.map +1 -0
- package/dist/handlers/internal/sponsorship.d.ts +83 -0
- package/dist/handlers/internal/sponsorship.d.ts.map +1 -0
- package/dist/handlers/internal/sponsorship.js +103 -0
- package/dist/handlers/internal/sponsorship.js.map +1 -0
- package/dist/handlers/internal/types.d.ts +284 -0
- package/dist/handlers/internal/types.d.ts.map +1 -0
- package/dist/handlers/internal/types.js +2 -0
- package/dist/handlers/internal/types.js.map +1 -0
- package/dist/handlers/internal/utils.d.ts +34 -0
- package/dist/handlers/internal/utils.d.ts.map +1 -0
- package/dist/handlers/internal/utils.js +131 -0
- package/dist/handlers/internal/utils.js.map +1 -0
- package/dist/handlers/relay.d.ts +119 -0
- package/dist/handlers/relay.d.ts.map +1 -0
- package/dist/handlers/relay.js +1264 -0
- package/dist/handlers/relay.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/Auth.d.ts +16 -10
- package/dist/internal/Auth.d.ts.map +1 -1
- package/dist/internal/Auth.js +72 -12
- package/dist/internal/Auth.js.map +1 -1
- package/dist/internal/RpcSchema.d.ts +10 -0
- package/dist/internal/RpcSchema.d.ts.map +1 -0
- package/dist/internal/RpcSchema.js +2 -0
- package/dist/internal/RpcSchema.js.map +1 -0
- package/dist/internal/Store.d.ts +42 -3
- package/dist/internal/Store.d.ts.map +1 -1
- package/dist/internal/Store.js +65 -3
- package/dist/internal/Store.js.map +1 -1
- package/dist/internal/VerifiedTokens.d.ts +15 -34
- package/dist/internal/VerifiedTokens.d.ts.map +1 -1
- package/dist/internal/VerifiedTokens.js +115 -159
- package/dist/internal/VerifiedTokens.js.map +1 -1
- package/dist/internal/Webhooks.d.ts +49 -35
- package/dist/internal/Webhooks.d.ts.map +1 -1
- package/dist/internal/Webhooks.js +92 -205
- package/dist/internal/Webhooks.js.map +1 -1
- package/package.json +7 -2
- package/src/ApiKey.test.ts +3 -3
- package/src/ApiKey.ts +10 -12
- package/src/ApiKeys.test.ts +175 -0
- package/src/ApiKeys.ts +205 -0
- package/src/App.test-d.ts +1 -1
- package/src/App.test.ts +10768 -351
- package/src/App.ts +79 -36
- package/src/Client.test-d.ts +1 -1
- package/src/Handler.ts +154 -0
- package/src/Scope.ts +5 -1
- package/src/Webhooks.test.ts +8 -7
- package/src/Webhooks.ts +11 -5
- package/src/admin/Access.ts +1 -3
- package/src/admin/App.ts +19 -24
- package/src/admin/apps/api-keys.test.ts +19 -18
- package/src/admin/apps/api-keys.ts +8 -9
- package/src/admin/apps/scopes.test.ts +4 -0
- package/src/admin/apps/verified-tokens.test.ts +3 -30
- package/src/admin/apps/verified-tokens.ts +17 -36
- package/src/admin/ui.generated.ts +1 -1
- package/src/apps/balances.test.ts +4 -3
- package/src/apps/blocks.test.ts +1 -1
- package/src/apps/exchanges.test.ts +1 -1
- package/src/apps/indexer.test.ts +1 -1
- package/src/apps/receipts.test.ts +1 -1
- package/src/apps/rpc.test.ts +100 -10
- package/src/apps/tokenlist.test.ts +5 -7
- package/src/apps/tokens.test.ts +4 -3
- package/src/apps/transactions.test.ts +1 -1
- package/src/apps/transfers.test.ts +1 -1
- package/src/apps/verified-tokens.test.ts +24 -12
- package/src/apps/webhooks.test.ts +130 -143
- package/src/apps/webhooks.ts +45 -47
- package/src/{Cli.test.ts → cli/Cli.test.ts} +10 -9
- package/src/{Cli.ts → cli/Cli.ts} +16 -9
- package/src/cli/bin.ts +4 -0
- package/src/cli/commands/admin.test.ts +71 -0
- package/src/cli/commands/admin.ts +60 -0
- package/src/cloudflare.ts +10 -0
- package/src/db/Db.test.ts +84 -0
- package/src/db/Db.ts +383 -0
- package/src/db/Schema.ts +164 -0
- package/src/db/tables/organizations.test.ts +124 -0
- package/src/db/tables/organizations.ts +127 -0
- package/src/db/tables/verifiedTokens.ts +111 -0
- package/src/db/tables/webhookDeliveries.ts +159 -0
- package/src/db/tables/webhookSubscriptions.ts +358 -0
- package/src/handlers/internal/executionError.ts +205 -0
- package/src/handlers/internal/multisig.localnet.test.ts +146 -0
- package/src/handlers/internal/multisig.test.ts +744 -0
- package/src/handlers/internal/multisig.ts +858 -0
- package/src/handlers/internal/relay.localnet.test.ts +2035 -0
- package/src/handlers/internal/requestListener.ts +273 -0
- package/src/handlers/internal/sponsorship.ts +186 -0
- package/src/handlers/internal/types.ts +378 -0
- package/src/handlers/internal/utils.ts +153 -0
- package/src/handlers/relay.ts +1605 -0
- package/src/index.ts +4 -2
- package/src/internal/Auth.test.ts +21 -21
- package/src/internal/Auth.ts +92 -19
- package/src/internal/RateLimit.test.ts +1 -1
- package/src/internal/RpcSchema.ts +10 -0
- package/src/internal/Store.test.ts +98 -10
- package/src/internal/Store.ts +112 -6
- package/src/internal/VerifiedTokens.test.ts +99 -115
- package/src/internal/VerifiedTokens.ts +123 -175
- package/src/internal/Webhooks.test.ts +107 -107
- package/src/internal/Webhooks.ts +102 -220
- package/dist/ApiKeySource.d.ts +0 -166
- package/dist/ApiKeySource.d.ts.map +0 -1
- package/dist/ApiKeySource.js +0 -234
- package/dist/ApiKeySource.js.map +0 -1
- package/dist/Cli.d.ts.map +0 -1
- package/dist/Cli.js +0 -13
- package/dist/Cli.js.map +0 -1
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000000.svg +0 -1
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000001.svg +0 -1
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000002.svg +0 -1
- package/seeds/31318/icons/0x20c0000000000000000000000000000000000003.svg +0 -1
- package/seeds/31318/verified-tokens.json +0 -30
- package/seeds/4217/icons/0x20c0000000000000000000000000000000000000.svg +0 -25
- package/seeds/4217/icons/0x20c000000000000000000000048c8f36df1c9a4a.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000000520792dcccccccc.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000000a6da882d075a4c3.svg +0 -4
- package/seeds/4217/icons/0x20c000000000000000000000111111111e910f0f.svg +0 -30
- package/seeds/4217/icons/0x20c00000000000000000000014f22ca97301eb73.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000001621e21f71cf12fb.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000002f52d5cc21a3207b.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000003158081efd85bfc2.svg +0 -11
- package/seeds/4217/icons/0x20c0000000000000000000003554d28269e0f3c2.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000383a23bacb546ab9.svg +0 -1
- package/seeds/4217/icons/0x20c00000000000000000000042109aef2f8b28e1.png +0 -0
- package/seeds/4217/icons/0x20c0000000000000000000005c0bac7cef389a11.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000006fd9a167923ba194.png +0 -0
- package/seeds/4217/icons/0x20c0000000000000000000007f7ba549dd0251b9.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000008191667423f70e67.svg +0 -5
- package/seeds/4217/icons/0x20c0000000000000000000008ee4fcff88888888.svg +0 -1
- package/seeds/4217/icons/0x20c0000000000000000000009a4a4b17e0dc6651.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000ab02d39df30bd17e.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000ae247a1130450f09.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000aeed2ec36a54d0e5.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000b9537d11c60e8b50.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000bd95bfb69fbe6ce3.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000c412ec89d0c08be5.svg +0 -1
- package/seeds/4217/icons/0x20c000000000000000000000f047dd7018e50367.png +0 -0
- package/seeds/4217/verified-tokens.json +0 -177
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000000.svg +0 -25
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000001.svg +0 -1
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000002.svg +0 -1
- package/seeds/42431/icons/0x20c0000000000000000000000000000000000003.svg +0 -1
- package/seeds/42431/icons/0x20c0000000000000000000009e8d7eb59b783726.svg +0 -1
- package/seeds/42431/icons/0x20c000000000000000000000d72572838bbee59c.svg +0 -1
- package/seeds/42431/verified-tokens.json +0 -44
- package/seeds/openrpc/README.md +0 -27
- package/seeds/openrpc/execution-apis.json +0 -8989
- package/src/ApiKeySource.test-d.ts +0 -11
- package/src/ApiKeySource.test.ts +0 -295
- package/src/ApiKeySource.ts +0 -303
|
@@ -1007,6 +1007,37 @@ export declare function transactions(): import("hono/hono-base").HonoBase<App.En
|
|
|
1007
1007
|
'timestamp.to'?: string | string[];
|
|
1008
1008
|
} | undefined;
|
|
1009
1009
|
};
|
|
1010
|
+
} | {
|
|
1011
|
+
output: {
|
|
1012
|
+
error: {
|
|
1013
|
+
code: "upstream_error";
|
|
1014
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
1015
|
+
message: string;
|
|
1016
|
+
};
|
|
1017
|
+
requestId: string;
|
|
1018
|
+
};
|
|
1019
|
+
outputFormat: "json";
|
|
1020
|
+
status: 502;
|
|
1021
|
+
input: {
|
|
1022
|
+
query?: {
|
|
1023
|
+
address?: string | string[];
|
|
1024
|
+
'blockNumber.from'?: string | string[];
|
|
1025
|
+
'blockNumber.to'?: string | string[];
|
|
1026
|
+
chainId?: string | string[];
|
|
1027
|
+
cursor?: string | string[];
|
|
1028
|
+
feePayer?: string | string[];
|
|
1029
|
+
feeToken?: string | string[];
|
|
1030
|
+
include?: string | string[];
|
|
1031
|
+
limit?: string | string[];
|
|
1032
|
+
order?: string | string[];
|
|
1033
|
+
page?: string | string[];
|
|
1034
|
+
recipient?: string | string[];
|
|
1035
|
+
sender?: string | string[];
|
|
1036
|
+
status?: string | string[];
|
|
1037
|
+
'timestamp.from'?: string | string[];
|
|
1038
|
+
'timestamp.to'?: string | string[];
|
|
1039
|
+
} | undefined;
|
|
1040
|
+
};
|
|
1010
1041
|
} | {
|
|
1011
1042
|
output: {
|
|
1012
1043
|
error: {
|
|
@@ -1388,37 +1419,6 @@ export declare function transactions(): import("hono/hono-base").HonoBase<App.En
|
|
|
1388
1419
|
'timestamp.to'?: string | string[];
|
|
1389
1420
|
} | undefined;
|
|
1390
1421
|
};
|
|
1391
|
-
} | {
|
|
1392
|
-
output: {
|
|
1393
|
-
error: {
|
|
1394
|
-
code: "upstream_error";
|
|
1395
|
-
details?: readonly Response.error.Detail[] | undefined;
|
|
1396
|
-
message: string;
|
|
1397
|
-
};
|
|
1398
|
-
requestId: string;
|
|
1399
|
-
};
|
|
1400
|
-
outputFormat: "json";
|
|
1401
|
-
status: 502;
|
|
1402
|
-
input: {
|
|
1403
|
-
query?: {
|
|
1404
|
-
address?: string | string[];
|
|
1405
|
-
'blockNumber.from'?: string | string[];
|
|
1406
|
-
'blockNumber.to'?: string | string[];
|
|
1407
|
-
chainId?: string | string[];
|
|
1408
|
-
cursor?: string | string[];
|
|
1409
|
-
feePayer?: string | string[];
|
|
1410
|
-
feeToken?: string | string[];
|
|
1411
|
-
include?: string | string[];
|
|
1412
|
-
limit?: string | string[];
|
|
1413
|
-
order?: string | string[];
|
|
1414
|
-
page?: string | string[];
|
|
1415
|
-
recipient?: string | string[];
|
|
1416
|
-
sender?: string | string[];
|
|
1417
|
-
status?: string | string[];
|
|
1418
|
-
'timestamp.from'?: string | string[];
|
|
1419
|
-
'timestamp.to'?: string | string[];
|
|
1420
|
-
} | undefined;
|
|
1421
|
-
};
|
|
1422
1422
|
};
|
|
1423
1423
|
};
|
|
1424
1424
|
} & {
|
|
@@ -1440,14 +1440,14 @@ export declare function transactions(): import("hono/hono-base").HonoBase<App.En
|
|
|
1440
1440
|
} | {
|
|
1441
1441
|
output: {
|
|
1442
1442
|
error: {
|
|
1443
|
-
code: "
|
|
1443
|
+
code: "upstream_error";
|
|
1444
1444
|
details?: readonly Response.error.Detail[] | undefined;
|
|
1445
1445
|
message: string;
|
|
1446
1446
|
};
|
|
1447
1447
|
requestId: string;
|
|
1448
1448
|
};
|
|
1449
1449
|
outputFormat: "json";
|
|
1450
|
-
status:
|
|
1450
|
+
status: 502;
|
|
1451
1451
|
input: {
|
|
1452
1452
|
param: {
|
|
1453
1453
|
transactionHash: `0x${string}`;
|
|
@@ -1461,14 +1461,14 @@ export declare function transactions(): import("hono/hono-base").HonoBase<App.En
|
|
|
1461
1461
|
} | {
|
|
1462
1462
|
output: {
|
|
1463
1463
|
error: {
|
|
1464
|
-
code: "
|
|
1464
|
+
code: "api_key_malformed";
|
|
1465
1465
|
details?: readonly Response.error.Detail[] | undefined;
|
|
1466
1466
|
message: string;
|
|
1467
1467
|
};
|
|
1468
1468
|
requestId: string;
|
|
1469
1469
|
};
|
|
1470
1470
|
outputFormat: "json";
|
|
1471
|
-
status:
|
|
1471
|
+
status: 400;
|
|
1472
1472
|
input: {
|
|
1473
1473
|
param: {
|
|
1474
1474
|
transactionHash: `0x${string}`;
|
|
@@ -1482,14 +1482,14 @@ export declare function transactions(): import("hono/hono-base").HonoBase<App.En
|
|
|
1482
1482
|
} | {
|
|
1483
1483
|
output: {
|
|
1484
1484
|
error: {
|
|
1485
|
-
code: "
|
|
1485
|
+
code: "api_key_invalid" | "api_key_missing";
|
|
1486
1486
|
details?: readonly Response.error.Detail[] | undefined;
|
|
1487
1487
|
message: string;
|
|
1488
1488
|
};
|
|
1489
1489
|
requestId: string;
|
|
1490
1490
|
};
|
|
1491
1491
|
outputFormat: "json";
|
|
1492
|
-
status:
|
|
1492
|
+
status: 401;
|
|
1493
1493
|
input: {
|
|
1494
1494
|
param: {
|
|
1495
1495
|
transactionHash: `0x${string}`;
|
|
@@ -1503,14 +1503,14 @@ export declare function transactions(): import("hono/hono-base").HonoBase<App.En
|
|
|
1503
1503
|
} | {
|
|
1504
1504
|
output: {
|
|
1505
1505
|
error: {
|
|
1506
|
-
code: "
|
|
1506
|
+
code: "api_key_forbidden";
|
|
1507
1507
|
details?: readonly Response.error.Detail[] | undefined;
|
|
1508
1508
|
message: string;
|
|
1509
1509
|
};
|
|
1510
1510
|
requestId: string;
|
|
1511
1511
|
};
|
|
1512
1512
|
outputFormat: "json";
|
|
1513
|
-
status:
|
|
1513
|
+
status: 403;
|
|
1514
1514
|
input: {
|
|
1515
1515
|
param: {
|
|
1516
1516
|
transactionHash: `0x${string}`;
|
|
@@ -1524,14 +1524,14 @@ export declare function transactions(): import("hono/hono-base").HonoBase<App.En
|
|
|
1524
1524
|
} | {
|
|
1525
1525
|
output: {
|
|
1526
1526
|
error: {
|
|
1527
|
-
code: "
|
|
1527
|
+
code: "payment_required" | "rate_limit_exceeded";
|
|
1528
1528
|
details?: readonly Response.error.Detail[] | undefined;
|
|
1529
1529
|
message: string;
|
|
1530
1530
|
};
|
|
1531
1531
|
requestId: string;
|
|
1532
1532
|
};
|
|
1533
1533
|
outputFormat: "json";
|
|
1534
|
-
status:
|
|
1534
|
+
status: 429;
|
|
1535
1535
|
input: {
|
|
1536
1536
|
param: {
|
|
1537
1537
|
transactionHash: `0x${string}`;
|
|
@@ -1545,14 +1545,14 @@ export declare function transactions(): import("hono/hono-base").HonoBase<App.En
|
|
|
1545
1545
|
} | {
|
|
1546
1546
|
output: {
|
|
1547
1547
|
error: {
|
|
1548
|
-
code: "
|
|
1548
|
+
code: "query_invalid";
|
|
1549
1549
|
details?: readonly Response.error.Detail[] | undefined;
|
|
1550
1550
|
message: string;
|
|
1551
1551
|
};
|
|
1552
1552
|
requestId: string;
|
|
1553
1553
|
};
|
|
1554
1554
|
outputFormat: "json";
|
|
1555
|
-
status:
|
|
1555
|
+
status: 400;
|
|
1556
1556
|
input: {
|
|
1557
1557
|
param: {
|
|
1558
1558
|
transactionHash: `0x${string}`;
|
package/dist/apps/transfers.d.ts
CHANGED
|
@@ -350,35 +350,6 @@ export declare function transfers(): import("hono/hono-base").HonoBase<App.Envir
|
|
|
350
350
|
'timestamp.to'?: string | string[];
|
|
351
351
|
} | undefined;
|
|
352
352
|
};
|
|
353
|
-
} | {
|
|
354
|
-
output: {
|
|
355
|
-
error: {
|
|
356
|
-
code: "upstream_error";
|
|
357
|
-
details?: readonly Response.error.Detail[] | undefined;
|
|
358
|
-
message: string;
|
|
359
|
-
};
|
|
360
|
-
requestId: string;
|
|
361
|
-
};
|
|
362
|
-
outputFormat: "json";
|
|
363
|
-
status: 502;
|
|
364
|
-
input: {
|
|
365
|
-
query?: {
|
|
366
|
-
recipient?: string | string[];
|
|
367
|
-
sender?: string | string[];
|
|
368
|
-
token?: string | string[];
|
|
369
|
-
address?: string | string[];
|
|
370
|
-
'blockNumber.from'?: string | string[];
|
|
371
|
-
'blockNumber.to'?: string | string[];
|
|
372
|
-
chainId?: string | string[];
|
|
373
|
-
cursor?: string | string[];
|
|
374
|
-
include?: string | string[];
|
|
375
|
-
limit?: string | string[];
|
|
376
|
-
order?: string | string[];
|
|
377
|
-
page?: string | string[];
|
|
378
|
-
'timestamp.from'?: string | string[];
|
|
379
|
-
'timestamp.to'?: string | string[];
|
|
380
|
-
} | undefined;
|
|
381
|
-
};
|
|
382
353
|
} | {
|
|
383
354
|
output: {
|
|
384
355
|
data: {
|
|
@@ -438,6 +409,35 @@ export declare function transfers(): import("hono/hono-base").HonoBase<App.Envir
|
|
|
438
409
|
'timestamp.to'?: string | string[];
|
|
439
410
|
} | undefined;
|
|
440
411
|
};
|
|
412
|
+
} | {
|
|
413
|
+
output: {
|
|
414
|
+
error: {
|
|
415
|
+
code: "upstream_error";
|
|
416
|
+
details?: readonly Response.error.Detail[] | undefined;
|
|
417
|
+
message: string;
|
|
418
|
+
};
|
|
419
|
+
requestId: string;
|
|
420
|
+
};
|
|
421
|
+
outputFormat: "json";
|
|
422
|
+
status: 502;
|
|
423
|
+
input: {
|
|
424
|
+
query?: {
|
|
425
|
+
recipient?: string | string[];
|
|
426
|
+
sender?: string | string[];
|
|
427
|
+
token?: string | string[];
|
|
428
|
+
address?: string | string[];
|
|
429
|
+
'blockNumber.from'?: string | string[];
|
|
430
|
+
'blockNumber.to'?: string | string[];
|
|
431
|
+
chainId?: string | string[];
|
|
432
|
+
cursor?: string | string[];
|
|
433
|
+
include?: string | string[];
|
|
434
|
+
limit?: string | string[];
|
|
435
|
+
order?: string | string[];
|
|
436
|
+
page?: string | string[];
|
|
437
|
+
'timestamp.from'?: string | string[];
|
|
438
|
+
'timestamp.to'?: string | string[];
|
|
439
|
+
} | undefined;
|
|
440
|
+
};
|
|
441
441
|
};
|
|
442
442
|
};
|
|
443
443
|
}, "/", "/">;
|
package/dist/apps/webhooks.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod/mini';
|
|
2
2
|
import type * as App from '../App.js';
|
|
3
|
+
import * as Db from '../db/Db.js';
|
|
3
4
|
import * as Response from '../internal/Response.js';
|
|
4
5
|
import * as Store from '../internal/Store.js';
|
|
5
6
|
import type * as Tidx from '../internal/Tidx.js';
|
|
@@ -7611,12 +7612,16 @@ export declare namespace poll {
|
|
|
7611
7612
|
type Options = {
|
|
7612
7613
|
/** Max matching rows scanned per subscription per tick (default 100). */
|
|
7613
7614
|
batchSize?: number | undefined;
|
|
7615
|
+
/** Cache store for the token-metadata memoize (defaults to a fresh in-memory store; pass a persistent one to share lookups across ticks). */
|
|
7616
|
+
cache?: Store.Store | undefined;
|
|
7614
7617
|
/** Chain to poll. Callers loop over chains. */
|
|
7615
7618
|
chainId: number;
|
|
7616
7619
|
/** viem RPC client for the chain (used by the RPC monitoring scanners). */
|
|
7617
7620
|
client: Viem.getClient.ReturnType;
|
|
7618
7621
|
/** Reorg-safety window: only emit blocks this far behind head (default 2). */
|
|
7619
7622
|
confirmations?: number | undefined;
|
|
7623
|
+
/** Database holding subscriptions + cursors. */
|
|
7624
|
+
db: Db.Db;
|
|
7620
7625
|
/**
|
|
7621
7626
|
* Delivery transport. Defaults to inline {@link Webhooks.deliverAndRecord} (self-host);
|
|
7622
7627
|
* on Cloudflare pass a Queue producer so retry/backoff/DLQ are native.
|
|
@@ -7630,8 +7635,6 @@ export declare namespace poll {
|
|
|
7630
7635
|
maxBlocks?: number | undefined;
|
|
7631
7636
|
/** Clock for envelope timestamps; injectable for tests. */
|
|
7632
7637
|
now?: (() => Date) | undefined;
|
|
7633
|
-
/** Webhook state store (subscriptions + cursors). */
|
|
7634
|
-
store: Store.State;
|
|
7635
7638
|
/** TIDX query client for the legacy `token:transfer` type. */
|
|
7636
7639
|
tidx?: Tidx.Client | undefined;
|
|
7637
7640
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/apps/webhooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,OAAO,KAAK,KAAK,GAAG,MAAM,WAAW,CAAA;AAKrC,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAA;AAEnD,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAA;AAC7C,OAAO,KAAK,KAAK,IAAI,MAAM,qBAAqB,CAAA;AAG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KACtB,CAAA;CACF;AAmDD,4DAA4D;AAC5D,wBAAsB,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEnF;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAMxF;AAmED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAC3C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQzB;AAkDD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,EAAE,EAAE,OAAO,EACX,IAAI,GAAE,QAAQ,GAAG,QAAmB,GACnC,OAAO,CAmBT"}
|
package/dist/apps/webhooks.js
CHANGED
|
@@ -4,6 +4,7 @@ import * as z from 'zod/mini';
|
|
|
4
4
|
import * as Auth from '../internal/Auth.js';
|
|
5
5
|
import * as Cache from '../internal/Cache.js';
|
|
6
6
|
import * as Cursor from '../internal/Cursor.js';
|
|
7
|
+
import * as Db from '../db/Db.js';
|
|
7
8
|
import * as OpenApi from '../internal/OpenApi.js';
|
|
8
9
|
import * as Response from '../internal/Response.js';
|
|
9
10
|
import * as Schema from '../internal/Schema.js';
|
|
@@ -808,14 +809,14 @@ export function webhooks(options = {}) {
|
|
|
808
809
|
message: 'Check the request body and try again.',
|
|
809
810
|
});
|
|
810
811
|
const webhook = c.get('webhook');
|
|
811
|
-
const
|
|
812
|
+
const db = Db.get(c.get('db'));
|
|
812
813
|
const owner = ownerFor(c);
|
|
813
814
|
if (!owner)
|
|
814
815
|
return unauthorized(c);
|
|
815
816
|
const body = c.req.valid('json');
|
|
816
817
|
const chainId = body.chainId ?? c.get('chainId');
|
|
817
818
|
try {
|
|
818
|
-
const subscription = await Webhooks.createSubscription(
|
|
819
|
+
const subscription = await Webhooks.createSubscription(db, {
|
|
819
820
|
chainId,
|
|
820
821
|
...(body.context === undefined ? {} : { context: body.context }),
|
|
821
822
|
destination: body.destination,
|
|
@@ -855,7 +856,7 @@ export function webhooks(options = {}) {
|
|
|
855
856
|
code: 'query_invalid',
|
|
856
857
|
message: 'Check the query parameters and try again.',
|
|
857
858
|
});
|
|
858
|
-
const
|
|
859
|
+
const db = Db.get(c.get('db'));
|
|
859
860
|
const owner = ownerFor(c);
|
|
860
861
|
if (!owner)
|
|
861
862
|
return unauthorized(c);
|
|
@@ -865,11 +866,11 @@ export function webhooks(options = {}) {
|
|
|
865
866
|
// run it concurrently with the page list. Best-effort: a failure
|
|
866
867
|
// omits `meta` rather than failing the page.
|
|
867
868
|
const countPromise = include.includes('totalCount')
|
|
868
|
-
? Webhooks.countSubscriptions(
|
|
869
|
+
? Webhooks.countSubscriptions(db, owner).catch(() => undefined)
|
|
869
870
|
: undefined;
|
|
870
871
|
// Fetch one extra to detect a further page without a second round-trip.
|
|
871
872
|
// `page` translates to a positional slice of `(page - 1) * limit` rows.
|
|
872
|
-
const rows = await Webhooks.listSubscriptions(
|
|
873
|
+
const rows = await Webhooks.listSubscriptions(db, owner, {
|
|
873
874
|
cursor,
|
|
874
875
|
limit: limit + 1,
|
|
875
876
|
offset: page !== undefined && page > 1 ? (page - 1) * limit : undefined,
|
|
@@ -925,13 +926,13 @@ export function webhooks(options = {}) {
|
|
|
925
926
|
code: 'param_invalid',
|
|
926
927
|
message: 'Check the path parameters and try again.',
|
|
927
928
|
});
|
|
928
|
-
const
|
|
929
|
+
const db = Db.get(c.get('db'));
|
|
929
930
|
const owner = ownerFor(c);
|
|
930
931
|
if (!owner)
|
|
931
932
|
return unauthorized(c);
|
|
932
933
|
const { id } = c.req.valid('param');
|
|
933
934
|
try {
|
|
934
|
-
const subscription = await Webhooks.getSubscription(
|
|
935
|
+
const subscription = await Webhooks.getSubscription(db, owner, id);
|
|
935
936
|
if (!subscription)
|
|
936
937
|
return notFound(c);
|
|
937
938
|
return c.json(Response.validated(schema.getWebhook.Response, toPublic(subscription)), 200);
|
|
@@ -979,7 +980,7 @@ export function webhooks(options = {}) {
|
|
|
979
980
|
code: 'query_invalid',
|
|
980
981
|
message: 'Check the query parameters and try again.',
|
|
981
982
|
});
|
|
982
|
-
const
|
|
983
|
+
const db = Db.get(c.get('db'));
|
|
983
984
|
const owner = ownerFor(c);
|
|
984
985
|
if (!owner)
|
|
985
986
|
return unauthorized(c);
|
|
@@ -988,18 +989,18 @@ export function webhooks(options = {}) {
|
|
|
988
989
|
try {
|
|
989
990
|
// Owner-scope first: resolving the subscription under the caller's owner
|
|
990
991
|
// key 404s ids they don't own (indistinguishable from "doesn't exist").
|
|
991
|
-
const subscription = await Webhooks.getSubscription(
|
|
992
|
+
const subscription = await Webhooks.getSubscription(db, owner, id);
|
|
992
993
|
if (!subscription)
|
|
993
994
|
return notFound(c);
|
|
994
995
|
// `totalCount` is opt-in and exact (the delivery log is TTL-bounded);
|
|
995
996
|
// run it concurrently with the page list. Best-effort: a failure
|
|
996
997
|
// omits `meta` rather than failing the page.
|
|
997
998
|
const countPromise = include.includes('totalCount')
|
|
998
|
-
? Webhooks.countDeliveries(
|
|
999
|
+
? Webhooks.countDeliveries(db, id).catch(() => undefined)
|
|
999
1000
|
: undefined;
|
|
1000
1001
|
// Fetch one extra to detect a further page without a second round-trip.
|
|
1001
1002
|
// `page` translates to a positional slice of `(page - 1) * limit` rows.
|
|
1002
|
-
const rows = await Webhooks.listDeliveries(
|
|
1003
|
+
const rows = await Webhooks.listDeliveries(db, id, {
|
|
1003
1004
|
cursor,
|
|
1004
1005
|
limit: limit + 1,
|
|
1005
1006
|
offset: page !== undefined && page > 1 ? (page - 1) * limit : undefined,
|
|
@@ -1051,20 +1052,20 @@ export function webhooks(options = {}) {
|
|
|
1051
1052
|
code: 'param_invalid',
|
|
1052
1053
|
message: 'Check the path parameters and try again.',
|
|
1053
1054
|
});
|
|
1054
|
-
const
|
|
1055
|
+
const db = Db.get(c.get('db'));
|
|
1055
1056
|
const owner = ownerFor(c);
|
|
1056
1057
|
if (!owner)
|
|
1057
1058
|
return unauthorized(c);
|
|
1058
1059
|
const { id } = c.req.valid('param');
|
|
1059
1060
|
try {
|
|
1060
1061
|
// Owner-scope first so unowned/unknown ids are indistinguishable (404).
|
|
1061
|
-
const subscription = await Webhooks.getSubscription(
|
|
1062
|
+
const subscription = await Webhooks.getSubscription(db, owner, id);
|
|
1062
1063
|
if (!subscription)
|
|
1063
1064
|
return notFound(c);
|
|
1064
1065
|
// Inline delivery (not the queue) so the caller gets an immediate
|
|
1065
1066
|
// result. `ping` never mutates the subscription's failure/lifecycle
|
|
1066
1067
|
// state — a test must not disable a healthy endpoint.
|
|
1067
|
-
const { envelope, result } = await Webhooks.ping(
|
|
1068
|
+
const { envelope, result } = await Webhooks.ping(db, subscription);
|
|
1068
1069
|
return c.json(Response.validated(schema.pingWebhook.Response, {
|
|
1069
1070
|
delivered: result.ok,
|
|
1070
1071
|
eventId: envelope.id,
|
|
@@ -1108,17 +1109,17 @@ export function webhooks(options = {}) {
|
|
|
1108
1109
|
code: 'param_invalid',
|
|
1109
1110
|
message: 'Check the path parameters and try again.',
|
|
1110
1111
|
});
|
|
1111
|
-
const
|
|
1112
|
+
const db = Db.get(c.get('db'));
|
|
1112
1113
|
const owner = ownerFor(c);
|
|
1113
1114
|
if (!owner)
|
|
1114
1115
|
return unauthorized(c);
|
|
1115
1116
|
const { deliveryId, id } = c.req.valid('param');
|
|
1116
1117
|
try {
|
|
1117
1118
|
// Owner-scope the subscription first so unowned ids 404 like elsewhere.
|
|
1118
|
-
const subscription = await Webhooks.getSubscription(
|
|
1119
|
+
const subscription = await Webhooks.getSubscription(db, owner, id);
|
|
1119
1120
|
if (!subscription)
|
|
1120
1121
|
return notFound(c);
|
|
1121
|
-
const delivery = await Webhooks.getDelivery(
|
|
1122
|
+
const delivery = await Webhooks.getDelivery(db, id, deliveryId);
|
|
1122
1123
|
if (!delivery)
|
|
1123
1124
|
return Response.error(c, {
|
|
1124
1125
|
code: 'delivery_not_found',
|
|
@@ -1127,7 +1128,7 @@ export function webhooks(options = {}) {
|
|
|
1127
1128
|
});
|
|
1128
1129
|
// Replay the exact persisted envelope inline. Unlike `ping`, this is a
|
|
1129
1130
|
// real event, so the outcome updates the subscription's failure state.
|
|
1130
|
-
const result = await Webhooks.deliverAndRecord(
|
|
1131
|
+
const result = await Webhooks.deliverAndRecord(db, subscription, delivery.envelope);
|
|
1131
1132
|
return c.json(Response.validated(schema.retryWebhookDelivery.Response, {
|
|
1132
1133
|
delivered: result.ok,
|
|
1133
1134
|
eventId: delivery.envelope.id,
|
|
@@ -1179,7 +1180,7 @@ export function webhooks(options = {}) {
|
|
|
1179
1180
|
code: 'body_invalid',
|
|
1180
1181
|
message: 'Check the request body and try again.',
|
|
1181
1182
|
});
|
|
1182
|
-
const
|
|
1183
|
+
const db = Db.get(c.get('db'));
|
|
1183
1184
|
const owner = ownerFor(c);
|
|
1184
1185
|
if (!owner)
|
|
1185
1186
|
return unauthorized(c);
|
|
@@ -1192,12 +1193,12 @@ export function webhooks(options = {}) {
|
|
|
1192
1193
|
// persisting — otherwise a bad filter would silently widen the match
|
|
1193
1194
|
// set at scan time.
|
|
1194
1195
|
if (patch.filters !== undefined) {
|
|
1195
|
-
const existing = await Webhooks.getSubscription(
|
|
1196
|
+
const existing = await Webhooks.getSubscription(db, owner, id);
|
|
1196
1197
|
if (!existing)
|
|
1197
1198
|
return notFound(c);
|
|
1198
1199
|
parseFilters(existing.eventType, patch.filters);
|
|
1199
1200
|
}
|
|
1200
|
-
const subscription = await Webhooks.updateSubscription(
|
|
1201
|
+
const subscription = await Webhooks.updateSubscription(db, owner, id, patch);
|
|
1201
1202
|
if (!subscription)
|
|
1202
1203
|
return notFound(c);
|
|
1203
1204
|
return c.json(Response.validated(schema.updateWebhook.Response, toPublic(subscription)), 200);
|
|
@@ -1237,13 +1238,13 @@ export function webhooks(options = {}) {
|
|
|
1237
1238
|
code: 'param_invalid',
|
|
1238
1239
|
message: 'Check the path parameters and try again.',
|
|
1239
1240
|
});
|
|
1240
|
-
const
|
|
1241
|
+
const db = Db.get(c.get('db'));
|
|
1241
1242
|
const owner = ownerFor(c);
|
|
1242
1243
|
if (!owner)
|
|
1243
1244
|
return unauthorized(c);
|
|
1244
1245
|
const { id } = c.req.valid('param');
|
|
1245
1246
|
try {
|
|
1246
|
-
const deleted = await Webhooks.deleteSubscription(
|
|
1247
|
+
const deleted = await Webhooks.deleteSubscription(db, owner, id);
|
|
1247
1248
|
if (!deleted)
|
|
1248
1249
|
return notFound(c);
|
|
1249
1250
|
return c.json(Response.validated(schema.deleteWebhook.Response, { id }), 200);
|
|
@@ -1281,13 +1282,13 @@ const endOfBlockIndex = 2_147_483_647;
|
|
|
1281
1282
|
* pauses that subscription at the last good position and the next tick resumes.
|
|
1282
1283
|
*/
|
|
1283
1284
|
export async function poll(options) {
|
|
1284
|
-
const { batchSize = 100, chainId, client, confirmations = 2, eventTypes = ['token:transfer', 'transaction:included', 'log:emitted', 'block:created'], maxBlocks = 1_000,
|
|
1285
|
+
const { batchSize = 100, cache: cache_metadata = Store.memory(), chainId, client, confirmations = 2, db, eventTypes = ['token:transfer', 'transaction:included', 'log:emitted', 'block:created'], maxBlocks = 1_000, tidx, } = options;
|
|
1285
1286
|
const now = options.now ?? (() => new Date());
|
|
1286
1287
|
// Default (self-host) transport: deliver inline and record the outcome so a
|
|
1287
1288
|
// sustained-failure subscription auto-disables. On Cloudflare, callers pass a
|
|
1288
1289
|
// Queue producer instead and the consumer runs `deliverAndRecord`.
|
|
1289
1290
|
const dispatch = options.dispatch ??
|
|
1290
|
-
(({ envelope, subscription }) => Webhooks.deliverAndRecord(
|
|
1291
|
+
(({ envelope, subscription }) => Webhooks.deliverAndRecord(db, subscription, envelope));
|
|
1291
1292
|
// Head resolution is lazy and per-source. RPC types work back from the live
|
|
1292
1293
|
// RPC head; the legacy TIDX types from the indexed head (never ahead of the
|
|
1293
1294
|
// indexer). A pinned `headBlockNumber` (tests) overrides both.
|
|
@@ -1297,6 +1298,9 @@ export async function poll(options) {
|
|
|
1297
1298
|
let tidxHead = override === undefined ? undefined : Number(override);
|
|
1298
1299
|
const resolveTidxHead = async () => (tidxHead ??= tidx ? await getIndexedHead(tidx, chainId) : await resolveRpcHead());
|
|
1299
1300
|
const rpcSafeBlock = Math.max(0, (await resolveRpcHead()) - confirmations);
|
|
1301
|
+
// Reclaim expired rows (MPP-owned subscriptions, aged delivery logs) once
|
|
1302
|
+
// per tick; reads filter expiry at query time, so this is hygiene only.
|
|
1303
|
+
await Webhooks.pruneExpired(db, { now }).catch(() => { });
|
|
1300
1304
|
// Per-tick lazy cache so multiple subscriptions of the same/related types
|
|
1301
1305
|
// share fetched blocks and receipts instead of refetching the same window.
|
|
1302
1306
|
const cache = createChainCache(client);
|
|
@@ -1311,15 +1315,15 @@ export async function poll(options) {
|
|
|
1311
1315
|
for (const eventType of eventTypes) {
|
|
1312
1316
|
const legacy = eventType === 'token:transfer';
|
|
1313
1317
|
const safeBlock = legacy ? Math.max(0, (await resolveTidxHead()) - confirmations) : rpcSafeBlock;
|
|
1314
|
-
const subscriptions = await Webhooks.listActive(
|
|
1318
|
+
const subscriptions = await Webhooks.listActive(db, chainId, eventType);
|
|
1315
1319
|
for (const subscription of subscriptions) {
|
|
1316
1320
|
result.subscriptions++;
|
|
1317
|
-
const cursor = await Webhooks.getCursor(
|
|
1321
|
+
const cursor = await Webhooks.getCursor(db, subscription.id);
|
|
1318
1322
|
if (cursor === null) {
|
|
1319
1323
|
// First time we've seen this subscription: anchor it at the head of the
|
|
1320
1324
|
// confirmed window so we never backfill from genesis. Events start
|
|
1321
1325
|
// flowing from the next tick onward.
|
|
1322
|
-
await Webhooks.setCursor(
|
|
1326
|
+
await Webhooks.setCursor(db, subscription.id, Cursor.encode([safeBlock, endOfBlockIndex]));
|
|
1323
1327
|
continue;
|
|
1324
1328
|
}
|
|
1325
1329
|
const page = await scanSubscription({
|
|
@@ -1340,7 +1344,7 @@ export async function poll(options) {
|
|
|
1340
1344
|
// downstream destinations (Slack human amounts, richer `url`/`betterstack`
|
|
1341
1345
|
// payloads) can render `amount` in token units. Non-fatal on failure.
|
|
1342
1346
|
const data = eventType === 'token:transfer'
|
|
1343
|
-
? await withTokenMetadata(item.data, { chainId, client
|
|
1347
|
+
? await withTokenMetadata(item.data, { cache: cache_metadata, chainId, client })
|
|
1344
1348
|
: item.data;
|
|
1345
1349
|
const envelope = Webhooks.buildEnvelope({
|
|
1346
1350
|
blockNumber: item.cursor[0],
|
|
@@ -1365,14 +1369,14 @@ export async function poll(options) {
|
|
|
1365
1369
|
// a complete empty page — to the end of the confirmed window.
|
|
1366
1370
|
if (failed) {
|
|
1367
1371
|
if (accepted)
|
|
1368
|
-
await Webhooks.setCursor(
|
|
1372
|
+
await Webhooks.setCursor(db, subscription.id, Cursor.encode([...accepted]));
|
|
1369
1373
|
}
|
|
1370
1374
|
else if (page.scannedThrough !== undefined)
|
|
1371
|
-
await Webhooks.setCursor(
|
|
1375
|
+
await Webhooks.setCursor(db, subscription.id, Cursor.encode([page.scannedThrough, endOfBlockIndex]));
|
|
1372
1376
|
else if (accepted)
|
|
1373
|
-
await Webhooks.setCursor(
|
|
1377
|
+
await Webhooks.setCursor(db, subscription.id, Cursor.encode([...accepted]));
|
|
1374
1378
|
else if (!page.hasMore)
|
|
1375
|
-
await Webhooks.setCursor(
|
|
1379
|
+
await Webhooks.setCursor(db, subscription.id, Cursor.encode([safeBlock, endOfBlockIndex]));
|
|
1376
1380
|
}
|
|
1377
1381
|
}
|
|
1378
1382
|
return result;
|
|
@@ -1405,7 +1409,7 @@ async function resolveTokenMetadata(address, deps) {
|
|
|
1405
1409
|
return { decimals: meta.decimals, symbol: meta.symbol };
|
|
1406
1410
|
}, {
|
|
1407
1411
|
key: `webhook:token-meta:v1:${deps.chainId}:${address}`,
|
|
1408
|
-
store: deps.
|
|
1412
|
+
store: deps.cache,
|
|
1409
1413
|
ttl: Ttl.minutes(5),
|
|
1410
1414
|
});
|
|
1411
1415
|
}
|