-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add noir types package (#2893)
Co-authored-by: Koby Hall <102518238+kobyhallx@users.noreply.github.com>
- Loading branch information
1 parent
5e43bb6
commit e8fc868
Showing
17 changed files
with
136 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
// Since this is a simple function, we can use feature detection to | ||
// see if we are in the nodeJs environment or the browser environment. | ||
export function base64Decode(input: string): Uint8Array { | ||
if (typeof Buffer !== 'undefined') { | ||
if (typeof Buffer !== "undefined") { | ||
// Node.js environment | ||
return Buffer.from(input, 'base64'); | ||
} else if (typeof atob === 'function') { | ||
return Buffer.from(input, "base64"); | ||
} else if (typeof atob === "function") { | ||
// Browser environment | ||
return Uint8Array.from(atob(input), (c) => c.charCodeAt(0)); | ||
} else { | ||
throw new Error('No implementation found for base64 decoding.'); | ||
throw new Error("No implementation found for base64 decoding."); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import * as acvm from '@noir-lang/acvm_js'; | ||
import * as abi from '@noir-lang/noirc_abi'; | ||
import * as acvm from "@noir-lang/acvm_js"; | ||
import * as abi from "@noir-lang/noirc_abi"; | ||
|
||
export { acvm, abi }; | ||
|
||
export { generateWitness } from './witness_generation.js'; | ||
export { acirToUint8Array, witnessMapToUint8Array } from './serialize.js'; | ||
export { generateWitness } from "./witness_generation.js"; | ||
export { acirToUint8Array, witnessMapToUint8Array } from "./serialize.js"; | ||
|
||
export { Noir } from "./program.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: ['../../.eslintrc.js'], | ||
}; |
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "@noir-lang/types", | ||
"collaborators": [ | ||
"The Noir Team <team@noir-lang.org>" | ||
], | ||
"version": "0.14.1", | ||
"packageManager": "yarn@3.5.1", | ||
"license": "(MIT OR Apache-2.0)", | ||
"files": [ | ||
"lib", | ||
"package.json" | ||
], | ||
"types": "lib/types.ts" | ||
} |
Oops, something went wrong.