Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(do not merge) how to expose things 1o1 #2100

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bindings
6 changes: 6 additions & 0 deletions src/examples/poseidon-cipher.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Snarky, Field, initializeBindings } from 'o1js';

await initializeBindings();

let res = Snarky.run.poseidonBlockCipher([Field.from(21)]);
console.log(res);
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export { TupleN } from './lib/util/types.js';
export type { ProvablePure } from './lib/provable/types/provable-intf.js';
export { Ledger, initializeBindings } from './snarky.js';
export { Ledger, initializeBindings, Snarky } from './snarky.js';
export { Field, Bool, Group, Scalar } from './lib/provable/wrapped.js';
export {
createForeignField,
Expand Down Expand Up @@ -116,6 +116,7 @@ import { Recursive as Recursive_ } from './lib/proof-system/recursive.js';
export { Experimental };

import * as V2 from './lib/mina/v2/index.js';
import { Snarky } from './snarky.js';

const Experimental_ = {
memoizeWitness,
Expand Down
2 changes: 1 addition & 1 deletion src/mina
5 changes: 5 additions & 0 deletions src/snarky.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ declare const Snarky: {
* Check whether we are inside an asProver or exists block
*/
inProverBlock(): boolean;

poseidonBlockCipher(
state: Array<Field>,
): unknown;

/**
* Setting that controls whether snarky throws an exception on violated constraint.
*/
Expand Down