@chipi-stack/chipi-react 14.9.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 +2 -1
- package/dist/hooks.d.ts +2 -1
- package/dist/hooks.js +1032 -4
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +1029 -6
- package/dist/hooks.mjs.map +1 -1
- package/dist/{index-B8e6TdyG.d.mts → index-D9-uVlda.d.mts} +119 -1
- package/dist/{index-B8e6TdyG.d.ts → index-D9-uVlda.d.ts} +119 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1032 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1029 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -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.
|
package/dist/hooks.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { g as ChipiWalletData, S as SessionState, k as SessionWallet, X as ThresholdSignState, i as UseChipiSessionConfig, j as UseChipiSessionReturn, e as UseChipiWalletConfig, U as UseChipiWalletObjectConfig, f as UseChipiWalletReturn, R as UseGuardianRecoveryReturn, P as UseShhhSignerReturn, W as UseThresholdSignOptions, V as UseThresholdSignReturn, p as UseTransferConfig, M as UseX402PaymentConfig, N as UseX402PaymentReturn, H as useAddSessionKeyToContract, q as useApprove, A as useCallAnyContract, h as useChipiSession, d as useChipiWallet, D as useChipiWalletObject, G as useCreateSessionKey, u as useCreateWallet, K as useExecuteWithSession, J as useGetSessionData, z as useGetSku, y as useGetSkuList, x as useGetSkuPurchase, F as useGetTokenBalance, s as useGetTransaction, r as useGetTransactionList, t as useGetTransactionStatus, c as useGetWallet, Q as useGuardianRecovery, l as useMigrateWalletToPasskey, n as useMigrateWalletToShhh, w as usePurchaseSku, E as useRecordSendTransaction, I as useRevokeSessionKey, O as useShhhSigner, B as useSignTypedData, v as useSyncOnChainTransfers, T as useThresholdSign, o as useTransfer, m as useUpdateWalletEncryption, L as useX402Payment } from './index-
|
|
1
|
+
export { g as ChipiWalletData, a1 as PrivacyConfig, a2 as PrivacyKeys, a5 as PrivacyLedgerEvent, a3 as PrivacyStep, a6 as PrivateBalanceInput, S as SessionState, k as SessionWallet, a4 as ShieldHookInput, X as ThresholdSignState, i as UseChipiSessionConfig, j as UseChipiSessionReturn, e as UseChipiWalletConfig, U as UseChipiWalletObjectConfig, f as UseChipiWalletReturn, R as UseGuardianRecoveryReturn, P as UseShhhSignerReturn, W as UseThresholdSignOptions, V as UseThresholdSignReturn, p as UseTransferConfig, M as UseX402PaymentConfig, N as UseX402PaymentReturn, $ as derivePrivacyAccount, a0 as netPrivateBalance, H as useAddSessionKeyToContract, q as useApprove, A as useCallAnyContract, h as useChipiSession, d as useChipiWallet, D as useChipiWalletObject, G as useCreateSessionKey, u as useCreateWallet, K as useExecuteWithSession, J as useGetSessionData, z as useGetSku, y as useGetSkuList, x as useGetSkuPurchase, F as useGetTokenBalance, s as useGetTransaction, r as useGetTransactionList, t as useGetTransactionStatus, c as useGetWallet, Q as useGuardianRecovery, l as useMigrateWalletToPasskey, n as useMigrateWalletToShhh, _ as usePrivateBalance, w as usePurchaseSku, E as useRecordSendTransaction, I as useRevokeSessionKey, O as useShhhSigner, Y as useShield, B as useSignTypedData, v as useSyncOnChainTransfers, T as useThresholdSign, o as useTransfer, Z as useUnshield, m as useUpdateWalletEncryption, L as useX402Payment } from './index-D9-uVlda.mjs';
|
|
2
2
|
import '@chipi-stack/types';
|
|
3
3
|
import '@tanstack/react-query';
|
|
4
4
|
import '@chipi-stack/backend';
|
|
5
5
|
import 'starknet';
|
|
6
6
|
import '@starknet-io/types-js';
|
|
7
|
+
import '@chipi-stack/core';
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { g as ChipiWalletData, S as SessionState, k as SessionWallet, X as ThresholdSignState, i as UseChipiSessionConfig, j as UseChipiSessionReturn, e as UseChipiWalletConfig, U as UseChipiWalletObjectConfig, f as UseChipiWalletReturn, R as UseGuardianRecoveryReturn, P as UseShhhSignerReturn, W as UseThresholdSignOptions, V as UseThresholdSignReturn, p as UseTransferConfig, M as UseX402PaymentConfig, N as UseX402PaymentReturn, H as useAddSessionKeyToContract, q as useApprove, A as useCallAnyContract, h as useChipiSession, d as useChipiWallet, D as useChipiWalletObject, G as useCreateSessionKey, u as useCreateWallet, K as useExecuteWithSession, J as useGetSessionData, z as useGetSku, y as useGetSkuList, x as useGetSkuPurchase, F as useGetTokenBalance, s as useGetTransaction, r as useGetTransactionList, t as useGetTransactionStatus, c as useGetWallet, Q as useGuardianRecovery, l as useMigrateWalletToPasskey, n as useMigrateWalletToShhh, w as usePurchaseSku, E as useRecordSendTransaction, I as useRevokeSessionKey, O as useShhhSigner, B as useSignTypedData, v as useSyncOnChainTransfers, T as useThresholdSign, o as useTransfer, m as useUpdateWalletEncryption, L as useX402Payment } from './index-
|
|
1
|
+
export { g as ChipiWalletData, a1 as PrivacyConfig, a2 as PrivacyKeys, a5 as PrivacyLedgerEvent, a3 as PrivacyStep, a6 as PrivateBalanceInput, S as SessionState, k as SessionWallet, a4 as ShieldHookInput, X as ThresholdSignState, i as UseChipiSessionConfig, j as UseChipiSessionReturn, e as UseChipiWalletConfig, U as UseChipiWalletObjectConfig, f as UseChipiWalletReturn, R as UseGuardianRecoveryReturn, P as UseShhhSignerReturn, W as UseThresholdSignOptions, V as UseThresholdSignReturn, p as UseTransferConfig, M as UseX402PaymentConfig, N as UseX402PaymentReturn, $ as derivePrivacyAccount, a0 as netPrivateBalance, H as useAddSessionKeyToContract, q as useApprove, A as useCallAnyContract, h as useChipiSession, d as useChipiWallet, D as useChipiWalletObject, G as useCreateSessionKey, u as useCreateWallet, K as useExecuteWithSession, J as useGetSessionData, z as useGetSku, y as useGetSkuList, x as useGetSkuPurchase, F as useGetTokenBalance, s as useGetTransaction, r as useGetTransactionList, t as useGetTransactionStatus, c as useGetWallet, Q as useGuardianRecovery, l as useMigrateWalletToPasskey, n as useMigrateWalletToShhh, _ as usePrivateBalance, w as usePurchaseSku, E as useRecordSendTransaction, I as useRevokeSessionKey, O as useShhhSigner, Y as useShield, B as useSignTypedData, v as useSyncOnChainTransfers, T as useThresholdSign, o as useTransfer, Z as useUnshield, m as useUpdateWalletEncryption, L as useX402Payment } from './index-D9-uVlda.js';
|
|
2
2
|
import '@chipi-stack/types';
|
|
3
3
|
import '@tanstack/react-query';
|
|
4
4
|
import '@chipi-stack/backend';
|
|
5
5
|
import 'starknet';
|
|
6
6
|
import '@starknet-io/types-js';
|
|
7
|
+
import '@chipi-stack/core';
|