@coinbase/cdp-wagmi 0.0.71 → 0.0.73
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 +62 -0
- package/dist/esm/index3.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -406,4 +406,66 @@ export function WagmiSendCalls() {
|
|
|
406
406
|
</div>
|
|
407
407
|
);
|
|
408
408
|
}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
**Transaction Attribution with EIP-8021:**
|
|
412
|
+
|
|
413
|
+
You can add attribution data to Smart Account operations for tracking app usage and revenue sharing using the `dataSuffix` capability:
|
|
414
|
+
|
|
415
|
+
```tsx lines
|
|
416
|
+
import { useSendCalls, useChainId } from "wagmi;
|
|
417
|
+
import { parseEther, type Hex } from "viem";
|
|
418
|
+
|
|
419
|
+
function SendCallsWithAttribution() {
|
|
420
|
+
const { sendCalls, isPending } = useSendCalls();
|
|
421
|
+
const chainId = useChainId();
|
|
422
|
+
|
|
423
|
+
const handleSendWithAttribution = async () => {
|
|
424
|
+
// EIP-8021 data suffix for "baseapp" attribution (Schema ID 0)
|
|
425
|
+
const dataSuffix = "0xdddddddd62617365617070070080218021802180218021802180218021" as Hex;
|
|
426
|
+
|
|
427
|
+
await sendCalls({
|
|
428
|
+
calls: [
|
|
429
|
+
{
|
|
430
|
+
to: "0xTargetContract",
|
|
431
|
+
value: parseEther("0.001"),
|
|
432
|
+
}
|
|
433
|
+
],
|
|
434
|
+
capabilities: {
|
|
435
|
+
dataSuffix: {
|
|
436
|
+
value: dataSuffix // Attribution data appended to callData
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
return (
|
|
443
|
+
<button onClick={handleSendWithAttribution} disabled={isPending}>
|
|
444
|
+
Send with Attribution
|
|
445
|
+
</button>
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
The `dataSuffix` capability accepts a hex-encoded string following the [EIP-8021 standard](https://eip.tools/eip/8021). The suffix is automatically appended to the user operation's `callData` for onchain attribution, enabling usage tracking and revenue sharing mechanisms.
|
|
451
|
+
|
|
452
|
+
**Checking Data Suffix Support:**
|
|
453
|
+
|
|
454
|
+
Use `useCapabilities` to check if the wallet supports data suffix:
|
|
455
|
+
|
|
456
|
+
```tsx lines
|
|
457
|
+
import { useCapabilities, useChainId } from "wagmi/experimental";
|
|
458
|
+
|
|
459
|
+
function CheckDataSuffixSupport() {
|
|
460
|
+
const { data: capabilities } = useCapabilities();
|
|
461
|
+
const chainId = useChainId();
|
|
462
|
+
|
|
463
|
+
const supportsDataSuffix = capabilities?.[chainId.toString()]?.dataSuffix?.supported;
|
|
464
|
+
|
|
465
|
+
return (
|
|
466
|
+
<div>
|
|
467
|
+
Data Suffix Support: {supportsDataSuffix ? "✅ Supported" : "❌ Not Supported"}
|
|
468
|
+
</div>
|
|
469
|
+
);
|
|
470
|
+
}
|
|
409
471
|
```
|
package/dist/esm/index3.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cdp-wagmi",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.73",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"react": ">=18.2.0",
|
|
20
20
|
"viem": "^2.33.0",
|
|
21
21
|
"wagmi": "^2.16.0",
|
|
22
|
-
"@coinbase/cdp-core": "^0.0.
|
|
22
|
+
"@coinbase/cdp-core": "^0.0.73"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@tanstack/react-query": "^5.0.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@size-limit/webpack": "^11.2.0",
|
|
36
36
|
"@size-limit/webpack-why": "^11.2.0",
|
|
37
37
|
"size-limit": "^11.2.0",
|
|
38
|
-
"@coinbase/cdp-core": "^0.0.
|
|
38
|
+
"@coinbase/cdp-core": "^0.0.73"
|
|
39
39
|
},
|
|
40
40
|
"size-limit": [
|
|
41
41
|
{
|