@chipi-stack/core 0.3.1 → 0.4.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.
Files changed (69) hide show
  1. package/NOTICE-starknet-sdk.md +13 -0
  2. package/README.md +62 -0
  3. package/dist/index.d.ts +1534 -16
  4. package/dist/index.js +10996 -16
  5. package/dist/index.js.map +1 -1
  6. package/package.json +8 -5
  7. package/dist/estimation/estimate-fee.d.ts +0 -21
  8. package/dist/estimation/estimate-fee.d.ts.map +0 -1
  9. package/dist/estimation/estimate-fee.js +0 -34
  10. package/dist/estimation/estimate-fee.js.map +0 -1
  11. package/dist/estimation/types.d.ts +0 -14
  12. package/dist/estimation/types.d.ts.map +0 -1
  13. package/dist/estimation/types.js +0 -2
  14. package/dist/estimation/types.js.map +0 -1
  15. package/dist/index.d.ts.map +0 -1
  16. package/dist/signers/create-account.d.ts +0 -21
  17. package/dist/signers/create-account.d.ts.map +0 -1
  18. package/dist/signers/create-account.js +0 -19
  19. package/dist/signers/create-account.js.map +0 -1
  20. package/dist/signers/direct-signer.d.ts +0 -18
  21. package/dist/signers/direct-signer.d.ts.map +0 -1
  22. package/dist/signers/direct-signer.js +0 -32
  23. package/dist/signers/direct-signer.js.map +0 -1
  24. package/dist/signers/external-signer.d.ts +0 -17
  25. package/dist/signers/external-signer.d.ts.map +0 -1
  26. package/dist/signers/external-signer.js +0 -19
  27. package/dist/signers/external-signer.js.map +0 -1
  28. package/dist/signers/passkey-signer.d.ts +0 -25
  29. package/dist/signers/passkey-signer.d.ts.map +0 -1
  30. package/dist/signers/passkey-signer.js +0 -24
  31. package/dist/signers/passkey-signer.js.map +0 -1
  32. package/dist/signers/starknet-signer-adapter.d.ts +0 -18
  33. package/dist/signers/starknet-signer-adapter.d.ts.map +0 -1
  34. package/dist/signers/starknet-signer-adapter.js +0 -26
  35. package/dist/signers/starknet-signer-adapter.js.map +0 -1
  36. package/dist/signers/types.d.ts +0 -19
  37. package/dist/signers/types.d.ts.map +0 -1
  38. package/dist/signers/types.js +0 -2
  39. package/dist/signers/types.js.map +0 -1
  40. package/dist/tokens/amount.d.ts +0 -72
  41. package/dist/tokens/amount.d.ts.map +0 -1
  42. package/dist/tokens/amount.js +0 -166
  43. package/dist/tokens/amount.js.map +0 -1
  44. package/dist/tokens/erc20.d.ts +0 -38
  45. package/dist/tokens/erc20.d.ts.map +0 -1
  46. package/dist/tokens/erc20.js +0 -79
  47. package/dist/tokens/erc20.js.map +0 -1
  48. package/dist/tokens/presets/mainnet.json +0 -38
  49. package/dist/tokens/presets/sepolia.json +0 -20
  50. package/dist/tokens/registry.d.ts +0 -27
  51. package/dist/tokens/registry.d.ts.map +0 -1
  52. package/dist/tokens/registry.js +0 -38
  53. package/dist/tokens/registry.js.map +0 -1
  54. package/dist/transactions/tx-builder.d.ts +0 -74
  55. package/dist/transactions/tx-builder.d.ts.map +0 -1
  56. package/dist/transactions/tx-builder.js +0 -117
  57. package/dist/transactions/tx-builder.js.map +0 -1
  58. package/dist/transactions/types.d.ts +0 -11
  59. package/dist/transactions/types.d.ts.map +0 -1
  60. package/dist/transactions/types.js +0 -2
  61. package/dist/transactions/types.js.map +0 -1
  62. package/dist/x402/client.d.ts +0 -112
  63. package/dist/x402/client.d.ts.map +0 -1
  64. package/dist/x402/client.js +0 -270
  65. package/dist/x402/client.js.map +0 -1
  66. package/dist/x402/index.d.ts +0 -2
  67. package/dist/x402/index.d.ts.map +0 -1
  68. package/dist/x402/index.js +0 -2
  69. package/dist/x402/index.js.map +0 -1
