@gurge/sdk-react-native 0.3.124 → 0.3.136
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/common/src/crypto/babyJub.cjs +1 -1
- package/common/src/crypto/babyJub.mjs +3 -4
- package/common/src/crypto/eddsa.cjs +1 -1
- package/common/src/crypto/eddsa.mjs +3 -4
- package/common/src/crypto/poseidon.cjs +1 -1
- package/common/src/crypto/poseidon.mjs +5 -6
- package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -1
- package/common/src/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +1 -1
- package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
- package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -1
- package/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +1 -1
- package/package.json +1 -1
- package/shims/circomlibjs-hinkal-fork.mjs +17 -3
- package/shims/circomlibjs-hinkal-fork.cjs +0 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../constants/vite.constants.cjs`)
|
|
1
|
+
require("../../../_virtual/_rolldown/runtime.cjs");const e=require(`../constants/vite.constants.cjs`),t=require(`../../../shims/circomlibjs-hinkal-fork.cjs`);let n=require(`circomlibjs-hinkal-fork/src/babyjubRN.js`);var r=new class{babyjub=void 0;async init(){this.babyjub||=e.isReactNative?(0,n.buildBabyJubRN)():await t.buildBabyjub()}getJub(){return this.babyjub}},i=()=>r.getJub();exports.babyJubInstance=i,exports.jubHolder=r;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { isReactNative as e } from "../constants/vite.constants.mjs";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
var n = t(), r = new class {
|
|
2
|
+
import { buildBabyJubRN as t, buildBabyjub as n } from "../../../shims/circomlibjs-hinkal-fork.mjs";
|
|
3
|
+
var r = new class {
|
|
5
4
|
babyjub = void 0;
|
|
6
5
|
async init() {
|
|
7
|
-
this.babyjub ||= e ? (
|
|
6
|
+
this.babyjub ||= e ? t() : await n();
|
|
8
7
|
}
|
|
9
8
|
getJub() {
|
|
10
9
|
return this.babyjub;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../constants/vite.constants.cjs`)
|
|
1
|
+
require("../../../_virtual/_rolldown/runtime.cjs");const e=require(`../constants/vite.constants.cjs`),t=require(`../../../shims/circomlibjs-hinkal-fork.cjs`);let n=require(`circomlibjs-hinkal-fork/src/EddsaRN.js`);var r=new class{eddsa=void 0;async init(){this.eddsa||=e.isReactNative?await(0,n.buildEddsaRN)():await t.buildEddsa()}getEddsa(){return this.eddsa}},i=()=>r.getEddsa();exports.eddsaHolder=r,exports.eddsaInstance=i;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { isReactNative as e } from "../constants/vite.constants.mjs";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
var n = t(), r = new class {
|
|
2
|
+
import { buildEddsa as t, buildEddsaRN as n } from "../../../shims/circomlibjs-hinkal-fork.mjs";
|
|
3
|
+
var r = new class {
|
|
5
4
|
eddsa = void 0;
|
|
6
5
|
async init() {
|
|
7
|
-
this.eddsa ||= e ? await
|
|
6
|
+
this.eddsa ||= e ? await n() : await t();
|
|
8
7
|
}
|
|
9
8
|
getEddsa() {
|
|
10
9
|
return this.eddsa;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("../../../_virtual/_rolldown/runtime.cjs");const e=require(`../constants/vite.constants.cjs`),t=require(`../functions/utils/amounts.utils.cjs`),n=require(`../../../shims/circomlibjs-hinkal-fork.cjs`);let r=require(`ethers`);var
|
|
1
|
+
require("../../../_virtual/_rolldown/runtime.cjs");const e=require(`../constants/vite.constants.cjs`),t=require(`../functions/utils/amounts.utils.cjs`),n=require(`../../../shims/circomlibjs-hinkal-fork.cjs`);let r=require(`ethers`),i=require(`circomlibjs-hinkal-fork/src/poseidonRN.js`);var a=new class{poseidon=void 0;async init(){this.poseidon||=e.isReactNative?(0,i.buildPoseidon)():await n.buildPoseidon()}getPoseidon(){return this.poseidon}};function o(...e){let n=a.getPoseidon();return t.toBigInt(n.F.toString(n(e)))}var s=(...e)=>{let t=a.getPoseidon();return r.ethers.toBeHex(t.F.toString(t([...e])))};exports.poseidonFunction=o,exports.poseidonHash=s,exports.poseidonHolder=a;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { isReactNative as e } from "../constants/vite.constants.mjs";
|
|
2
2
|
import { toBigInt as t } from "../functions/utils/amounts.utils.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { ethers as
|
|
5
|
-
|
|
6
|
-
var i = n(), a = new class {
|
|
3
|
+
import { buildPoseidon as n, buildPoseidonRN as r } from "../../../shims/circomlibjs-hinkal-fork.mjs";
|
|
4
|
+
import { ethers as i } from "ethers";
|
|
5
|
+
var a = new class {
|
|
7
6
|
poseidon = void 0;
|
|
8
7
|
async init() {
|
|
9
|
-
this.poseidon ||= e ? (
|
|
8
|
+
this.poseidon ||= e ? r() : await n();
|
|
10
9
|
}
|
|
11
10
|
getPoseidon() {
|
|
12
11
|
return this.poseidon;
|
|
@@ -18,7 +17,7 @@ function o(...e) {
|
|
|
18
17
|
}
|
|
19
18
|
var s = (...e) => {
|
|
20
19
|
let t = a.getPoseidon();
|
|
21
|
-
return
|
|
20
|
+
return i.toBeHex(t.F.toString(t([...e])));
|
|
22
21
|
};
|
|
23
22
|
//#endregion
|
|
24
23
|
export { o as poseidonFunction, s as poseidonHash, a as poseidonHolder };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`/assets/utxoWorkerLauncher-
|
|
1
|
+
var e=`/assets/utxoWorkerLauncher-CRlrc4dY.js`;exports.default=e;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
const domain = 'https://storage.googleapis.com/hinkal-workers-staging';
|
|
3
3
|
|
|
4
4
|
const WORKER_CDN_URLS = {
|
|
5
|
-
ZKProof: domain + '/0.3.
|
|
6
|
-
SnarkJS: domain + '/0.3.
|
|
7
|
-
UTXO: domain + '/0.3.
|
|
5
|
+
ZKProof: domain + '/0.3.135/' + 'zkProofWorkerLauncher.js',
|
|
6
|
+
SnarkJS: domain + '/0.3.135/' + 'snarkjsWorkerLauncher.js',
|
|
7
|
+
UTXO: domain + '/0.3.135/' + 'utxoWorkerLauncher.js',
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
// Returns a blob:// URL which points
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`/assets/zkProofWorkerLauncher-
|
|
1
|
+
var e=`/assets/zkProofWorkerLauncher-y_N3GC7k.js`;exports.default=e;
|
package/package.json
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
function notSupported(name) {
|
|
2
|
+
return () => {
|
|
3
|
+
throw new Error(
|
|
4
|
+
`[hinkal-rn] circomlibjs-hinkal-fork.${name} is not available on React Native. ` +
|
|
5
|
+
'Use buildBabyJubRN, buildPoseidonRN, or buildEddsaRN instead.',
|
|
6
|
+
);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { buildBabyJubRN } from 'circomlibjs-hinkal-fork/src/babyjubRN.js';
|
|
11
|
+
export { buildPoseidon as buildPoseidonRN } from 'circomlibjs-hinkal-fork/src/poseidonRN.js';
|
|
12
|
+
export { buildEddsaRN } from 'circomlibjs-hinkal-fork/src/EddsaRN.js';
|
|
13
|
+
|
|
14
|
+
export const buildPoseidon = notSupported('buildPoseidon');
|
|
15
|
+
export const buildPoseidonWasm = notSupported('buildPoseidonWasm');
|
|
16
|
+
export const buildBabyjub = notSupported('buildBabyjub');
|
|
17
|
+
export const buildEddsa = notSupported('buildEddsa');
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
|
|
3
|
-
const pkgRoot = path.dirname(require.resolve('circomlibjs-hinkal-fork/package.json'));
|
|
4
|
-
const {
|
|
5
|
-
buildBabyJubRN,
|
|
6
|
-
buildPoseidonRN,
|
|
7
|
-
buildEddsaRN,
|
|
8
|
-
} = require(path.join(pkgRoot, 'build/main.cjs'));
|
|
9
|
-
|
|
10
|
-
function notSupported(name) {
|
|
11
|
-
return () => {
|
|
12
|
-
throw new Error(
|
|
13
|
-
`[hinkal-rn] circomlibjs-hinkal-fork.${name} is not available on React Native. ` +
|
|
14
|
-
'Use buildBabyJubRN, buildPoseidonRN, or buildEddsaRN instead.',
|
|
15
|
-
);
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
module.exports = {
|
|
20
|
-
buildPoseidon: notSupported('buildPoseidon'),
|
|
21
|
-
buildPoseidonWasm: notSupported('buildPoseidonWasm'),
|
|
22
|
-
buildBabyjub: notSupported('buildBabyjub'),
|
|
23
|
-
buildEddsa: notSupported('buildEddsa'),
|
|
24
|
-
buildBabyJubRN,
|
|
25
|
-
buildPoseidonRN,
|
|
26
|
-
buildEddsaRN,
|
|
27
|
-
};
|