@agentbadge/circle-payments 0.1.3 → 0.1.4
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
CHANGED
|
@@ -26,4 +26,5 @@ export interface ArcSelfSettleHandle {
|
|
|
26
26
|
settle(payload: unknown, requirements: PaymentRequirements): Promise<SettleResult>;
|
|
27
27
|
}
|
|
28
28
|
export declare function buildArcSelfSettleRequirements(chain: SupportedChain, amount: string, payTo: string): PaymentRequirements;
|
|
29
|
+
export declare function createArcSelfSettleHandle(config: ArcSelfSettleConfig): ArcSelfSettleHandle;
|
|
29
30
|
export declare function registerArcSelfSettleScheme(server: x402ResourceServer, config: ArcSelfSettleConfig): ArcSelfSettleHandle;
|
|
@@ -57,16 +57,13 @@ function findPaymentTransfer(receipt, usdc, payTo, amount) {
|
|
|
57
57
|
}
|
|
58
58
|
return undefined;
|
|
59
59
|
}
|
|
60
|
-
export function
|
|
60
|
+
export function createArcSelfSettleHandle(config) {
|
|
61
61
|
const chain = config.chain ?? ARC_TESTNET;
|
|
62
62
|
const publicClient = config.publicClient ??
|
|
63
63
|
createPublicClient({
|
|
64
64
|
transport: http(config.rpcUrl ?? chain.rpcUrl),
|
|
65
65
|
});
|
|
66
66
|
const seenTxHashes = config.seenTxHashes ?? new Set();
|
|
67
|
-
server.register(chain.caip2, {
|
|
68
|
-
scheme: ARC_SELF_SETTLE_SCHEME,
|
|
69
|
-
});
|
|
70
67
|
async function inspectReceipt(payload, requirements, phase) {
|
|
71
68
|
const txHash = extractTxHash(payload);
|
|
72
69
|
if (!txHash)
|
|
@@ -112,3 +109,10 @@ export function registerArcSelfSettleScheme(server, config) {
|
|
|
112
109
|
},
|
|
113
110
|
};
|
|
114
111
|
}
|
|
112
|
+
export function registerArcSelfSettleScheme(server, config) {
|
|
113
|
+
const handle = createArcSelfSettleHandle(config);
|
|
114
|
+
server.register(handle.network, {
|
|
115
|
+
scheme: ARC_SELF_SETTLE_SCHEME,
|
|
116
|
+
});
|
|
117
|
+
return handle;
|
|
118
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentbadge/circle-payments",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Circle Gateway nanopayments + x402 payment rails (Base Sepolia, Arc) for AgentBadge
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "Circle Gateway nanopayments + x402 payment rails (Base Sepolia, Arc) for AgentBadge — trusted agent payments",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -49,4 +49,4 @@
|
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"hono": "^4.7.0"
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
}
|