mppx 0.9.0 → 0.9.2
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/CHANGELOG.md +18 -0
- package/README.md +7 -0
- package/dist/Errors.d.ts +10 -0
- package/dist/Errors.js +12 -0
- package/dist/Mcp.d.ts +9 -1
- package/dist/Mcp.js +18 -0
- package/dist/Method.d.ts +7 -0
- package/dist/cli/cli.d.ts +1 -0
- package/dist/cli/cli.js +135 -135
- package/dist/cli/internal.js +2 -2
- package/dist/cli/plugins/evm.js +2 -0
- package/dist/cli/plugins/index.d.ts +1 -0
- package/dist/cli/plugins/index.js +12 -12
- package/dist/cli/plugins/x402.d.ts +3 -0
- package/dist/cli/plugins/x402.js +61 -0
- package/dist/client/internal/protocols/Mcp.js +2 -1
- package/dist/mcp/client/McpClient.js +22 -10
- package/dist/mcp/server/Transport.d.ts +2 -2
- package/dist/mcp/server/Transport.js +11 -4
- package/dist/middlewares/internal/mppx.js +17 -3
- package/dist/server/Mppx.d.ts +6 -0
- package/dist/server/Mppx.js +75 -6
- package/dist/server/Transport.js +8 -15
- package/dist/stripe/Methods.d.ts +24 -0
- package/dist/stripe/Methods.js +3 -1
- package/dist/stripe/client/Charge.d.ts +24 -0
- package/dist/stripe/client/Methods.d.ts +24 -0
- package/dist/stripe/internal/constants.d.ts +4 -0
- package/dist/stripe/internal/constants.js +2 -0
- package/dist/stripe/internal/payment-intent.d.ts +16 -0
- package/dist/stripe/internal/payment-intent.js +13 -0
- package/dist/stripe/internal/types.d.ts +4 -0
- package/dist/stripe/server/Charge.d.ts +24 -0
- package/dist/stripe/server/Charge.js +31 -10
- package/dist/stripe/server/Methods.d.ts +6 -0
- package/dist/stripe/server/Methods.js +80 -8
- package/dist/stripe/server/internal/hosted-fee-payer.d.ts +10 -0
- package/dist/stripe/server/internal/hosted-fee-payer.js +54 -0
- package/dist/stripe/server/internal/html.gen.d.ts +1 -1
- package/dist/stripe/server/internal/html.gen.js +1 -1
- package/dist/stripe/server/internal/record-payment.d.ts +3 -1
- package/dist/stripe/server/internal/record-payment.js +33 -5
- package/dist/tempo/Tokens.d.ts +13 -0
- package/dist/tempo/Tokens.js +13 -0
- package/dist/tempo/client/Charge.d.ts +1 -1
- package/dist/tempo/client/Charge.js +17 -0
- package/dist/tempo/index.d.ts +1 -0
- package/dist/tempo/index.js +1 -0
- package/dist/tempo/internal/account.d.ts +1 -0
- package/dist/tempo/internal/fee-payer.d.ts +1 -1
- package/dist/tempo/internal/fee-payer.js +2 -12
- package/dist/tempo/internal/fee-token.d.ts +2 -0
- package/dist/tempo/internal/fee-token.js +7 -0
- package/dist/tempo/internal/remote-fee-payer.d.ts +2 -0
- package/dist/tempo/server/internal/html.gen.d.ts +1 -1
- package/dist/tempo/server/internal/html.gen.js +1 -1
- package/dist/tempo/session/client/SessionManager.js +1 -2
- package/dist/tempo/session/server/Session.js +5 -2
- package/dist/viem/Client.js +1 -0
- package/dist/x402/mcp.js +4 -3
- package/package.json +1 -1
package/dist/cli/internal.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
import * as AcceptPayment from '../internal/AcceptPayment.js';
|
|
4
|
-
import { evm as evmPlugin, stripe as stripePlugin, tempo as tempoPlugin } from './plugins/index.js';
|
|
5
|
-
const builtinPlugins = [tempoPlugin(), stripePlugin(), evmPlugin()];
|
|
4
|
+
import { evm as evmPlugin, stripe as stripePlugin, tempo as tempoPlugin, x402 as x402Plugin, } from './plugins/index.js';
|
|
5
|
+
const builtinPlugins = [tempoPlugin(), stripePlugin(), evmPlugin(), x402Plugin()];
|
|
6
6
|
export function resolvePlugin(challenge, config) {
|
|
7
7
|
const configPlugin = config?.plugins?.find((p) => supportsPlugin(p, challenge));
|
|
8
8
|
if (configPlugin)
|
package/dist/cli/plugins/evm.js
CHANGED
|
@@ -2,11 +2,13 @@ import { createClient, erc20Abi, http } from 'viem';
|
|
|
2
2
|
import { readContract } from 'viem/actions';
|
|
3
3
|
import * as viemChains from 'viem/chains';
|
|
4
4
|
import { evm as evmMethods, assets as evmAssets } from '../../evm/client/index.js';
|
|
5
|
+
import * as x402_ChallengeBrand from '../../x402/internal/ChallengeBrand.js';
|
|
5
6
|
import { resolveAccount } from '../account.js';
|
|
6
7
|
import { createPlugin } from './plugin.js';
|
|
7
8
|
export function evm() {
|
|
8
9
|
return createPlugin({
|
|
9
10
|
method: 'evm',
|
|
11
|
+
supports: (challenge) => challenge.method === 'evm' && !x402_ChallengeBrand.is(challenge),
|
|
10
12
|
async setup({ challenge }) {
|
|
11
13
|
const request = challenge.request;
|
|
12
14
|
const methodDetails = request.methodDetails;
|