@agentcash/router 1.14.0 → 1.14.1
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/index.d.cts +8 -4
- package/dist/index.d.ts +8 -4
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1000,9 +1000,10 @@ interface ServiceRouter<TPriceKeys extends string = never> {
|
|
|
1000
1000
|
monitors(): MonitorEntry[];
|
|
1001
1001
|
registry: RouteRegistry;
|
|
1002
1002
|
}
|
|
1003
|
-
|
|
1004
|
-
prices
|
|
1005
|
-
}
|
|
1003
|
+
type ExtractPriceKeys<C> = [C] extends [{
|
|
1004
|
+
prices: infer P extends Record<string, string>;
|
|
1005
|
+
}] ? Extract<keyof P, string> : never;
|
|
1006
|
+
declare function createRouter<const C extends RouterConfig>(config: C): ServiceRouter<ExtractPriceKeys<C>>;
|
|
1006
1007
|
/**
|
|
1007
1008
|
* Build a {@link ServiceRouter} from environment variables.
|
|
1008
1009
|
*
|
|
@@ -1023,6 +1024,9 @@ declare function createRouter<const P extends Record<string, string> = Record<ne
|
|
|
1023
1024
|
* });
|
|
1024
1025
|
* ```
|
|
1025
1026
|
*/
|
|
1026
|
-
|
|
1027
|
+
type ExtractEnvPriceKeys<O> = [O] extends [{
|
|
1028
|
+
prices: infer P extends Record<string, string>;
|
|
1029
|
+
}] ? Extract<keyof P, string> : never;
|
|
1030
|
+
declare function createRouterFromEnv<const O extends CreateRouterFromEnvOptions>(options: O): ServiceRouter<ExtractEnvPriceKeys<O>>;
|
|
1027
1031
|
|
|
1028
1032
|
export { BASE_MAINNET_NETWORK, BASE_USDC_ADDRESS, BASE_USDC_DECIMALS, type CheckoutSessionContext, type CheckoutSessionFn, type CheckoutSessionResponse, type CreateRouterFromEnvOptions, DEFAULT_SOLANA_FACILITATOR_URL, DEFAULT_TEMPO_RPC_URL, type DiscoveryConfig, type HandlerContext, HttpError, type KvStore, type MppProtocolInfo, type PaidOptions, type ProtocolType, RouteDefinitionError, type RouterConfig, RouterConfigError, type RouterConfigIssue, type RouterConfigIssueCode, type RouterConfigIssueSeverity, type RouterPlugin, SOLANA_MAINNET_NETWORK, type ServiceRouter, type SettlementErrorContext, type SettlementLifecycleContext, type SettlementSettledContext, TEMPO_USDC_ADDRESS, TEMPO_USDC_DECIMALS, type X402FacilitatorsConfig, ZERO_EVM_ADDRESS, createRouter, createRouterFromEnv, routerConfigFromEnv };
|
package/dist/index.d.ts
CHANGED
|
@@ -1000,9 +1000,10 @@ interface ServiceRouter<TPriceKeys extends string = never> {
|
|
|
1000
1000
|
monitors(): MonitorEntry[];
|
|
1001
1001
|
registry: RouteRegistry;
|
|
1002
1002
|
}
|
|
1003
|
-
|
|
1004
|
-
prices
|
|
1005
|
-
}
|
|
1003
|
+
type ExtractPriceKeys<C> = [C] extends [{
|
|
1004
|
+
prices: infer P extends Record<string, string>;
|
|
1005
|
+
}] ? Extract<keyof P, string> : never;
|
|
1006
|
+
declare function createRouter<const C extends RouterConfig>(config: C): ServiceRouter<ExtractPriceKeys<C>>;
|
|
1006
1007
|
/**
|
|
1007
1008
|
* Build a {@link ServiceRouter} from environment variables.
|
|
1008
1009
|
*
|
|
@@ -1023,6 +1024,9 @@ declare function createRouter<const P extends Record<string, string> = Record<ne
|
|
|
1023
1024
|
* });
|
|
1024
1025
|
* ```
|
|
1025
1026
|
*/
|
|
1026
|
-
|
|
1027
|
+
type ExtractEnvPriceKeys<O> = [O] extends [{
|
|
1028
|
+
prices: infer P extends Record<string, string>;
|
|
1029
|
+
}] ? Extract<keyof P, string> : never;
|
|
1030
|
+
declare function createRouterFromEnv<const O extends CreateRouterFromEnvOptions>(options: O): ServiceRouter<ExtractEnvPriceKeys<O>>;
|
|
1027
1031
|
|
|
1028
1032
|
export { BASE_MAINNET_NETWORK, BASE_USDC_ADDRESS, BASE_USDC_DECIMALS, type CheckoutSessionContext, type CheckoutSessionFn, type CheckoutSessionResponse, type CreateRouterFromEnvOptions, DEFAULT_SOLANA_FACILITATOR_URL, DEFAULT_TEMPO_RPC_URL, type DiscoveryConfig, type HandlerContext, HttpError, type KvStore, type MppProtocolInfo, type PaidOptions, type ProtocolType, RouteDefinitionError, type RouterConfig, RouterConfigError, type RouterConfigIssue, type RouterConfigIssueCode, type RouterConfigIssueSeverity, type RouterPlugin, SOLANA_MAINNET_NETWORK, type ServiceRouter, type SettlementErrorContext, type SettlementLifecycleContext, type SettlementSettledContext, TEMPO_USDC_ADDRESS, TEMPO_USDC_DECIMALS, type X402FacilitatorsConfig, ZERO_EVM_ADDRESS, createRouter, createRouterFromEnv, routerConfigFromEnv };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentcash/router",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.1",
|
|
4
4
|
"description": "Unified route builder for Next.js App Router APIs with x402, MPP, SIWX, and API key auth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "tsup",
|
|
68
|
-
"typecheck": "tsc --noEmit",
|
|
68
|
+
"typecheck": "tsc --noEmit && tsc -p tests/tsconfig.json --noEmit",
|
|
69
69
|
"lint": "eslint src/ tests/ --max-warnings 0",
|
|
70
70
|
"lint:fix": "eslint src/ tests/ --fix",
|
|
71
71
|
"format": "prettier --write 'src/**/*.ts' 'tests/**/*.ts' 'examples/fortune/**/*.ts' 'examples/fortune/**/*.md' '*.json' '*.mjs'",
|