@hinkal/common 0.2.8 → 0.2.10
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/API/API.cjs +1 -1
- package/API/API.d.ts +2 -1
- package/API/API.mjs +27 -26
- package/API/kycCalls.cjs +1 -1
- package/API/kycCalls.d.ts +4 -0
- package/API/kycCalls.mjs +15 -11
- package/constants/rewards.constants.cjs +1 -1
- package/constants/rewards.constants.d.ts +1 -0
- package/constants/rewards.constants.mjs +9 -8
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +1 -0
- package/constants/server.constants.mjs +5 -4
- package/data-structures/event-service/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/AbstractEventService.mjs +42 -30
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientAccessTokenSnapshotService.mjs +10 -5
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientCommitmentsSnapshotService.mjs +10 -5
- package/data-structures/snapshot/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/ClientNullifierSnapshotService.mjs +8 -3
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.mjs +13 -13
- package/functions/web3/events/getShieldedBalance.cjs +2 -2
- package/functions/web3/events/getShieldedBalance.mjs +66 -58
- package/index.cjs +1 -1
- package/index.mjs +469 -468
- package/package.json +2 -1
- package/types/rewards.types.cjs +1 -1
- package/types/rewards.types.d.ts +4 -3
- package/types/rewards.types.mjs +12 -12
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLogic.mjs +26 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hinkal/common",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"homepage": "hinkal.pro",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Hinkal Protocol"
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"require": "./providers/prepareWagmiHinkal.cjs"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
+
"types": "./index.d.ts",
|
|
36
37
|
"scripts": {
|
|
37
38
|
"prebuild": "nx prebuild:workers",
|
|
38
39
|
"build": "nx build",
|
package/types/rewards.types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=(n=>(n.None="None",n.Bronze="Bronze",n.Silver="Silver",n.Gold="Gold",n.Platinum="Platinum",n.Diamond="Diamond",n.Elite="Elite",n))(e||{}),r=(n=>(n.None="None",n.Bronze="Bronze",n.Silver="Silver",n.Gold="Gold",n.Platinum="Platinum",n.Diamond="Diamond",n))(r||{}),i=(n=>(n.Points="POINTS",n.ReferralProgram="REFERRAL",n.LrtPoints="LRT_POINTS",n.LPProgram="LP",n.RewardsHistory="HISTORY",n))(i||{}),t=(n=>(n.InProgress="In Progress",n.Closed="Closed",n))(t||{}),o=(n=>(n.Pending="Pending",n.Submitted="Submitted",n.Unsubmitted="Didn't Submit",n))(o||{}),l=(n=>(n.Pending="Pending",n.Eligible="Eligible",n.Ineligible="Ineligible",n))(l||{}),s=(n=>(n.Pending="Pending",n.Completed="Completed",n.Unsubmitted="Didn't Submit",n))(s||{}),P=(n=>(n.Gold="Gold",n.Silver="Silver",n))(P||{}),m=(n=>(n.CertificationPoints="CertificationPoints",n.TradePoints="TradePoints",n.LPPoints="LPPoints",n.ReferralPoints="ReferralPoints",n.GalxePoints="GalxePoints",n.ZealyPoints="ZealyPoints",n.TaskOnPoints="TaskOnPoints",n.BonusPoints="BonusPoints",n))(m||{}),a=(n=>(n.Season="Season",n.Week="Week",n))(a||{}),d=(n=>(n.PAID="PAID",n.PENDING="PENDING",n))(d||{}),v=(n=>(n[n.Certify=0]="Certify",n[n.CheckActivity=1]="CheckActivity",n))(v||{}),u=(n=>(n[n.Points=0]="Points",n[n.Trader=1]="Trader",n[n.Affiliate=2]="Affiliate",n[n.LP=3]="LP",n[n.History=4]="History",n))(u||{}),S=(n=>(n[n.ReclaimCheck=0]="ReclaimCheck",n[n.IntegrationCheck=1]="IntegrationCheck",n[n.RandomPrizeGold=2]="RandomPrizeGold",n[n.RandomPrizeSilver=3]="RandomPrizeSilver",n))(S||{});const c={Result:{}},k={renzo:0,kelp:0,etherFi:0,zircuit:0};exports.BonusType=S;exports.CertifyType=v;exports.LP_TIER=r;exports.PaymentStatus=d;exports.PointType=m;exports.RafflePrizeType=P;exports.RewardPage=u;exports.RewardsHistoryDistribution=s;exports.RewardsHistoryEligibility=l;exports.RewardsHistorySnapshots=o;exports.RewardsHistoryStatuses=t;exports.RewardsPageTabs=i;exports.TIER_LEVEL=e;exports.Timeline=a;exports.emptyUserPointsBreakdown=k;exports.emptyUserPointsResponse=c;
|
package/types/rewards.types.d.ts
CHANGED
|
@@ -184,9 +184,10 @@ export declare enum RewardPage {
|
|
|
184
184
|
History = 4
|
|
185
185
|
}
|
|
186
186
|
export declare enum BonusType {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
187
|
+
ReclaimCheck = 0,
|
|
188
|
+
IntegrationCheck = 1,
|
|
189
|
+
RandomPrizeGold = 2,
|
|
190
|
+
RandomPrizeSilver = 3
|
|
190
191
|
}
|
|
191
192
|
export type UserPoints = Record<string, number>;
|
|
192
193
|
export type UserPointsTokens = Record<string, UserPoints>;
|
package/types/rewards.types.mjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var r = /* @__PURE__ */ ((n) => (n.None = "None", n.Bronze = "Bronze", n.Silver = "Silver", n.Gold = "Gold", n.Platinum = "Platinum", n.Diamond = "Diamond", n.Elite = "Elite", n))(r || {}), i = /* @__PURE__ */ ((n) => (n.None = "None", n.Bronze = "Bronze", n.Silver = "Silver", n.Gold = "Gold", n.Platinum = "Platinum", n.Diamond = "Diamond", n))(i || {}), t = /* @__PURE__ */ ((n) => (n.Points = "POINTS", n.ReferralProgram = "REFERRAL", n.LrtPoints = "LRT_POINTS", n.LPProgram = "LP", n.RewardsHistory = "HISTORY", n))(t || {}), e = /* @__PURE__ */ ((n) => (n.InProgress = "In Progress", n.Closed = "Closed", n))(e || {}), o = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Submitted = "Submitted", n.Unsubmitted = "Didn't Submit", n))(o || {}), l = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Eligible = "Eligible", n.Ineligible = "Ineligible", n))(l || {}), P = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Completed = "Completed", n.Unsubmitted = "Didn't Submit", n))(P || {}),
|
|
2
|
-
const
|
|
1
|
+
var r = /* @__PURE__ */ ((n) => (n.None = "None", n.Bronze = "Bronze", n.Silver = "Silver", n.Gold = "Gold", n.Platinum = "Platinum", n.Diamond = "Diamond", n.Elite = "Elite", n))(r || {}), i = /* @__PURE__ */ ((n) => (n.None = "None", n.Bronze = "Bronze", n.Silver = "Silver", n.Gold = "Gold", n.Platinum = "Platinum", n.Diamond = "Diamond", n))(i || {}), t = /* @__PURE__ */ ((n) => (n.Points = "POINTS", n.ReferralProgram = "REFERRAL", n.LrtPoints = "LRT_POINTS", n.LPProgram = "LP", n.RewardsHistory = "HISTORY", n))(t || {}), e = /* @__PURE__ */ ((n) => (n.InProgress = "In Progress", n.Closed = "Closed", n))(e || {}), o = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Submitted = "Submitted", n.Unsubmitted = "Didn't Submit", n))(o || {}), l = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Eligible = "Eligible", n.Ineligible = "Ineligible", n))(l || {}), P = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Completed = "Completed", n.Unsubmitted = "Didn't Submit", n))(P || {}), m = /* @__PURE__ */ ((n) => (n.Gold = "Gold", n.Silver = "Silver", n))(m || {}), v = /* @__PURE__ */ ((n) => (n.CertificationPoints = "CertificationPoints", n.TradePoints = "TradePoints", n.LPPoints = "LPPoints", n.ReferralPoints = "ReferralPoints", n.GalxePoints = "GalxePoints", n.ZealyPoints = "ZealyPoints", n.TaskOnPoints = "TaskOnPoints", n.BonusPoints = "BonusPoints", n))(v || {}), d = /* @__PURE__ */ ((n) => (n.Season = "Season", n.Week = "Week", n))(d || {}), u = /* @__PURE__ */ ((n) => (n.PAID = "PAID", n.PENDING = "PENDING", n))(u || {}), c = /* @__PURE__ */ ((n) => (n[n.Certify = 0] = "Certify", n[n.CheckActivity = 1] = "CheckActivity", n))(c || {}), S = /* @__PURE__ */ ((n) => (n[n.Points = 0] = "Points", n[n.Trader = 1] = "Trader", n[n.Affiliate = 2] = "Affiliate", n[n.LP = 3] = "LP", n[n.History = 4] = "History", n))(S || {}), k = /* @__PURE__ */ ((n) => (n[n.ReclaimCheck = 0] = "ReclaimCheck", n[n.IntegrationCheck = 1] = "IntegrationCheck", n[n.RandomPrizeGold = 2] = "RandomPrizeGold", n[n.RandomPrizeSilver = 3] = "RandomPrizeSilver", n))(k || {});
|
|
2
|
+
const G = {
|
|
3
3
|
Result: {}
|
|
4
|
-
},
|
|
4
|
+
}, C = {
|
|
5
5
|
renzo: 0,
|
|
6
6
|
kelp: 0,
|
|
7
7
|
etherFi: 0,
|
|
8
8
|
zircuit: 0
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
k as BonusType,
|
|
12
|
+
c as CertifyType,
|
|
13
13
|
i as LP_TIER,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
u as PaymentStatus,
|
|
15
|
+
v as PointType,
|
|
16
|
+
m as RafflePrizeType,
|
|
17
|
+
S as RewardPage,
|
|
18
18
|
P as RewardsHistoryDistribution,
|
|
19
19
|
l as RewardsHistoryEligibility,
|
|
20
20
|
o as RewardsHistorySnapshots,
|
|
21
21
|
e as RewardsHistoryStatuses,
|
|
22
22
|
t as RewardsPageTabs,
|
|
23
23
|
r as TIER_LEVEL,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
d as Timeline,
|
|
25
|
+
C as emptyUserPointsBreakdown,
|
|
26
|
+
G as emptyUserPointsResponse
|
|
27
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/snarkjsWorkerLauncher-
|
|
1
|
+
"use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/snarkjsWorkerLauncher-C4z-FxO0.js").href:new URL("../../assets/snarkjsWorkerLauncher-C4z-FxO0.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const $=require("../workerProxy.cjs"),n=require("../../constants/vite.constants.cjs"),O=require("snarkjs"),v=require("axios");function F(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return i.default=e,Object.freeze(i)}const p=F(O),c=new $.WorkerProxy,y=async e=>new Uint8Array((await v.get(e,{responseType:"arraybuffer"})).data),g=async e=>{const{input:i,wasmFilePath:t,zKeyFilePath:s,chainId:b}=e.payload.data,{hostLocation:{origin:l},constants:{isDevelopment:w,chains:{chainIds:k}}}=e.metadata;let a=t,r=s,u,f;const d=a.startsWith("https://");if(n.isNode&&!d){n.isWebpack?(a=`libs/hardhat/test/circuits/${t}`,r=`libs/hardhat/test/circuits/${s}`):!n.isWebpack&&w&&(a=`test/circuits/${t}`,r=`test/circuits/${s}`);const o=require("path");a=o.resolve(a),r=o.resolve(r)}n.isNode&&d?(u=await y(a),f=await y(r)):b===k.localhost&&!n.isNode&&(a=`${l}/${t}`,r=`${l}/${s}`);try{const{proof:o,publicSignals:h}=await p.groth16.fullProve(i,u??a,f??r),P=await p.groth16.exportSolidityCallData(o,h),m=JSON.parse(`[${P}]`);c.postMessageToMainThread({zkCallData:m,proof:o,publicSignals:h})}catch(o){console.log(o)}};c.attachWorkerSideOnMessage(g);exports.default=c;exports.onWorkerMessage=g;
|
|
@@ -1,31 +1,36 @@
|
|
|
1
|
-
import { WorkerProxy as
|
|
2
|
-
import { isNode as
|
|
3
|
-
import * as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { WorkerProxy as P } from "../workerProxy.mjs";
|
|
2
|
+
import { isNode as o, isWebpack as p } from "../../constants/vite.constants.mjs";
|
|
3
|
+
import * as u from "snarkjs";
|
|
4
|
+
import b from "axios";
|
|
5
|
+
const m = new P(), y = async (s) => new Uint8Array((await b.get(s, { responseType: "arraybuffer" })).data), x = async (s) => {
|
|
6
|
+
const { input: d, wasmFilePath: r, zKeyFilePath: i, chainId: w } = s.payload.data, {
|
|
6
7
|
hostLocation: { origin: l },
|
|
7
8
|
constants: {
|
|
8
|
-
isDevelopment:
|
|
9
|
+
isDevelopment: g,
|
|
9
10
|
chains: { chainIds: $ }
|
|
10
11
|
}
|
|
11
|
-
} =
|
|
12
|
-
let t =
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
t =
|
|
12
|
+
} = s.metadata;
|
|
13
|
+
let t = r, a = i, n, c;
|
|
14
|
+
const h = t.startsWith("https://");
|
|
15
|
+
if (o && !h) {
|
|
16
|
+
p ? (t = `libs/hardhat/test/circuits/${r}`, a = `libs/hardhat/test/circuits/${i}`) : !p && g && (t = `test/circuits/${r}`, a = `test/circuits/${i}`);
|
|
17
|
+
const e = require("path");
|
|
18
|
+
t = e.resolve(t), a = e.resolve(a);
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
o && h ? (n = await y(t), c = await y(a)) : w === $.localhost && !o && (t = `${l}/${r}`, a = `${l}/${i}`);
|
|
20
21
|
try {
|
|
21
|
-
const { proof:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const { proof: e, publicSignals: f } = await u.groth16.fullProve(
|
|
23
|
+
d,
|
|
24
|
+
n ?? t,
|
|
25
|
+
c ?? a
|
|
26
|
+
), k = await u.groth16.exportSolidityCallData(e, f), F = JSON.parse(`[${k}]`);
|
|
27
|
+
m.postMessageToMainThread({ zkCallData: F, proof: e, publicSignals: f });
|
|
28
|
+
} catch (e) {
|
|
29
|
+
console.log(e);
|
|
25
30
|
}
|
|
26
31
|
};
|
|
27
|
-
|
|
32
|
+
m.attachWorkerSideOnMessage(x);
|
|
28
33
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
m as default,
|
|
35
|
+
x as onWorkerMessage
|
|
31
36
|
};
|