tapimo 0.11.0 → 0.12.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/dist/App.d.ts +2296 -1010
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +2 -2
- package/dist/App.js.map +1 -1
- package/dist/Assets.d.ts +15 -0
- package/dist/Assets.d.ts.map +1 -1
- package/dist/Assets.js +7 -0
- package/dist/Assets.js.map +1 -1
- package/dist/admin/App.d.ts +53 -4
- package/dist/admin/App.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.d.ts +4 -4
- package/dist/admin/apps/earn-vaults.d.ts +114 -0
- package/dist/admin/apps/earn-vaults.d.ts.map +1 -1
- package/dist/admin/apps/earn-vaults.js +59 -6
- package/dist/admin/apps/earn-vaults.js.map +1 -1
- package/dist/admin/apps/organizations.d.ts.map +1 -1
- package/dist/admin/apps/organizations.js +4 -2
- package/dist/admin/apps/organizations.js.map +1 -1
- package/dist/admin/apps/verified-tokens.d.ts +9 -9
- package/dist/admin/ui.generated.d.ts +1 -1
- package/dist/admin/ui.generated.d.ts.map +1 -1
- package/dist/admin/ui.generated.js +151 -151
- package/dist/admin/ui.generated.js.map +1 -1
- package/dist/apps/data/App.d.ts +1699 -749
- package/dist/apps/data/App.d.ts.map +1 -1
- package/dist/apps/data/App.js +56 -7
- package/dist/apps/data/App.js.map +1 -1
- package/dist/apps/data/ZoneSelection.d.ts +62 -0
- package/dist/apps/data/ZoneSelection.d.ts.map +1 -0
- package/dist/apps/data/ZoneSelection.js +44 -0
- package/dist/apps/data/ZoneSelection.js.map +1 -0
- package/dist/apps/data/routes/activities.d.ts +2367 -4
- package/dist/apps/data/routes/activities.d.ts.map +1 -1
- package/dist/apps/data/routes/activities.js +368 -87
- package/dist/apps/data/routes/activities.js.map +1 -1
- package/dist/apps/data/routes/addresses.d.ts +471 -340
- package/dist/apps/data/routes/addresses.d.ts.map +1 -1
- package/dist/apps/data/routes/balances.d.ts +28 -28
- package/dist/apps/data/routes/balances.js +1 -1
- package/dist/apps/data/routes/balances.js.map +1 -1
- package/dist/apps/data/routes/blocks.d.ts +4 -4
- package/dist/apps/data/routes/blocks.js +1 -1
- package/dist/apps/data/routes/blocks.js.map +1 -1
- package/dist/apps/data/routes/coingecko.d.ts +176 -176
- package/dist/apps/data/routes/earn.d.ts +131 -6
- package/dist/apps/data/routes/earn.d.ts.map +1 -1
- package/dist/apps/data/routes/earn.js +157 -25
- package/dist/apps/data/routes/earn.js.map +1 -1
- package/dist/apps/data/routes/exchanges.d.ts +825 -119
- package/dist/apps/data/routes/exchanges.d.ts.map +1 -1
- package/dist/apps/data/routes/exchanges.js +16 -13
- package/dist/apps/data/routes/exchanges.js.map +1 -1
- package/dist/apps/data/routes/fee-amm.d.ts.map +1 -1
- package/dist/apps/data/routes/fee-amm.js +9 -11
- package/dist/apps/data/routes/fee-amm.js.map +1 -1
- package/dist/apps/data/routes/indexer.d.ts +34 -34
- package/dist/apps/data/routes/receipts.d.ts +230 -230
- package/dist/apps/data/routes/receipts.js +1 -1
- package/dist/apps/data/routes/receipts.js.map +1 -1
- package/dist/apps/data/routes/rpc.js +24 -10
- package/dist/apps/data/routes/rpc.js.map +1 -1
- package/dist/apps/data/routes/tokenlist.d.ts.map +1 -1
- package/dist/apps/data/routes/tokenlist.js +16 -15
- package/dist/apps/data/routes/tokenlist.js.map +1 -1
- package/dist/apps/data/routes/tokens.d.ts +14 -0
- package/dist/apps/data/routes/tokens.d.ts.map +1 -1
- package/dist/apps/data/routes/tokens.js +34 -15
- package/dist/apps/data/routes/tokens.js.map +1 -1
- package/dist/apps/data/routes/transactions.js +1 -1
- package/dist/apps/data/routes/transactions.js.map +1 -1
- package/dist/apps/data/routes/transfers.d.ts.map +1 -1
- package/dist/apps/data/routes/transfers.js +7 -9
- package/dist/apps/data/routes/transfers.js.map +1 -1
- package/dist/apps/data/routes/webhooks.d.ts +4 -4
- package/dist/apps/data/routes/webhooks.d.ts.map +1 -1
- package/dist/apps/data/routes/webhooks.js +2 -2
- package/dist/apps/data/routes/webhooks.js.map +1 -1
- package/dist/apps/data/routes/zones.d.ts +30 -30
- package/dist/apps/funding/App.d.ts +27 -27
- package/dist/apps/funding/routes/chains.d.ts.map +1 -1
- package/dist/apps/funding/routes/chains.js +5 -4
- package/dist/apps/funding/routes/chains.js.map +1 -1
- package/dist/apps/funding/routes/deposit-addresses.d.ts +16 -16
- package/dist/apps/funding/routes/deposit-addresses.d.ts.map +1 -1
- package/dist/apps/funding/routes/deposit-addresses.js +8 -8
- package/dist/apps/funding/routes/deposit-addresses.js.map +1 -1
- package/dist/apps/funding/routes/providers.d.ts +13 -13
- package/dist/apps/funding/routes/providers.d.ts.map +1 -1
- package/dist/apps/funding/routes/providers.js +3 -2
- package/dist/apps/funding/routes/providers.js.map +1 -1
- package/dist/apps/funding/routes/quotes.d.ts.map +1 -1
- package/dist/apps/funding/routes/quotes.js +2 -2
- package/dist/apps/funding/routes/quotes.js.map +1 -1
- package/dist/apps/management/App.d.ts +627 -293
- package/dist/apps/management/App.d.ts.map +1 -1
- package/dist/apps/management/Billing.d.ts.map +1 -1
- package/dist/apps/management/Billing.js +19 -6
- package/dist/apps/management/Billing.js.map +1 -1
- package/dist/apps/management/routes/api-keys.d.ts +114 -54
- package/dist/apps/management/routes/api-keys.d.ts.map +1 -1
- package/dist/apps/management/routes/api-keys.js +76 -30
- package/dist/apps/management/routes/api-keys.js.map +1 -1
- package/dist/apps/management/routes/billing.d.ts +103 -30
- package/dist/apps/management/routes/billing.d.ts.map +1 -1
- package/dist/apps/management/routes/billing.js +91 -32
- package/dist/apps/management/routes/billing.js.map +1 -1
- package/dist/apps/management/routes/faucet.d.ts +33 -33
- package/dist/apps/management/routes/faucet.d.ts.map +1 -1
- package/dist/apps/management/routes/faucet.js +23 -12
- package/dist/apps/management/routes/faucet.js.map +1 -1
- package/dist/apps/management/routes/invitations.d.ts +46 -13
- package/dist/apps/management/routes/invitations.d.ts.map +1 -1
- package/dist/apps/management/routes/invitations.js +79 -29
- package/dist/apps/management/routes/invitations.js.map +1 -1
- package/dist/apps/management/routes/invite-links.d.ts +86 -41
- package/dist/apps/management/routes/invite-links.d.ts.map +1 -1
- package/dist/apps/management/routes/invite-links.js +100 -41
- package/dist/apps/management/routes/invite-links.js.map +1 -1
- package/dist/apps/management/routes/me.d.ts +5 -5
- package/dist/apps/management/routes/me.d.ts.map +1 -1
- package/dist/apps/management/routes/me.js +14 -10
- package/dist/apps/management/routes/me.js.map +1 -1
- package/dist/apps/management/routes/members.d.ts +93 -72
- package/dist/apps/management/routes/members.d.ts.map +1 -1
- package/dist/apps/management/routes/members.js +37 -18
- package/dist/apps/management/routes/members.js.map +1 -1
- package/dist/apps/management/routes/orgs.d.ts +48 -8
- package/dist/apps/management/routes/orgs.d.ts.map +1 -1
- package/dist/apps/management/routes/orgs.js +48 -19
- package/dist/apps/management/routes/orgs.js.map +1 -1
- package/dist/apps/management/routes/projects.d.ts +90 -28
- package/dist/apps/management/routes/projects.d.ts.map +1 -1
- package/dist/apps/management/routes/projects.js +72 -21
- package/dist/apps/management/routes/projects.js.map +1 -1
- package/dist/apps/management/routes/scopes.d.ts.map +1 -1
- package/dist/apps/management/routes/scopes.js +8 -5
- package/dist/apps/management/routes/scopes.js.map +1 -1
- package/dist/apps/management/routes/usage.d.ts +78 -78
- package/dist/apps/management/routes/usage.d.ts.map +1 -1
- package/dist/apps/management/routes/usage.js +41 -31
- package/dist/apps/management/routes/usage.js.map +1 -1
- package/dist/apps/management/routes/verified-token-requests.d.ts +34 -6
- package/dist/apps/management/routes/verified-token-requests.d.ts.map +1 -1
- package/dist/apps/management/routes/verified-token-requests.js +36 -17
- package/dist/apps/management/routes/verified-token-requests.js.map +1 -1
- package/dist/apps/management/routes/webhooks.d.ts +147 -130
- package/dist/apps/management/routes/webhooks.d.ts.map +1 -1
- package/dist/apps/management/routes/webhooks.js +80 -35
- package/dist/apps/management/routes/webhooks.js.map +1 -1
- package/dist/apps/mpp/internal/Adapter.d.ts +1 -1
- package/dist/apps/mpp/internal/Adapter.d.ts.map +1 -1
- package/dist/apps/mpp/internal/Adapter.js +12 -0
- package/dist/apps/mpp/internal/Adapter.js.map +1 -1
- package/dist/db/Db.d.ts +2 -0
- package/dist/db/Db.d.ts.map +1 -1
- package/dist/db/Db.js +40 -0
- package/dist/db/Db.js.map +1 -1
- package/dist/db/Schema.d.ts +23 -1
- package/dist/db/Schema.d.ts.map +1 -1
- package/dist/db/Schema.js +19 -3
- package/dist/db/Schema.js.map +1 -1
- package/dist/db/tables/earnVaults.d.ts +5 -1
- package/dist/db/tables/earnVaults.d.ts.map +1 -1
- package/dist/db/tables/earnVaults.js +5 -0
- package/dist/db/tables/earnVaults.js.map +1 -1
- package/dist/db/tables/webhookDeliveries.d.ts.map +1 -1
- package/dist/db/tables/webhookDeliveries.js +10 -0
- package/dist/db/tables/webhookDeliveries.js.map +1 -1
- package/dist/db/tables/webhookQueueCompletions.d.ts +15 -0
- package/dist/db/tables/webhookQueueCompletions.d.ts.map +1 -0
- package/dist/db/tables/webhookQueueCompletions.js +32 -0
- package/dist/db/tables/webhookQueueCompletions.js.map +1 -0
- package/dist/db/tables/webhookQueueEvents.d.ts +14 -20
- package/dist/db/tables/webhookQueueEvents.d.ts.map +1 -1
- package/dist/db/tables/webhookQueueEvents.js +68 -47
- package/dist/db/tables/webhookQueueEvents.js.map +1 -1
- package/dist/db/tables/webhookSubscriptions.d.ts +16 -5
- package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -1
- package/dist/db/tables/webhookSubscriptions.js +29 -5
- package/dist/db/tables/webhookSubscriptions.js.map +1 -1
- package/dist/internal/Auth.d.ts +8 -1
- package/dist/internal/Auth.d.ts.map +1 -1
- package/dist/internal/Auth.js +13 -3
- package/dist/internal/Auth.js.map +1 -1
- package/dist/internal/Cache.d.ts.map +1 -1
- package/dist/internal/Cache.js +11 -7
- package/dist/internal/Cache.js.map +1 -1
- package/dist/internal/EarnVaults.d.ts +41 -2
- package/dist/internal/EarnVaults.d.ts.map +1 -1
- package/dist/internal/EarnVaults.js +167 -0
- package/dist/internal/EarnVaults.js.map +1 -1
- package/dist/internal/OpenApi.d.ts +26 -22
- package/dist/internal/OpenApi.d.ts.map +1 -1
- package/dist/internal/OpenApi.js +128 -39
- package/dist/internal/OpenApi.js.map +1 -1
- package/dist/internal/Response.d.ts +13 -8
- package/dist/internal/Response.d.ts.map +1 -1
- package/dist/internal/Response.js +16 -5
- package/dist/internal/Response.js.map +1 -1
- package/dist/internal/Schema.d.ts +5 -7
- package/dist/internal/Schema.d.ts.map +1 -1
- package/dist/internal/Schema.js +6 -7
- package/dist/internal/Schema.js.map +1 -1
- package/dist/internal/Store.d.ts +15 -6
- package/dist/internal/Store.d.ts.map +1 -1
- package/dist/internal/Store.js +45 -15
- package/dist/internal/Store.js.map +1 -1
- package/dist/internal/Tidx.d.ts +2 -0
- package/dist/internal/Tidx.d.ts.map +1 -1
- package/dist/internal/Tidx.js +16 -4
- package/dist/internal/Tidx.js.map +1 -1
- package/dist/internal/Webhooks.d.ts +29 -12
- package/dist/internal/Webhooks.d.ts.map +1 -1
- package/dist/internal/Webhooks.js +37 -20
- package/dist/internal/Webhooks.js.map +1 -1
- package/dist/internal/funding/Deposit.d.ts +2 -2
- package/dist/internal/funding/Deposit.d.ts.map +1 -1
- package/dist/internal/funding/Deposit.js +9 -8
- package/dist/internal/funding/Deposit.js.map +1 -1
- package/dist/internal/funding/DepositAddress.d.ts +4 -4
- package/dist/internal/funding/DepositAddress.d.ts.map +1 -1
- package/dist/internal/funding/DepositAddress.js +9 -8
- package/dist/internal/funding/DepositAddress.js.map +1 -1
- package/dist/internal/funding/Provider.d.ts.map +1 -1
- package/dist/internal/funding/Provider.js +13 -12
- package/dist/internal/funding/Provider.js.map +1 -1
- package/dist/internal/funding/providers/stargate.d.ts +19 -0
- package/dist/internal/funding/providers/stargate.d.ts.map +1 -0
- package/dist/internal/funding/providers/stargate.js +143 -0
- package/dist/internal/funding/providers/stargate.js.map +1 -0
- package/dist/providers/index.d.ts +7 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +3 -0
- package/dist/providers/index.js.map +1 -1
- package/package.json +2 -2
- package/src/App.test.ts +48 -0
- package/src/App.ts +4 -2
- package/src/Assets.test.ts +18 -0
- package/src/Assets.ts +22 -0
- package/src/Client.test-d.ts +265 -16
- package/src/admin/apps/earn-vaults.test.ts +143 -0
- package/src/admin/apps/earn-vaults.ts +83 -6
- package/src/admin/apps/organizations.ts +6 -2
- package/src/admin/ui/src/routes/api-keys.tsx +36 -0
- package/src/admin/ui.generated.ts +151 -189
- package/src/apps/data/App.test.ts +31 -0
- package/src/apps/data/App.ts +56 -8
- package/src/apps/data/ZoneSelection.test.ts +196 -0
- package/src/apps/data/ZoneSelection.ts +108 -0
- package/src/apps/data/routes/activities.test.ts +328 -1
- package/src/apps/data/routes/activities.ts +498 -93
- package/src/apps/data/routes/balances.ts +1 -1
- package/src/apps/data/routes/blocks.ts +1 -1
- package/src/apps/data/routes/earn.test.ts +183 -23
- package/src/apps/data/routes/earn.ts +225 -29
- package/src/apps/data/routes/earn.zone-access.test.ts +46 -0
- package/src/apps/data/routes/exchanges.test.ts +31 -1
- package/src/apps/data/routes/exchanges.ts +19 -15
- package/src/apps/data/routes/fee-amm.ts +18 -11
- package/src/apps/data/routes/receipts.ts +1 -1
- package/src/apps/data/routes/rpc.test.ts +75 -0
- package/src/apps/data/routes/rpc.ts +23 -9
- package/src/apps/data/routes/tokenlist.ts +21 -18
- package/src/apps/data/routes/tokens.test.ts +29 -0
- package/src/apps/data/routes/tokens.ts +38 -15
- package/src/apps/data/routes/transactions.ts +1 -1
- package/src/apps/data/routes/transfers.test.ts +3 -3
- package/src/apps/data/routes/transfers.ts +12 -9
- package/src/apps/data/routes/webhooks.ts +6 -2
- package/src/apps/data/routes/zones.test.ts +19 -13
- package/src/apps/funding/routes/chains.test.ts +211 -7
- package/src/apps/funding/routes/chains.ts +19 -12
- package/src/apps/funding/routes/deposit-addresses.test.ts +394 -0
- package/src/apps/funding/routes/deposit-addresses.ts +84 -72
- package/src/apps/funding/routes/providers.ts +9 -5
- package/src/apps/funding/routes/quotes.test.ts +46 -0
- package/src/apps/funding/routes/quotes.ts +8 -5
- package/src/apps/funding/routes/transfers.test.ts +35 -32
- package/src/apps/management/Billing.test.ts +26 -0
- package/src/apps/management/Billing.ts +24 -7
- package/src/apps/management/routes/api-keys.test.ts +178 -0
- package/src/apps/management/routes/api-keys.ts +203 -144
- package/src/apps/management/routes/billing.test.ts +209 -0
- package/src/apps/management/routes/billing.ts +254 -177
- package/src/apps/management/routes/faucet.test.ts +39 -0
- package/src/apps/management/routes/faucet.ts +75 -41
- package/src/apps/management/routes/invitations.test.ts +216 -0
- package/src/apps/management/routes/invitations.ts +186 -109
- package/src/apps/management/routes/invite-links.test.ts +263 -1
- package/src/apps/management/routes/invite-links.ts +295 -214
- package/src/apps/management/routes/me.test.ts +49 -0
- package/src/apps/management/routes/me.ts +42 -32
- package/src/apps/management/routes/members.test.ts +124 -1
- package/src/apps/management/routes/members.ts +81 -51
- package/src/apps/management/routes/orgs.test.ts +176 -0
- package/src/apps/management/routes/orgs.ts +101 -59
- package/src/apps/management/routes/projects.test.ts +183 -0
- package/src/apps/management/routes/projects.ts +124 -60
- package/src/apps/management/routes/scopes.test.ts +44 -0
- package/src/apps/management/routes/scopes.ts +37 -28
- package/src/apps/management/routes/usage.test.ts +92 -0
- package/src/apps/management/routes/usage.ts +186 -151
- package/src/apps/management/routes/verified-token-requests.test.ts +114 -0
- package/src/apps/management/routes/verified-token-requests.ts +166 -133
- package/src/apps/management/routes/webhooks.test.ts +234 -0
- package/src/apps/management/routes/webhooks.ts +191 -78
- package/src/apps/mpp/internal/Adapter.ts +13 -1
- package/src/db/Db.test.ts +41 -0
- package/src/db/Db.ts +62 -0
- package/src/db/Schema.ts +28 -3
- package/src/db/tables/earnVaults.test.ts +22 -0
- package/src/db/tables/earnVaults.ts +11 -1
- package/src/db/tables/webhookDeliveries.ts +13 -0
- package/src/db/tables/webhookQueueCompletions.ts +55 -0
- package/src/db/tables/webhookQueueEvents.ts +95 -61
- package/src/db/tables/webhookSubscriptions.ts +45 -6
- package/src/internal/Auth.ts +23 -5
- package/src/internal/Cache.ts +14 -7
- package/src/internal/EarnVaults.capabilities.test.ts +33 -0
- package/src/internal/EarnVaults.test.ts +79 -0
- package/src/internal/EarnVaults.ts +277 -0
- package/src/internal/OpenApi.ts +165 -49
- package/src/internal/Response.test.ts +95 -0
- package/src/internal/Response.ts +40 -2
- package/src/internal/Schema.test.ts +16 -0
- package/src/internal/Schema.ts +7 -7
- package/src/internal/Store.test.ts +186 -0
- package/src/internal/Store.ts +57 -17
- package/src/internal/Tidx.test.ts +19 -0
- package/src/internal/Tidx.ts +16 -4
- package/src/internal/Webhooks.test.ts +122 -8
- package/src/internal/Webhooks.ts +59 -29
- package/src/internal/funding/Deposit.ts +71 -64
- package/src/internal/funding/DepositAddress.ts +50 -43
- package/src/internal/funding/Provider.ts +164 -142
- package/src/internal/funding/providers/index.test.ts +185 -0
- package/src/internal/funding/providers/stargate.ts +184 -0
- package/src/providers/index.test.ts +1 -0
- package/src/providers/index.ts +9 -0
|
@@ -34,52 +34,55 @@ export namespace schema {
|
|
|
34
34
|
/** Schemas for the createFundingDepositAddress operation. */
|
|
35
35
|
export namespace createFundingDepositAddress {
|
|
36
36
|
/** Funding deposit address creation request body. */
|
|
37
|
-
export const Body =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
37
|
+
export const Body = OpenApi.component(
|
|
38
|
+
z
|
|
39
|
+
.strictObject({
|
|
40
|
+
amount: FundingTransfer.schema.CreateRequest.shape.amount,
|
|
41
|
+
destinationToken: z
|
|
42
|
+
.string()
|
|
43
|
+
.check(
|
|
44
|
+
z.minLength(1),
|
|
45
|
+
z.describe('Tempo destination token symbol, contract address, or token key.'),
|
|
46
|
+
z.meta({ examples: ['usdt0'] }),
|
|
47
|
+
),
|
|
48
|
+
recipient: z
|
|
49
|
+
.string()
|
|
50
|
+
.check(
|
|
51
|
+
z.regex(/^0x[0-9a-fA-F]{40}$/),
|
|
52
|
+
z.describe('Tempo account that receives completed deposits.'),
|
|
53
|
+
z.meta({ examples: [`0x${'11'.repeat(20)}`] }),
|
|
54
|
+
),
|
|
55
|
+
refundAddress: z
|
|
56
|
+
.string()
|
|
57
|
+
.check(
|
|
58
|
+
z.minLength(1),
|
|
59
|
+
z.describe('Source-chain account that receives refunds.'),
|
|
60
|
+
z.meta({ examples: ['TJRabPrwbZy45sbavfcjinPJC18kjpRTv8'] }),
|
|
61
|
+
),
|
|
62
|
+
sourceChain: z
|
|
63
|
+
.string()
|
|
64
|
+
.check(
|
|
65
|
+
z.minLength(1),
|
|
66
|
+
z.describe('Source chain CAIP-2 id, slug, or alias.'),
|
|
67
|
+
z.meta({ examples: ['tron', 'tron:0x2b6653dc'] }),
|
|
68
|
+
),
|
|
69
|
+
sourceToken: z
|
|
70
|
+
.string()
|
|
71
|
+
.check(
|
|
72
|
+
z.minLength(1),
|
|
73
|
+
z.describe('Source token symbol, contract address, or token key.'),
|
|
74
|
+
z.meta({ examples: ['usdt'] }),
|
|
75
|
+
),
|
|
76
|
+
subsidize: z
|
|
77
|
+
.optional(z.boolean())
|
|
78
|
+
.check(
|
|
79
|
+
z.describe('Guarantees normalized 1:1 delivery through a Tempo-funded subsidy.'),
|
|
80
|
+
z.meta({ examples: [false] }),
|
|
81
|
+
),
|
|
82
|
+
})
|
|
83
|
+
.check(z.describe('Reusable funding deposit address creation request.')),
|
|
84
|
+
'CreateFundingDepositAddressRequest',
|
|
85
|
+
)
|
|
83
86
|
|
|
84
87
|
/** Required headers for funding deposit address creation. */
|
|
85
88
|
export const Headers = z.object({
|
|
@@ -95,16 +98,19 @@ export namespace schema {
|
|
|
95
98
|
})
|
|
96
99
|
|
|
97
100
|
/** The reusable address, with quoted terms only when the provider address was newly stored. */
|
|
98
|
-
export const Response =
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
export const Response = OpenApi.component(
|
|
102
|
+
z
|
|
103
|
+
.union([
|
|
104
|
+
FundingDepositAddress.schema.CreatedFundingDepositAddress,
|
|
105
|
+
FundingDepositAddress.schema.FundingDepositAddress,
|
|
106
|
+
])
|
|
107
|
+
.check(
|
|
108
|
+
z.describe(
|
|
109
|
+
'A reusable funding deposit address, including terms sampled for a newly stored provider address.',
|
|
110
|
+
),
|
|
106
111
|
),
|
|
107
|
-
|
|
112
|
+
'CreateFundingDepositAddressResponse',
|
|
113
|
+
)
|
|
108
114
|
}
|
|
109
115
|
|
|
110
116
|
/** Schemas for the getFundingDepositAddress operation. */
|
|
@@ -137,14 +143,17 @@ export namespace schema {
|
|
|
137
143
|
.check(z.describe('Paging parameters for listing funding deposit addresses.'))
|
|
138
144
|
|
|
139
145
|
/** One page of reusable funding deposit addresses. */
|
|
140
|
-
export const Response =
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
export const Response = OpenApi.component(
|
|
147
|
+
z
|
|
148
|
+
.object({
|
|
149
|
+
data: z
|
|
150
|
+
.array(DepositAddress)
|
|
151
|
+
.check(z.describe('Funding deposit addresses on this page, newest first.')),
|
|
152
|
+
nextCursor: Schema.NextCursor,
|
|
153
|
+
})
|
|
154
|
+
.check(z.describe('A page of reusable funding deposit addresses.')),
|
|
155
|
+
'FundingDepositAddressList',
|
|
156
|
+
)
|
|
148
157
|
}
|
|
149
158
|
|
|
150
159
|
/** Schemas for the reconcileFundingDepositAddress operation. */
|
|
@@ -199,15 +208,18 @@ export namespace schema {
|
|
|
199
208
|
.check(z.describe('Optional deposit filters and paging parameters.'))
|
|
200
209
|
|
|
201
210
|
/** One page of detected deposits. */
|
|
202
|
-
export const Response =
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
export const Response = OpenApi.component(
|
|
212
|
+
z
|
|
213
|
+
.object({
|
|
214
|
+
data: z.array(Deposit).check(z.describe('Detected deposits on this page, newest first.')),
|
|
215
|
+
meta: z
|
|
216
|
+
.optional(Schema.CountMeta)
|
|
217
|
+
.check(z.describe('Extra response metadata requested with `include`.')),
|
|
218
|
+
nextCursor: Schema.NextCursor,
|
|
219
|
+
})
|
|
220
|
+
.check(z.describe('A page of visible funding deposits.')),
|
|
221
|
+
'FundingDepositList',
|
|
222
|
+
)
|
|
211
223
|
}
|
|
212
224
|
|
|
213
225
|
/** Schemas for the getFundingDeposit operation. */
|
|
@@ -22,11 +22,14 @@ export namespace schema {
|
|
|
22
22
|
/** Schemas for the getFundingProviders operation. */
|
|
23
23
|
export namespace getFundingProviders {
|
|
24
24
|
/** Non-paginated funding provider catalog. */
|
|
25
|
-
export const Response =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
export const Response = OpenApi.component(
|
|
26
|
+
Schema.describe(
|
|
27
|
+
z.object({
|
|
28
|
+
data: z.array(Provider).check(z.describe("Providers in Tempo's funding quote catalog.")),
|
|
29
|
+
}),
|
|
30
|
+
'A non-paginated list of funding quote providers.',
|
|
31
|
+
),
|
|
32
|
+
'FundingProviderList',
|
|
30
33
|
)
|
|
31
34
|
}
|
|
32
35
|
}
|
|
@@ -44,6 +47,7 @@ export function providers() {
|
|
|
44
47
|
description: 'Lists available transfer providers.',
|
|
45
48
|
operationId: 'getFundingProviders',
|
|
46
49
|
responses: OpenApi.responses({
|
|
50
|
+
errors: { 400: { codes: [] } },
|
|
47
51
|
success: {
|
|
48
52
|
description: 'Funding quote providers supported by Tempo.',
|
|
49
53
|
example: providersResponseExample,
|
|
@@ -10,6 +10,8 @@ import * as Rhino from '../../../internal/funding/providers/rhino.js'
|
|
|
10
10
|
|
|
11
11
|
import * as Squid from '../../../internal/funding/providers/squid.js'
|
|
12
12
|
|
|
13
|
+
import * as Stargate from '../../../internal/funding/providers/stargate.js'
|
|
14
|
+
|
|
13
15
|
import * as Symbiosis from '../../../internal/funding/providers/symbiosis.js'
|
|
14
16
|
|
|
15
17
|
import type * as Log from '../../../internal/Log.js'
|
|
@@ -34,6 +36,10 @@ const providers = [
|
|
|
34
36
|
integratorId: 'squid-integrator-id',
|
|
35
37
|
userAddress: '0x1111111111111111111111111111111111111111',
|
|
36
38
|
}),
|
|
39
|
+
Stargate.stargate({
|
|
40
|
+
apiKey: 'layerzero-api-key',
|
|
41
|
+
userAddress: '0x1111111111111111111111111111111111111111',
|
|
42
|
+
}),
|
|
37
43
|
Symbiosis.symbiosis({ userAddress: '0x1111111111111111111111111111111111111111' }),
|
|
38
44
|
] as const
|
|
39
45
|
|
|
@@ -175,6 +181,27 @@ describe('GET /funding/quotes', () => {
|
|
|
175
181
|
expect(body.data[0]?.quote.expiresAt).toBe('2026-01-01T00:01:00Z')
|
|
176
182
|
})
|
|
177
183
|
|
|
184
|
+
test('returns Stargate quotes for Base USDC to Tempo USDC.e', async () => {
|
|
185
|
+
const app = create({ providers: [stargateProvider()] })
|
|
186
|
+
const response = await app.request(quoteUrl({ ...baseUsdcQuery, provider: 'stargate' }), {
|
|
187
|
+
headers: TestApp.auth.headers,
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
expect(response.status).toBe(200)
|
|
191
|
+
const body = await TestApp.json(response, Funding.schema.quoteFunding.Response)
|
|
192
|
+
expect(body.data[0]).toMatchObject({
|
|
193
|
+
destinationAmount: { baseUnits: '999600' },
|
|
194
|
+
destinationAmountMin: { baseUnits: '999100' },
|
|
195
|
+
id: 'base-usdc-tempo-usdce-stargate',
|
|
196
|
+
provider: { id: 'stargate', name: 'Stargate' },
|
|
197
|
+
quality: {
|
|
198
|
+
liquiditySource: 'providerQuote',
|
|
199
|
+
sourceDetail: 'stargate:value-transfer-v1:bus',
|
|
200
|
+
tier: 'liquid',
|
|
201
|
+
},
|
|
202
|
+
})
|
|
203
|
+
})
|
|
204
|
+
|
|
178
205
|
test('returns non-EVM Rhino quotes with stable chain and token ids', async () => {
|
|
179
206
|
const app = create({ providers: [rhinoProvider()] })
|
|
180
207
|
const response = await app.request(
|
|
@@ -501,6 +528,25 @@ function rhinoProvider() {
|
|
|
501
528
|
})
|
|
502
529
|
}
|
|
503
530
|
|
|
531
|
+
function stargateProvider() {
|
|
532
|
+
return withGetQuote('stargate', async (input, signal) => {
|
|
533
|
+
expect(signal.aborted).toBe(false)
|
|
534
|
+
expect(input.candidate.id).toBe('base-usdc-tempo-usdce-stargate')
|
|
535
|
+
return {
|
|
536
|
+
destinationAmountMin: '999100',
|
|
537
|
+
destinationAmount: '999600',
|
|
538
|
+
quality: {
|
|
539
|
+
estimatedSeconds: 28,
|
|
540
|
+
liquiditySource: 'providerQuote',
|
|
541
|
+
sourceDetail: 'stargate:value-transfer-v1:bus',
|
|
542
|
+
tier: 'liquid',
|
|
543
|
+
},
|
|
544
|
+
sampledAt: '2026-01-01T00:00:00Z',
|
|
545
|
+
status: 'available',
|
|
546
|
+
}
|
|
547
|
+
})
|
|
548
|
+
}
|
|
549
|
+
|
|
504
550
|
function withGetQuote(
|
|
505
551
|
id: FundingProvider.ProviderId,
|
|
506
552
|
getQuote: FundingProvider.Provider['getQuote'],
|
|
@@ -22,11 +22,14 @@ export namespace schema {
|
|
|
22
22
|
export const Query = FundingProvider.schema.QuoteRequest
|
|
23
23
|
|
|
24
24
|
/** Non-paginated list of successful funding quotes. */
|
|
25
|
-
export const Response =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
export const Response = OpenApi.component(
|
|
26
|
+
Schema.describe(
|
|
27
|
+
z.object({
|
|
28
|
+
data: z.array(FundingQuote).check(z.describe('Successful live funding quotes.')),
|
|
29
|
+
}),
|
|
30
|
+
'A non-paginated list of successful live funding quotes.',
|
|
31
|
+
),
|
|
32
|
+
'FundingQuoteList',
|
|
30
33
|
)
|
|
31
34
|
}
|
|
32
35
|
}
|
|
@@ -39,6 +39,24 @@ function create(options: TestApp.create.Options = {}) {
|
|
|
39
39
|
return TestApp.create({ ...options, db })
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
type JsonSchema = {
|
|
43
|
+
$ref?: string | undefined
|
|
44
|
+
additionalProperties?: boolean | undefined
|
|
45
|
+
examples?: readonly unknown[] | undefined
|
|
46
|
+
properties?: Record<string, JsonSchema> | undefined
|
|
47
|
+
required?: readonly string[] | undefined
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
type ComponentSpec = {
|
|
51
|
+
components: { schemas: Record<string, JsonSchema> }
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function dereference(spec: ComponentSpec, schema: JsonSchema): JsonSchema {
|
|
55
|
+
if (!schema.$ref) return schema
|
|
56
|
+
const name = schema.$ref.split('/').at(-1)!
|
|
57
|
+
return spec.components.schemas[name]!
|
|
58
|
+
}
|
|
59
|
+
|
|
42
60
|
describe('GET /funding/transfers', () => {
|
|
43
61
|
test('requires the funding:read scope', async () => {
|
|
44
62
|
const app = transfersApp()
|
|
@@ -766,33 +784,23 @@ describe('funding transfers OpenAPI', () => {
|
|
|
766
784
|
|
|
767
785
|
test('publishes human-readable deposit address route examples', async () => {
|
|
768
786
|
const app = create({ auth: false })
|
|
769
|
-
type Property = { examples: string[] }
|
|
770
787
|
type Operation = {
|
|
771
788
|
requestBody: {
|
|
772
|
-
content: Record<
|
|
773
|
-
string,
|
|
774
|
-
{
|
|
775
|
-
schema: {
|
|
776
|
-
properties: {
|
|
777
|
-
destinationToken: Property
|
|
778
|
-
sourceChain: Property
|
|
779
|
-
sourceToken: Property
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
>
|
|
789
|
+
content: Record<string, { schema: JsonSchema }>
|
|
784
790
|
}
|
|
785
791
|
}
|
|
786
|
-
type Spec = { paths: Record<string, { post: Operation }> }
|
|
792
|
+
type Spec = ComponentSpec & { paths: Record<string, { post: Operation }> }
|
|
787
793
|
const spec = (await (await app.request('/openapi.json')).json()) as Spec
|
|
788
|
-
const properties =
|
|
794
|
+
const properties = dereference(
|
|
795
|
+
spec,
|
|
789
796
|
spec.paths['/v1/funding/deposit-addresses']!.post.requestBody.content['application/json']!
|
|
790
|
-
.schema
|
|
797
|
+
.schema,
|
|
798
|
+
).properties!
|
|
791
799
|
|
|
792
800
|
expect({
|
|
793
|
-
destinationToken: properties
|
|
794
|
-
sourceChain: properties
|
|
795
|
-
sourceToken: properties
|
|
801
|
+
destinationToken: properties['destinationToken']!.examples,
|
|
802
|
+
sourceChain: properties['sourceChain']!.examples,
|
|
803
|
+
sourceToken: properties['sourceToken']!.examples,
|
|
796
804
|
}).toMatchInlineSnapshot(`
|
|
797
805
|
{
|
|
798
806
|
"destinationToken": [
|
|
@@ -949,30 +957,22 @@ describe('funding transfers OpenAPI', () => {
|
|
|
949
957
|
|
|
950
958
|
test('publishes concrete creation schemas', async () => {
|
|
951
959
|
const app = create({ auth: false })
|
|
952
|
-
|
|
960
|
+
type Spec = ComponentSpec & {
|
|
953
961
|
paths: Record<
|
|
954
962
|
string,
|
|
955
963
|
{
|
|
956
964
|
post?: {
|
|
957
965
|
requestBody: {
|
|
958
|
-
content: Record<
|
|
959
|
-
string,
|
|
960
|
-
{
|
|
961
|
-
schema: {
|
|
962
|
-
additionalProperties?: boolean
|
|
963
|
-
properties: object
|
|
964
|
-
required?: readonly string[] | undefined
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
>
|
|
966
|
+
content: Record<string, { schema: JsonSchema }>
|
|
968
967
|
}
|
|
969
968
|
responses: Record<string, unknown>
|
|
970
969
|
}
|
|
971
970
|
}
|
|
972
971
|
>
|
|
973
972
|
}
|
|
973
|
+
const spec = (await (await app.request('/openapi.json')).json()) as Spec
|
|
974
974
|
const creationSchema = (path: string) =>
|
|
975
|
-
spec.paths[path]!.post!.requestBody.content['application/json']!.schema
|
|
975
|
+
dereference(spec, spec.paths[path]!.post!.requestBody.content['application/json']!.schema)
|
|
976
976
|
expect(
|
|
977
977
|
creationSchema('/v1/funding/deposit-addresses').required?.includes('subsidize') ?? false,
|
|
978
978
|
).toMatchInlineSnapshot(`false`)
|
|
@@ -980,7 +980,7 @@ describe('funding transfers OpenAPI', () => {
|
|
|
980
980
|
const schema = creationSchema(path)
|
|
981
981
|
return {
|
|
982
982
|
additionalProperties: schema.additionalProperties,
|
|
983
|
-
properties: Object.keys(schema.properties),
|
|
983
|
+
properties: Object.keys(schema.properties!),
|
|
984
984
|
}
|
|
985
985
|
}
|
|
986
986
|
|
|
@@ -1025,6 +1025,7 @@ describe('funding transfers OpenAPI', () => {
|
|
|
1025
1025
|
"200",
|
|
1026
1026
|
"400",
|
|
1027
1027
|
"401",
|
|
1028
|
+
"403",
|
|
1028
1029
|
"404",
|
|
1029
1030
|
"409",
|
|
1030
1031
|
"429",
|
|
@@ -1047,6 +1048,7 @@ describe('funding transfers OpenAPI', () => {
|
|
|
1047
1048
|
"vaultResponses": [
|
|
1048
1049
|
"400",
|
|
1049
1050
|
"401",
|
|
1051
|
+
"403",
|
|
1050
1052
|
"429",
|
|
1051
1053
|
"500",
|
|
1052
1054
|
"501",
|
|
@@ -1069,6 +1071,7 @@ describe('funding transfers OpenAPI', () => {
|
|
|
1069
1071
|
"zoneResponses": [
|
|
1070
1072
|
"400",
|
|
1071
1073
|
"401",
|
|
1074
|
+
"403",
|
|
1072
1075
|
"429",
|
|
1073
1076
|
"500",
|
|
1074
1077
|
"501",
|
|
@@ -199,6 +199,32 @@ describe('createReporter', () => {
|
|
|
199
199
|
await db.close()
|
|
200
200
|
})
|
|
201
201
|
|
|
202
|
+
test('behavior: marks a meter event that Stripe already accepted', async () => {
|
|
203
|
+
const db = create()
|
|
204
|
+
await db.migrate()
|
|
205
|
+
await StripeCustomers.create(db, { orgId: 'org_1', stripeCustomerId: 'cus_1' })
|
|
206
|
+
const row = await finalized(db, { feeAmount: '100000', seed: '03' })
|
|
207
|
+
|
|
208
|
+
const { stripe } = stubStripe({
|
|
209
|
+
meterEvent: (params) => {
|
|
210
|
+
throw new Error(`An event already exists with identifier ${params.identifier}.`)
|
|
211
|
+
},
|
|
212
|
+
subscriptions: [{ items: ['feePayerSpend', 'apiRequests'], status: 'active' }],
|
|
213
|
+
})
|
|
214
|
+
expect(await Billing.createReporter({ db, stripe }).tick()).toStrictEqual({
|
|
215
|
+
failed: 0,
|
|
216
|
+
reported: 1,
|
|
217
|
+
skipped: 0,
|
|
218
|
+
})
|
|
219
|
+
expect((await SponsoredTransactions.get(db, row.id))?.meterReportedAt).not.toBeNull()
|
|
220
|
+
expect(await Billing.createReporter({ db, stripe }).tick()).toStrictEqual({
|
|
221
|
+
failed: 0,
|
|
222
|
+
reported: 0,
|
|
223
|
+
skipped: 0,
|
|
224
|
+
})
|
|
225
|
+
await db.close()
|
|
226
|
+
})
|
|
227
|
+
|
|
202
228
|
test('behavior: canceled customers skip without meter events', async () => {
|
|
203
229
|
const db = create()
|
|
204
230
|
await db.migrate()
|
|
@@ -357,12 +357,18 @@ export function createReporter(options: createReporter.Options): createReporter.
|
|
|
357
357
|
const stamp = recent && !subscription.items.feePayerSpend?.created
|
|
358
358
|
// The row id makes short-window retries idempotent on Stripe's
|
|
359
359
|
// side; `meter_reported_at` is the durable exactly-once guard.
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
360
|
+
try {
|
|
361
|
+
await stripe.billing.meterEvents.create({
|
|
362
|
+
event_name: meterEventName,
|
|
363
|
+
identifier: row.id,
|
|
364
|
+
payload: { stripe_customer_id: customer.stripeCustomerId, value: row.feeAmount! },
|
|
365
|
+
...(stamp ? { timestamp: Math.floor(finalizedAt / 1000) } : {}),
|
|
366
|
+
})
|
|
367
|
+
} catch (error) {
|
|
368
|
+
// Stripe may persist the event before the Worker records its ack.
|
|
369
|
+
// Its duplicate response proves this exact row was already metered.
|
|
370
|
+
if (!isDuplicateMeterEvent(error, row.id)) throw error
|
|
371
|
+
}
|
|
366
372
|
reported++
|
|
367
373
|
} else {
|
|
368
374
|
// Deleted orgs and Stripe-deleted (canceled) customers keep their
|
|
@@ -381,6 +387,14 @@ export function createReporter(options: createReporter.Options): createReporter.
|
|
|
381
387
|
}
|
|
382
388
|
}
|
|
383
389
|
|
|
390
|
+
/** Whether Stripe confirms that the exact meter event identifier already exists. */
|
|
391
|
+
function isDuplicateMeterEvent(error: unknown, identifier: string): boolean {
|
|
392
|
+
return (
|
|
393
|
+
error instanceof Error &&
|
|
394
|
+
error.message === `An event already exists with identifier ${identifier}.`
|
|
395
|
+
)
|
|
396
|
+
}
|
|
397
|
+
|
|
384
398
|
export declare namespace createReporter {
|
|
385
399
|
/** Options for {@link createReporter}. */
|
|
386
400
|
type Options = {
|
|
@@ -452,7 +466,10 @@ export function createRequestUsageReporter(
|
|
|
452
466
|
count: status.count,
|
|
453
467
|
environment,
|
|
454
468
|
oldestPendingAgeSeconds: status.oldestAttemptedAt
|
|
455
|
-
? Math.max(
|
|
469
|
+
? Math.max(
|
|
470
|
+
0,
|
|
471
|
+
Math.floor((now() - new Date(status.oldestAttemptedAt).getTime()) / 1_000),
|
|
472
|
+
)
|
|
456
473
|
: 0,
|
|
457
474
|
}
|
|
458
475
|
}),
|