tapimo 0.7.2 → 0.8.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 +10 -7
- package/dist/ApiKey.d.ts +3 -0
- package/dist/ApiKey.d.ts.map +1 -1
- package/dist/ApiKey.js +10 -0
- package/dist/ApiKey.js.map +1 -1
- package/dist/ApiKeys.d.ts +7 -3
- package/dist/ApiKeys.d.ts.map +1 -1
- package/dist/ApiKeys.js +9 -2
- package/dist/ApiKeys.js.map +1 -1
- package/dist/App.d.ts +20434 -19484
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +62 -4
- package/dist/App.js.map +1 -1
- package/dist/admin/App.d.ts +84 -74
- package/dist/admin/App.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.d.ts +14 -1
- package/dist/admin/apps/api-keys.d.ts.map +1 -1
- package/dist/admin/apps/api-keys.js +6 -2
- package/dist/admin/apps/api-keys.js.map +1 -1
- package/dist/admin/apps/organizations.d.ts +2 -0
- package/dist/admin/apps/organizations.d.ts.map +1 -1
- package/dist/admin/apps/verified-tokens.d.ts +168 -168
- package/dist/admin/ui.generated.d.ts +1 -1
- package/dist/admin/ui.generated.js +67 -67
- package/dist/admin/ui.generated.js.map +1 -1
- package/dist/analytics/Analytics.d.ts +2 -0
- package/dist/analytics/Analytics.d.ts.map +1 -1
- package/dist/analytics/Analytics.js +3 -0
- package/dist/analytics/Analytics.js.map +1 -1
- package/dist/apps/data/App.d.ts +10305 -12785
- package/dist/apps/data/App.d.ts.map +1 -1
- package/dist/apps/data/App.js +4 -8
- package/dist/apps/data/App.js.map +1 -1
- package/dist/apps/data/routes/activities.d.ts +24 -24
- package/dist/apps/data/routes/addresses.d.ts +288 -288
- package/dist/apps/data/routes/balances.d.ts +6 -6
- package/dist/apps/data/routes/blocks.d.ts +39 -39
- package/dist/apps/data/routes/coingecko.d.ts +170 -170
- package/dist/apps/data/routes/earn.d.ts +436 -6
- package/dist/apps/data/routes/earn.d.ts.map +1 -1
- package/dist/apps/data/routes/earn.js +631 -4
- package/dist/apps/data/routes/earn.js.map +1 -1
- package/dist/apps/data/routes/exchanges.d.ts +10 -10
- package/dist/apps/data/routes/fee-amm.d.ts +2 -2
- package/dist/apps/data/routes/indexer.d.ts +6 -6
- package/dist/apps/data/routes/indexer.js +4 -1
- package/dist/apps/data/routes/indexer.js.map +1 -1
- package/dist/apps/data/routes/receipts.d.ts +235 -235
- package/dist/apps/data/routes/rpc.d.ts +1 -1
- package/dist/apps/data/routes/rpc.js +4 -1
- package/dist/apps/data/routes/rpc.js.map +1 -1
- package/dist/apps/data/routes/tokenlist.d.ts +36 -36
- package/dist/apps/data/routes/tokens.d.ts +6 -6
- package/dist/apps/data/routes/transactions.d.ts +2 -2
- package/dist/apps/data/routes/transfers.d.ts +1 -1
- package/dist/apps/data/routes/valuation.d.ts +1 -1
- package/dist/apps/data/routes/verified-tokens.d.ts +36 -36
- package/dist/apps/data/routes/webhooks.d.ts +9 -9
- package/dist/apps/data/routes/zones.d.ts +14 -14
- package/dist/apps/funding/Access.d.ts +16 -0
- package/dist/apps/funding/Access.d.ts.map +1 -0
- package/dist/apps/funding/Access.js +22 -0
- package/dist/apps/funding/Access.js.map +1 -0
- package/dist/apps/{data/routes/funding.d.ts → funding/App.d.ts} +1717 -3035
- package/dist/apps/funding/App.d.ts.map +1 -0
- package/dist/apps/funding/App.js +46 -0
- package/dist/apps/funding/App.js.map +1 -0
- package/dist/apps/funding/Inventory.d.ts +5 -0
- package/dist/apps/funding/Inventory.d.ts.map +1 -0
- package/dist/apps/funding/Inventory.js +25 -0
- package/dist/apps/funding/Inventory.js.map +1 -0
- package/dist/apps/funding/ProviderAttempts.d.ts +5 -0
- package/dist/apps/funding/ProviderAttempts.d.ts.map +1 -0
- package/dist/apps/funding/ProviderAttempts.js +24 -0
- package/dist/apps/funding/ProviderAttempts.js.map +1 -0
- package/dist/apps/funding/index.d.ts +2 -0
- package/dist/apps/funding/index.d.ts.map +1 -0
- package/dist/apps/funding/index.js +2 -0
- package/dist/apps/funding/index.js.map +1 -0
- package/dist/apps/funding/routes/chains.d.ts +169 -0
- package/dist/apps/funding/routes/chains.d.ts.map +1 -0
- package/dist/apps/funding/routes/chains.js +80 -0
- package/dist/apps/funding/routes/chains.js.map +1 -0
- package/dist/apps/funding/routes/deposit-addresses.d.ts +2388 -0
- package/dist/apps/funding/routes/deposit-addresses.d.ts.map +1 -0
- package/dist/apps/funding/routes/deposit-addresses.js +860 -0
- package/dist/apps/funding/routes/deposit-addresses.js.map +1 -0
- package/dist/apps/funding/routes/providers.d.ts +91 -0
- package/dist/apps/funding/routes/providers.d.ts.map +1 -0
- package/dist/apps/funding/routes/providers.js +56 -0
- package/dist/apps/funding/routes/providers.js.map +1 -0
- package/dist/apps/funding/routes/quotes.d.ts +426 -0
- package/dist/apps/funding/routes/quotes.d.ts.map +1 -0
- package/dist/apps/funding/routes/quotes.js +188 -0
- package/dist/apps/funding/routes/quotes.js.map +1 -0
- package/dist/apps/funding/routes/transfers.d.ts +1999 -0
- package/dist/apps/funding/routes/transfers.d.ts.map +1 -0
- package/dist/apps/funding/routes/transfers.js +614 -0
- package/dist/apps/funding/routes/transfers.js.map +1 -0
- package/dist/apps/index.d.ts +1 -0
- package/dist/apps/index.d.ts.map +1 -1
- package/dist/apps/index.js +1 -0
- package/dist/apps/index.js.map +1 -1
- package/dist/apps/management/App.d.ts +430 -165
- package/dist/apps/management/App.d.ts.map +1 -1
- package/dist/apps/management/routes/api-keys.d.ts +298 -21
- package/dist/apps/management/routes/api-keys.d.ts.map +1 -1
- package/dist/apps/management/routes/api-keys.js +75 -1
- package/dist/apps/management/routes/api-keys.js.map +1 -1
- package/dist/apps/management/routes/billing.d.ts +6 -6
- package/dist/apps/management/routes/faucet.d.ts +35 -35
- package/dist/apps/management/routes/invitations.d.ts +48 -48
- package/dist/apps/management/routes/invite-links.d.ts +38 -38
- package/dist/apps/management/routes/members.d.ts +69 -69
- package/dist/apps/management/routes/orgs.d.ts +37 -37
- package/dist/apps/management/routes/projects.d.ts +25 -25
- package/dist/apps/management/routes/scopes.d.ts +1 -1
- package/dist/apps/management/routes/usage.d.ts +72 -72
- package/dist/apps/management/routes/verified-token-requests.d.ts +18 -18
- package/dist/apps/management/routes/webhooks.d.ts +128 -128
- package/dist/apps/mcp.d.ts +2 -3
- package/dist/apps/mcp.d.ts.map +1 -1
- package/dist/apps/mcp.js +16 -14
- package/dist/apps/mcp.js.map +1 -1
- package/dist/apps/metadata.d.ts +4 -0
- package/dist/apps/metadata.d.ts.map +1 -1
- package/dist/apps/metadata.js +10 -0
- package/dist/apps/metadata.js.map +1 -1
- package/dist/apps/mpp/App.d.ts +2 -2
- package/dist/cloudflare.d.ts +50 -0
- package/dist/cloudflare.d.ts.map +1 -1
- package/dist/cloudflare.js +178 -0
- package/dist/cloudflare.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 +37 -0
- package/dist/db/Db.js.map +1 -1
- package/dist/db/Schema.d.ts +12 -0
- package/dist/db/Schema.d.ts.map +1 -1
- package/dist/db/Schema.js +20 -0
- package/dist/db/Schema.js.map +1 -1
- package/dist/db/tables/fundingDepositAddresses.d.ts +13 -0
- package/dist/db/tables/fundingDepositAddresses.d.ts.map +1 -1
- package/dist/db/tables/fundingDepositAddresses.js +12 -0
- package/dist/db/tables/fundingDepositAddresses.js.map +1 -1
- package/dist/db/tables/fundingDepositRequestObservations.d.ts +45 -0
- package/dist/db/tables/fundingDepositRequestObservations.d.ts.map +1 -0
- package/dist/db/tables/fundingDepositRequestObservations.js +46 -0
- package/dist/db/tables/fundingDepositRequestObservations.js.map +1 -0
- package/dist/db/tables/fundingDeposits.d.ts +57 -1
- package/dist/db/tables/fundingDeposits.d.ts.map +1 -1
- package/dist/db/tables/fundingDeposits.js +82 -0
- package/dist/db/tables/fundingDeposits.js.map +1 -1
- package/dist/internal/Auth.d.ts +11 -11
- package/dist/internal/Auth.d.ts.map +1 -1
- package/dist/internal/Auth.js +41 -15
- package/dist/internal/Auth.js.map +1 -1
- package/dist/internal/Cache.js +1 -1
- package/dist/internal/Cache.js.map +1 -1
- package/dist/internal/EdgeCache.d.ts +2 -2
- package/dist/internal/EdgeCache.d.ts.map +1 -1
- package/dist/internal/EdgeCache.js +10 -4
- package/dist/internal/EdgeCache.js.map +1 -1
- package/dist/internal/IpAllowlist.d.ts +15 -0
- package/dist/internal/IpAllowlist.d.ts.map +1 -0
- package/dist/internal/IpAllowlist.js +27 -0
- package/dist/internal/IpAllowlist.js.map +1 -0
- package/dist/internal/OpenApi.d.ts +1 -1
- package/dist/internal/OpenApi.js +1 -1
- package/dist/internal/OpenApi.js.map +1 -1
- package/dist/internal/Tidx.d.ts +6 -0
- package/dist/internal/Tidx.d.ts.map +1 -1
- package/dist/internal/Tidx.js +13 -3
- package/dist/internal/Tidx.js.map +1 -1
- package/dist/internal/Viem.d.ts +8 -0
- package/dist/internal/Viem.d.ts.map +1 -1
- package/dist/internal/Viem.js +12 -5
- package/dist/internal/Viem.js.map +1 -1
- package/dist/internal/funding/Deposit.d.ts +42 -0
- package/dist/internal/funding/Deposit.d.ts.map +1 -1
- package/dist/internal/funding/Deposit.js +37 -5
- package/dist/internal/funding/Deposit.js.map +1 -1
- package/dist/internal/funding/Evidence.d.ts +1 -5
- package/dist/internal/funding/Evidence.d.ts.map +1 -1
- package/dist/internal/funding/Evidence.js +4 -3
- package/dist/internal/funding/Evidence.js.map +1 -1
- package/dist/internal/funding/Provider.d.ts +102 -0
- package/dist/internal/funding/Provider.d.ts.map +1 -1
- package/dist/internal/funding/Provider.js +5 -0
- package/dist/internal/funding/Provider.js.map +1 -1
- package/dist/internal/funding/Reconciliation.d.ts +16 -2
- package/dist/internal/funding/Reconciliation.d.ts.map +1 -1
- package/dist/internal/funding/Reconciliation.js +257 -48
- package/dist/internal/funding/Reconciliation.js.map +1 -1
- package/dist/internal/funding/SourceObservation.d.ts +108 -0
- package/dist/internal/funding/SourceObservation.d.ts.map +1 -0
- package/dist/internal/funding/SourceObservation.js +143 -0
- package/dist/internal/funding/SourceObservation.js.map +1 -0
- package/dist/internal/funding/Subsidy.d.ts +2 -2
- package/dist/internal/funding/Subsidy.d.ts.map +1 -1
- package/dist/internal/funding/Subsidy.js +1 -1
- package/dist/internal/funding/Subsidy.js.map +1 -1
- package/dist/internal/funding/index.d.ts +1 -0
- package/dist/internal/funding/index.d.ts.map +1 -1
- package/dist/internal/funding/index.js +1 -0
- package/dist/internal/funding/index.js.map +1 -1
- package/dist/internal/funding/providers/relay.d.ts +43 -1
- package/dist/internal/funding/providers/relay.d.ts.map +1 -1
- package/dist/internal/funding/providers/relay.js +434 -27
- package/dist/internal/funding/providers/relay.js.map +1 -1
- package/package.json +3 -3
- package/src/ApiKey.test.ts +35 -0
- package/src/ApiKey.ts +27 -0
- package/src/ApiKeys.test.ts +29 -0
- package/src/ApiKeys.ts +11 -3
- package/src/App.test.ts +23 -5
- package/src/App.ts +76 -5
- package/src/Client.test-d.ts +171 -19
- package/src/admin/apps/api-keys.test.ts +25 -1
- package/src/admin/apps/api-keys.ts +6 -2
- package/src/admin/ui.generated.ts +67 -67
- package/src/analytics/Analytics.ts +4 -0
- package/src/apps/composition.test.ts +100 -2
- package/src/apps/data/App.test.ts +0 -12
- package/src/apps/data/App.ts +4 -8
- package/src/apps/data/routes/earn.test.ts +283 -0
- package/src/apps/data/routes/earn.ts +800 -3
- package/src/apps/data/routes/indexer.ts +2 -1
- package/src/apps/data/routes/rpc.ts +2 -0
- package/src/apps/data/routes/tokens.test.ts +6 -8
- package/src/apps/funding/Access.ts +26 -0
- package/src/apps/funding/App.test.ts +78 -0
- package/src/apps/funding/App.ts +63 -0
- package/src/apps/funding/Inventory.ts +30 -0
- package/src/apps/funding/ProviderAttempts.ts +26 -0
- package/src/apps/funding/index.ts +1 -0
- package/src/apps/funding/routes/chains.test.ts +78 -0
- package/src/apps/funding/routes/chains.ts +101 -0
- package/src/apps/funding/routes/deposit-addresses.test.ts +1628 -0
- package/src/apps/funding/routes/deposit-addresses.ts +1015 -0
- package/src/apps/funding/routes/providers.test.ts +165 -0
- package/src/apps/funding/routes/providers.ts +73 -0
- package/src/apps/funding/routes/quotes.test.ts +511 -0
- package/src/apps/funding/routes/quotes.ts +205 -0
- package/src/apps/funding/routes/transfers.test.ts +1255 -0
- package/src/apps/funding/routes/transfers.ts +704 -0
- package/src/apps/index.ts +1 -0
- package/src/apps/management/routes/api-keys.test.ts +98 -0
- package/src/apps/management/routes/api-keys.ts +96 -1
- package/src/apps/mcp.test.ts +17 -2
- package/src/apps/mcp.ts +18 -13
- package/src/apps/metadata.ts +12 -0
- package/src/apps/mpp/internal/Policy.test.ts +7 -1
- package/src/cloudflare.ts +279 -0
- package/src/db/Db.ts +62 -0
- package/src/db/Schema.ts +24 -0
- package/src/db/tables/fundingDepositAddresses.ts +28 -0
- package/src/db/tables/fundingDepositRequestObservations.test.ts +106 -0
- package/src/db/tables/fundingDepositRequestObservations.ts +99 -0
- package/src/db/tables/fundingDeposits.test.ts +138 -0
- package/src/db/tables/fundingDeposits.ts +145 -1
- package/src/internal/Auth.test.ts +177 -5
- package/src/internal/Auth.ts +48 -18
- package/src/internal/Cache.test.ts +37 -3
- package/src/internal/Cache.ts +1 -1
- package/src/internal/EdgeCache.test.ts +7 -7
- package/src/internal/EdgeCache.ts +13 -4
- package/src/internal/IpAllowlist.test.ts +52 -0
- package/src/internal/IpAllowlist.ts +39 -0
- package/src/internal/Log.test.ts +7 -1
- package/src/internal/OpenApi.ts +1 -1
- package/src/internal/Tidx.test.ts +28 -0
- package/src/internal/Tidx.ts +19 -3
- package/src/internal/Viem.test.ts +28 -0
- package/src/internal/Viem.ts +21 -5
- package/src/internal/funding/Deposit.ts +74 -5
- package/src/internal/funding/Evidence.test.ts +2 -2
- package/src/internal/funding/Evidence.ts +4 -9
- package/src/internal/funding/Provider.ts +115 -0
- package/src/internal/funding/Reconciliation.local.test.ts +7 -0
- package/src/internal/funding/Reconciliation.test.ts +1052 -35
- package/src/internal/funding/Reconciliation.ts +328 -56
- package/src/internal/funding/SourceObservation.test.ts +301 -0
- package/src/internal/funding/SourceObservation.ts +267 -0
- package/src/internal/funding/Subsidy.ts +2 -2
- package/src/internal/funding/index.test.ts +1 -0
- package/src/internal/funding/index.ts +1 -0
- package/src/internal/funding/providers/relay.test.ts +94 -4
- package/src/internal/funding/providers/relay.ts +528 -27
- package/dist/apps/data/routes/funding.d.ts.map +0 -1
- package/dist/apps/data/routes/funding.js +0 -1557
- package/dist/apps/data/routes/funding.js.map +0 -1
- package/src/apps/data/routes/funding.test.ts +0 -2994
- package/src/apps/data/routes/funding.ts +0 -1821
|
@@ -83,7 +83,7 @@ describe('resolveRpcUrls', () => {
|
|
|
83
83
|
})
|
|
84
84
|
|
|
85
85
|
describe('createVerifier', () => {
|
|
86
|
-
test('verifies finalized Solana and Tron token transfers', async () => {
|
|
86
|
+
test('verifies finalized Solana and one-confirmation Tron token transfers', async () => {
|
|
87
87
|
const tron = TestFunding.depositAddressSnapshot()
|
|
88
88
|
const solana = TestFunding.transferSnapshot({
|
|
89
89
|
sourceChain: {
|
|
@@ -118,7 +118,7 @@ describe('createVerifier', () => {
|
|
|
118
118
|
return
|
|
119
119
|
}
|
|
120
120
|
const result = request.url?.includes('getnowblock')
|
|
121
|
-
? { block_header: { raw_data: { number:
|
|
121
|
+
? { block_header: { raw_data: { number: 150 } } }
|
|
122
122
|
: request.url?.includes('gettransactioninfobyid')
|
|
123
123
|
? {
|
|
124
124
|
blockNumber: 150,
|
|
@@ -14,6 +14,7 @@ const transferEvent = AbiEvent.from(
|
|
|
14
14
|
)
|
|
15
15
|
const transferTopic = AbiEvent.getSelector(transferEvent).slice(2)
|
|
16
16
|
const catalogCacheTtlMs = 60_000
|
|
17
|
+
const defaultConfirmations = 1
|
|
17
18
|
|
|
18
19
|
type SolanaRpcSchema = RpcSchema.From<{
|
|
19
20
|
Request: {
|
|
@@ -117,7 +118,7 @@ export declare namespace resolveRpcUrls {
|
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
120
|
|
|
120
|
-
/** Creates a
|
|
121
|
+
/** Creates a token-transfer verifier for EVM, Solana, and Tron chains. */
|
|
121
122
|
export function createVerifier(options: createVerifier.Options): Reconciliation.VerifyTransfers {
|
|
122
123
|
const fetch = options.fetch ?? globalThis.fetch
|
|
123
124
|
// Delay this shared read until reconciliation releases its claim transaction.
|
|
@@ -156,15 +157,13 @@ export function createVerifier(options: createVerifier.Options): Reconciliation.
|
|
|
156
157
|
if (!urls || urls.length === 0) throw new ChainConfigurationError(parameters.chain.id)
|
|
157
158
|
if (parameters.chain.kind === 'evm')
|
|
158
159
|
return verifyEvm(parameters, {
|
|
159
|
-
confirmations:
|
|
160
|
-
options.confirmations?.[parameters.chain.id] ?? options.defaultEvmConfirmations ?? 12,
|
|
160
|
+
confirmations: options.confirmations?.[parameters.chain.id] ?? defaultConfirmations,
|
|
161
161
|
fetch,
|
|
162
162
|
urls,
|
|
163
163
|
})
|
|
164
164
|
if (parameters.chain.kind === 'solana') return verifySolana(parameters, { fetch, urls })
|
|
165
165
|
return verifyTron(parameters, {
|
|
166
|
-
confirmations:
|
|
167
|
-
options.confirmations?.[parameters.chain.id] ?? options.defaultTronConfirmations ?? 20,
|
|
166
|
+
confirmations: options.confirmations?.[parameters.chain.id] ?? defaultConfirmations,
|
|
168
167
|
fetch,
|
|
169
168
|
urls,
|
|
170
169
|
})
|
|
@@ -180,10 +179,6 @@ export declare namespace createVerifier {
|
|
|
180
179
|
db: Db.Source
|
|
181
180
|
/** Tempo chain that receives a shared RPC URL override. */
|
|
182
181
|
defaultChainId?: Viem.ChainId | undefined
|
|
183
|
-
/** Default confirmation requirement for EVM chains. */
|
|
184
|
-
defaultEvmConfirmations?: number | undefined
|
|
185
|
-
/** Default confirmation requirement for Tron. */
|
|
186
|
-
defaultTronConfirmations?: number | undefined
|
|
187
182
|
/** Fetch implementation override for tests. */
|
|
188
183
|
fetch?: typeof globalThis.fetch | undefined
|
|
189
184
|
/** Shared or per-EVM-chain RPC URL environment value. */
|
|
@@ -249,6 +249,7 @@ export namespace schema {
|
|
|
249
249
|
createdAt: z.iso.datetime(),
|
|
250
250
|
destinationTransactionHashes: z.array(z.string()),
|
|
251
251
|
id: z.string().check(z.minLength(1)),
|
|
252
|
+
providerState: z.optional(z.record(z.string(), z.unknown())),
|
|
252
253
|
sourceTransactionHashes: z.array(z.string()),
|
|
253
254
|
status: z.string().check(z.minLength(1)),
|
|
254
255
|
updatedAt: z.iso.datetime(),
|
|
@@ -478,6 +479,68 @@ export declare namespace listDepositAddressRequests {
|
|
|
478
479
|
type ReturnType = z.output<typeof schema.DepositAddressRequestsResult>
|
|
479
480
|
}
|
|
480
481
|
|
|
482
|
+
/** Contract of the provider `observeDepositAddressRequest` method. */
|
|
483
|
+
export declare namespace observeDepositAddressRequest {
|
|
484
|
+
/** Verified source transfer used to correlate provider delivery. */
|
|
485
|
+
type Source = {
|
|
486
|
+
/** Token quantity in base units. */
|
|
487
|
+
amount: string
|
|
488
|
+
/** Verified source transaction reference. */
|
|
489
|
+
transactionHash: string
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/** Input passed to a provider observing one pending reusable-address request. */
|
|
493
|
+
type Parameters = {
|
|
494
|
+
/** Provider-owned reusable deposit address. */
|
|
495
|
+
address: string
|
|
496
|
+
/** Chain that receives provider delivery. */
|
|
497
|
+
destinationChain: ChainRef
|
|
498
|
+
/** Token delivered by the provider. */
|
|
499
|
+
destinationToken: TokenRef
|
|
500
|
+
/** Bounded private provider correlation from an earlier observation. */
|
|
501
|
+
providerState?: Record<string, unknown> | undefined
|
|
502
|
+
/** Final beneficiary on the destination chain. */
|
|
503
|
+
recipient: string
|
|
504
|
+
/** Source-chain account credited by the provider deposit. */
|
|
505
|
+
refundAddress: string
|
|
506
|
+
/** Pending provider request being accelerated. */
|
|
507
|
+
request: listDepositAddressRequests.ReturnType['requests'][number]
|
|
508
|
+
/** One verified source transfer attributed to the request. */
|
|
509
|
+
source: Source
|
|
510
|
+
/** Chain containing the source transfer. */
|
|
511
|
+
sourceChain: ChainRef
|
|
512
|
+
/** Token received by the reusable address. */
|
|
513
|
+
sourceToken: TokenRef
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/** Private provider evidence shared by pending and verified observations. */
|
|
517
|
+
type Evidence = {
|
|
518
|
+
/** Bounded private provider correlation retained for reconciliation. */
|
|
519
|
+
providerState?: Record<string, unknown> | undefined
|
|
520
|
+
/** Verified provider-leg transaction references. */
|
|
521
|
+
providerTransactionHashes?: readonly string[] | undefined
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/** Bounded provider delivery observation. */
|
|
525
|
+
type ReturnType = Evidence &
|
|
526
|
+
(
|
|
527
|
+
| {
|
|
528
|
+
/** No matching provider delivery has reached the destination yet. */
|
|
529
|
+
type: 'pending'
|
|
530
|
+
}
|
|
531
|
+
| {
|
|
532
|
+
/** This provider or route cannot produce authenticated delivery observations. */
|
|
533
|
+
type: 'unsupported'
|
|
534
|
+
}
|
|
535
|
+
| {
|
|
536
|
+
/** Verified destination transaction references. */
|
|
537
|
+
destinationTransactionHashes: readonly string[]
|
|
538
|
+
/** Authenticated provider delivery was observed onchain. */
|
|
539
|
+
type: 'verified'
|
|
540
|
+
}
|
|
541
|
+
)
|
|
542
|
+
}
|
|
543
|
+
|
|
481
544
|
/** Optional webhook capability implemented by a complete funding integration. */
|
|
482
545
|
export type Webhook = {
|
|
483
546
|
/** Authenticates, resolves, and enqueues one provider status event. */
|
|
@@ -502,12 +565,46 @@ export declare namespace Webhook {
|
|
|
502
565
|
type Dispatchable = {
|
|
503
566
|
/** Stored funding deposit address id. */
|
|
504
567
|
addressId: string
|
|
568
|
+
/** Bounded follow-up state for work awaiting provider or settlement confirmation. */
|
|
569
|
+
followUp?: FollowUp | undefined
|
|
505
570
|
/** Reconciliation lease fencing token, when a scheduled poll already claimed the address. */
|
|
506
571
|
pollLeaseVersion?: number | undefined
|
|
507
572
|
/** Optional provider request id that triggered reconciliation. */
|
|
508
573
|
requestId?: string | undefined
|
|
574
|
+
/** Mechanism that requested reconciliation. */
|
|
575
|
+
trigger: 'chain' | 'manual' | 'poll' | 'webhook'
|
|
509
576
|
/** Reconciliation queue message discriminator. */
|
|
510
577
|
type: 'funding:deposit-address:reconcile'
|
|
578
|
+
/** Authenticated provider webhook timing carried into reconciliation. */
|
|
579
|
+
webhookTiming?: WebhookTiming | undefined
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/** Bounded follow-up state carried between delayed reconciliation messages. */
|
|
583
|
+
type FollowUp = {
|
|
584
|
+
/** Zero-based attempt in the current follow-up schedule. */
|
|
585
|
+
attempt: number
|
|
586
|
+
/** Work that still awaits confirmation. */
|
|
587
|
+
kind: 'delivery' | 'provider' | 'settlement'
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/** Authenticated provider webhook timing used for latency measurement. */
|
|
591
|
+
type WebhookTiming = {
|
|
592
|
+
/** When Tempo sent the reconciliation message to its queue. */
|
|
593
|
+
enqueuedAt: string
|
|
594
|
+
/** Bounded provider status carried by the webhook. */
|
|
595
|
+
providerStatus: string
|
|
596
|
+
/** When the provider last changed the request status. */
|
|
597
|
+
providerUpdatedAt: string
|
|
598
|
+
/** When Tempo started processing the webhook request. */
|
|
599
|
+
receivedAt: string
|
|
600
|
+
/** When the provider sent the signed webhook. */
|
|
601
|
+
sentAt: string
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/** Durable reconciliation message, including messages queued before trigger attribution. */
|
|
605
|
+
type Queued = Omit<Dispatchable, 'trigger'> & {
|
|
606
|
+
/** Mechanism that requested reconciliation, when written by a trigger-aware producer. */
|
|
607
|
+
trigger?: Dispatchable['trigger'] | undefined
|
|
511
608
|
}
|
|
512
609
|
|
|
513
610
|
/** Safe disposition of one authenticated funding provider webhook. */
|
|
@@ -526,8 +623,14 @@ export declare namespace Webhook {
|
|
|
526
623
|
type ReturnType = {
|
|
527
624
|
/** Reusable provider address, when the provider attributed one. */
|
|
528
625
|
address?: string | undefined
|
|
626
|
+
/** Bounded provider status carried by the webhook. */
|
|
627
|
+
providerStatus?: string | undefined
|
|
628
|
+
/** When the provider last changed the request status. */
|
|
629
|
+
providerUpdatedAt?: string | undefined
|
|
529
630
|
/** Provider request id, when included in the event. */
|
|
530
631
|
requestId?: string | undefined
|
|
632
|
+
/** When the provider sent the signed webhook. */
|
|
633
|
+
sentAt?: string | undefined
|
|
531
634
|
}
|
|
532
635
|
}
|
|
533
636
|
}
|
|
@@ -546,6 +649,11 @@ export type Provider<id extends string = string> = core_Provider.Provider<id, 'f
|
|
|
546
649
|
input: listDepositAddressRequests.Parameters,
|
|
547
650
|
signal: AbortSignal,
|
|
548
651
|
): Promise<listDepositAddressRequests.ReturnType>
|
|
652
|
+
/** Observes authenticated delivery for a pending reusable-address request, when supported. */
|
|
653
|
+
observeDepositAddressRequest?(
|
|
654
|
+
input: observeDepositAddressRequest.Parameters,
|
|
655
|
+
signal: AbortSignal,
|
|
656
|
+
): Promise<observeDepositAddressRequest.ReturnType>
|
|
549
657
|
/** Prepares an executable funding transfer, when the provider supports it. */
|
|
550
658
|
prepareTransfer?(
|
|
551
659
|
input: prepareTransfer.Parameters,
|
|
@@ -595,6 +703,13 @@ export function canListDepositAddressRequests(provider: Provider): provider is P
|
|
|
595
703
|
return typeof provider.listDepositAddressRequests === 'function'
|
|
596
704
|
}
|
|
597
705
|
|
|
706
|
+
/** Narrows a funding provider to one that observes reusable-address delivery onchain. */
|
|
707
|
+
export function canObserveDepositAddressRequest(provider: Provider): provider is Provider & {
|
|
708
|
+
observeDepositAddressRequest: NonNullable<Provider['observeDepositAddressRequest']>
|
|
709
|
+
} {
|
|
710
|
+
return typeof provider.observeDepositAddressRequest === 'function'
|
|
711
|
+
}
|
|
712
|
+
|
|
598
713
|
/** Narrows a funding provider to one with authenticated webhook receipt. */
|
|
599
714
|
export function canReceiveWebhook(provider: Provider): provider is Provider & {
|
|
600
715
|
webhook: Webhook
|
|
@@ -210,9 +210,11 @@ describe.skipIf(runtime.mode !== 'localnet')('reconcileRequest', () => {
|
|
|
210
210
|
{
|
|
211
211
|
"createdAt": Any<String>,
|
|
212
212
|
"depositAddressId": Any<String>,
|
|
213
|
+
"detectionTrigger": "poll",
|
|
213
214
|
"environment": "production",
|
|
214
215
|
"id": Any<String>,
|
|
215
216
|
"orgId": "org_local_subsidy",
|
|
217
|
+
"pollObservedAt": null,
|
|
216
218
|
"projectId": null,
|
|
217
219
|
"providerOutputAmount": {
|
|
218
220
|
"baseUnits": "950000",
|
|
@@ -318,6 +320,7 @@ describe.skipIf(runtime.mode !== 'localnet')('reconcileRequest', () => {
|
|
|
318
320
|
"tempoGasPaid": null,
|
|
319
321
|
"updatedAt": Any<String>,
|
|
320
322
|
"version": 3,
|
|
323
|
+
"webhookReceivedAt": null,
|
|
321
324
|
}
|
|
322
325
|
`,
|
|
323
326
|
)
|
|
@@ -366,9 +369,11 @@ describe.skipIf(runtime.mode !== 'localnet')('reconcileRequest', () => {
|
|
|
366
369
|
"completed": {
|
|
367
370
|
"createdAt": Any<String>,
|
|
368
371
|
"depositAddressId": Any<String>,
|
|
372
|
+
"detectionTrigger": "poll",
|
|
369
373
|
"environment": "production",
|
|
370
374
|
"id": Any<String>,
|
|
371
375
|
"orgId": "org_local_subsidy",
|
|
376
|
+
"pollObservedAt": null,
|
|
372
377
|
"projectId": null,
|
|
373
378
|
"providerOutputAmount": {
|
|
374
379
|
"baseUnits": "950000",
|
|
@@ -480,6 +485,7 @@ describe.skipIf(runtime.mode !== 'localnet')('reconcileRequest', () => {
|
|
|
480
485
|
"tempoGasPaid": Any<String>,
|
|
481
486
|
"updatedAt": Any<String>,
|
|
482
487
|
"version": 7,
|
|
488
|
+
"webhookReceivedAt": null,
|
|
483
489
|
},
|
|
484
490
|
"first": {
|
|
485
491
|
"created": 1,
|
|
@@ -489,6 +495,7 @@ describe.skipIf(runtime.mode !== 'localnet')('reconcileRequest', () => {
|
|
|
489
495
|
"memoMatchesDeposit": true,
|
|
490
496
|
"second": {
|
|
491
497
|
"created": 0,
|
|
498
|
+
"followUp": "settlement",
|
|
492
499
|
"terminal": false,
|
|
493
500
|
"updated": 1,
|
|
494
501
|
},
|