@xona-labs/xpay 0.2.23 → 0.2.25
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 +133 -76
- package/README.md +95 -71
- package/SKILL.md +29 -22
- package/dist/agenc/api.d.ts +8 -8
- package/dist/agenc/api.js +11 -11
- package/dist/agenc/hire.d.ts +4 -4
- package/dist/agenc/hire.js +17 -17
- package/dist/agenc/price.d.ts +1 -1
- package/dist/agenc/price.js +1 -1
- package/dist/biometric/index.d.ts +3 -3
- package/dist/biometric/index.js +6 -6
- package/dist/cli/accounts.d.ts +1 -1
- package/dist/cli/accounts.js +1 -1
- package/dist/cli/agenc.d.ts +2 -2
- package/dist/cli/agenc.js +4 -4
- package/dist/cli/balance.d.ts +1 -1
- package/dist/cli/balance.d.ts.map +1 -1
- package/dist/cli/balance.js +11 -10
- package/dist/cli/balance.js.map +1 -1
- package/dist/cli/bento.d.ts +3 -3
- package/dist/cli/bento.js +8 -8
- package/dist/cli/bento.js.map +1 -1
- package/dist/cli/biometric.d.ts +1 -1
- package/dist/cli/biometric.js +8 -8
- package/dist/cli/common.js +6 -6
- package/dist/cli/common.js.map +1 -1
- package/dist/cli/discover.d.ts +2 -2
- package/dist/cli/discover.js +10 -4
- package/dist/cli/discover.js.map +1 -1
- package/dist/cli/guardrail.d.ts +1 -1
- package/dist/cli/guardrail.js +3 -3
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +12 -12
- package/dist/cli/init.d.ts +1 -1
- package/dist/cli/init.js +2 -2
- package/dist/cli/magicblock.d.ts +1 -1
- package/dist/cli/magicblock.js +4 -4
- package/dist/cli/mcp-server.d.ts +2 -2
- package/dist/cli/mcp-server.js +21 -21
- package/dist/cli/pay.d.ts +1 -1
- package/dist/cli/pay.js +1 -1
- package/dist/cli/report.d.ts +2 -2
- package/dist/cli/report.js +4 -4
- package/dist/cli/report.js.map +1 -1
- package/dist/cli/sana.d.ts +1 -1
- package/dist/cli/sana.js +3 -3
- package/dist/cli/shop.d.ts +1 -1
- package/dist/cli/shop.js +1 -1
- package/dist/cli/swap.d.ts +1 -1
- package/dist/cli/swap.js +3 -3
- package/dist/cli/token.d.ts +2 -2
- package/dist/cli/token.js +2 -2
- package/dist/cli/trade.d.ts +2 -2
- package/dist/cli/trade.js +8 -8
- package/dist/cli/trade.js.map +1 -1
- package/dist/cli/transfer.d.ts +1 -1
- package/dist/cli/transfer.js +1 -1
- package/dist/cli/x.d.ts +1 -1
- package/dist/cli/x.js +1 -1
- package/dist/cli/zauth.d.ts +1 -1
- package/dist/cli/zauth.js +5 -5
- package/dist/discover/cache.js +1 -1
- package/dist/discover/index.d.ts +2 -2
- package/dist/discover/index.d.ts.map +1 -1
- package/dist/discover/index.js +21 -7
- package/dist/discover/index.js.map +1 -1
- package/dist/discover/orbitx402.d.ts +2 -2
- package/dist/discover/orbitx402.js +1 -1
- package/dist/discover/payai.js +1 -1
- package/dist/do/index.d.ts +2 -2
- package/dist/do/index.js +1 -1
- package/dist/guardrail/index.d.ts +4 -4
- package/dist/guardrail/index.js +14 -14
- package/dist/guardrail/index.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +2 -2
- package/dist/magicblock/client.d.ts +2 -2
- package/dist/magicblock/client.js +4 -4
- package/dist/profile/index.d.ts +3 -3
- package/dist/profile/index.d.ts.map +1 -1
- package/dist/profile/index.js +13 -4
- package/dist/profile/index.js.map +1 -1
- package/dist/profile/storage.d.ts +1 -1
- package/dist/profile/storage.js +4 -4
- package/dist/profile/types.d.ts +6 -6
- package/dist/profile/types.js +1 -1
- package/dist/report/index.d.ts +1 -1
- package/dist/report/index.js +2 -2
- package/dist/sana/tools.js +8 -8
- package/dist/signers/raw-evm.d.ts +1 -1
- package/dist/signers/raw-evm.d.ts.map +1 -1
- package/dist/signers/raw-evm.js +22 -7
- package/dist/signers/raw-evm.js.map +1 -1
- package/dist/signers/raw-solana.d.ts +1 -1
- package/dist/signers/raw-solana.js +4 -4
- package/dist/swap/index.d.ts +6 -6
- package/dist/swap/index.js +12 -12
- package/dist/token/index.d.ts +8 -8
- package/dist/token/index.js +14 -14
- package/dist/token/rwa.d.ts +3 -3
- package/dist/token/rwa.js +3 -3
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +46 -41
- package/dist/tools/index.js.map +1 -1
- package/dist/trading/discovery.d.ts +6 -6
- package/dist/trading/discovery.js +7 -7
- package/dist/trading/index.d.ts +6 -6
- package/dist/trading/index.js +13 -13
- package/dist/transfer/index.d.ts +6 -5
- package/dist/transfer/index.d.ts.map +1 -1
- package/dist/transfer/index.js +41 -21
- package/dist/transfer/index.js.map +1 -1
- package/dist/types.d.ts +10 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/use/index.d.ts +5 -5
- package/dist/use/index.js +24 -20
- package/dist/use/index.js.map +1 -1
- package/dist/wallet/index.d.ts +2 -2
- package/dist/wallet/index.d.ts.map +1 -1
- package/dist/wallet/index.js +5 -3
- package/dist/wallet/index.js.map +1 -1
- package/dist/x402/evm-payment.d.ts +4 -4
- package/dist/x402/evm-payment.d.ts.map +1 -1
- package/dist/x402/evm-payment.js +7 -6
- package/dist/x402/evm-payment.js.map +1 -1
- package/dist/x402/extract.d.ts +1 -1
- package/dist/x402/extract.js +1 -1
- package/dist/x402/svm-payment.d.ts +2 -2
- package/dist/x402/svm-payment.js +2 -2
- package/dist/zauth/index.d.ts +4 -4
- package/dist/zauth/index.js +5 -5
- package/package.json +6 -3
package/dist/wallet/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqCH,MAAM,UAAU,YAAY,CAAC,IAAmB;IAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/B,MAAM,OAAO,GAAG,IAAI,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IP-3009 `TransferWithAuthorization` typed-data payload
|
|
6
|
-
* (an off-chain signature
|
|
6
|
+
* (an off-chain signature - USDC supports it natively) → header carries
|
|
7
7
|
* the authorization + signature → facilitator submits the transfer
|
|
8
8
|
* on-chain and pays the gas.
|
|
9
9
|
*
|
|
@@ -19,7 +19,7 @@ import type { PaymentRequirement } from "../types.js";
|
|
|
19
19
|
export interface BuildEvmPaymentArgs {
|
|
20
20
|
/** Payer address (the EVM signer's wallet address). */
|
|
21
21
|
address: string;
|
|
22
|
-
/** EIP-712 typed-data signer
|
|
22
|
+
/** EIP-712 typed-data signer - from `signer.signEvmTypedData`. */
|
|
23
23
|
signTypedData: (typedData: {
|
|
24
24
|
domain: Record<string, unknown>;
|
|
25
25
|
types: Record<string, Array<{
|
|
@@ -39,12 +39,12 @@ export declare function isEvmNetwork(network: string): boolean;
|
|
|
39
39
|
/**
|
|
40
40
|
* True when this requirement carries the EIP-712 domain params (`extra.name`
|
|
41
41
|
* + `extra.version`) the gasless signature needs. Catalog snapshots usually
|
|
42
|
-
* strip `extra`
|
|
42
|
+
* strip `extra` - a fresh 402 challenge always has it.
|
|
43
43
|
*/
|
|
44
44
|
export declare function hasEvmDomainParams(req: PaymentRequirement): boolean;
|
|
45
45
|
/**
|
|
46
46
|
* Returns the value of the `X-Payment` header (base64 of canonical JSON
|
|
47
|
-
* envelope), ready to attach to the retry request. Nothing is broadcast
|
|
47
|
+
* envelope), ready to attach to the retry request. Nothing is broadcast -
|
|
48
48
|
* the facilitator settles server-side.
|
|
49
49
|
*/
|
|
50
50
|
export declare function buildEvmPaymentHeader(args: BuildEvmPaymentArgs): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evm-payment.d.ts","sourceRoot":"","sources":["../../src/x402/evm-payment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"evm-payment.d.ts","sourceRoot":"","sources":["../../src/x402/evm-payment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAwBtD,MAAM,WAAW,mBAAmB;IAClC,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,aAAa,EAAE,CAAC,SAAS,EAAE;QACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC,CAAC;QAC7D,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,4CAA4C;IAC5C,WAAW,EAAE,kBAAkB,CAAC;IAChC,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CASlD;AAED,0FAA0F;AAC1F,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,kBAAkB,GAAG,OAAO,CAEnE;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8DtF"}
|
package/dist/x402/evm-payment.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Spec flow (`exact` scheme on eip155 networks):
|
|
5
5
|
* client signs an EIP-3009 `TransferWithAuthorization` typed-data payload
|
|
6
|
-
* (an off-chain signature
|
|
6
|
+
* (an off-chain signature - USDC supports it natively) → header carries
|
|
7
7
|
* the authorization + signature → facilitator submits the transfer
|
|
8
8
|
* on-chain and pays the gas.
|
|
9
9
|
*
|
|
@@ -33,6 +33,7 @@ const NAMED_CHAIN_IDS = {
|
|
|
33
33
|
arbitrum: 42161,
|
|
34
34
|
optimism: 10,
|
|
35
35
|
robinhood: 4663,
|
|
36
|
+
stable: 988,
|
|
36
37
|
};
|
|
37
38
|
export function evmChainId(network) {
|
|
38
39
|
if (network.startsWith("eip155:")) {
|
|
@@ -53,29 +54,29 @@ export function isEvmNetwork(network) {
|
|
|
53
54
|
/**
|
|
54
55
|
* True when this requirement carries the EIP-712 domain params (`extra.name`
|
|
55
56
|
* + `extra.version`) the gasless signature needs. Catalog snapshots usually
|
|
56
|
-
* strip `extra`
|
|
57
|
+
* strip `extra` - a fresh 402 challenge always has it.
|
|
57
58
|
*/
|
|
58
59
|
export function hasEvmDomainParams(req) {
|
|
59
60
|
return Boolean(req.extra?.name && req.extra?.version);
|
|
60
61
|
}
|
|
61
62
|
/**
|
|
62
63
|
* Returns the value of the `X-Payment` header (base64 of canonical JSON
|
|
63
|
-
* envelope), ready to attach to the retry request. Nothing is broadcast
|
|
64
|
+
* envelope), ready to attach to the retry request. Nothing is broadcast -
|
|
64
65
|
* the facilitator settles server-side.
|
|
65
66
|
*/
|
|
66
67
|
export async function buildEvmPaymentHeader(args) {
|
|
67
68
|
const req = args.requirement;
|
|
68
|
-
// The EIP-3009 payload shape only exists in x402 v2
|
|
69
|
+
// The EIP-3009 payload shape only exists in x402 v2 - never emit a v1
|
|
69
70
|
// envelope here (v1 catalog entries without a version reach us as 1).
|
|
70
71
|
const version = Math.max(args.x402Version ?? 2, 2);
|
|
71
72
|
if (!hasEvmDomainParams(req)) {
|
|
72
|
-
throw new Error(`buildEvmPaymentHeader: EIP-712 domain params (extra.name/extra.version) missing for asset ${req.asset}
|
|
73
|
+
throw new Error(`buildEvmPaymentHeader: EIP-712 domain params (extra.name/extra.version) missing for asset ${req.asset} - re-fetch the live 402 challenge`);
|
|
73
74
|
}
|
|
74
75
|
const now = Math.floor(Date.now() / 1000);
|
|
75
76
|
const nonceBytes = globalThis.crypto.getRandomValues(new Uint8Array(32));
|
|
76
77
|
const nonce = "0x" + Buffer.from(nonceBytes).toString("hex");
|
|
77
78
|
// Authorization values travel as decimal strings in the header payload but
|
|
78
|
-
// are signed as uint256
|
|
79
|
+
// are signed as uint256 - same split @x402/evm's client makes.
|
|
79
80
|
const authorization = {
|
|
80
81
|
from: args.address,
|
|
81
82
|
to: req.payTo,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evm-payment.js","sourceRoot":"","sources":["../../src/x402/evm-payment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,4DAA4D;AAC5D,MAAM,mBAAmB,GAAG;IAC1B,yBAAyB,EAAE;QACzB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;QACjC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;QAC/B,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;QAClC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;QACvC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE;QACxC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;KACnC;CACF,CAAC;AAEF,0DAA0D;AAC1D,MAAM,eAAe,GAA2B;IAC9C,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,IAAI;
|
|
1
|
+
{"version":3,"file":"evm-payment.js","sourceRoot":"","sources":["../../src/x402/evm-payment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,4DAA4D;AAC5D,MAAM,mBAAmB,GAAG;IAC1B,y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MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC1E,CAAC"}
|
package/dist/x402/extract.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* envelope, or a SINGLE bare requirement object
|
|
10
10
|
* encoding: raw JSON, base64-JSON, url-encoded JSON, or "<scheme> <payload>"
|
|
11
11
|
* fields: PayAI uses `amount`/`payTo`; the x402 spec uses
|
|
12
|
-
* `maxAmountRequired`/`payTo`; others use `recipient`/`token`
|
|
12
|
+
* `maxAmountRequired`/`payTo`; others use `recipient`/`token` -
|
|
13
13
|
* we alias them all into our PaymentRequirement.
|
|
14
14
|
*
|
|
15
15
|
* Shared by `probe()` and `useByUrl()`.
|
package/dist/x402/extract.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* envelope, or a SINGLE bare requirement object
|
|
10
10
|
* encoding: raw JSON, base64-JSON, url-encoded JSON, or "<scheme> <payload>"
|
|
11
11
|
* fields: PayAI uses `amount`/`payTo`; the x402 spec uses
|
|
12
|
-
* `maxAmountRequired`/`payTo`; others use `recipient`/`token`
|
|
12
|
+
* `maxAmountRequired`/`payTo`; others use `recipient`/`token` -
|
|
13
13
|
* we alias them all into our PaymentRequirement.
|
|
14
14
|
*
|
|
15
15
|
* Shared by `probe()` and `useByUrl()`.
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
* This is the path xPay 0.1.4+ takes for Solana endpoints reporting
|
|
9
9
|
* `x402Version >= 2` (CAIP networks like `solana:5eykt4…`). Legacy 0.1.x
|
|
10
10
|
* sent a sign-and-broadcast `txSig` header which is *not* what the
|
|
11
|
-
* canonical x402 servers expect
|
|
11
|
+
* canonical x402 servers expect - your endpoint would 4xx on the retry.
|
|
12
12
|
*
|
|
13
13
|
* Inputs (the `PaymentRequirement` xPay parsed from the 402 challenge) are
|
|
14
14
|
* normalized into `@x402/core/types`'s `PaymentRequirements` shape.
|
|
15
15
|
*/
|
|
16
16
|
import type { PaymentRequirement } from "../types.js";
|
|
17
17
|
export interface BuildSvmPaymentArgs {
|
|
18
|
-
/** A `@solana/kit` TransactionSigner
|
|
18
|
+
/** A `@solana/kit` TransactionSigner - from `signer.getKitSigner()`. */
|
|
19
19
|
kitSigner: unknown;
|
|
20
20
|
/** What the server's 402 told us we owe. */
|
|
21
21
|
requirement: PaymentRequirement;
|
package/dist/x402/svm-payment.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* This is the path xPay 0.1.4+ takes for Solana endpoints reporting
|
|
9
9
|
* `x402Version >= 2` (CAIP networks like `solana:5eykt4…`). Legacy 0.1.x
|
|
10
10
|
* sent a sign-and-broadcast `txSig` header which is *not* what the
|
|
11
|
-
* canonical x402 servers expect
|
|
11
|
+
* canonical x402 servers expect - your endpoint would 4xx on the retry.
|
|
12
12
|
*
|
|
13
13
|
* Inputs (the `PaymentRequirement` xPay parsed from the 402 challenge) are
|
|
14
14
|
* normalized into `@x402/core/types`'s `PaymentRequirements` shape.
|
|
@@ -43,7 +43,7 @@ export async function buildSvmPaymentHeader(args) {
|
|
|
43
43
|
// partial = { x402Version, payload: { transaction: <base64 signed tx> } }
|
|
44
44
|
// Assemble the FULL canonical PaymentPayloadV2 envelope:
|
|
45
45
|
// { x402Version, accepted: <the requirement we're paying>, payload }
|
|
46
|
-
// The `accepted` field is REQUIRED in v2
|
|
46
|
+
// The `accepted` field is REQUIRED in v2 - it tells the facilitator which
|
|
47
47
|
// of its advertised `accepts[]` items we picked. (Loose top-level
|
|
48
48
|
// scheme/network is v1; v2 nests them inside `accepted`.)
|
|
49
49
|
const envelope = {
|
package/dist/zauth/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* zauth partner integration
|
|
2
|
+
* zauth partner integration - repository security scans behind zauth's
|
|
3
3
|
* x402-paywalled endpoint. The scan POST is paid (normal x402 flow); results
|
|
4
4
|
* are polled from an unpaid status URL keyed by sessionToken. A repo that
|
|
5
5
|
* zauth has scanned recently may return its cached report on the POST
|
|
@@ -13,7 +13,7 @@ export interface ScanPending {
|
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Kickoff response from the paid POST: `{ status, scanId, sessionToken }`.
|
|
16
|
-
* Only this response carries the sessionToken (a ~1h JWT)
|
|
16
|
+
* Only this response carries the sessionToken (a ~1h JWT) - poll responses
|
|
17
17
|
* echo just `{ status, scanId, progress }`, so callers must hold on to the
|
|
18
18
|
* token themselves.
|
|
19
19
|
*/
|
|
@@ -23,7 +23,7 @@ export declare function isScanning(data: unknown): boolean;
|
|
|
23
23
|
/** One unpaid GET against the scan-status endpoint. */
|
|
24
24
|
export declare function fetchScanStatus(sessionToken: string): Promise<unknown>;
|
|
25
25
|
/**
|
|
26
|
-
* Completed reports embed every provenance match with full file contents
|
|
26
|
+
* Completed reports embed every provenance match with full file contents -
|
|
27
27
|
* tens of KB the caller rarely needs (analysisMarkdown already summarizes
|
|
28
28
|
* them). Swap the array for a count; use the raw payload when full detail
|
|
29
29
|
* matters (CLI --json).
|
|
@@ -38,7 +38,7 @@ export interface PollOptions {
|
|
|
38
38
|
/**
|
|
39
39
|
* Poll the unpaid status endpoint until the scan leaves "scanning" or the
|
|
40
40
|
* timeout elapses. On timeout the last payload (still pending) is returned
|
|
41
|
-
* rather than throwing
|
|
41
|
+
* rather than throwing - callers surface the sessionToken for a later check.
|
|
42
42
|
*/
|
|
43
43
|
export declare function pollRepoScan(sessionToken: string, opts?: PollOptions): Promise<unknown>;
|
|
44
44
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/zauth/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* zauth partner integration
|
|
2
|
+
* zauth partner integration - repository security scans behind zauth's
|
|
3
3
|
* x402-paywalled endpoint. The scan POST is paid (normal x402 flow); results
|
|
4
4
|
* are polled from an unpaid status URL keyed by sessionToken. A repo that
|
|
5
5
|
* zauth has scanned recently may return its cached report on the POST
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export const ZAUTH_BASE = process.env.XPAY_ZAUTH_ENDPOINT ?? "https://api.zauth.inc";
|
|
9
9
|
/**
|
|
10
10
|
* Kickoff response from the paid POST: `{ status, scanId, sessionToken }`.
|
|
11
|
-
* Only this response carries the sessionToken (a ~1h JWT)
|
|
11
|
+
* Only this response carries the sessionToken (a ~1h JWT) - poll responses
|
|
12
12
|
* echo just `{ status, scanId, progress }`, so callers must hold on to the
|
|
13
13
|
* token themselves.
|
|
14
14
|
*/
|
|
@@ -26,7 +26,7 @@ export async function fetchScanStatus(sessionToken) {
|
|
|
26
26
|
// The kickoff response carries both a short scanId and a JWT sessionToken;
|
|
27
27
|
// only the JWT works here. Catch the mixup before it becomes an opaque 401.
|
|
28
28
|
if (!sessionToken.includes(".")) {
|
|
29
|
-
throw new Error(`zauth: "${sessionToken}" looks like a scanId
|
|
29
|
+
throw new Error(`zauth: "${sessionToken}" looks like a scanId - pass the sessionToken (the long JWT from the scan kickoff) instead`);
|
|
30
30
|
}
|
|
31
31
|
const res = await fetch(`${ZAUTH_BASE}/x402/reposcan/${encodeURIComponent(sessionToken)}`);
|
|
32
32
|
const text = await res.text();
|
|
@@ -46,7 +46,7 @@ export async function fetchScanStatus(sessionToken) {
|
|
|
46
46
|
return data;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* Completed reports embed every provenance match with full file contents
|
|
49
|
+
* Completed reports embed every provenance match with full file contents -
|
|
50
50
|
* tens of KB the caller rarely needs (analysisMarkdown already summarizes
|
|
51
51
|
* them). Swap the array for a count; use the raw payload when full detail
|
|
52
52
|
* matters (CLI --json).
|
|
@@ -62,7 +62,7 @@ export function compactScanReport(data) {
|
|
|
62
62
|
/**
|
|
63
63
|
* Poll the unpaid status endpoint until the scan leaves "scanning" or the
|
|
64
64
|
* timeout elapses. On timeout the last payload (still pending) is returned
|
|
65
|
-
* rather than throwing
|
|
65
|
+
* rather than throwing - callers surface the sessionToken for a later check.
|
|
66
66
|
*/
|
|
67
67
|
export async function pollRepoScan(sessionToken, opts = {}) {
|
|
68
68
|
const timeoutMs = opts.timeoutMs ?? 90_000;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xona-labs/xpay",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
4
4
|
"mcpName": "io.github.xona-labs/xpay",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Xona Wallet: agent wallet and payment rail for agentic commerce. Multi-network wallet, x402 payments, AgenC marketplace hires, 20k+ services via PayAI and other catalogs",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
@@ -27,8 +27,9 @@
|
|
|
27
27
|
"type": "git",
|
|
28
28
|
"url": "https://github.com/xona-labs/xpay"
|
|
29
29
|
},
|
|
30
|
-
"homepage": "https://
|
|
30
|
+
"homepage": "https://wallet.xona-agent.com",
|
|
31
31
|
"keywords": [
|
|
32
|
+
"xona-wallet",
|
|
32
33
|
"x402",
|
|
33
34
|
"agentic-commerce",
|
|
34
35
|
"agenc",
|
|
@@ -36,6 +37,8 @@
|
|
|
36
37
|
"payai",
|
|
37
38
|
"solana",
|
|
38
39
|
"base",
|
|
40
|
+
"stable",
|
|
41
|
+
"usdt0",
|
|
39
42
|
"ai-agent",
|
|
40
43
|
"mcp",
|
|
41
44
|
"xona",
|