@aptos-labs/confidential-assets-bindings 0.0.6 → 0.0.7
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.cjs +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.mts +1 -2
- package/dist/index.mjs +1 -3
- package/package.json +19 -44
- package/android/build.gradle +0 -18
- package/android/src/main/AndroidManifest.xml +0 -2
- package/android/src/main/java/com/aptoslabs/confidentialassetsbindings/ConfidentialAssetsBindingsModule.kt +0 -50
- package/android/src/main/java/com/aptoslabs/confidentialassetsbindings/ConfidentialAssetsBindingsView.kt +0 -30
- package/dist/ConfidentialAssetsBindings.types.d.ts +0 -18
- package/dist/ConfidentialAssetsBindings.types.d.ts.map +0 -1
- package/dist/ConfidentialAssetsBindings.types.js +0 -2
- package/dist/ConfidentialAssetsBindings.types.js.map +0 -1
- package/dist/ConfidentialAssetsBindingsModule.d.ts +0 -10
- package/dist/ConfidentialAssetsBindingsModule.d.ts.map +0 -1
- package/dist/ConfidentialAssetsBindingsModule.js +0 -4
- package/dist/ConfidentialAssetsBindingsModule.js.map +0 -1
- package/dist/ConfidentialAssetsBindingsModule.web.d.ts +0 -10
- package/dist/ConfidentialAssetsBindingsModule.web.d.ts.map +0 -1
- package/dist/ConfidentialAssetsBindingsModule.web.js +0 -12
- package/dist/ConfidentialAssetsBindingsModule.web.js.map +0 -1
- package/dist/ConfidentialAssetsBindingsView.d.ts +0 -4
- package/dist/ConfidentialAssetsBindingsView.d.ts.map +0 -1
- package/dist/ConfidentialAssetsBindingsView.js +0 -7
- package/dist/ConfidentialAssetsBindingsView.js.map +0 -1
- package/dist/ConfidentialAssetsBindingsView.web.d.ts +0 -4
- package/dist/ConfidentialAssetsBindingsView.web.d.ts.map +0 -1
- package/dist/ConfidentialAssetsBindingsView.web.js +0 -7
- package/dist/ConfidentialAssetsBindingsView.web.js.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/index.native.d.ts +0 -4
- package/dist/index.native.d.ts.map +0 -1
- package/dist/index.native.js +0 -6
- package/dist/index.native.js.map +0 -1
- package/expo-module.config.json +0 -9
- package/ios/ConfidentialAssetsBindings.podspec +0 -29
- package/ios/ConfidentialAssetsBindingsModule.swift +0 -48
- package/ios/ConfidentialAssetsBindingsView.swift +0 -38
- package/src/ConfidentialAssetsBindings.types.ts +0 -19
- package/src/ConfidentialAssetsBindingsModule.ts +0 -12
- package/src/ConfidentialAssetsBindingsModule.web.ts +0 -15
- package/src/ConfidentialAssetsBindingsView.tsx +0 -11
- package/src/ConfidentialAssetsBindingsView.web.tsx +0 -15
- package/src/index.native.ts +0 -5
- package/src/index.ts +0 -163
package/dist/index.cjs
CHANGED
|
@@ -522,7 +522,7 @@ async function __wbg_init(module_or_path) {
|
|
|
522
522
|
}
|
|
523
523
|
//#endregion
|
|
524
524
|
//#region src/index.ts
|
|
525
|
-
const CDN_WASM_URL = `https://unpkg.com/@aptos-labs/confidential-assets-bindings@0.0.
|
|
525
|
+
const CDN_WASM_URL = `https://unpkg.com/@aptos-labs/confidential-assets-bindings@0.0.7/dist/aptos_confidential_asset_wasm_bg.wasm`;
|
|
526
526
|
async function getNodeModulesWASM() {
|
|
527
527
|
try {
|
|
528
528
|
const fs = await import("fs");
|
package/dist/index.d.cts
CHANGED
|
@@ -40,5 +40,4 @@ interface BatchVerifyRangeProofInputs {
|
|
|
40
40
|
declare const batchVerifyProof: (inputs: BatchVerifyRangeProofInputs) => Promise<boolean>;
|
|
41
41
|
declare const solveDiscreteLog: (y: Uint8Array, maxNumBits: number) => Promise<bigint>;
|
|
42
42
|
//#endregion
|
|
43
|
-
export { BatchRangeProofInputs, BatchVerifyRangeProofInputs, RangeProofInputs, VerifyRangeProofInputs, batchRangeProof, batchVerifyProof, ensureWasmInitialized, rangeProof, solveDiscreteLog, verifyProof };
|
|
44
|
-
//# sourceMappingURL=index.d.cts.map
|
|
43
|
+
export { BatchRangeProofInputs, BatchVerifyRangeProofInputs, RangeProofInputs, VerifyRangeProofInputs, batchRangeProof, batchVerifyProof, ensureWasmInitialized, rangeProof, solveDiscreteLog, verifyProof };
|
package/dist/index.d.mts
CHANGED
|
@@ -40,5 +40,4 @@ interface BatchVerifyRangeProofInputs {
|
|
|
40
40
|
declare const batchVerifyProof: (inputs: BatchVerifyRangeProofInputs) => Promise<boolean>;
|
|
41
41
|
declare const solveDiscreteLog: (y: Uint8Array, maxNumBits: number) => Promise<bigint>;
|
|
42
42
|
//#endregion
|
|
43
|
-
export { BatchRangeProofInputs, BatchVerifyRangeProofInputs, RangeProofInputs, VerifyRangeProofInputs, batchRangeProof, batchVerifyProof, ensureWasmInitialized, rangeProof, solveDiscreteLog, verifyProof };
|
|
44
|
-
//# sourceMappingURL=index.d.mts.map
|
|
43
|
+
export { BatchRangeProofInputs, BatchVerifyRangeProofInputs, RangeProofInputs, VerifyRangeProofInputs, batchRangeProof, batchVerifyProof, ensureWasmInitialized, rangeProof, solveDiscreteLog, verifyProof };
|
package/dist/index.mjs
CHANGED
|
@@ -521,7 +521,7 @@ async function __wbg_init(module_or_path) {
|
|
|
521
521
|
}
|
|
522
522
|
//#endregion
|
|
523
523
|
//#region src/index.ts
|
|
524
|
-
const CDN_WASM_URL = `https://unpkg.com/@aptos-labs/confidential-assets-bindings@0.0.
|
|
524
|
+
const CDN_WASM_URL = `https://unpkg.com/@aptos-labs/confidential-assets-bindings@0.0.7/dist/aptos_confidential_asset_wasm_bg.wasm`;
|
|
525
525
|
async function getNodeModulesWASM() {
|
|
526
526
|
try {
|
|
527
527
|
const fs = await import("fs");
|
|
@@ -596,5 +596,3 @@ const solveDiscreteLog = async (y, maxNumBits) => {
|
|
|
596
596
|
};
|
|
597
597
|
//#endregion
|
|
598
598
|
export { batchRangeProof, batchVerifyProof, ensureWasmInitialized, rangeProof, solveDiscreteLog, verifyProof };
|
|
599
|
-
|
|
600
|
-
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptos-labs/confidential-assets-bindings",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Bindings for Aptos confidential assets (discrete log + range proofs)",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/aptos-labs/confidential-asset-wasm-bindings.git"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"aptos",
|
|
12
|
+
"confidential",
|
|
13
|
+
"wasm",
|
|
14
|
+
"bulletproofs",
|
|
15
|
+
"discrete-log",
|
|
16
|
+
"range-proof"
|
|
17
|
+
],
|
|
18
|
+
"files": ["dist"],
|
|
7
19
|
"type": "module",
|
|
20
|
+
"main": "./dist/index.cjs",
|
|
8
21
|
"module": "./dist/index.mjs",
|
|
9
|
-
"
|
|
22
|
+
"types": "./dist/index.d.mts",
|
|
10
23
|
"exports": {
|
|
11
24
|
".": {
|
|
12
|
-
"react-native": {
|
|
13
|
-
"types": "./dist/index.native.d.ts",
|
|
14
|
-
"default": "./dist/index.native.js"
|
|
15
|
-
},
|
|
16
25
|
"import": {
|
|
17
26
|
"types": "./dist/index.d.mts",
|
|
18
27
|
"default": "./dist/index.mjs"
|
|
@@ -24,51 +33,17 @@
|
|
|
24
33
|
"default": "./dist/index.mjs"
|
|
25
34
|
}
|
|
26
35
|
},
|
|
27
|
-
"files": ["dist", "src", "android", "ios", "expo-module.config.json"],
|
|
28
36
|
"scripts": {
|
|
29
37
|
"build:wasm": "wasm-pack build ./rust/wasm --target web --out-dir ../../build/wasm --release",
|
|
30
|
-
"build:
|
|
31
|
-
"build
|
|
32
|
-
"build": "npm run build:wasm && npm run build:lib && npm run build:expo",
|
|
38
|
+
"build:js": "tsdown",
|
|
39
|
+
"build": "npm run build:wasm && npm run build:js",
|
|
33
40
|
"changeset": "changeset",
|
|
34
|
-
"lint": "expo-module lint",
|
|
35
|
-
"test": "expo-module test",
|
|
36
|
-
"open:ios": "xed example/ios",
|
|
37
|
-
"open:android": "open -a \"Android Studio\" example/android",
|
|
38
41
|
"release": "npm run build && changeset publish"
|
|
39
42
|
},
|
|
40
|
-
"keywords": [
|
|
41
|
-
"aptos",
|
|
42
|
-
"confidential",
|
|
43
|
-
"wasm",
|
|
44
|
-
"bulletproofs",
|
|
45
|
-
"discrete-log",
|
|
46
|
-
"range-proof",
|
|
47
|
-
"react-native",
|
|
48
|
-
"expo",
|
|
49
|
-
"@aptos-labs/confidential-assets-bindings",
|
|
50
|
-
"ConfidentialAssetsBindings"
|
|
51
|
-
],
|
|
52
|
-
"repository": "https://github.com/aptos-labs/confidential-assets-bindings",
|
|
53
|
-
"bugs": {
|
|
54
|
-
"url": "https://github.com/aptos-labs/confidential-assets-bindings/issues"
|
|
55
|
-
},
|
|
56
|
-
"author": "aptoslabs <aptoslabs@aptoslabs.com> (https://github.com/aptos-labs)",
|
|
57
|
-
"license": "Apache-2.0",
|
|
58
|
-
"homepage": "https://github.com/aptos-labs/confidential-assets-bindings#readme",
|
|
59
43
|
"devDependencies": {
|
|
60
44
|
"@changesets/cli": "^2.30.0",
|
|
61
|
-
"@types/react": "~19.1.1",
|
|
62
|
-
"expo": "^55.0.11",
|
|
63
|
-
"expo-module-scripts": "^55.0.2",
|
|
64
|
-
"react-native": "0.82.1",
|
|
65
45
|
"tsdown": "^0.21.7",
|
|
66
46
|
"typescript": "^5.8.3",
|
|
67
47
|
"wasm-pack": "^0.13.1"
|
|
68
|
-
},
|
|
69
|
-
"peerDependencies": {
|
|
70
|
-
"expo": "*",
|
|
71
|
-
"react": "*",
|
|
72
|
-
"react-native": "*"
|
|
73
48
|
}
|
|
74
49
|
}
|
package/android/build.gradle
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
plugins {
|
|
2
|
-
id 'com.android.library'
|
|
3
|
-
id 'expo-module-gradle-plugin'
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
group = 'com.aptoslabs.confidentialassetsbindings'
|
|
7
|
-
version = '0.1.0'
|
|
8
|
-
|
|
9
|
-
android {
|
|
10
|
-
namespace "com.aptoslabs.confidentialassetsbindings"
|
|
11
|
-
defaultConfig {
|
|
12
|
-
versionCode 1
|
|
13
|
-
versionName "0.1.0"
|
|
14
|
-
}
|
|
15
|
-
lintOptions {
|
|
16
|
-
abortOnError false
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
package com.aptoslabs.confidentialassetsbindings
|
|
2
|
-
|
|
3
|
-
import expo.modules.kotlin.modules.Module
|
|
4
|
-
import expo.modules.kotlin.modules.ModuleDefinition
|
|
5
|
-
import java.net.URL
|
|
6
|
-
|
|
7
|
-
class ConfidentialAssetsBindingsModule : Module() {
|
|
8
|
-
// Each module class must implement the definition function. The definition consists of components
|
|
9
|
-
// that describes the module's functionality and behavior.
|
|
10
|
-
// See https://docs.expo.dev/modules/module-api for more details about available components.
|
|
11
|
-
override fun definition() = ModuleDefinition {
|
|
12
|
-
// Sets the name of the module that JavaScript code will use to refer to the module. Takes a string as an argument.
|
|
13
|
-
// Can be inferred from module's class name, but it's recommended to set it explicitly for clarity.
|
|
14
|
-
// The module will be accessible from `requireNativeModule('ConfidentialAssetsBindings')` in JavaScript.
|
|
15
|
-
Name("ConfidentialAssetsBindings")
|
|
16
|
-
|
|
17
|
-
// Defines constant property on the module.
|
|
18
|
-
Constant("PI") {
|
|
19
|
-
Math.PI
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Defines event names that the module can send to JavaScript.
|
|
23
|
-
Events("onChange")
|
|
24
|
-
|
|
25
|
-
// Defines a JavaScript synchronous function that runs the native code on the JavaScript thread.
|
|
26
|
-
Function("hello") {
|
|
27
|
-
"Hello world! 👋"
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Defines a JavaScript function that always returns a Promise and whose native code
|
|
31
|
-
// is by default dispatched on the different thread than the JavaScript runtime runs on.
|
|
32
|
-
AsyncFunction("setValueAsync") { value: String ->
|
|
33
|
-
// Send an event to JavaScript.
|
|
34
|
-
sendEvent("onChange", mapOf(
|
|
35
|
-
"value" to value
|
|
36
|
-
))
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Enables the module to be used as a native view. Definition components that are accepted as part of
|
|
40
|
-
// the view definition: Prop, Events.
|
|
41
|
-
View(ConfidentialAssetsBindingsView::class) {
|
|
42
|
-
// Defines a setter for the `url` prop.
|
|
43
|
-
Prop("url") { view: ConfidentialAssetsBindingsView, url: URL ->
|
|
44
|
-
view.webView.loadUrl(url.toString())
|
|
45
|
-
}
|
|
46
|
-
// Defines an event that the view can send to JavaScript.
|
|
47
|
-
Events("onLoad")
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
package com.aptoslabs.confidentialassetsbindings
|
|
2
|
-
|
|
3
|
-
import android.content.Context
|
|
4
|
-
import android.webkit.WebView
|
|
5
|
-
import android.webkit.WebViewClient
|
|
6
|
-
import expo.modules.kotlin.AppContext
|
|
7
|
-
import expo.modules.kotlin.viewevent.EventDispatcher
|
|
8
|
-
import expo.modules.kotlin.views.ExpoView
|
|
9
|
-
|
|
10
|
-
class ConfidentialAssetsBindingsView(context: Context, appContext: AppContext) : ExpoView(context, appContext) {
|
|
11
|
-
// Creates and initializes an event dispatcher for the `onLoad` event.
|
|
12
|
-
// The name of the event is inferred from the value and needs to match the event name defined in the module.
|
|
13
|
-
private val onLoad by EventDispatcher()
|
|
14
|
-
|
|
15
|
-
// Defines a WebView that will be used as the root subview.
|
|
16
|
-
internal val webView = WebView(context).apply {
|
|
17
|
-
layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
|
|
18
|
-
webViewClient = object : WebViewClient() {
|
|
19
|
-
override fun onPageFinished(view: WebView, url: String) {
|
|
20
|
-
// Sends an event to JavaScript. Triggers a callback defined on the view component in JavaScript.
|
|
21
|
-
onLoad(mapOf("url" to url))
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
init {
|
|
27
|
-
// Adds the WebView to the view hierarchy.
|
|
28
|
-
addView(webView)
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
export type OnLoadEventPayload = {
|
|
3
|
-
url: string;
|
|
4
|
-
};
|
|
5
|
-
export type ConfidentialAssetsBindingsModuleEvents = {
|
|
6
|
-
onChange: (params: ChangeEventPayload) => void;
|
|
7
|
-
};
|
|
8
|
-
export type ChangeEventPayload = {
|
|
9
|
-
value: string;
|
|
10
|
-
};
|
|
11
|
-
export type ConfidentialAssetsBindingsViewProps = {
|
|
12
|
-
url: string;
|
|
13
|
-
onLoad: (event: {
|
|
14
|
-
nativeEvent: OnLoadEventPayload;
|
|
15
|
-
}) => void;
|
|
16
|
-
style?: StyleProp<ViewStyle>;
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=ConfidentialAssetsBindings.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidentialAssetsBindings.types.d.ts","sourceRoot":"","sources":["../src/ConfidentialAssetsBindings.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG;IACnD,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,kBAAkB,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7D,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidentialAssetsBindings.types.js","sourceRoot":"","sources":["../src/ConfidentialAssetsBindings.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\n\nexport type OnLoadEventPayload = {\n url: string;\n};\n\nexport type ConfidentialAssetsBindingsModuleEvents = {\n onChange: (params: ChangeEventPayload) => void;\n};\n\nexport type ChangeEventPayload = {\n value: string;\n};\n\nexport type ConfidentialAssetsBindingsViewProps = {\n url: string;\n onLoad: (event: { nativeEvent: OnLoadEventPayload }) => void;\n style?: StyleProp<ViewStyle>;\n};\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { NativeModule } from 'expo';
|
|
2
|
-
import { ConfidentialAssetsBindingsModuleEvents } from './ConfidentialAssetsBindings.types';
|
|
3
|
-
declare class ConfidentialAssetsBindingsModule extends NativeModule<ConfidentialAssetsBindingsModuleEvents> {
|
|
4
|
-
PI: number;
|
|
5
|
-
hello(): string;
|
|
6
|
-
setValueAsync(value: string): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
declare const _default: ConfidentialAssetsBindingsModule;
|
|
9
|
-
export default _default;
|
|
10
|
-
//# sourceMappingURL=ConfidentialAssetsBindingsModule.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidentialAssetsBindingsModule.d.ts","sourceRoot":"","sources":["../src/ConfidentialAssetsBindingsModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAC;AAEzD,OAAO,EAAE,sCAAsC,EAAE,MAAM,oCAAoC,CAAC;AAE5F,OAAO,OAAO,gCAAiC,SAAQ,YAAY,CAAC,sCAAsC,CAAC;IACzG,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,IAAI,MAAM;IACf,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAC5C;;AAGD,wBAAmG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidentialAssetsBindingsModule.js","sourceRoot":"","sources":["../src/ConfidentialAssetsBindingsModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAUzD,yDAAyD;AACzD,eAAe,mBAAmB,CAAmC,4BAA4B,CAAC,CAAC","sourcesContent":["import { NativeModule, requireNativeModule } from 'expo';\n\nimport { ConfidentialAssetsBindingsModuleEvents } from './ConfidentialAssetsBindings.types';\n\ndeclare class ConfidentialAssetsBindingsModule extends NativeModule<ConfidentialAssetsBindingsModuleEvents> {\n PI: number;\n hello(): string;\n setValueAsync(value: string): Promise<void>;\n}\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<ConfidentialAssetsBindingsModule>('ConfidentialAssetsBindings');\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { NativeModule } from 'expo';
|
|
2
|
-
import { ConfidentialAssetsBindingsModuleEvents } from './ConfidentialAssetsBindings.types';
|
|
3
|
-
declare class ConfidentialAssetsBindingsModule extends NativeModule<ConfidentialAssetsBindingsModuleEvents> {
|
|
4
|
-
PI: number;
|
|
5
|
-
setValueAsync(value: string): Promise<void>;
|
|
6
|
-
hello(): string;
|
|
7
|
-
}
|
|
8
|
-
declare const _default: typeof ConfidentialAssetsBindingsModule;
|
|
9
|
-
export default _default;
|
|
10
|
-
//# sourceMappingURL=ConfidentialAssetsBindingsModule.web.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidentialAssetsBindingsModule.web.d.ts","sourceRoot":"","sources":["../src/ConfidentialAssetsBindingsModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,EAAE,sCAAsC,EAAE,MAAM,oCAAoC,CAAC;AAE5F,cAAM,gCAAiC,SAAQ,YAAY,CAAC,sCAAsC,CAAC;IACjG,EAAE,SAAW;IACP,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAGjD,KAAK;CAGN;;AAED,wBAAuG"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { registerWebModule, NativeModule } from 'expo';
|
|
2
|
-
class ConfidentialAssetsBindingsModule extends NativeModule {
|
|
3
|
-
PI = Math.PI;
|
|
4
|
-
async setValueAsync(value) {
|
|
5
|
-
this.emit('onChange', { value });
|
|
6
|
-
}
|
|
7
|
-
hello() {
|
|
8
|
-
return 'Hello world! 👋';
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export default registerWebModule(ConfidentialAssetsBindingsModule, 'ConfidentialAssetsBindingsModule');
|
|
12
|
-
//# sourceMappingURL=ConfidentialAssetsBindingsModule.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidentialAssetsBindingsModule.web.js","sourceRoot":"","sources":["../src/ConfidentialAssetsBindingsModule.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAIvD,MAAM,gCAAiC,SAAQ,YAAoD;IACjG,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IACb,KAAK,CAAC,aAAa,CAAC,KAAa;QAC/B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACnC,CAAC;IACD,KAAK;QACH,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF;AAED,eAAe,iBAAiB,CAAC,gCAAgC,EAAE,kCAAkC,CAAC,CAAC","sourcesContent":["import { registerWebModule, NativeModule } from 'expo';\n\nimport { ConfidentialAssetsBindingsModuleEvents } from './ConfidentialAssetsBindings.types';\n\nclass ConfidentialAssetsBindingsModule extends NativeModule<ConfidentialAssetsBindingsModuleEvents> {\n PI = Math.PI;\n async setValueAsync(value: string): Promise<void> {\n this.emit('onChange', { value });\n }\n hello() {\n return 'Hello world! 👋';\n }\n}\n\nexport default registerWebModule(ConfidentialAssetsBindingsModule, 'ConfidentialAssetsBindingsModule');\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ConfidentialAssetsBindingsViewProps } from './ConfidentialAssetsBindings.types';
|
|
3
|
-
export default function ConfidentialAssetsBindingsView(props: ConfidentialAssetsBindingsViewProps): React.JSX.Element;
|
|
4
|
-
//# sourceMappingURL=ConfidentialAssetsBindingsView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidentialAssetsBindingsView.d.ts","sourceRoot":"","sources":["../src/ConfidentialAssetsBindingsView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mCAAmC,EAAE,MAAM,oCAAoC,CAAC;AAKzF,MAAM,CAAC,OAAO,UAAU,8BAA8B,CAAC,KAAK,EAAE,mCAAmC,qBAEhG"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { requireNativeView } from 'expo';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
const NativeView = requireNativeView('ConfidentialAssetsBindings');
|
|
4
|
-
export default function ConfidentialAssetsBindingsView(props) {
|
|
5
|
-
return <NativeView {...props}/>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=ConfidentialAssetsBindingsView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidentialAssetsBindingsView.js","sourceRoot":"","sources":["../src/ConfidentialAssetsBindingsView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,UAAU,GACd,iBAAiB,CAAC,4BAA4B,CAAC,CAAC;AAElD,MAAM,CAAC,OAAO,UAAU,8BAA8B,CAAC,KAA0C;IAC/F,OAAO,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACnC,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport * as React from 'react';\n\nimport { ConfidentialAssetsBindingsViewProps } from './ConfidentialAssetsBindings.types';\n\nconst NativeView: React.ComponentType<ConfidentialAssetsBindingsViewProps> =\n requireNativeView('ConfidentialAssetsBindings');\n\nexport default function ConfidentialAssetsBindingsView(props: ConfidentialAssetsBindingsViewProps) {\n return <NativeView {...props} />;\n}\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ConfidentialAssetsBindingsViewProps } from './ConfidentialAssetsBindings.types';
|
|
3
|
-
export default function ConfidentialAssetsBindingsView(props: ConfidentialAssetsBindingsViewProps): React.JSX.Element;
|
|
4
|
-
//# sourceMappingURL=ConfidentialAssetsBindingsView.web.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidentialAssetsBindingsView.web.d.ts","sourceRoot":"","sources":["../src/ConfidentialAssetsBindingsView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,mCAAmC,EAAE,MAAM,oCAAoC,CAAC;AAEzF,MAAM,CAAC,OAAO,UAAU,8BAA8B,CAAC,KAAK,EAAE,mCAAmC,qBAUhG"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export default function ConfidentialAssetsBindingsView(props) {
|
|
3
|
-
return (<div>
|
|
4
|
-
<iframe style={{ flex: 1 }} src={props.url} onLoad={() => props.onLoad({ nativeEvent: { url: props.url } })}/>
|
|
5
|
-
</div>);
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=ConfidentialAssetsBindingsView.web.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfidentialAssetsBindingsView.web.js","sourceRoot":"","sources":["../src/ConfidentialAssetsBindingsView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,CAAC,OAAO,UAAU,8BAA8B,CAAC,KAA0C;IAC/F,OAAO,CACL,CAAC,GAAG,CACF;MAAA,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CACnB,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CACf,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAEpE;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\n\nimport { ConfidentialAssetsBindingsViewProps } from './ConfidentialAssetsBindings.types';\n\nexport default function ConfidentialAssetsBindingsView(props: ConfidentialAssetsBindingsViewProps) {\n return (\n <div>\n <iframe\n style={{ flex: 1 }}\n src={props.url}\n onLoad={() => props.onLoad({ nativeEvent: { url: props.url } })}\n />\n </div>\n );\n}\n"]}
|
package/dist/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";iBAiDsB,qBAAA,CAAA,GAAyB,OAAA;AAAA,UAiB9B,gBAAA;EACf,CAAA;EACA,CAAA,EAAG,UAAA;EACH,OAAA,EAAS,UAAA;EACT,QAAA,EAAU,UAAA;EACV,O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AA;EACP,IAAA,EAAM,UAAA;EACN,OAAA,EAAS,UAAA;EACT,QAAA,EAAU,UAAA;EACV,OAAA;AAAA;AAAA,cAGW,WAAA,GAAqB,MAAA,EAAQ,sBAAA,KAAsB,OAAA;AAAA,UAQ/C,2BAAA;EACf,KAAA,EAAO,UAAA;EACP,KAAA,EAAO,UAAA;EACP,OAAA,EAAS,UAAA;EACT,QAAA,EAAU,UAAA;EACV,OAAA;AAAA;AAAA,cAGW,gBAAA,GAA0B,MAAA,EAAQ,2BAAA,KAA2B,OAAA;AAAA,cAgB7D,gBAAA,GAA0B,CAAA,EAAG,UAAA,EAAY,UAAA,aAAkB,OAAA"}
|
package/dist/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["pkg.version","init"],"sources":["../build/wasm/aptos_confidential_asset_wasm.js","../package.json","../src/index.ts"],"sourcesContent":["/* @ts-self-types=\"./aptos_confidential_asset_wasm.d.ts\" */\n\n/**\n * Result of a batch range proof generation\n */\nexport class BatchRangeProof {\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(BatchRangeProof.prototype);\n obj.__wbg_ptr = ptr;\n BatchRangeProofFinalization.register(obj, obj.__wbg_ptr, obj);\n return obj;\n }\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n BatchRangeProofFinalization.unregister(this);\n return ptr;\n }\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_batchrangeproof_free(ptr, 0);\n }\n /**\n * Returns the serialized commitments (each 32 bytes)\n * @returns {Uint8Array[]}\n */\n comms() {\n const ret = wasm.batchrangeproof_comms(this.__wbg_ptr);\n var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();\n wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);\n return v1;\n }\n /**\n * Returns the serialized proof bytes\n * @returns {Uint8Array}\n */\n proof() {\n const ret = wasm.batchrangeproof_proof(this.__wbg_ptr);\n var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();\n wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);\n return v1;\n }\n}\nif (Symbol.dispose) BatchRangeProof.prototype[Symbol.dispose] = BatchRangeProof.prototype.free;\n\n/**\n * Discrete log solver supporting 16-bit and 32-bit secrets.\n */\nexport class DiscreteLogSolver {\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n DiscreteLogSolverFinalization.unregister(this);\n return ptr;\n }\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_discretelogsolver_free(ptr, 0);\n }\n /**\n * Returns the algorithm name.\n * @returns {string}\n */\n algorithm() {\n let deferred1_0;\n let deferred1_1;\n try {\n const ret = wasm.discretelogsolver_algorithm(this.__wbg_ptr);\n deferred1_0 = ret[0];\n deferred1_1 = ret[1];\n return getStringFromWasm0(ret[0], ret[1]);\n } finally {\n wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * Returns the supported bit sizes as an array [16, 32].\n * @returns {Uint8Array}\n */\n max_num_bits() {\n const ret = wasm.discretelogsolver_max_num_bits(this.__wbg_ptr);\n var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();\n wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);\n return v1;\n }\n /**\n * Creates a new solver with precomputed tables.\n */\n constructor() {\n const ret = wasm.discretelogsolver_new();\n this.__wbg_ptr = ret >>> 0;\n DiscreteLogSolverFinalization.register(this, this.__wbg_ptr, this);\n return this;\n }\n /**\n * Solves the discrete log problem.\n *\n * Given a compressed Ristretto point y = g^x (32 bytes), finds x.\n *\n * # Arguments\n * * `y` - The compressed Ristretto point (32 bytes)\n * * `max_num_bits` - Maximum bits of the secret: 16 or 32\n *\n * # Returns\n * The discrete log x, or an error if not found or invalid input.\n * @param {Uint8Array} y\n * @param {number} max_num_bits\n * @returns {bigint}\n */\n solve(y, max_num_bits) {\n const ptr0 = passArray8ToWasm0(y, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.discretelogsolver_solve(this.__wbg_ptr, ptr0, len0, max_num_bits);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return BigInt.asUintN(64, ret[0]);\n }\n}\nif (Symbol.dispose) DiscreteLogSolver.prototype[Symbol.dispose] = DiscreteLogSolver.prototype.free;\n\n/**\n * Result of a single range proof generation\n */\nexport class SingleRangeProof {\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(SingleRangeProof.prototype);\n obj.__wbg_ptr = ptr;\n SingleRangeProofFinalization.register(obj, obj.__wbg_ptr, obj);\n return obj;\n }\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n SingleRangeProofFinalization.unregister(this);\n return ptr;\n }\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_singlerangeproof_free(ptr, 0);\n }\n /**\n * Returns the serialized commitment (32 bytes)\n * @returns {Uint8Array}\n */\n comm() {\n const ret = wasm.singlerangeproof_comm(this.__wbg_ptr);\n var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();\n wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);\n return v1;\n }\n /**\n * Returns the serialized proof bytes\n * @returns {Uint8Array}\n */\n proof() {\n const ret = wasm.singlerangeproof_proof(this.__wbg_ptr);\n var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();\n wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);\n return v1;\n }\n}\nif (Symbol.dispose) SingleRangeProof.prototype[Symbol.dispose] = SingleRangeProof.prototype.free;\n\n/**\n * Generate a batch range proof for multiple values.\n *\n * # Arguments\n * * `v` - The secret values to prove are in range [0, 2^num_bits)\n * * `rs` - The blinding factors (each 32-byte scalar)\n * * `val_base` - Value base point for Pedersen commitment (32-byte compressed point)\n * * `rand_base` - Randomness base point for Pedersen commitment (32-byte compressed point)\n * * `num_bits` - Bit length for range proof (8, 16, 32, or 64)\n * @param {BigUint64Array} v\n * @param {Uint8Array[]} rs\n * @param {Uint8Array} val_base\n * @param {Uint8Array} rand_base\n * @param {number} num_bits\n * @returns {BatchRangeProof}\n */\nexport function batch_range_proof(v, rs, val_base, rand_base, num_bits) {\n const ptr0 = passArray64ToWasm0(v, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArrayJsValueToWasm0(rs, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passArray8ToWasm0(val_base, wasm.__wbindgen_malloc);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passArray8ToWasm0(rand_base, wasm.__wbindgen_malloc);\n const len3 = WASM_VECTOR_LEN;\n const ret = wasm.batch_range_proof(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, num_bits);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return BatchRangeProof.__wrap(ret[0]);\n}\n\n/**\n * Verify a batch range proof.\n * @param {Uint8Array} proof\n * @param {Uint8Array[]} comms\n * @param {Uint8Array} val_base\n * @param {Uint8Array} rand_base\n * @param {number} num_bits\n * @returns {boolean}\n */\nexport function batch_verify_proof(proof, comms, val_base, rand_base, num_bits) {\n const ptr0 = passArray8ToWasm0(proof, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArrayJsValueToWasm0(comms, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passArray8ToWasm0(val_base, wasm.__wbindgen_malloc);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passArray8ToWasm0(rand_base, wasm.__wbindgen_malloc);\n const len3 = WASM_VECTOR_LEN;\n const ret = wasm.batch_verify_proof(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, num_bits);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return ret[0] !== 0;\n}\n\n/**\n * Installs a panic hook that forwards Rust panic messages to `console.error`.\n * Called automatically on WASM init. Without this, panics surface as an\n * opaque `RuntimeError: unreachable` with no message.\n */\nexport function init() {\n wasm.init();\n}\n\n/**\n * Generate a single range proof.\n *\n * # Arguments\n * * `v` - The secret value to prove is in range [0, 2^num_bits)\n * * `r` - The blinding factor (32-byte scalar)\n * * `val_base` - Value base point for Pedersen commitment (32-byte compressed point)\n * * `rand_base` - Randomness base point for Pedersen commitment (32-byte compressed point)\n * * `num_bits` - Bit length for range proof (8, 16, 32, or 64)\n * @param {bigint} v\n * @param {Uint8Array} r\n * @param {Uint8Array} val_base\n * @param {Uint8Array} rand_base\n * @param {number} num_bits\n * @returns {SingleRangeProof}\n */\nexport function range_proof(v, r, val_base, rand_base, num_bits) {\n const ptr0 = passArray8ToWasm0(r, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(val_base, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passArray8ToWasm0(rand_base, wasm.__wbindgen_malloc);\n const len2 = WASM_VECTOR_LEN;\n const ret = wasm.range_proof(v, ptr0, len0, ptr1, len1, ptr2, len2, num_bits);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return SingleRangeProof.__wrap(ret[0]);\n}\n\n/**\n * Verify a single range proof.\n * @param {Uint8Array} proof\n * @param {Uint8Array} comm\n * @param {Uint8Array} val_base\n * @param {Uint8Array} rand_base\n * @param {number} num_bits\n * @returns {boolean}\n */\nexport function verify_proof(proof, comm, val_base, rand_base, num_bits) {\n const ptr0 = passArray8ToWasm0(proof, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(comm, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passArray8ToWasm0(val_base, wasm.__wbindgen_malloc);\n const len2 = WASM_VECTOR_LEN;\n const ptr3 = passArray8ToWasm0(rand_base, wasm.__wbindgen_malloc);\n const len3 = WASM_VECTOR_LEN;\n const ret = wasm.verify_proof(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, num_bits);\n if (ret[2]) {\n throw takeFromExternrefTable0(ret[1]);\n }\n return ret[0] !== 0;\n}\n\nfunction __wbg_get_imports() {\n const import0 = {\n __proto__: null,\n __wbg_Error_2e59b1b37a9a34c3: function(arg0, arg1) {\n const ret = Error(getStringFromWasm0(arg0, arg1));\n return ret;\n },\n __wbg___wbindgen_is_function_49868bde5eb1e745: function(arg0) {\n const ret = typeof(arg0) === 'function';\n return ret;\n },\n __wbg___wbindgen_is_object_40c5a80572e8f9d3: function(arg0) {\n const val = arg0;\n const ret = typeof(val) === 'object' && val !== null;\n return ret;\n },\n __wbg___wbindgen_is_string_b29b5c5a8065ba1a: function(arg0) {\n const ret = typeof(arg0) === 'string';\n return ret;\n },\n __wbg___wbindgen_is_undefined_c0cca72b82b86f4d: function(arg0) {\n const ret = arg0 === undefined;\n return ret;\n },\n __wbg___wbindgen_throw_81fc77679af83bc6: function(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n },\n __wbg_call_d578befcc3145dee: function() { return handleError(function (arg0, arg1, arg2) {\n const ret = arg0.call(arg1, arg2);\n return ret;\n }, arguments); },\n __wbg_crypto_38df2bab126b63dc: function(arg0) {\n const ret = arg0.crypto;\n return ret;\n },\n __wbg_error_38bec0a78dd8ded8: function(arg0) {\n console.error(arg0);\n },\n __wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {\n arg0.getRandomValues(arg1);\n }, arguments); },\n __wbg_length_0c32cb8543c8e4c8: function(arg0) {\n const ret = arg0.length;\n return ret;\n },\n __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {\n const ret = arg0.msCrypto;\n return ret;\n },\n __wbg_new_from_slice_2580ff33d0d10520: function(arg0, arg1) {\n const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));\n return ret;\n },\n __wbg_new_with_length_9cedd08484b73942: function(arg0) {\n const ret = new Uint8Array(arg0 >>> 0);\n return ret;\n },\n __wbg_node_84ea875411254db1: function(arg0) {\n const ret = arg0.node;\n return ret;\n },\n __wbg_process_44c7a14e11e9f69e: function(arg0) {\n const ret = arg0.process;\n return ret;\n },\n __wbg_prototypesetcall_3e05eb9545565046: function(arg0, arg1, arg2) {\n Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);\n },\n __wbg_randomFillSync_6c25eac9869eb53c: function() { return handleError(function (arg0, arg1) {\n arg0.randomFillSync(arg1);\n }, arguments); },\n __wbg_require_b4edbdcf3e2a1ef0: function() { return handleError(function () {\n const ret = module.require;\n return ret;\n }, arguments); },\n __wbg_static_accessor_GLOBAL_THIS_a1248013d790bf5f: function() {\n const ret = typeof globalThis === 'undefined' ? null : globalThis;\n return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);\n },\n __wbg_static_accessor_GLOBAL_f2e0f995a21329ff: function() {\n const ret = typeof global === 'undefined' ? null : global;\n return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);\n },\n __wbg_static_accessor_SELF_24f78b6d23f286ea: function() {\n const ret = typeof self === 'undefined' ? null : self;\n return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);\n },\n __wbg_static_accessor_WINDOW_59fd959c540fe405: function() {\n const ret = typeof window === 'undefined' ? null : window;\n return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);\n },\n __wbg_subarray_0f98d3fb634508ad: function(arg0, arg1, arg2) {\n const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);\n return ret;\n },\n __wbg_versions_276b2795b1c6a219: function(arg0) {\n const ret = arg0.versions;\n return ret;\n },\n __wbindgen_cast_0000000000000001: function(arg0, arg1) {\n // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref(\"Uint8Array\")`.\n const ret = getArrayU8FromWasm0(arg0, arg1);\n return ret;\n },\n __wbindgen_cast_0000000000000002: function(arg0, arg1) {\n // Cast intrinsic for `Ref(String) -> Externref`.\n const ret = getStringFromWasm0(arg0, arg1);\n return ret;\n },\n __wbindgen_init_externref_table: function() {\n const table = wasm.__wbindgen_externrefs;\n const offset = table.grow(4);\n table.set(0, undefined);\n table.set(offset + 0, undefined);\n table.set(offset + 1, null);\n table.set(offset + 2, true);\n table.set(offset + 3, false);\n },\n };\n return {\n __proto__: null,\n \"./aptos_confidential_asset_wasm_bg.js\": import0,\n };\n}\n\nconst BatchRangeProofFinalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_batchrangeproof_free(ptr >>> 0, 1));\nconst DiscreteLogSolverFinalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_discretelogsolver_free(ptr >>> 0, 1));\nconst SingleRangeProofFinalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_singlerangeproof_free(ptr >>> 0, 1));\n\nfunction addToExternrefTable0(obj) {\n const idx = wasm.__externref_table_alloc();\n wasm.__wbindgen_externrefs.set(idx, obj);\n return idx;\n}\n\nfunction getArrayJsValueFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n const mem = getDataViewMemory0();\n const result = [];\n for (let i = ptr; i < ptr + 4 * len; i += 4) {\n result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));\n }\n wasm.__externref_drop_slice(ptr, len);\n return result;\n}\n\nfunction getArrayU8FromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);\n}\n\nlet cachedBigUint64ArrayMemory0 = null;\nfunction getBigUint64ArrayMemory0() {\n if (cachedBigUint64ArrayMemory0 === null || cachedBigUint64ArrayMemory0.byteLength === 0) {\n cachedBigUint64ArrayMemory0 = new BigUint64Array(wasm.memory.buffer);\n }\n return cachedBigUint64ArrayMemory0;\n}\n\nlet cachedDataViewMemory0 = null;\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return decodeText(ptr, len);\n}\n\nlet cachedUint8ArrayMemory0 = null;\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n const idx = addToExternrefTable0(e);\n wasm.__wbindgen_exn_store(idx);\n }\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nfunction passArray64ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 8, 8) >>> 0;\n getBigUint64ArrayMemory0().set(arg, ptr / 8);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nfunction passArray8ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 1, 1) >>> 0;\n getUint8ArrayMemory0().set(arg, ptr / 1);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nfunction passArrayJsValueToWasm0(array, malloc) {\n const ptr = malloc(array.length * 4, 4) >>> 0;\n for (let i = 0; i < array.length; i++) {\n const add = addToExternrefTable0(array[i]);\n getDataViewMemory0().setUint32(ptr + 4 * i, add, true);\n }\n WASM_VECTOR_LEN = array.length;\n return ptr;\n}\n\nfunction takeFromExternrefTable0(idx) {\n const value = wasm.__wbindgen_externrefs.get(idx);\n wasm.__externref_table_dealloc(idx);\n return value;\n}\n\nlet cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\ncachedTextDecoder.decode();\nconst MAX_SAFARI_DECODE_BYTES = 2146435072;\nlet numBytesDecoded = 0;\nfunction decodeText(ptr, len) {\n numBytesDecoded += len;\n if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {\n cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n cachedTextDecoder.decode();\n numBytesDecoded = len;\n }\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nlet wasmModule, wasm;\nfunction __wbg_finalize_init(instance, module) {\n wasm = instance.exports;\n wasmModule = module;\n cachedBigUint64ArrayMemory0 = null;\n cachedDataViewMemory0 = null;\n cachedUint8ArrayMemory0 = null;\n wasm.__wbindgen_start();\n return wasm;\n}\n\nasync function __wbg_load(module, imports) {\n if (typeof Response === 'function' && module instanceof Response) {\n if (typeof WebAssembly.instantiateStreaming === 'function') {\n try {\n return await WebAssembly.instantiateStreaming(module, imports);\n } catch (e) {\n const validResponse = module.ok && expectedResponseType(module.type);\n\n if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {\n console.warn(\"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\\n\", e);\n\n } else { throw e; }\n }\n }\n\n const bytes = await module.arrayBuffer();\n return await WebAssembly.instantiate(bytes, imports);\n } else {\n const instance = await WebAssembly.instantiate(module, imports);\n\n if (instance instanceof WebAssembly.Instance) {\n return { instance, module };\n } else {\n return instance;\n }\n }\n\n function expectedResponseType(type) {\n switch (type) {\n case 'basic': case 'cors': case 'default': return true;\n }\n return false;\n }\n}\n\nfunction initSync(module) {\n if (wasm !== undefined) return wasm;\n\n\n if (module !== undefined) {\n if (Object.getPrototypeOf(module) === Object.prototype) {\n ({module} = module)\n } else {\n console.warn('using deprecated parameters for `initSync()`; pass a single object instead')\n }\n }\n\n const imports = __wbg_get_imports();\n if (!(module instanceof WebAssembly.Module)) {\n module = new WebAssembly.Module(module);\n }\n const instance = new WebAssembly.Instance(module, imports);\n return __wbg_finalize_init(instance, module);\n}\n\nasync function __wbg_init(module_or_path) {\n if (wasm !== undefined) return wasm;\n\n\n if (module_or_path !== undefined) {\n if (Object.getPrototypeOf(module_or_path) === Object.prototype) {\n ({module_or_path} = module_or_path)\n } else {\n console.warn('using deprecated parameters for the initialization function; pass a single object instead')\n }\n }\n\n if (module_or_path === undefined) {\n module_or_path = new URL('aptos_confidential_asset_wasm_bg.wasm', import.meta.url);\n }\n const imports = __wbg_get_imports();\n\n if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {\n module_or_path = fetch(module_or_path);\n }\n\n const { instance, module } = await __wbg_load(await module_or_path, imports);\n\n return __wbg_finalize_init(instance, module);\n}\n\nexport { initSync, __wbg_init as default };\n","","import init, {\n DiscreteLogSolver,\n range_proof,\n batch_range_proof,\n verify_proof,\n batch_verify_proof,\n} from '../build/wasm/aptos_confidential_asset_wasm';\n\nimport pkg from '../package.json';\n\nconst CDN_WASM_URL = `https://unpkg.com/@aptos-labs/confidential-assets-bindings@${pkg.version}/dist/aptos_confidential_asset_wasm_bg.wasm`;\n\nasync function getNodeModulesWASM(): Promise<string | BufferSource> {\n // In Node.js, try to load from local node_modules\n try {\n // Dynamic import for Node.js fs module\n const fs = await import(\"fs\");\n const path = await import(\"path\");\n\n // Try to find the WASM file in node_modules\n const possiblePaths = [\n path.resolve(\n process.cwd(),\n \"node_modules/@aptos-labs/confidential-assets-bindings/dist/aptos_confidential_asset_wasm_bg.wasm\",\n ),\n new URL(\"./aptos_confidential_asset_wasm_bg.wasm\", import.meta.url).pathname,\n ];\n\n for (const wasmPath of possiblePaths) {\n if (fs.existsSync(wasmPath)) {\n return fs.readFileSync(wasmPath);\n }\n }\n } catch {\n // Fall through to URL\n }\n return CDN_WASM_URL;\n}\n\nasync function getWasmSource(): Promise<string | BufferSource> {\n if (typeof process !== \"undefined\" && process.versions?.node) {\n return getNodeModulesWASM();\n }\n return CDN_WASM_URL;\n}\n\nlet initPromise: Promise<void> | undefined;\nlet initialized = false;\n\nexport async function ensureWasmInitialized(): Promise<void> {\n if (initialized) return;\n if (!initPromise) {\n initPromise = (async () => {\n try {\n const moduleOrPath = await getWasmSource();\n await init({ module_or_path: moduleOrPath });\n initialized = true;\n } catch (error) {\n initPromise = undefined;\n throw error;\n }\n })();\n }\n await initPromise;\n}\n\nexport interface RangeProofInputs {\n v: bigint;\n r: Uint8Array;\n valBase: Uint8Array;\n randBase: Uint8Array;\n numBits?: number;\n}\n\nexport const rangeProof = async (inputs: RangeProofInputs) => {\n await ensureWasmInitialized();\n\n const { v, r, valBase, randBase, numBits = 32 } = inputs;\n\n const proof = range_proof(v, r, valBase, randBase, numBits);\n\n try {\n return {\n proof: proof.proof(),\n commitment: proof.comm(),\n }\n } finally {\n proof.free();\n }\n}\n\nexport interface BatchRangeProofInputs {\n v: bigint[];\n rs: Uint8Array[];\n valBase: Uint8Array;\n randBase: Uint8Array;\n numBits?: number;\n}\n\nexport const batchRangeProof = async (inputs: BatchRangeProofInputs) => {\n await ensureWasmInitialized();\n\n const { v, rs, valBase, randBase, numBits = 32 } = inputs;\n\n const proof = batch_range_proof(new BigUint64Array(v), rs, valBase, randBase, numBits);\n\n try {\n return {\n proof: proof.proof(),\n commitments: proof.comms(),\n }\n } finally {\n proof.free();\n }\n}\n\nexport interface VerifyRangeProofInputs {\n proof: Uint8Array;\n comm: Uint8Array;\n valBase: Uint8Array;\n randBase: Uint8Array;\n numBits?: number;\n}\n\nexport const verifyProof = async (inputs: VerifyRangeProofInputs) => {\n await ensureWasmInitialized();\n\n const { proof, comm, valBase, randBase, numBits = 32 } = inputs;\n\n return verify_proof(proof, comm, valBase, randBase, numBits);\n}\n\nexport interface BatchVerifyRangeProofInputs {\n proof: Uint8Array;\n comms: Uint8Array[];\n valBase: Uint8Array;\n randBase: Uint8Array;\n numBits: number;\n}\n\nexport const batchVerifyProof = async (inputs: BatchVerifyRangeProofInputs) => {\n await ensureWasmInitialized();\n\n const { proof, comms, valBase, randBase, numBits } = inputs;\n\n return batch_verify_proof(proof, comms, valBase, randBase, numBits);\n}\n\nlet _discreteLogSolver: DiscreteLogSolver | null = null;\n\nconst getDiscreteLogSolver = () => {\n if (_discreteLogSolver) return _discreteLogSolver;\n\n return _discreteLogSolver = new DiscreteLogSolver();\n}\n\nexport const solveDiscreteLog = async (y: Uint8Array, maxNumBits: number) => {\n await ensureWasmInitialized();\n\n const solver = getDiscreteLogSolver();\n\n return solver.solve(y, maxNumBits);\n}\n"],"mappings":";;;;AAKA,IAAa,kBAAb,MAAa,gBAAgB;CACzB,OAAO,OAAO,KAAK;AACf,QAAM,QAAQ;EACd,MAAM,MAAM,OAAO,OAAO,gBAAgB,UAAU;AACpD,MAAI,YAAY;AAChB,8BAA4B,SAAS,KAAK,IAAI,WAAW,IAAI;AAC7D,SAAO;;CAEX,qBAAqB;EACjB,MAAM,MAAM,KAAK;AACjB,OAAK,YAAY;AACjB,8BAA4B,WAAW,KAAK;AAC5C,SAAO;;CAEX,OAAO;EACH,MAAM,MAAM,KAAK,oBAAoB;AACrC,OAAK,2BAA2B,KAAK,EAAE;;;;;;CAM3C,QAAQ;EACJ,MAAM,MAAM,KAAK,sBAAsB,KAAK,UAAU;EACtD,IAAI,KAAK,yBAAyB,IAAI,IAAI,IAAI,GAAG,CAAC,OAAO;AACzD,OAAK,gBAAgB,IAAI,IAAI,IAAI,KAAK,GAAG,EAAE;AAC3C,SAAO;;;;;;CAMX,QAAQ;EACJ,MAAM,MAAM,KAAK,sBAAsB,KAAK,UAAU;EACtD,IAAI,KAAK,oBAAoB,IAAI,IAAI,IAAI,GAAG,CAAC,OAAO;AACpD,OAAK,gBAAgB,IAAI,IAAI,IAAI,KAAK,GAAG,EAAE;AAC3C,SAAO;;;AAGf,IAAI,OAAO,QAAS,iBAAgB,UAAU,OAAO,WAAW,gBAAgB,UAAU;;;;AAK1F,IAAa,o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AAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAC7F,cAAe,oCAAoC,CAAC"}
|
package/dist/index.native.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// Reexport the native module. On web, it will be resolved to ConfidentialAssetsBindingsModule.web.ts
|
|
2
|
-
// and on native platforms to ConfidentialAssetsBindingsModule.ts
|
|
3
|
-
export { default } from './ConfidentialAssetsBindingsModule';
|
|
4
|
-
export { default as ConfidentialAssetsBindingsView } from './ConfidentialAssetsBindingsView';
|
|
5
|
-
export * from './ConfidentialAssetsBindings.types';
|
|
6
|
-
//# sourceMappingURL=index.native.js.map
|
package/dist/index.native.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,iEAAiE;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAC7F,cAAe,oCAAoC,CAAC","sourcesContent":["// Reexport the native module. On web, it will be resolved to ConfidentialAssetsBindingsModule.web.ts\n// and on native platforms to ConfidentialAssetsBindingsModule.ts\nexport { default } from './ConfidentialAssetsBindingsModule';\nexport { default as ConfidentialAssetsBindingsView } from './ConfidentialAssetsBindingsView';\nexport * from './ConfidentialAssetsBindings.types';\n"]}
|
package/expo-module.config.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
require 'json'
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
|
-
|
|
5
|
-
Pod::Spec.new do |s|
|
|
6
|
-
s.name = 'ConfidentialAssetsBindings'
|
|
7
|
-
s.version = package['version']
|
|
8
|
-
s.summary = package['description']
|
|
9
|
-
s.description = package['description']
|
|
10
|
-
s.license = package['license']
|
|
11
|
-
s.author = package['author']
|
|
12
|
-
s.homepage = package['homepage']
|
|
13
|
-
s.platforms = {
|
|
14
|
-
:ios => '15.1',
|
|
15
|
-
:tvos => '15.1'
|
|
16
|
-
}
|
|
17
|
-
s.swift_version = '5.9'
|
|
18
|
-
s.source = { git: 'https://github.com/aptos-labs/confidential-assets-bindings' }
|
|
19
|
-
s.static_framework = true
|
|
20
|
-
|
|
21
|
-
s.dependency 'ExpoModulesCore'
|
|
22
|
-
|
|
23
|
-
# Swift/Objective-C compatibility
|
|
24
|
-
s.pod_target_xcconfig = {
|
|
25
|
-
'DEFINES_MODULE' => 'YES',
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
s.source_files = "**/*.{h,m,mm,swift,hpp,cpp}"
|
|
29
|
-
end
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import ExpoModulesCore
|
|
2
|
-
|
|
3
|
-
public class ConfidentialAssetsBindingsModule: Module {
|
|
4
|
-
// Each module class must implement the definition function. The definition consists of components
|
|
5
|
-
// that describes the module's functionality and behavior.
|
|
6
|
-
// See https://docs.expo.dev/modules/module-api for more details about available components.
|
|
7
|
-
public func definition() -> ModuleDefinition {
|
|
8
|
-
// Sets the name of the module that JavaScript code will use to refer to the module. Takes a string as an argument.
|
|
9
|
-
// Can be inferred from module's class name, but it's recommended to set it explicitly for clarity.
|
|
10
|
-
// The module will be accessible from `requireNativeModule('ConfidentialAssetsBindings')` in JavaScript.
|
|
11
|
-
Name("ConfidentialAssetsBindings")
|
|
12
|
-
|
|
13
|
-
// Defines constant property on the module.
|
|
14
|
-
Constant("PI") {
|
|
15
|
-
Double.pi
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Defines event names that the module can send to JavaScript.
|
|
19
|
-
Events("onChange")
|
|
20
|
-
|
|
21
|
-
// Defines a JavaScript synchronous function that runs the native code on the JavaScript thread.
|
|
22
|
-
Function("hello") {
|
|
23
|
-
return "Hello world! 👋"
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Defines a JavaScript function that always returns a Promise and whose native code
|
|
27
|
-
// is by default dispatched on the different thread than the JavaScript runtime runs on.
|
|
28
|
-
AsyncFunction("setValueAsync") { (value: String) in
|
|
29
|
-
// Send an event to JavaScript.
|
|
30
|
-
self.sendEvent("onChange", [
|
|
31
|
-
"value": value
|
|
32
|
-
])
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Enables the module to be used as a native view. Definition components that are accepted as part of the
|
|
36
|
-
// view definition: Prop, Events.
|
|
37
|
-
View(ConfidentialAssetsBindingsView.self) {
|
|
38
|
-
// Defines a setter for the `url` prop.
|
|
39
|
-
Prop("url") { (view: ConfidentialAssetsBindingsView, url: URL) in
|
|
40
|
-
if view.webView.url != url {
|
|
41
|
-
view.webView.load(URLRequest(url: url))
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
Events("onLoad")
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import ExpoModulesCore
|
|
2
|
-
import WebKit
|
|
3
|
-
|
|
4
|
-
// This view will be used as a native component. Make sure to inherit from `ExpoView`
|
|
5
|
-
// to apply the proper styling (e.g. border radius and shadows).
|
|
6
|
-
class ConfidentialAssetsBindingsView: ExpoView {
|
|
7
|
-
let webView = WKWebView()
|
|
8
|
-
let onLoad = EventDispatcher()
|
|
9
|
-
var delegate: WebViewDelegate?
|
|
10
|
-
|
|
11
|
-
required init(appContext: AppContext? = nil) {
|
|
12
|
-
super.init(appContext: appContext)
|
|
13
|
-
clipsToBounds = true
|
|
14
|
-
delegate = WebViewDelegate { url in
|
|
15
|
-
self.onLoad(["url": url])
|
|
16
|
-
}
|
|
17
|
-
webView.navigationDelegate = delegate
|
|
18
|
-
addSubview(webView)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
override func layoutSubviews() {
|
|
22
|
-
webView.frame = bounds
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
class WebViewDelegate: NSObject, WKNavigationDelegate {
|
|
27
|
-
let onUrlChange: (String) -> Void
|
|
28
|
-
|
|
29
|
-
init(onUrlChange: @escaping (String) -> Void) {
|
|
30
|
-
self.onUrlChange = onUrlChange
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation) {
|
|
34
|
-
if let url = webView.url {
|
|
35
|
-
onUrlChange(url.absoluteString)
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
|
|
3
|
-
export type OnLoadEventPayload = {
|
|
4
|
-
url: string;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export type ConfidentialAssetsBindingsModuleEvents = {
|
|
8
|
-
onChange: (params: ChangeEventPayload) => void;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export type ChangeEventPayload = {
|
|
12
|
-
value: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type ConfidentialAssetsBindingsViewProps = {
|
|
16
|
-
url: string;
|
|
17
|
-
onLoad: (event: { nativeEvent: OnLoadEventPayload }) => void;
|
|
18
|
-
style?: StyleProp<ViewStyle>;
|
|
19
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { NativeModule, requireNativeModule } from 'expo';
|
|
2
|
-
|
|
3
|
-
import { ConfidentialAssetsBindingsModuleEvents } from './ConfidentialAssetsBindings.types';
|
|
4
|
-
|
|
5
|
-
declare class ConfidentialAssetsBindingsModule extends NativeModule<ConfidentialAssetsBindingsModuleEvents> {
|
|
6
|
-
PI: number;
|
|
7
|
-
hello(): string;
|
|
8
|
-
setValueAsync(value: string): Promise<void>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// This call loads the native module object from the JSI.
|
|
12
|
-
export default requireNativeModule<ConfidentialAssetsBindingsModule>('ConfidentialAssetsBindings');
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { registerWebModule, NativeModule } from 'expo';
|
|
2
|
-
|
|
3
|
-
import { ConfidentialAssetsBindingsModuleEvents } from './ConfidentialAssetsBindings.types';
|
|
4
|
-
|
|
5
|
-
class ConfidentialAssetsBindingsModule extends NativeModule<ConfidentialAssetsBindingsModuleEvents> {
|
|
6
|
-
PI = Math.PI;
|
|
7
|
-
async setValueAsync(value: string): Promise<void> {
|
|
8
|
-
this.emit('onChange', { value });
|
|
9
|
-
}
|
|
10
|
-
hello() {
|
|
11
|
-
return 'Hello world! 👋';
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default registerWebModule(ConfidentialAssetsBindingsModule, 'ConfidentialAssetsBindingsModule');
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { requireNativeView } from 'expo';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
import { ConfidentialAssetsBindingsViewProps } from './ConfidentialAssetsBindings.types';
|
|
5
|
-
|
|
6
|
-
const NativeView: React.ComponentType<ConfidentialAssetsBindingsViewProps> =
|
|
7
|
-
requireNativeView('ConfidentialAssetsBindings');
|
|
8
|
-
|
|
9
|
-
export default function ConfidentialAssetsBindingsView(props: ConfidentialAssetsBindingsViewProps) {
|
|
10
|
-
return <NativeView {...props} />;
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { ConfidentialAssetsBindingsViewProps } from './ConfidentialAssetsBindings.types';
|
|
4
|
-
|
|
5
|
-
export default function ConfidentialAssetsBindingsView(props: ConfidentialAssetsBindingsViewProps) {
|
|
6
|
-
return (
|
|
7
|
-
<div>
|
|
8
|
-
<iframe
|
|
9
|
-
style={{ flex: 1 }}
|
|
10
|
-
src={props.url}
|
|
11
|
-
onLoad={() => props.onLoad({ nativeEvent: { url: props.url } })}
|
|
12
|
-
/>
|
|
13
|
-
</div>
|
|
14
|
-
);
|
|
15
|
-
}
|
package/src/index.native.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// Reexport the native module. On web, it will be resolved to ConfidentialAssetsBindingsModule.web.ts
|
|
2
|
-
// and on native platforms to ConfidentialAssetsBindingsModule.ts
|
|
3
|
-
export { default } from './ConfidentialAssetsBindingsModule';
|
|
4
|
-
export { default as ConfidentialAssetsBindingsView } from './ConfidentialAssetsBindingsView';
|
|
5
|
-
export * from './ConfidentialAssetsBindings.types';
|
package/src/index.ts
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import init, {
|
|
2
|
-
DiscreteLogSolver,
|
|
3
|
-
range_proof,
|
|
4
|
-
batch_range_proof,
|
|
5
|
-
verify_proof,
|
|
6
|
-
batch_verify_proof,
|
|
7
|
-
} from '../build/wasm/aptos_confidential_asset_wasm';
|
|
8
|
-
|
|
9
|
-
import pkg from '../package.json';
|
|
10
|
-
|
|
11
|
-
const CDN_WASM_URL = `https://unpkg.com/@aptos-labs/confidential-assets-bindings@${pkg.version}/dist/aptos_confidential_asset_wasm_bg.wasm`;
|
|
12
|
-
|
|
13
|
-
async function getNodeModulesWASM(): Promise<string | BufferSource> {
|
|
14
|
-
// In Node.js, try to load from local node_modules
|
|
15
|
-
try {
|
|
16
|
-
// Dynamic import for Node.js fs module
|
|
17
|
-
const fs = await import("fs");
|
|
18
|
-
const path = await import("path");
|
|
19
|
-
|
|
20
|
-
// Try to find the WASM file in node_modules
|
|
21
|
-
const possiblePaths = [
|
|
22
|
-
path.resolve(
|
|
23
|
-
process.cwd(),
|
|
24
|
-
"node_modules/@aptos-labs/confidential-assets-bindings/dist/aptos_confidential_asset_wasm_bg.wasm",
|
|
25
|
-
),
|
|
26
|
-
new URL("./aptos_confidential_asset_wasm_bg.wasm", import.meta.url).pathname,
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
for (const wasmPath of possiblePaths) {
|
|
30
|
-
if (fs.existsSync(wasmPath)) {
|
|
31
|
-
return fs.readFileSync(wasmPath);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
} catch {
|
|
35
|
-
// Fall through to URL
|
|
36
|
-
}
|
|
37
|
-
return CDN_WASM_URL;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async function getWasmSource(): Promise<string | BufferSource> {
|
|
41
|
-
if (typeof process !== "undefined" && process.versions?.node) {
|
|
42
|
-
return getNodeModulesWASM();
|
|
43
|
-
}
|
|
44
|
-
return CDN_WASM_URL;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
let initPromise: Promise<void> | undefined;
|
|
48
|
-
let initialized = false;
|
|
49
|
-
|
|
50
|
-
export async function ensureWasmInitialized(): Promise<void> {
|
|
51
|
-
if (initialized) return;
|
|
52
|
-
if (!initPromise) {
|
|
53
|
-
initPromise = (async () => {
|
|
54
|
-
try {
|
|
55
|
-
const moduleOrPath = await getWasmSource();
|
|
56
|
-
await init({ module_or_path: moduleOrPath });
|
|
57
|
-
initialized = true;
|
|
58
|
-
} catch (error) {
|
|
59
|
-
initPromise = undefined;
|
|
60
|
-
throw error;
|
|
61
|
-
}
|
|
62
|
-
})();
|
|
63
|
-
}
|
|
64
|
-
await initPromise;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface RangeProofInputs {
|
|
68
|
-
v: bigint;
|
|
69
|
-
r: Uint8Array;
|
|
70
|
-
valBase: Uint8Array;
|
|
71
|
-
randBase: Uint8Array;
|
|
72
|
-
numBits?: number;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export const rangeProof = async (inputs: RangeProofInputs) => {
|
|
76
|
-
await ensureWasmInitialized();
|
|
77
|
-
|
|
78
|
-
const { v, r, valBase, randBase, numBits = 32 } = inputs;
|
|
79
|
-
|
|
80
|
-
const proof = range_proof(v, r, valBase, randBase, numBits);
|
|
81
|
-
|
|
82
|
-
try {
|
|
83
|
-
return {
|
|
84
|
-
proof: proof.proof(),
|
|
85
|
-
commitment: proof.comm(),
|
|
86
|
-
}
|
|
87
|
-
} finally {
|
|
88
|
-
proof.free();
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface BatchRangeProofInputs {
|
|
93
|
-
v: bigint[];
|
|
94
|
-
rs: Uint8Array[];
|
|
95
|
-
valBase: Uint8Array;
|
|
96
|
-
randBase: Uint8Array;
|
|
97
|
-
numBits?: number;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export const batchRangeProof = async (inputs: BatchRangeProofInputs) => {
|
|
101
|
-
await ensureWasmInitialized();
|
|
102
|
-
|
|
103
|
-
const { v, rs, valBase, randBase, numBits = 32 } = inputs;
|
|
104
|
-
|
|
105
|
-
const proof = batch_range_proof(new BigUint64Array(v), rs, valBase, randBase, numBits);
|
|
106
|
-
|
|
107
|
-
try {
|
|
108
|
-
return {
|
|
109
|
-
proof: proof.proof(),
|
|
110
|
-
commitments: proof.comms(),
|
|
111
|
-
}
|
|
112
|
-
} finally {
|
|
113
|
-
proof.free();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export interface VerifyRangeProofInputs {
|
|
118
|
-
proof: Uint8Array;
|
|
119
|
-
comm: Uint8Array;
|
|
120
|
-
valBase: Uint8Array;
|
|
121
|
-
randBase: Uint8Array;
|
|
122
|
-
numBits?: number;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export const verifyProof = async (inputs: VerifyRangeProofInputs) => {
|
|
126
|
-
await ensureWasmInitialized();
|
|
127
|
-
|
|
128
|
-
const { proof, comm, valBase, randBase, numBits = 32 } = inputs;
|
|
129
|
-
|
|
130
|
-
return verify_proof(proof, comm, valBase, randBase, numBits);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface BatchVerifyRangeProofInputs {
|
|
134
|
-
proof: Uint8Array;
|
|
135
|
-
comms: Uint8Array[];
|
|
136
|
-
valBase: Uint8Array;
|
|
137
|
-
randBase: Uint8Array;
|
|
138
|
-
numBits: number;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export const batchVerifyProof = async (inputs: BatchVerifyRangeProofInputs) => {
|
|
142
|
-
await ensureWasmInitialized();
|
|
143
|
-
|
|
144
|
-
const { proof, comms, valBase, randBase, numBits } = inputs;
|
|
145
|
-
|
|
146
|
-
return batch_verify_proof(proof, comms, valBase, randBase, numBits);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
let _discreteLogSolver: DiscreteLogSolver | null = null;
|
|
150
|
-
|
|
151
|
-
const getDiscreteLogSolver = () => {
|
|
152
|
-
if (_discreteLogSolver) return _discreteLogSolver;
|
|
153
|
-
|
|
154
|
-
return _discreteLogSolver = new DiscreteLogSolver();
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export const solveDiscreteLog = async (y: Uint8Array, maxNumBits: number) => {
|
|
158
|
-
await ensureWasmInitialized();
|
|
159
|
-
|
|
160
|
-
const solver = getDiscreteLogSolver();
|
|
161
|
-
|
|
162
|
-
return solver.solve(y, maxNumBits);
|
|
163
|
-
}
|