@chipi-stack/backend 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/dist/index.d.mts +201 -15
- package/dist/index.d.ts +201 -15
- package/dist/index.js +168 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +163 -10
- package/dist/index.mjs.map +1 -1
- package/dist/skuPurchases.js +9 -1
- package/dist/skuPurchases.js.map +1 -1
- package/dist/skuPurchases.mjs +10 -2
- package/dist/skuPurchases.mjs.map +1 -1
- package/dist/transactions.js +9 -1
- package/dist/transactions.js.map +1 -1
- package/dist/transactions.mjs +10 -2
- package/dist/transactions.mjs.map +1 -1
- package/dist/wallets.js +9 -1
- package/dist/wallets.js.map +1 -1
- package/dist/wallets.mjs +10 -2
- package/dist/wallets.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -8,7 +8,7 @@ import { ChipiTransactions } from './transactions.mjs';
|
|
|
8
8
|
import { ChipiSkuPurchases } from './skuPurchases.mjs';
|
|
9
9
|
import { ChipiSkus } from './skus.mjs';
|
|
10
10
|
import { C as ChipiClient } from './client-CqD_yGH0.mjs';
|
|
11
|
-
import { Call } from 'starknet';
|
|
11
|
+
import { Call, ProviderInterface, Account } from 'starknet';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Session key management for CHIPI wallets (SNIP-9 compatible).
|
|
@@ -202,7 +202,7 @@ declare class ChipiSessions {
|
|
|
202
202
|
* Set a spending policy for a session key + token pair.
|
|
203
203
|
*
|
|
204
204
|
* This executes a sponsored transaction (using owner signature) to call
|
|
205
|
-
* `set_spending_policy` on the CHIPI
|
|
205
|
+
* `set_spending_policy` on the wallet contract (CHIPI v29 or SHHH V8.4).
|
|
206
206
|
*
|
|
207
207
|
* The contract enforces these limits automatically during `__execute__()` on
|
|
208
208
|
* ERC-20 operations (transfer, approve, increase_allowance) made by the session.
|
|
@@ -254,7 +254,7 @@ declare class ChipiSessions {
|
|
|
254
254
|
* Remove a spending policy for a session key + token pair.
|
|
255
255
|
*
|
|
256
256
|
* This executes a sponsored transaction (using owner signature) to call
|
|
257
|
-
* `remove_spending_policy` on the CHIPI
|
|
257
|
+
* `remove_spending_policy` on the wallet contract (CHIPI v29 or SHHH V8.4).
|
|
258
258
|
*
|
|
259
259
|
* After removal, the session key has no spending limits for this token.
|
|
260
260
|
*
|
|
@@ -292,10 +292,11 @@ declare class ChipiExchanges {
|
|
|
292
292
|
*
|
|
293
293
|
* Auth model (decision §11.2 — owner-signature-as-authorization):
|
|
294
294
|
* - propose / sign: `pk_` (the public api key) PLUS the owner's V2_SNIP12
|
|
295
|
-
* envelope (already inside the proposal body) AND the owner's
|
|
296
|
-
* `ownerPubkey
|
|
297
|
-
*
|
|
298
|
-
*
|
|
295
|
+
* envelope (already inside the proposal body) AND the owner's
|
|
296
|
+
* `ownerPubkey` (kind-specific — see {@link ForTreasuryConfig.ownerPubkey}).
|
|
297
|
+
* chipi-back's OwnerSignatureVerifier proves the request came from a
|
|
298
|
+
* current on-chain owner, so no secret is needed — these are safe to
|
|
299
|
+
* call from the browser.
|
|
299
300
|
* - execute / list / allowance: `sk_` (a secret key bearer). execute relays
|
|
300
301
|
* through the paymaster and meters; reads are org-private. Call these from
|
|
301
302
|
* a server (a Next.js route handler / your backend), never the browser.
|
|
@@ -324,9 +325,13 @@ interface TreasuryProposal {
|
|
|
324
325
|
}[] | null;
|
|
325
326
|
/** Human label for an action ("Vote YES on Proposal #5"). */
|
|
326
327
|
title?: string | null;
|
|
327
|
-
/** Arbitrary integrator context
|
|
328
|
-
*
|
|
328
|
+
/** Arbitrary integrator context persisted with the proposal (chipi-back
|
|
329
|
+
* #301, `meta Json?`) — e.g. `{ poolId }`, read by the approver app's
|
|
330
|
+
* `renderContext`. Null on payments and pre-#301 rows. */
|
|
329
331
|
meta?: Record<string, string | number> | null;
|
|
332
|
+
/** App-level risk tier the proposal was filed under (chipi-back #302;
|
|
333
|
+
* null = none). */
|
|
334
|
+
risk?: "ROUTINE" | "SENSITIVE" | null;
|
|
330
335
|
oeMessageHash: string;
|
|
331
336
|
oeNonce: string | null;
|
|
332
337
|
/** chipi-back persists only `oeExecuteBefore`; the OE `executeAfter` is
|
|
@@ -349,9 +354,13 @@ interface ProposeBody {
|
|
|
349
354
|
entrypoint: string;
|
|
350
355
|
calldata: string[];
|
|
351
356
|
}[];
|
|
352
|
-
/** Arbitrary integrator context
|
|
353
|
-
*
|
|
357
|
+
/** Arbitrary integrator context persisted with the proposal (chipi-back
|
|
358
|
+
* #301). Flat string|number values, bounded server-side: ≤16 keys, key
|
|
359
|
+
* ≤40 chars, string values ≤200 chars. */
|
|
354
360
|
meta?: Record<string, string | number>;
|
|
361
|
+
/** Template risk tier (chipi-back #302): when the treasury configured the
|
|
362
|
+
* matching quorum, the server overrides requiredApprovals at propose. */
|
|
363
|
+
risk?: "ROUTINE" | "SENSITIVE";
|
|
355
364
|
oeMessageHash: string;
|
|
356
365
|
oeNonce: string;
|
|
357
366
|
oeExecuteBefore: string;
|
|
@@ -379,7 +388,7 @@ interface MultisigAllowance {
|
|
|
379
388
|
[key: string]: unknown;
|
|
380
389
|
}
|
|
381
390
|
/**
|
|
382
|
-
* A transport bound to one treasury + the local owner's
|
|
391
|
+
* A transport bound to one treasury + the local owner's public key.
|
|
383
392
|
* Structurally compatible with `@chipi-stack/chipi-react`'s `MultisigTransport`.
|
|
384
393
|
*/
|
|
385
394
|
interface TreasuryTransport {
|
|
@@ -395,8 +404,20 @@ interface TreasuryTransport {
|
|
|
395
404
|
interface ForTreasuryConfig {
|
|
396
405
|
/** The org treasury id (the multisig wallet's row id in chipi-back). */
|
|
397
406
|
treasuryId: string;
|
|
398
|
-
/**
|
|
399
|
-
*
|
|
407
|
+
/**
|
|
408
|
+
* The local owner's public key, sent with propose / sign so the backend can
|
|
409
|
+
* verify the envelope commits to a current on-chain owner. Kind-specific
|
|
410
|
+
* format (must match the `signerKind` of the envelopes this transport sends):
|
|
411
|
+
* - STARK: one 0x-hex felt (the stark key) — `starkPubkeyFelts(pub)[0]`.
|
|
412
|
+
* - WEBAUTHN_P256: `"0x<x>,0x<y>"` (full 32-byte BE P-256 coordinates) —
|
|
413
|
+
* use `webauthnOwnerPubkeyParam(pubkey)`.
|
|
414
|
+
* - EIP191_SECP256K1 (MetaMask): `"0x<x>,0x<y>"` (full 32-byte BE
|
|
415
|
+
* secp256k1 coordinates) — use `eip191OwnerPubkeyParam(pubkey)`.
|
|
416
|
+
* - ED25519 (Phantom): `"0x<low>,0x<high>"` (LE u128 halves of the
|
|
417
|
+
* 32-byte key) — use `ed25519OwnerPubkeyParam(publicKey)`.
|
|
418
|
+
* NOTE: the coordinate-based kinds take the FULL x/y values, never the
|
|
419
|
+
* 4-felt `*PubkeyFelts` form (the backend rejects more than 2 values).
|
|
420
|
+
*/
|
|
400
421
|
ownerPubkey: string;
|
|
401
422
|
/** A secret key (`sk_`) for execute / list / allowance. Falls back to the
|
|
402
423
|
* SDK's configured `apiSecretKey`. Required only for those three; propose /
|
|
@@ -622,6 +643,14 @@ declare class ChipiSDK {
|
|
|
622
643
|
signTypedData({ params }: {
|
|
623
644
|
params: SignTypedDataParams;
|
|
624
645
|
}): Promise<SignTypedDataResult>;
|
|
646
|
+
/**
|
|
647
|
+
* Sign SNIP-12 typed data and return the full signature span (felt strings) —
|
|
648
|
+
* the shape a dApp's `wallet_signTypedData` expects. Wallet-type aware:
|
|
649
|
+
* SHHH returns the V2_SNIP12 owner envelope; standard accounts return [r, s].
|
|
650
|
+
*/
|
|
651
|
+
signTypedDataArray({ params }: {
|
|
652
|
+
params: SignTypedDataParams;
|
|
653
|
+
}): Promise<string[]>;
|
|
625
654
|
/**
|
|
626
655
|
* Transfer tokens
|
|
627
656
|
*/
|
|
@@ -781,6 +810,23 @@ declare class ChipiBrowserSDK extends ChipiSDK {
|
|
|
781
810
|
declare const signTypedData: ({ params, }: {
|
|
782
811
|
params: SignTypedDataParams;
|
|
783
812
|
}) => Promise<SignTypedDataResult>;
|
|
813
|
+
/**
|
|
814
|
+
* Sign SNIP-12 typed data and return the full signature SPAN as felt strings —
|
|
815
|
+
* the shape a dApp's `wallet_signTypedData` expects (wallet-api `Signature`).
|
|
816
|
+
*
|
|
817
|
+
* Wallet-type aware (this is the part the plain `signTypedData` {r,s} can't do):
|
|
818
|
+
* - **SHHH V8.4**: `__validate__` is disabled and the account verifies a
|
|
819
|
+
* V2_SNIP12 envelope `[V2_SNIP12, owner_id, 'STARK', r, s]`. We hash the
|
|
820
|
+
* typed data per SNIP-12, sign with the STARK owner key, and wrap it so the
|
|
821
|
+
* account's `is_valid_signature` accepts it. Purely local (no API call).
|
|
822
|
+
* - **READY / standard**: a bare `[r, s]` from `account.signMessage`.
|
|
823
|
+
*
|
|
824
|
+
* Phase 0 covers the primary STARK owner (ownerIndex 0). WebAuthn-rooted
|
|
825
|
+
* owners (interactive passkey assertion) are a follow-up.
|
|
826
|
+
*/
|
|
827
|
+
declare const signTypedDataArray: ({ params, }: {
|
|
828
|
+
params: SignTypedDataParams;
|
|
829
|
+
}) => Promise<string[]>;
|
|
784
830
|
|
|
785
831
|
declare const encryptPrivateKey: (privateKey: string, password: string) => string;
|
|
786
832
|
declare const decryptPrivateKey: (encryptedPrivateKey: string, password: string) => string;
|
|
@@ -1254,6 +1300,15 @@ declare function ed25519OwnerId(publicKey: Uint8Array): bigint;
|
|
|
1254
1300
|
* order — what the Cairo `kind == ED25519` branch reads.
|
|
1255
1301
|
*/
|
|
1256
1302
|
declare function ed25519PubkeyFelts(publicKey: Uint8Array): bigint[];
|
|
1303
|
+
/**
|
|
1304
|
+
* The `ownerPubkey` string for the treasury coordination endpoints
|
|
1305
|
+
* (`sdk.treasury.forTreasury({ ownerPubkey })`): `"0x<low>,0x<high>"` —
|
|
1306
|
+
* the comma-joined `ed25519PubkeyFelts` halves. chipi-back's
|
|
1307
|
+
* OwnerSignatureVerifier parses exactly this shape for ED25519 owners,
|
|
1308
|
+
* so use this helper rather than hand-formatting (the LE-halves split is
|
|
1309
|
+
* easy to get backwards).
|
|
1310
|
+
*/
|
|
1311
|
+
declare function ed25519OwnerPubkeyParam(publicKey: Uint8Array): string;
|
|
1257
1312
|
/**
|
|
1258
1313
|
* Build a V2_SNIP12 envelope for the Ed25519 kind. Async because the
|
|
1259
1314
|
* underlying Garaga WASM must be initialized; subsequent calls reuse
|
|
@@ -1374,6 +1429,15 @@ declare function eip191PubkeyFelts(pubkey: Eip191Pubkey): bigint[];
|
|
|
1374
1429
|
* owner_id = owner_commitment(EIP191_tag, [x.low, x.high, y.low, y.high]).
|
|
1375
1430
|
*/
|
|
1376
1431
|
declare function eip191OwnerId(pubkey: Eip191Pubkey): bigint;
|
|
1432
|
+
/**
|
|
1433
|
+
* The `ownerPubkey` string for the treasury coordination endpoints
|
|
1434
|
+
* (`sdk.treasury.forTreasury({ ownerPubkey })`): `"0x<x>,0x<y>"` — the
|
|
1435
|
+
* FULL 32-byte BE coordinates of the uncompressed secp256k1 point, NOT
|
|
1436
|
+
* the 4 `eip191PubkeyFelts` halves. chipi-back's OwnerSignatureVerifier
|
|
1437
|
+
* splits the coordinates into commitment felts itself; sending the
|
|
1438
|
+
* 4-felt form fails its DTO validation (max 2 comma-joined values).
|
|
1439
|
+
*/
|
|
1440
|
+
declare function eip191OwnerPubkeyParam(pubkey: Eip191Pubkey): string;
|
|
1377
1441
|
/**
|
|
1378
1442
|
* Parse a 65-byte `personal_sign`/`eth_sign` signature hex string into
|
|
1379
1443
|
* the Cairo-shaped envelope payload `[r.low, r.high, s.low, s.high, y_parity]`.
|
|
@@ -1482,6 +1546,14 @@ declare function parseDerEcdsaSignature(der: Uint8Array): {
|
|
|
1482
1546
|
};
|
|
1483
1547
|
declare function webauthnPubkeyFelts(pub: WebAuthnPubkey): bigint[];
|
|
1484
1548
|
declare function webauthnOwnerId(pub: WebAuthnPubkey): bigint;
|
|
1549
|
+
/**
|
|
1550
|
+
* The `ownerPubkey` string for the treasury coordination endpoints
|
|
1551
|
+
* (`sdk.treasury.forTreasury({ ownerPubkey })`): `"0x<x>,0x<y>"` — the
|
|
1552
|
+
* FULL 32-byte BE P-256 coordinates, NOT the 4 `webauthnPubkeyFelts`
|
|
1553
|
+
* halves. chipi-back's OwnerSignatureVerifier splits the coordinates
|
|
1554
|
+
* into commitment felts itself.
|
|
1555
|
+
*/
|
|
1556
|
+
declare function webauthnOwnerPubkeyParam(pub: WebAuthnPubkey): string;
|
|
1485
1557
|
/**
|
|
1486
1558
|
* Production / browser flow. The caller has run
|
|
1487
1559
|
* `navigator.credentials.get({ publicKey: { challenge: msgBe32, ... } })`
|
|
@@ -2386,4 +2458,118 @@ declare function executeShhhSponsoredRaw(params: {
|
|
|
2386
2458
|
chainId?: bigint | string;
|
|
2387
2459
|
}): Promise<string>;
|
|
2388
2460
|
|
|
2389
|
-
|
|
2461
|
+
/**
|
|
2462
|
+
* ShhhAccount — ergonomic drop-in adapter for signing as a SHHH V8.4
|
|
2463
|
+
* owner from a raw owner private key.
|
|
2464
|
+
*
|
|
2465
|
+
* Why this exists: a SHHH account is account-abstracted and its
|
|
2466
|
+
* `__validate__` is DISABLED (shhh-wallet-cairo `src/account.cairo`
|
|
2467
|
+
* panics with `'SHHH: __validate__ disabled'`), so the standard
|
|
2468
|
+
* starknet.js path — `new Account(provider, addr, key).execute(calls)`
|
|
2469
|
+
* — does NOT work. The only authorized execution path is
|
|
2470
|
+
* `execute_from_outside_v2`: you sign an OutsideExecution and submit it.
|
|
2471
|
+
*
|
|
2472
|
+
* This wrapper hides that plumbing so a holder of an exported STARK
|
|
2473
|
+
* owner key can write the familiar:
|
|
2474
|
+
*
|
|
2475
|
+
* const account = new ShhhAccount(provider, address, privateKey, {
|
|
2476
|
+
* submit: submitViaAccount(fundedRelayer),
|
|
2477
|
+
* });
|
|
2478
|
+
* const { transactionHash } = await account.execute(calls);
|
|
2479
|
+
*
|
|
2480
|
+
* It signs the OE with the owner key (ownerIndex 0 = primary) and
|
|
2481
|
+
* broadcasts via the configured `submit` strategy — either a funded
|
|
2482
|
+
* Starknet account you control (fully self-sovereign, no Chipi servers)
|
|
2483
|
+
* or a paymaster relay (gasless). If you don't configure `submit`, call
|
|
2484
|
+
* `signExecution()` and broadcast the calldata yourself.
|
|
2485
|
+
*
|
|
2486
|
+
* Scope: STARK-kind owners. Other signer kinds (Ed25519 / EIP-191 /
|
|
2487
|
+
* WebAuthn) have their own envelope builders; this adapter targets the
|
|
2488
|
+
* exported-private-key use case, which is always a STARK owner.
|
|
2489
|
+
*/
|
|
2490
|
+
|
|
2491
|
+
/**
|
|
2492
|
+
* How a signed `execute_from_outside_v2` calldata is broadcast. The
|
|
2493
|
+
* account itself can never pay gas (`__validate__` is disabled), so the
|
|
2494
|
+
* broadcaster is always a separate party: a funded relayer you control,
|
|
2495
|
+
* or a paymaster service. It only pays gas — it is NOT the signer.
|
|
2496
|
+
*/
|
|
2497
|
+
type ShhhSubmit = (input: {
|
|
2498
|
+
accountAddress: string;
|
|
2499
|
+
calldata: string[];
|
|
2500
|
+
}) => Promise<{
|
|
2501
|
+
transactionHash: string;
|
|
2502
|
+
}>;
|
|
2503
|
+
interface ShhhAccountOptions {
|
|
2504
|
+
/**
|
|
2505
|
+
* Owner index into the wallet's owner_set. Defaults to `0n` (the
|
|
2506
|
+
* primary owner — what an exported private key controls). Override
|
|
2507
|
+
* for additional owners added via `propose_add_owner`.
|
|
2508
|
+
*/
|
|
2509
|
+
ownerIndex?: bigint;
|
|
2510
|
+
/**
|
|
2511
|
+
* Chain id used for SNIP-12 hashing. Defaults to Starknet mainnet
|
|
2512
|
+
* (Chipi is mainnet-only). A wrong value makes the account reject the
|
|
2513
|
+
* signature on chain.
|
|
2514
|
+
*/
|
|
2515
|
+
chainId?: bigint | string;
|
|
2516
|
+
/** Broadcast strategy. Omit to sign-only via {@link ShhhAccount.signExecution}. */
|
|
2517
|
+
submit?: ShhhSubmit;
|
|
2518
|
+
}
|
|
2519
|
+
interface ShhhSignedExecution {
|
|
2520
|
+
/** The OutsideExecution that was signed. */
|
|
2521
|
+
outsideExecution: OutsideExecution;
|
|
2522
|
+
/** The owner signature envelope `[V2_SNIP12, owner_id, 'STARK', r, s]`. */
|
|
2523
|
+
signature: bigint[];
|
|
2524
|
+
/** The SNIP-12 message hash that was signed. */
|
|
2525
|
+
messageHash: bigint;
|
|
2526
|
+
/** Flat felt calldata for the `execute_from_outside_v2` selector. */
|
|
2527
|
+
calldata: string[];
|
|
2528
|
+
}
|
|
2529
|
+
interface ShhhExecuteOptions {
|
|
2530
|
+
/** Override the replay nonce. Default: `(Date.now() << 24) | random24`. */
|
|
2531
|
+
nonce?: bigint | string;
|
|
2532
|
+
/**
|
|
2533
|
+
* How long (seconds from now) the OE stays valid. Default: the account
|
|
2534
|
+
* max (~2h). The builder backdates `execute_after` by a 60s clock-skew
|
|
2535
|
+
* buffer, and the account caps the total window at 2h, so the usable
|
|
2536
|
+
* max here is `MAX_OE_VALIDITY_WINDOW_SECONDS - 60` (7140s). Values
|
|
2537
|
+
* above that throw with a clear message rather than a cryptic builder
|
|
2538
|
+
* error.
|
|
2539
|
+
*/
|
|
2540
|
+
validForSeconds?: number;
|
|
2541
|
+
}
|
|
2542
|
+
declare class ShhhAccount {
|
|
2543
|
+
/** The provider, exposed for convenience (e.g. `account.provider.waitForTransaction`). */
|
|
2544
|
+
readonly provider: ProviderInterface;
|
|
2545
|
+
readonly address: string;
|
|
2546
|
+
readonly ownerIndex: bigint;
|
|
2547
|
+
readonly chainId: bigint | string;
|
|
2548
|
+
private readonly privateKey;
|
|
2549
|
+
private readonly submitFn?;
|
|
2550
|
+
constructor(provider: ProviderInterface, address: string, privateKey: bigint | string, options?: ShhhAccountOptions);
|
|
2551
|
+
/**
|
|
2552
|
+
* Build + sign an OutsideExecution for `calls` and return the
|
|
2553
|
+
* serialized `execute_from_outside_v2` calldata (plus the underlying
|
|
2554
|
+
* pieces). Use this when you want to broadcast the calldata yourself.
|
|
2555
|
+
*/
|
|
2556
|
+
signExecution(calls: Call[], options?: ShhhExecuteOptions): Promise<ShhhSignedExecution>;
|
|
2557
|
+
/**
|
|
2558
|
+
* Sign `calls` and broadcast them via the configured `submit` strategy.
|
|
2559
|
+
* Mirrors starknet.js `Account.execute` ergonomically. Returns the
|
|
2560
|
+
* transaction hash without waiting for inclusion — use
|
|
2561
|
+
* `provider.waitForTransaction(transactionHash)` if you need to block.
|
|
2562
|
+
*/
|
|
2563
|
+
execute(calls: Call[], options?: ShhhExecuteOptions): Promise<{
|
|
2564
|
+
transactionHash: string;
|
|
2565
|
+
}>;
|
|
2566
|
+
}
|
|
2567
|
+
/**
|
|
2568
|
+
* Self-sovereign submit strategy: relay the signed OE through any funded
|
|
2569
|
+
* Starknet account you control. The funded account only pays gas — it is
|
|
2570
|
+
* NOT the signer, and never sees the SHHH owner key. This is the path
|
|
2571
|
+
* that needs no Chipi servers at all.
|
|
2572
|
+
*/
|
|
2573
|
+
declare function submitViaAccount(funded: Account): ShhhSubmit;
|
|
2574
|
+
|
|
2575
|
+
export { ANY_CALLER_FELT, APPLE_ISSUER, type AppleTokenResponse, type ApproveBody, BOOTSTRAP_DOMAIN_SEPARATOR, type BootstrapMessageParams, type BuildBootstrapSignedCallParams, type BuildMigrationCallsParams, ChipiBrowserSDK, ChipiClient, ChipiPaymasterAdapter, ChipiSDK, ChipiServerSDK, ChipiSessions, ChipiSkuPurchases, ChipiSkus, ChipiTransactions, ChipiTreasury, ChipiWallets, type ComputeAddressInput, DEFAULT_OP_EXPIRY_SECONDS, type Eip191Pubkey, type ExecuteResult, type ForTreasuryConfig, ISIGNER_CANONICAL_LABEL, ISIGNER_ID, ISRC9_V2_ID, type JwtAppleSubPubkey, MAX_OE_VALIDITY_WINDOW_SECONDS, MIN_THRESHOLD_OWNERS, type MultisigAllowance, type NewOwnerInput, OE_DOMAIN_NAME, OE_DOMAIN_REVISION, OE_DOMAIN_VERSION, OP_ADD_OWNER, OP_REMOVE_OWNER, OP_ROTATE_OWNER, OP_SET_THRESHOLD, type OutsideExecution, type OwnerRole, type ProposeBody, ROLE_GUARDIAN, ROLE_OWNER, SIG_VERSION_V1_HEX_ASCII, SIG_VERSION_V2_SNIP12, SIG_VERSION_V2_THRESHOLD, STARKNET_MESSAGE_PREFIX, ShhhAccount, type ShhhAccountOptions, type ShhhExecuteOptions, type ShhhSignedExecution, type ShhhSubmit, type ShhhX402Wallet, TIMELOCK_SECONDS, type TreasuryProposal, type TreasuryProposalSignature, type TreasuryTransport, VIEW_SELECTORS, type WebAuthnPubkey, X402Facilitator, type X402FacilitatorCreateOptions, type X402MiddlewareConfig, type X402MiddlewareFlatConfig, X402ShhhClient, type X402ShhhClientConfig, assertValidV2Snip12Envelope, buildBootstrapSignedCall, buildCancelPendingOpCall, buildCancelRecoveryCall, buildEd25519Envelope, buildEd25519EnvelopeFromSignature, buildEip191EnvelopeFromPrivateKey, buildEip191EnvelopeFromSignature, buildExecuteAddOwnerCall, buildExecuteRemoveOwnerCall, buildExecuteRotateOwnerCall, buildExecuteSetThresholdCall, buildFinalizeRecoveryCall, buildInitiateRecoveryCall, buildJwtAppleSubEnvelopeFromTestKey, buildJwtAppleSubEnvelopeFromTokenResponse, buildMigrationCalls, buildOutsideExecution, buildProposeAddOwnerCall, buildProposeRemoveOwnerCall, buildProposeRotateOwnerCall, buildProposeSetThresholdCall, buildStarkEnvelope, buildThresholdEnvelope, buildWebAuthnEnvelopeFromAssertion, buildWebAuthnEnvelopeFromPrivateKey, byteArrayToFelts, computeAddressSalt, computeBootstrapMessage, computeISignerId, computeOeHash, computeShhhAddress, computeSnip12Hash, decryptPrivateKey, ed25519OwnerId, ed25519OwnerPubkeyParam, ed25519PubkeyFelts, ed25519SignedBytes, eip191OwnerId, eip191OwnerPubkeyParam, eip191PubkeyFelts, encryptPrivateKey, estimateThresholdGasOverhead, executeShhhSponsoredRaw, hashCall, hashCalls, hashOutsideExecutionStruct, hashStarknetDomain, isReadyToExecute, jwtAppleSubHash, jwtAppleSubOwnerId, jwtAppleSubPubkeyFelts, labelToFelt, locateSubClaim, messageHashToNonceB64url, ownerCommitment, parseAppleIdToken, parseDerEcdsaSignature, parseEip191Signature, parseThresholdEnvelope, resolveShhhChainId, secondsUntilExecutable, serializeExecuteFromOutsideV2Calldata, signBootstrapMessage, signTypedData, signTypedDataArray, snip12HashToHexAsciiBytes, starkOwnerId, starkPubkeyFelts, submitViaAccount, webauthnOwnerId, webauthnOwnerPubkeyParam, webauthnPubkeyFelts, wrapV2Snip12Envelope, wrapV2ThresholdEnvelope, x402Middleware };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { ChipiTransactions } from './transactions.js';
|
|
|
8
8
|
import { ChipiSkuPurchases } from './skuPurchases.js';
|
|
9
9
|
import { ChipiSkus } from './skus.js';
|
|
10
10
|
import { C as ChipiClient } from './client-CqD_yGH0.js';
|
|
11
|
-
import { Call } from 'starknet';
|
|
11
|
+
import { Call, ProviderInterface, Account } from 'starknet';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Session key management for CHIPI wallets (SNIP-9 compatible).
|
|
@@ -202,7 +202,7 @@ declare class ChipiSessions {
|
|
|
202
202
|
* Set a spending policy for a session key + token pair.
|
|
203
203
|
*
|
|
204
204
|
* This executes a sponsored transaction (using owner signature) to call
|
|
205
|
-
* `set_spending_policy` on the CHIPI
|
|
205
|
+
* `set_spending_policy` on the wallet contract (CHIPI v29 or SHHH V8.4).
|
|
206
206
|
*
|
|
207
207
|
* The contract enforces these limits automatically during `__execute__()` on
|
|
208
208
|
* ERC-20 operations (transfer, approve, increase_allowance) made by the session.
|
|
@@ -254,7 +254,7 @@ declare class ChipiSessions {
|
|
|
254
254
|
* Remove a spending policy for a session key + token pair.
|
|
255
255
|
*
|
|
256
256
|
* This executes a sponsored transaction (using owner signature) to call
|
|
257
|
-
* `remove_spending_policy` on the CHIPI
|
|
257
|
+
* `remove_spending_policy` on the wallet contract (CHIPI v29 or SHHH V8.4).
|
|
258
258
|
*
|
|
259
259
|
* After removal, the session key has no spending limits for this token.
|
|
260
260
|
*
|
|
@@ -292,10 +292,11 @@ declare class ChipiExchanges {
|
|
|
292
292
|
*
|
|
293
293
|
* Auth model (decision §11.2 — owner-signature-as-authorization):
|
|
294
294
|
* - propose / sign: `pk_` (the public api key) PLUS the owner's V2_SNIP12
|
|
295
|
-
* envelope (already inside the proposal body) AND the owner's
|
|
296
|
-
* `ownerPubkey
|
|
297
|
-
*
|
|
298
|
-
*
|
|
295
|
+
* envelope (already inside the proposal body) AND the owner's
|
|
296
|
+
* `ownerPubkey` (kind-specific — see {@link ForTreasuryConfig.ownerPubkey}).
|
|
297
|
+
* chipi-back's OwnerSignatureVerifier proves the request came from a
|
|
298
|
+
* current on-chain owner, so no secret is needed — these are safe to
|
|
299
|
+
* call from the browser.
|
|
299
300
|
* - execute / list / allowance: `sk_` (a secret key bearer). execute relays
|
|
300
301
|
* through the paymaster and meters; reads are org-private. Call these from
|
|
301
302
|
* a server (a Next.js route handler / your backend), never the browser.
|
|
@@ -324,9 +325,13 @@ interface TreasuryProposal {
|
|
|
324
325
|
}[] | null;
|
|
325
326
|
/** Human label for an action ("Vote YES on Proposal #5"). */
|
|
326
327
|
title?: string | null;
|
|
327
|
-
/** Arbitrary integrator context
|
|
328
|
-
*
|
|
328
|
+
/** Arbitrary integrator context persisted with the proposal (chipi-back
|
|
329
|
+
* #301, `meta Json?`) — e.g. `{ poolId }`, read by the approver app's
|
|
330
|
+
* `renderContext`. Null on payments and pre-#301 rows. */
|
|
329
331
|
meta?: Record<string, string | number> | null;
|
|
332
|
+
/** App-level risk tier the proposal was filed under (chipi-back #302;
|
|
333
|
+
* null = none). */
|
|
334
|
+
risk?: "ROUTINE" | "SENSITIVE" | null;
|
|
330
335
|
oeMessageHash: string;
|
|
331
336
|
oeNonce: string | null;
|
|
332
337
|
/** chipi-back persists only `oeExecuteBefore`; the OE `executeAfter` is
|
|
@@ -349,9 +354,13 @@ interface ProposeBody {
|
|
|
349
354
|
entrypoint: string;
|
|
350
355
|
calldata: string[];
|
|
351
356
|
}[];
|
|
352
|
-
/** Arbitrary integrator context
|
|
353
|
-
*
|
|
357
|
+
/** Arbitrary integrator context persisted with the proposal (chipi-back
|
|
358
|
+
* #301). Flat string|number values, bounded server-side: ≤16 keys, key
|
|
359
|
+
* ≤40 chars, string values ≤200 chars. */
|
|
354
360
|
meta?: Record<string, string | number>;
|
|
361
|
+
/** Template risk tier (chipi-back #302): when the treasury configured the
|
|
362
|
+
* matching quorum, the server overrides requiredApprovals at propose. */
|
|
363
|
+
risk?: "ROUTINE" | "SENSITIVE";
|
|
355
364
|
oeMessageHash: string;
|
|
356
365
|
oeNonce: string;
|
|
357
366
|
oeExecuteBefore: string;
|
|
@@ -379,7 +388,7 @@ interface MultisigAllowance {
|
|
|
379
388
|
[key: string]: unknown;
|
|
380
389
|
}
|
|
381
390
|
/**
|
|
382
|
-
* A transport bound to one treasury + the local owner's
|
|
391
|
+
* A transport bound to one treasury + the local owner's public key.
|
|
383
392
|
* Structurally compatible with `@chipi-stack/chipi-react`'s `MultisigTransport`.
|
|
384
393
|
*/
|
|
385
394
|
interface TreasuryTransport {
|
|
@@ -395,8 +404,20 @@ interface TreasuryTransport {
|
|
|
395
404
|
interface ForTreasuryConfig {
|
|
396
405
|
/** The org treasury id (the multisig wallet's row id in chipi-back). */
|
|
397
406
|
treasuryId: string;
|
|
398
|
-
/**
|
|
399
|
-
*
|
|
407
|
+
/**
|
|
408
|
+
* The local owner's public key, sent with propose / sign so the backend can
|
|
409
|
+
* verify the envelope commits to a current on-chain owner. Kind-specific
|
|
410
|
+
* format (must match the `signerKind` of the envelopes this transport sends):
|
|
411
|
+
* - STARK: one 0x-hex felt (the stark key) — `starkPubkeyFelts(pub)[0]`.
|
|
412
|
+
* - WEBAUTHN_P256: `"0x<x>,0x<y>"` (full 32-byte BE P-256 coordinates) —
|
|
413
|
+
* use `webauthnOwnerPubkeyParam(pubkey)`.
|
|
414
|
+
* - EIP191_SECP256K1 (MetaMask): `"0x<x>,0x<y>"` (full 32-byte BE
|
|
415
|
+
* secp256k1 coordinates) — use `eip191OwnerPubkeyParam(pubkey)`.
|
|
416
|
+
* - ED25519 (Phantom): `"0x<low>,0x<high>"` (LE u128 halves of the
|
|
417
|
+
* 32-byte key) — use `ed25519OwnerPubkeyParam(publicKey)`.
|
|
418
|
+
* NOTE: the coordinate-based kinds take the FULL x/y values, never the
|
|
419
|
+
* 4-felt `*PubkeyFelts` form (the backend rejects more than 2 values).
|
|
420
|
+
*/
|
|
400
421
|
ownerPubkey: string;
|
|
401
422
|
/** A secret key (`sk_`) for execute / list / allowance. Falls back to the
|
|
402
423
|
* SDK's configured `apiSecretKey`. Required only for those three; propose /
|
|
@@ -622,6 +643,14 @@ declare class ChipiSDK {
|
|
|
622
643
|
signTypedData({ params }: {
|
|
623
644
|
params: SignTypedDataParams;
|
|
624
645
|
}): Promise<SignTypedDataResult>;
|
|
646
|
+
/**
|
|
647
|
+
* Sign SNIP-12 typed data and return the full signature span (felt strings) —
|
|
648
|
+
* the shape a dApp's `wallet_signTypedData` expects. Wallet-type aware:
|
|
649
|
+
* SHHH returns the V2_SNIP12 owner envelope; standard accounts return [r, s].
|
|
650
|
+
*/
|
|
651
|
+
signTypedDataArray({ params }: {
|
|
652
|
+
params: SignTypedDataParams;
|
|
653
|
+
}): Promise<string[]>;
|
|
625
654
|
/**
|
|
626
655
|
* Transfer tokens
|
|
627
656
|
*/
|
|
@@ -781,6 +810,23 @@ declare class ChipiBrowserSDK extends ChipiSDK {
|
|
|
781
810
|
declare const signTypedData: ({ params, }: {
|
|
782
811
|
params: SignTypedDataParams;
|
|
783
812
|
}) => Promise<SignTypedDataResult>;
|
|
813
|
+
/**
|
|
814
|
+
* Sign SNIP-12 typed data and return the full signature SPAN as felt strings —
|
|
815
|
+
* the shape a dApp's `wallet_signTypedData` expects (wallet-api `Signature`).
|
|
816
|
+
*
|
|
817
|
+
* Wallet-type aware (this is the part the plain `signTypedData` {r,s} can't do):
|
|
818
|
+
* - **SHHH V8.4**: `__validate__` is disabled and the account verifies a
|
|
819
|
+
* V2_SNIP12 envelope `[V2_SNIP12, owner_id, 'STARK', r, s]`. We hash the
|
|
820
|
+
* typed data per SNIP-12, sign with the STARK owner key, and wrap it so the
|
|
821
|
+
* account's `is_valid_signature` accepts it. Purely local (no API call).
|
|
822
|
+
* - **READY / standard**: a bare `[r, s]` from `account.signMessage`.
|
|
823
|
+
*
|
|
824
|
+
* Phase 0 covers the primary STARK owner (ownerIndex 0). WebAuthn-rooted
|
|
825
|
+
* owners (interactive passkey assertion) are a follow-up.
|
|
826
|
+
*/
|
|
827
|
+
declare const signTypedDataArray: ({ params, }: {
|
|
828
|
+
params: SignTypedDataParams;
|
|
829
|
+
}) => Promise<string[]>;
|
|
784
830
|
|
|
785
831
|
declare const encryptPrivateKey: (privateKey: string, password: string) => string;
|
|
786
832
|
declare const decryptPrivateKey: (encryptedPrivateKey: string, password: string) => string;
|
|
@@ -1254,6 +1300,15 @@ declare function ed25519OwnerId(publicKey: Uint8Array): bigint;
|
|
|
1254
1300
|
* order — what the Cairo `kind == ED25519` branch reads.
|
|
1255
1301
|
*/
|
|
1256
1302
|
declare function ed25519PubkeyFelts(publicKey: Uint8Array): bigint[];
|
|
1303
|
+
/**
|
|
1304
|
+
* The `ownerPubkey` string for the treasury coordination endpoints
|
|
1305
|
+
* (`sdk.treasury.forTreasury({ ownerPubkey })`): `"0x<low>,0x<high>"` —
|
|
1306
|
+
* the comma-joined `ed25519PubkeyFelts` halves. chipi-back's
|
|
1307
|
+
* OwnerSignatureVerifier parses exactly this shape for ED25519 owners,
|
|
1308
|
+
* so use this helper rather than hand-formatting (the LE-halves split is
|
|
1309
|
+
* easy to get backwards).
|
|
1310
|
+
*/
|
|
1311
|
+
declare function ed25519OwnerPubkeyParam(publicKey: Uint8Array): string;
|
|
1257
1312
|
/**
|
|
1258
1313
|
* Build a V2_SNIP12 envelope for the Ed25519 kind. Async because the
|
|
1259
1314
|
* underlying Garaga WASM must be initialized; subsequent calls reuse
|
|
@@ -1374,6 +1429,15 @@ declare function eip191PubkeyFelts(pubkey: Eip191Pubkey): bigint[];
|
|
|
1374
1429
|
* owner_id = owner_commitment(EIP191_tag, [x.low, x.high, y.low, y.high]).
|
|
1375
1430
|
*/
|
|
1376
1431
|
declare function eip191OwnerId(pubkey: Eip191Pubkey): bigint;
|
|
1432
|
+
/**
|
|
1433
|
+
* The `ownerPubkey` string for the treasury coordination endpoints
|
|
1434
|
+
* (`sdk.treasury.forTreasury({ ownerPubkey })`): `"0x<x>,0x<y>"` — the
|
|
1435
|
+
* FULL 32-byte BE coordinates of the uncompressed secp256k1 point, NOT
|
|
1436
|
+
* the 4 `eip191PubkeyFelts` halves. chipi-back's OwnerSignatureVerifier
|
|
1437
|
+
* splits the coordinates into commitment felts itself; sending the
|
|
1438
|
+
* 4-felt form fails its DTO validation (max 2 comma-joined values).
|
|
1439
|
+
*/
|
|
1440
|
+
declare function eip191OwnerPubkeyParam(pubkey: Eip191Pubkey): string;
|
|
1377
1441
|
/**
|
|
1378
1442
|
* Parse a 65-byte `personal_sign`/`eth_sign` signature hex string into
|
|
1379
1443
|
* the Cairo-shaped envelope payload `[r.low, r.high, s.low, s.high, y_parity]`.
|
|
@@ -1482,6 +1546,14 @@ declare function parseDerEcdsaSignature(der: Uint8Array): {
|
|
|
1482
1546
|
};
|
|
1483
1547
|
declare function webauthnPubkeyFelts(pub: WebAuthnPubkey): bigint[];
|
|
1484
1548
|
declare function webauthnOwnerId(pub: WebAuthnPubkey): bigint;
|
|
1549
|
+
/**
|
|
1550
|
+
* The `ownerPubkey` string for the treasury coordination endpoints
|
|
1551
|
+
* (`sdk.treasury.forTreasury({ ownerPubkey })`): `"0x<x>,0x<y>"` — the
|
|
1552
|
+
* FULL 32-byte BE P-256 coordinates, NOT the 4 `webauthnPubkeyFelts`
|
|
1553
|
+
* halves. chipi-back's OwnerSignatureVerifier splits the coordinates
|
|
1554
|
+
* into commitment felts itself.
|
|
1555
|
+
*/
|
|
1556
|
+
declare function webauthnOwnerPubkeyParam(pub: WebAuthnPubkey): string;
|
|
1485
1557
|
/**
|
|
1486
1558
|
* Production / browser flow. The caller has run
|
|
1487
1559
|
* `navigator.credentials.get({ publicKey: { challenge: msgBe32, ... } })`
|
|
@@ -2386,4 +2458,118 @@ declare function executeShhhSponsoredRaw(params: {
|
|
|
2386
2458
|
chainId?: bigint | string;
|
|
2387
2459
|
}): Promise<string>;
|
|
2388
2460
|
|
|
2389
|
-
|
|
2461
|
+
/**
|
|
2462
|
+
* ShhhAccount — ergonomic drop-in adapter for signing as a SHHH V8.4
|
|
2463
|
+
* owner from a raw owner private key.
|
|
2464
|
+
*
|
|
2465
|
+
* Why this exists: a SHHH account is account-abstracted and its
|
|
2466
|
+
* `__validate__` is DISABLED (shhh-wallet-cairo `src/account.cairo`
|
|
2467
|
+
* panics with `'SHHH: __validate__ disabled'`), so the standard
|
|
2468
|
+
* starknet.js path — `new Account(provider, addr, key).execute(calls)`
|
|
2469
|
+
* — does NOT work. The only authorized execution path is
|
|
2470
|
+
* `execute_from_outside_v2`: you sign an OutsideExecution and submit it.
|
|
2471
|
+
*
|
|
2472
|
+
* This wrapper hides that plumbing so a holder of an exported STARK
|
|
2473
|
+
* owner key can write the familiar:
|
|
2474
|
+
*
|
|
2475
|
+
* const account = new ShhhAccount(provider, address, privateKey, {
|
|
2476
|
+
* submit: submitViaAccount(fundedRelayer),
|
|
2477
|
+
* });
|
|
2478
|
+
* const { transactionHash } = await account.execute(calls);
|
|
2479
|
+
*
|
|
2480
|
+
* It signs the OE with the owner key (ownerIndex 0 = primary) and
|
|
2481
|
+
* broadcasts via the configured `submit` strategy — either a funded
|
|
2482
|
+
* Starknet account you control (fully self-sovereign, no Chipi servers)
|
|
2483
|
+
* or a paymaster relay (gasless). If you don't configure `submit`, call
|
|
2484
|
+
* `signExecution()` and broadcast the calldata yourself.
|
|
2485
|
+
*
|
|
2486
|
+
* Scope: STARK-kind owners. Other signer kinds (Ed25519 / EIP-191 /
|
|
2487
|
+
* WebAuthn) have their own envelope builders; this adapter targets the
|
|
2488
|
+
* exported-private-key use case, which is always a STARK owner.
|
|
2489
|
+
*/
|
|
2490
|
+
|
|
2491
|
+
/**
|
|
2492
|
+
* How a signed `execute_from_outside_v2` calldata is broadcast. The
|
|
2493
|
+
* account itself can never pay gas (`__validate__` is disabled), so the
|
|
2494
|
+
* broadcaster is always a separate party: a funded relayer you control,
|
|
2495
|
+
* or a paymaster service. It only pays gas — it is NOT the signer.
|
|
2496
|
+
*/
|
|
2497
|
+
type ShhhSubmit = (input: {
|
|
2498
|
+
accountAddress: string;
|
|
2499
|
+
calldata: string[];
|
|
2500
|
+
}) => Promise<{
|
|
2501
|
+
transactionHash: string;
|
|
2502
|
+
}>;
|
|
2503
|
+
interface ShhhAccountOptions {
|
|
2504
|
+
/**
|
|
2505
|
+
* Owner index into the wallet's owner_set. Defaults to `0n` (the
|
|
2506
|
+
* primary owner — what an exported private key controls). Override
|
|
2507
|
+
* for additional owners added via `propose_add_owner`.
|
|
2508
|
+
*/
|
|
2509
|
+
ownerIndex?: bigint;
|
|
2510
|
+
/**
|
|
2511
|
+
* Chain id used for SNIP-12 hashing. Defaults to Starknet mainnet
|
|
2512
|
+
* (Chipi is mainnet-only). A wrong value makes the account reject the
|
|
2513
|
+
* signature on chain.
|
|
2514
|
+
*/
|
|
2515
|
+
chainId?: bigint | string;
|
|
2516
|
+
/** Broadcast strategy. Omit to sign-only via {@link ShhhAccount.signExecution}. */
|
|
2517
|
+
submit?: ShhhSubmit;
|
|
2518
|
+
}
|
|
2519
|
+
interface ShhhSignedExecution {
|
|
2520
|
+
/** The OutsideExecution that was signed. */
|
|
2521
|
+
outsideExecution: OutsideExecution;
|
|
2522
|
+
/** The owner signature envelope `[V2_SNIP12, owner_id, 'STARK', r, s]`. */
|
|
2523
|
+
signature: bigint[];
|
|
2524
|
+
/** The SNIP-12 message hash that was signed. */
|
|
2525
|
+
messageHash: bigint;
|
|
2526
|
+
/** Flat felt calldata for the `execute_from_outside_v2` selector. */
|
|
2527
|
+
calldata: string[];
|
|
2528
|
+
}
|
|
2529
|
+
interface ShhhExecuteOptions {
|
|
2530
|
+
/** Override the replay nonce. Default: `(Date.now() << 24) | random24`. */
|
|
2531
|
+
nonce?: bigint | string;
|
|
2532
|
+
/**
|
|
2533
|
+
* How long (seconds from now) the OE stays valid. Default: the account
|
|
2534
|
+
* max (~2h). The builder backdates `execute_after` by a 60s clock-skew
|
|
2535
|
+
* buffer, and the account caps the total window at 2h, so the usable
|
|
2536
|
+
* max here is `MAX_OE_VALIDITY_WINDOW_SECONDS - 60` (7140s). Values
|
|
2537
|
+
* above that throw with a clear message rather than a cryptic builder
|
|
2538
|
+
* error.
|
|
2539
|
+
*/
|
|
2540
|
+
validForSeconds?: number;
|
|
2541
|
+
}
|
|
2542
|
+
declare class ShhhAccount {
|
|
2543
|
+
/** The provider, exposed for convenience (e.g. `account.provider.waitForTransaction`). */
|
|
2544
|
+
readonly provider: ProviderInterface;
|
|
2545
|
+
readonly address: string;
|
|
2546
|
+
readonly ownerIndex: bigint;
|
|
2547
|
+
readonly chainId: bigint | string;
|
|
2548
|
+
private readonly privateKey;
|
|
2549
|
+
private readonly submitFn?;
|
|
2550
|
+
constructor(provider: ProviderInterface, address: string, privateKey: bigint | string, options?: ShhhAccountOptions);
|
|
2551
|
+
/**
|
|
2552
|
+
* Build + sign an OutsideExecution for `calls` and return the
|
|
2553
|
+
* serialized `execute_from_outside_v2` calldata (plus the underlying
|
|
2554
|
+
* pieces). Use this when you want to broadcast the calldata yourself.
|
|
2555
|
+
*/
|
|
2556
|
+
signExecution(calls: Call[], options?: ShhhExecuteOptions): Promise<ShhhSignedExecution>;
|
|
2557
|
+
/**
|
|
2558
|
+
* Sign `calls` and broadcast them via the configured `submit` strategy.
|
|
2559
|
+
* Mirrors starknet.js `Account.execute` ergonomically. Returns the
|
|
2560
|
+
* transaction hash without waiting for inclusion — use
|
|
2561
|
+
* `provider.waitForTransaction(transactionHash)` if you need to block.
|
|
2562
|
+
*/
|
|
2563
|
+
execute(calls: Call[], options?: ShhhExecuteOptions): Promise<{
|
|
2564
|
+
transactionHash: string;
|
|
2565
|
+
}>;
|
|
2566
|
+
}
|
|
2567
|
+
/**
|
|
2568
|
+
* Self-sovereign submit strategy: relay the signed OE through any funded
|
|
2569
|
+
* Starknet account you control. The funded account only pays gas — it is
|
|
2570
|
+
* NOT the signer, and never sees the SHHH owner key. This is the path
|
|
2571
|
+
* that needs no Chipi servers at all.
|
|
2572
|
+
*/
|
|
2573
|
+
declare function submitViaAccount(funded: Account): ShhhSubmit;
|
|
2574
|
+
|
|
2575
|
+
export { ANY_CALLER_FELT, APPLE_ISSUER, type AppleTokenResponse, type ApproveBody, BOOTSTRAP_DOMAIN_SEPARATOR, type BootstrapMessageParams, type BuildBootstrapSignedCallParams, type BuildMigrationCallsParams, ChipiBrowserSDK, ChipiClient, ChipiPaymasterAdapter, ChipiSDK, ChipiServerSDK, ChipiSessions, ChipiSkuPurchases, ChipiSkus, ChipiTransactions, ChipiTreasury, ChipiWallets, type ComputeAddressInput, DEFAULT_OP_EXPIRY_SECONDS, type Eip191Pubkey, type ExecuteResult, type ForTreasuryConfig, ISIGNER_CANONICAL_LABEL, ISIGNER_ID, ISRC9_V2_ID, type JwtAppleSubPubkey, MAX_OE_VALIDITY_WINDOW_SECONDS, MIN_THRESHOLD_OWNERS, type MultisigAllowance, type NewOwnerInput, OE_DOMAIN_NAME, OE_DOMAIN_REVISION, OE_DOMAIN_VERSION, OP_ADD_OWNER, OP_REMOVE_OWNER, OP_ROTATE_OWNER, OP_SET_THRESHOLD, type OutsideExecution, type OwnerRole, type ProposeBody, ROLE_GUARDIAN, ROLE_OWNER, SIG_VERSION_V1_HEX_ASCII, SIG_VERSION_V2_SNIP12, SIG_VERSION_V2_THRESHOLD, STARKNET_MESSAGE_PREFIX, ShhhAccount, type ShhhAccountOptions, type ShhhExecuteOptions, type ShhhSignedExecution, type ShhhSubmit, type ShhhX402Wallet, TIMELOCK_SECONDS, type TreasuryProposal, type TreasuryProposalSignature, type TreasuryTransport, VIEW_SELECTORS, type WebAuthnPubkey, X402Facilitator, type X402FacilitatorCreateOptions, type X402MiddlewareConfig, type X402MiddlewareFlatConfig, X402ShhhClient, type X402ShhhClientConfig, assertValidV2Snip12Envelope, buildBootstrapSignedCall, buildCancelPendingOpCall, buildCancelRecoveryCall, buildEd25519Envelope, buildEd25519EnvelopeFromSignature, buildEip191EnvelopeFromPrivateKey, buildEip191EnvelopeFromSignature, buildExecuteAddOwnerCall, buildExecuteRemoveOwnerCall, buildExecuteRotateOwnerCall, buildExecuteSetThresholdCall, buildFinalizeRecoveryCall, buildInitiateRecoveryCall, buildJwtAppleSubEnvelopeFromTestKey, buildJwtAppleSubEnvelopeFromTokenResponse, buildMigrationCalls, buildOutsideExecution, buildProposeAddOwnerCall, buildProposeRemoveOwnerCall, buildProposeRotateOwnerCall, buildProposeSetThresholdCall, buildStarkEnvelope, buildThresholdEnvelope, buildWebAuthnEnvelopeFromAssertion, buildWebAuthnEnvelopeFromPrivateKey, byteArrayToFelts, computeAddressSalt, computeBootstrapMessage, computeISignerId, computeOeHash, computeShhhAddress, computeSnip12Hash, decryptPrivateKey, ed25519OwnerId, ed25519OwnerPubkeyParam, ed25519PubkeyFelts, ed25519SignedBytes, eip191OwnerId, eip191OwnerPubkeyParam, eip191PubkeyFelts, encryptPrivateKey, estimateThresholdGasOverhead, executeShhhSponsoredRaw, hashCall, hashCalls, hashOutsideExecutionStruct, hashStarknetDomain, isReadyToExecute, jwtAppleSubHash, jwtAppleSubOwnerId, jwtAppleSubPubkeyFelts, labelToFelt, locateSubClaim, messageHashToNonceB64url, ownerCommitment, parseAppleIdToken, parseDerEcdsaSignature, parseEip191Signature, parseThresholdEnvelope, resolveShhhChainId, secondsUntilExecutable, serializeExecuteFromOutsideV2Calldata, signBootstrapMessage, signTypedData, signTypedDataArray, snip12HashToHexAsciiBytes, starkOwnerId, starkPubkeyFelts, submitViaAccount, webauthnOwnerId, webauthnOwnerPubkeyParam, webauthnPubkeyFelts, wrapV2Snip12Envelope, wrapV2ThresholdEnvelope, x402Middleware };
|