@@ -0,0 +1,13 @@
1
+ # Bundled third-party software
2
+
3
+ `@chipi-stack/core`'s build bundles the **StarkWare Starknet Privacy SDK**
4
+ ("starknet-sdk", from github.com/starknet-innovation/starknet-privacy),
5
+ licensed under the **Apache License, Version 2.0**
6
+ (http://www.apache.org/licenses/LICENSE-2.0).
7
+
8
+ Changes from upstream: `ContractDiscoveryProvider` is re-exported from the
9
+ package's main index (upstream exported it only via `starknet-sdk/testing`,
10
+ which drags devnet/Node-only modules into client bundles).
11
+
12
+ Copyright © StarkWare Industries and contributors. Bundled with attribution
13
+ per Apache-2.0 §4. The full license text accompanies the upstream source.
package/README.md CHANGED
@@ -98,3 +98,65 @@ Full docs at [docs.chipipay.com](https://docs.chipipay.com)
98
98
  ## License
99
99
 
100
100
  MIT
101
+
102
+
103
+ ## Private balances (STRK20 privacy pool)
104
+
105
+ Mainnet-proven shield/unshield engine (Chipi's "Modo privado"). React apps
106
+ should use the hooks in `@chipi-stack/chipi-react` / `@chipi-stack/nextjs`;
107
+ this is the headless layer they wrap.
108
+
109
+ ```ts
110
+ import {
111
+ ChipiProofProvider,
112
+ derivePoolKeypair,
113
+ deriveCompanionKeypair,
114
+ deriveCompanionAddress,
115
+ requestGasFunding,
116
+ waitForFunding,
117
+ execShield,
118
+ GAS_FUND_STRK,
119
+ } from "@chipi-stack/core";
120
+ import { RpcProvider } from "starknet";
121
+
122
+ // Keys derive CLIENT-SIDE from the user's anchor — never persist them.
123
+ // NOTE the trust model: delegated proving sends the pool key to the prover
124
+ // per operation (privacy vs the PUBLIC, not the proving operator) — docs.
125
+ const pool = await derivePoolKeypair({ anchorSecret, seedDomainTag: wallet.address });
126
+ const companion = await deriveCompanionKeypair(anchorSecret);
127
+ const companionAddress = deriveCompanionAddress({
128
+ publicKey: companion.publicKey,
129
+ classHash: COMPANION_CLASS_HASH,
130
+ });
131
+
132
+ const provider = new RpcProvider({ nodeUrl: "https://api.cartridge.gg/x/starknet/mainnet" });
133
+ await requestGasFunding(companionAddress, {
134
+ baseUrl: "https://api.chipipay.com/v1",
135
+ apiKey: apiPublicKey,
136
+ getBearerToken: () => getToken(),
137
+ });
138
+ await waitForFunding(provider, companionAddress, { strk: GAS_FUND_STRK });
139
+ const result = await execShield(
140
+ {
141
+ provider,
142
+ chainId: "0x534e5f4d41494e",
143
+ companionAddress,
144
+ companionKey: companion.privateKey,
145
+ classHash: COMPANION_CLASS_HASH,
146
+ poolKey: BigInt(pool.privateKey),
147
+ provingProvider: new ChipiProofProvider({
148
+ baseUrl: "https://api.chipipay.com/v1",
149
+ apiKey: apiPublicKey,
150
+ getBearerToken: () => getToken(),
151
+ chainId: "0x534e5f4d41494e",
152
+ }),
153
+ },
154
+ USDC_ADDRESS,
155
+ 1_000_000n,
156
+ );
157
+ console.log(result.transactionHash); // receipt + pool event already verified
158
+ ```
159
+
160
+ The bundled note-graph SDK is StarkWare's, Apache-2.0 — see
161
+ `NOTICE-starknet-sdk.md`. Full guide: the docs' "Private Balances" page;
162
+ runnable example + smoke: `examples/private-balance`.