@chipi-stack/chipi-react 14.8.0 → 14.10.0
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 +33 -0
- package/dist/hooks.d.mts +7 -2619
- package/dist/hooks.d.ts +7 -2619
- package/dist/hooks.js +19581 -211
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +19424 -81
- package/dist/hooks.mjs.map +1 -1
- package/dist/index-D9-uVlda.d.mts +2861 -0
- package/dist/index-D9-uVlda.d.ts +2861 -0
- package/dist/index.d.mts +61 -2
- package/dist/index.d.ts +61 -2
- package/dist/index.js +19696 -178
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19675 -186
- package/dist/index.mjs.map +1 -1
- package/dist/multisig.d.mts +133 -1
- package/dist/multisig.d.ts +133 -1
- package/dist/multisig.js +467 -1
- package/dist/multisig.js.map +1 -1
- package/dist/multisig.mjs +459 -2
- package/dist/multisig.mjs.map +1 -1
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -109,3 +109,36 @@ Full docs at [docs.chipipay.com](https://docs.chipipay.com)
|
|
|
109
109
|
## License
|
|
110
110
|
|
|
111
111
|
MIT
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## Private balances (useShield / useUnshield / usePrivateBalance)
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
import { useShield, usePrivateBalance, derivePrivacyAccount } from "@chipi-stack/chipi-react";
|
|
118
|
+
|
|
119
|
+
const keys = await derivePrivacyAccount({
|
|
120
|
+
anchorSecret,
|
|
121
|
+
seedDomainTag: wallet.address,
|
|
122
|
+
classHash: COMPANION_CLASS_HASH,
|
|
123
|
+
});
|
|
124
|
+
const { shieldAsync } = useShield();
|
|
125
|
+
await shieldAsync({
|
|
126
|
+
config: {
|
|
127
|
+
apiPublicKey,
|
|
128
|
+
getBearerToken: () => getToken(),
|
|
129
|
+
gatewaySubmitUrl: "/api/starknet-gateway", // browsers need this CORS proxy
|
|
130
|
+
},
|
|
131
|
+
keys,
|
|
132
|
+
token: USDC_ADDRESS,
|
|
133
|
+
amount: 1_000_000n,
|
|
134
|
+
fundDeposit: (companion, amount) => transferGasless(companion, amount),
|
|
135
|
+
onStep: setPhase, // prepare | fund | deposit | prove | finish
|
|
136
|
+
});
|
|
137
|
+
const { byToken } = usePrivateBalance({ mode: "ledger", events: recordedEvents });
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Client-derived keys (cache the address, never the keys; the DELEGATED
|
|
141
|
+
PROVER sees the pool key per op — privacy holds vs the public, not the
|
|
142
|
+
proving operator: see the docs' trust-model section),
|
|
143
|
+
gasless for the end user (Chipi fronts the STRK per allowlisted API key).
|
|
144
|
+
Capture the StarkWare pool ToS at the first shield. Full guide in the docs.
|