@universal-everything/sdk-core-viem 1.1.0-dev.f8883ee → 1.1.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/README.md +45 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -58,6 +58,51 @@ unchanged.
|
|
|
58
58
|
`signTypedData` throws because the relayer has no
|
|
59
59
|
`/v1/sign/typed-data` endpoint yet. Track in M11.
|
|
60
60
|
|
|
61
|
+
## Onboarding helpers (A1 external-controller deploy)
|
|
62
|
+
|
|
63
|
+
For extensionless onboarding, this package also exports pure,
|
|
64
|
+
chain-free helpers to predict a Universal Profile's CREATE2 address and
|
|
65
|
+
prove control of an external controller — the client side of the
|
|
66
|
+
relayer's A1 deploy path. No account adapter needed; they take a
|
|
67
|
+
caller-supplied `signMessage`.
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import {
|
|
71
|
+
predictProfileAddress,
|
|
72
|
+
deriveLsp23ProxyAddress,
|
|
73
|
+
encodeDeploymentCalldata,
|
|
74
|
+
buildControlProof,
|
|
75
|
+
} from "@universal-everything/sdk-core-viem";
|
|
76
|
+
|
|
77
|
+
// 1. Vary `salt` to offer the user a choice of profile addresses
|
|
78
|
+
// (identicons) — each derivation is offline, no RPC.
|
|
79
|
+
const { deploymentCalldata, predictedAddress } = predictProfileAddress(
|
|
80
|
+
factoryAddress,
|
|
81
|
+
{ salt, primaryImplementation, secondaryImplementation,
|
|
82
|
+
postDeploymentModule, postDeploymentModuleCalldata },
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
// 2. Prove the external controller authorized THIS deploy. The message
|
|
86
|
+
// is byte-identical to the relayer's `buildControlProofMessage`, so
|
|
87
|
+
// the recovered signer must match or the deploy is rejected.
|
|
88
|
+
const nonce = await client.getNonce();
|
|
89
|
+
const controlProof = await buildControlProof(
|
|
90
|
+
{ subject, controllerAddress, predictedAddress, chainId, deploymentCalldata },
|
|
91
|
+
nonce,
|
|
92
|
+
Math.floor(Date.now() / 1000),
|
|
93
|
+
(message) => wallet.signMessage({ message }), // wagmi / viem / Privy
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
// 3. Deploy via the external-controller variant of `client.deployProfile`.
|
|
97
|
+
await client.deployProfile({
|
|
98
|
+
chainId, controllerAddress, controlProof, predictedAddress, deploymentCalldata,
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`deriveLsp23ProxyAddress({ factoryAddress, deploymentCalldata })` is the
|
|
103
|
+
standalone predictor if you already have calldata;
|
|
104
|
+
`encodeDeploymentCalldata` builds it from `Lsp23DeploymentParams`.
|
|
105
|
+
|
|
61
106
|
## Privy per-op authorization
|
|
62
107
|
|
|
63
108
|
For user-owned Privy wallets, each sign call needs a fresh per-op
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@universal-everything/sdk-core-viem",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/universal-everything/universal-relayer.git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"viem": "^2.21.0",
|
|
26
|
-
"@universal-everything/sdk-core": "1.1.0
|
|
26
|
+
"@universal-everything/sdk-core": "1.1.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"typescript": "^5.7.0",
|