@chipi-stack/core 0.3.0 → 0.4.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/NOTICE-starknet-sdk.md +13 -0
- package/README.md +71 -0
- package/dist/index.d.ts +1534 -16
- package/dist/index.js +10998 -16
- package/dist/index.js.map +1 -1
- package/package.json +49 -9
- package/dist/estimation/estimate-fee.d.ts +0 -21
- package/dist/estimation/estimate-fee.d.ts.map +0 -1
- package/dist/estimation/estimate-fee.js +0 -34
- package/dist/estimation/estimate-fee.js.map +0 -1
- package/dist/estimation/types.d.ts +0 -14
- package/dist/estimation/types.d.ts.map +0 -1
- package/dist/estimation/types.js +0 -2
- package/dist/estimation/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/signers/create-account.d.ts +0 -21
- package/dist/signers/create-account.d.ts.map +0 -1
- package/dist/signers/create-account.js +0 -19
- package/dist/signers/create-account.js.map +0 -1
- package/dist/signers/direct-signer.d.ts +0 -18
- package/dist/signers/direct-signer.d.ts.map +0 -1
- package/dist/signers/direct-signer.js +0 -32
- package/dist/signers/direct-signer.js.map +0 -1
- package/dist/signers/external-signer.d.ts +0 -17
- package/dist/signers/external-signer.d.ts.map +0 -1
- package/dist/signers/external-signer.js +0 -19
- package/dist/signers/external-signer.js.map +0 -1
- package/dist/signers/passkey-signer.d.ts +0 -25
- package/dist/signers/passkey-signer.d.ts.map +0 -1
- package/dist/signers/passkey-signer.js +0 -24
- package/dist/signers/passkey-signer.js.map +0 -1
- package/dist/signers/starknet-signer-adapter.d.ts +0 -18
- package/dist/signers/starknet-signer-adapter.d.ts.map +0 -1
- package/dist/signers/starknet-signer-adapter.js +0 -26
- package/dist/signers/starknet-signer-adapter.js.map +0 -1
- package/dist/signers/types.d.ts +0 -19
- package/dist/signers/types.d.ts.map +0 -1
- package/dist/signers/types.js +0 -2
- package/dist/signers/types.js.map +0 -1
- package/dist/tokens/amount.d.ts +0 -72
- package/dist/tokens/amount.d.ts.map +0 -1
- package/dist/tokens/amount.js +0 -166
- package/dist/tokens/amount.js.map +0 -1
- package/dist/tokens/erc20.d.ts +0 -38
- package/dist/tokens/erc20.d.ts.map +0 -1
- package/dist/tokens/erc20.js +0 -79
- package/dist/tokens/erc20.js.map +0 -1
- package/dist/tokens/presets/mainnet.json +0 -38
- package/dist/tokens/presets/sepolia.json +0 -20
- package/dist/tokens/registry.d.ts +0 -27
- package/dist/tokens/registry.d.ts.map +0 -1
- package/dist/tokens/registry.js +0 -38
- package/dist/tokens/registry.js.map +0 -1
- package/dist/transactions/tx-builder.d.ts +0 -74
- package/dist/transactions/tx-builder.d.ts.map +0 -1
- package/dist/transactions/tx-builder.js +0 -117
- package/dist/transactions/tx-builder.js.map +0 -1
- package/dist/transactions/types.d.ts +0 -11
- package/dist/transactions/types.d.ts.map +0 -1
- package/dist/transactions/types.js +0 -2
- package/dist/transactions/types.js.map +0 -1
- package/dist/x402/client.d.ts +0 -112
- package/dist/x402/client.d.ts.map +0 -1
- package/dist/x402/client.js +0 -270
- package/dist/x402/client.js.map +0 -1
- package/dist/x402/index.d.ts +0 -2
- package/dist/x402/index.d.ts.map +0 -1
- package/dist/x402/index.js +0 -2
- 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
|
@@ -82,6 +82,15 @@ const fee = await estimateFee(calls, account);
|
|
|
82
82
|
const check = await preflight(calls, account); // fee + balance check
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
## What you can ship
|
|
86
|
+
|
|
87
|
+
- **Gasless wallets for gaming and loyalty apps** — abstract away gas fees so users never touch crypto
|
|
88
|
+
- **Invisible signers for AI agents** — let autonomous agents sign and submit transactions
|
|
89
|
+
- **Multi-call DeFi transactions** — batch swaps, approvals, and transfers into a single execution
|
|
90
|
+
- **Custom payment flows for remittance platforms** — build cross-border payment rails on Starknet
|
|
91
|
+
|
|
92
|
+
Have an idea? [Tell us what you want to build](https://github.com/chipi-pay/build-with-chipi/issues/new)
|
|
93
|
+
|
|
85
94
|
## Documentation
|
|
86
95
|
|
|
87
96
|
Full docs at [docs.chipipay.com](https://docs.chipipay.com)
|
|
@@ -89,3 +98,65 @@ Full docs at [docs.chipipay.com](https://docs.chipipay.com)
|
|
|
89
98
|
## License
|
|
90
99
|
|
|
91
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`.
|