@gurge/sdk-react-native 0.3.71 → 0.3.76

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.
Files changed (138) hide show
  1. package/_virtual/_rolldown/runtime.mjs +11 -2
  2. package/common/src/API/getCoingeckoPrice.cjs +1 -1
  3. package/common/src/API/proxyAccountsCalls.cjs +1 -1
  4. package/common/src/crypto/EddsaRN.cjs +1 -1
  5. package/common/src/crypto/babyJub.cjs +1 -1
  6. package/common/src/crypto/babyJub.mjs +7 -6
  7. package/common/src/crypto/ecdh-sealed-keys.cjs +1 -1
  8. package/common/src/crypto/ecdh.cjs +1 -1
  9. package/common/src/crypto/eddsa.cjs +1 -1
  10. package/common/src/crypto/eddsa.mjs +7 -6
  11. package/common/src/crypto/poseidon.cjs +1 -1
  12. package/common/src/crypto/poseidon.mjs +13 -13
  13. package/common/src/crypto/preProcessing.cjs +1 -1
  14. package/common/src/data-structures/AccountActions/AccountActions.cjs +1 -1
  15. package/common/src/data-structures/Hinkal/Hinkal.cjs +1 -1
  16. package/common/src/data-structures/Hinkal/hinkalSolanaClaimUtxo.cjs +1 -1
  17. package/common/src/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
  18. package/common/src/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
  19. package/common/src/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
  20. package/common/src/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
  21. package/common/src/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
  22. package/common/src/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
  23. package/common/src/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
  24. package/common/src/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
  25. package/common/src/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
  26. package/common/src/data-structures/Hinkal/prepareDepositOnChainUtxosZkProof.cjs +1 -1
  27. package/common/src/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
  28. package/common/src/data-structures/IndexedDB/activity-db.cjs +1 -1
  29. package/common/src/data-structures/IndexedDB/activity-db.mjs +38 -38
  30. package/common/src/data-structures/IndexedDB/balances-db.cjs +1 -1
  31. package/common/src/data-structures/IndexedDB/balances-db.mjs +18 -16
  32. package/common/src/data-structures/IndexedDB/contact-db.cjs +1 -1
  33. package/common/src/data-structures/IndexedDB/contact-db.mjs +16 -14
  34. package/common/src/data-structures/IndexedDB/key-val-store.cjs +1 -1
  35. package/common/src/data-structures/IndexedDB/key-val-store.mjs +12 -12
  36. package/common/src/data-structures/IndexedDB/pay-activity-db.cjs +1 -1
  37. package/common/src/data-structures/IndexedDB/pay-activity-db.mjs +10 -8
  38. package/common/src/data-structures/IndexedDB/signatures-db.cjs +1 -1
  39. package/common/src/data-structures/IndexedDB/signatures-db.mjs +23 -21
  40. package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +1 -1
  41. package/common/src/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +32 -31
  42. package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.cjs +1 -1
  43. package/common/src/data-structures/TokenDBs/ArcPublicTokensDB.mjs +25 -25
  44. package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
  45. package/common/src/data-structures/TokenDBs/EventsPublicTokensDB.mjs +47 -46
  46. package/common/src/data-structures/TokenDBs/PrivateTokensDB.cjs +1 -1
  47. package/common/src/data-structures/TokenDBs/PrivateTokensDB.mjs +20 -20
  48. package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.cjs +1 -1
  49. package/common/src/data-structures/TokenDBs/TempoPublicTokensDB.mjs +19 -19
  50. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.cjs +1 -1
  51. package/common/src/data-structures/TokenDBs/TronPublicTokensDB.mjs +19 -19
  52. package/common/src/data-structures/TokenDBs/token-visibility-db.cjs +1 -1
  53. package/common/src/data-structures/TokenDBs/token-visibility-db.mjs +45 -44
  54. package/common/src/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
  55. package/common/src/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
  56. package/common/src/data-structures/crypto-keys/keys.cjs +1 -1
  57. package/common/src/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
  58. package/common/src/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
  59. package/common/src/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -1
  60. package/common/src/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
  61. package/common/src/data-structures/http/BasicHttpClient.cjs +1 -1
  62. package/common/src/functions/pre-transaction/convert-okx-instructions.cjs +1 -1
  63. package/common/src/functions/pre-transaction/ensureAmountChanges.cjs +1 -1
  64. package/common/src/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
  65. package/common/src/functions/pre-transaction/sendV0Transaction.cjs +1 -1
  66. package/common/src/functions/pre-transaction/solana.cjs +1 -1
  67. package/common/src/functions/pre-transaction/solanaTransfer.utils.cjs +1 -1
  68. package/common/src/functions/private-wallet/emporium.helpers.cjs +1 -1
  69. package/common/src/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
  70. package/common/src/functions/snarkjs/common.snarkjs.cjs +1 -1
  71. package/common/src/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
  72. package/common/src/functions/snarkjs/fetchOnChainRootHashes.cjs +1 -1
  73. package/common/src/functions/snarkjs/signedMessageHash.cjs +1 -1
  74. package/common/src/functions/snarkjs/verifyCommitmentValidationData.cjs +1 -1
  75. package/common/src/functions/snarkjs/verifyCommitmentValidationData.mjs +4 -1
  76. package/common/src/functions/utils/abi.utils.cjs +1 -1
  77. package/common/src/functions/utils/addresses.cjs +1 -1
  78. package/common/src/functions/utils/cacheFunctions.cjs +1 -1
  79. package/common/src/functions/utils/cacheFunctions.mjs +13 -13
  80. package/common/src/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -1
  81. package/common/src/functions/utils/create-provider.cjs +1 -1
  82. package/common/src/functions/utils/encryptInputForEnclave.cjs +1 -1
  83. package/common/src/functions/utils/external-action.utils.cjs +1 -1
  84. package/common/src/functions/utils/getSignerFromContract.cjs +1 -1
  85. package/common/src/functions/utils/getUtxosFromReceiptSolana.cjs +1 -1
  86. package/common/src/functions/utils/ipfs.cjs +1 -1
  87. package/common/src/functions/utils/ipfs.mjs +3 -1
  88. package/common/src/functions/utils/mnemonics.cjs +1 -1
  89. package/common/src/functions/utils/publicBalance.utils.cjs +1 -1
  90. package/common/src/functions/utils/solana-memo.cjs +1 -1
  91. package/common/src/functions/utils/solanaMint.utils.cjs +1 -1
  92. package/common/src/functions/utils/tron.utils.cjs +1 -1
  93. package/common/src/functions/utils/userAgent.cjs +1 -1
  94. package/common/src/functions/web3/etherFunctions.cjs +1 -1
  95. package/common/src/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
  96. package/common/src/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
  97. package/common/src/functions/web3/events/getShieldedBalance.cjs +1 -1
  98. package/common/src/functions/web3/functionCalls/approveToken.cjs +1 -1
  99. package/common/src/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
  100. package/common/src/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
  101. package/common/src/functions/web3/getContractMetadata.cjs +1 -1
  102. package/common/src/functions/web3/okxAPI.cjs +1 -1
  103. package/common/src/functions/web3/uniswapAPI.cjs +1 -1
  104. package/common/src/mutexes/chainBalanceRwLock.cjs +1 -1
  105. package/common/src/mutexes/mutex.cjs +1 -1
  106. package/common/src/providers/EthersProviderAdapter.cjs +1 -1
  107. package/common/src/providers/SolanaProviderAdapter.cjs +1 -1
  108. package/common/src/providers/WagmiProviderAdapter.cjs +1 -1
  109. package/common/src/types/hinkal.types.cjs +1 -1
  110. package/common/src/webworker/viteWorkerURL.constant.mjs +3 -3
  111. package/package.json +1 -1
  112. package/react-native/bridge/HinkalRNWorker.cjs +1 -1
  113. package/shims/circomlibjs-hinkal-fork.cjs +14 -0
  114. package/shims/circomlibjs-hinkal-fork.mjs +3 -0
  115. package/shims/circomlibjs.cjs +15 -0
  116. package/shims/circomlibjs.mjs +3 -0
  117. package/shims/constants.cjs +7 -0
  118. package/shims/constants.mjs +3 -0
  119. package/shims/crypto.cjs +102 -0
  120. package/shims/crypto.mjs +3 -0
  121. package/shims/ffjavascript.cjs +5 -0
  122. package/shims/ffjavascript.mjs +3 -0
  123. package/shims/globals.cjs +15 -0
  124. package/shims/globals.mjs +3 -0
  125. package/shims/idb-keyval.cjs +75 -0
  126. package/shims/idb-keyval.mjs +3 -0
  127. package/shims/multiformats.cjs +1 -0
  128. package/shims/multiformats.mjs +3 -0
  129. package/shims/os.cjs +7 -0
  130. package/shims/os.mjs +3 -0
  131. package/shims/readline.cjs +6 -0
  132. package/shims/readline.mjs +3 -0
  133. package/shims/snarkjs.cjs +21 -0
  134. package/shims/snarkjs.mjs +3 -0
  135. package/shims/url.cjs +5 -0
  136. package/shims/url.mjs +3 -0
  137. package/shims/web-worker.cjs +7 -0
  138. package/shims/web-worker.mjs +3 -0
@@ -0,0 +1,75 @@
1
+ // idb-keyval shim for React Native
2
+ const AsyncStorage =
3
+ require("@react-native-async-storage/async-storage").default;
4
+
5
+ const PREFIX = "@hinkal/idb-keyval:";
6
+ const key = (k) => `${PREFIX}${typeof k === "string" ? k : JSON.stringify(k)}`;
7
+
8
+ async function get(k) {
9
+ const raw = await AsyncStorage.getItem(key(k));
10
+ if (raw == null) return undefined;
11
+ try {
12
+ return JSON.parse(raw);
13
+ } catch {
14
+ return undefined;
15
+ }
16
+ }
17
+
18
+ async function set(k, value) {
19
+ if (value === undefined) {
20
+ await AsyncStorage.removeItem(key(k));
21
+ return;
22
+ }
23
+ await AsyncStorage.setItem(key(k), JSON.stringify(value));
24
+ }
25
+
26
+ async function update(k, updater) {
27
+ const current = await get(k);
28
+ const next = updater(current);
29
+ await set(k, next);
30
+ return next;
31
+ }
32
+
33
+ async function del(k) {
34
+ await AsyncStorage.removeItem(key(k));
35
+ }
36
+
37
+ async function clear() {
38
+ const all = await AsyncStorage.getAllKeys();
39
+ const ours = all.filter((x) => x.startsWith(PREFIX));
40
+ if (ours.length) await AsyncStorage.multiRemove(ours);
41
+ }
42
+
43
+ async function keys() {
44
+ const all = await AsyncStorage.getAllKeys();
45
+ return all.filter((x) => x.startsWith(PREFIX)).map((x) => x.slice(PREFIX.length));
46
+ }
47
+
48
+ async function values() {
49
+ const ks = await keys();
50
+ return Promise.all(ks.map(get));
51
+ }
52
+
53
+ async function entries() {
54
+ const ks = await keys();
55
+ const vs = await Promise.all(ks.map(get));
56
+ return ks.map((k, i) => [k, vs[i]]);
57
+ }
58
+
59
+ function createStore() {
60
+ // idb-keyval lets callers create a store with a custom DB name; we ignore it
61
+ return undefined;
62
+ }
63
+
64
+ module.exports = {
65
+ get,
66
+ set,
67
+ update,
68
+ del,
69
+ clear,
70
+ keys,
71
+ values,
72
+ entries,
73
+ createStore,
74
+ };
75
+ module.exports.default = module.exports;
@@ -0,0 +1,3 @@
1
+ import mod from "./idb-keyval.cjs";
2
+ export function require_idb_keyval() { return mod; }
3
+ export default mod;
@@ -0,0 +1 @@
1
+ module.exports = {};
@@ -0,0 +1,3 @@
1
+ import mod from "./multiformats.cjs";
2
+ export function require_multiformats() { return mod; }
3
+ export default mod;
package/shims/os.cjs ADDED
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ hostname: () => 'localhost',
3
+ platform: () => 'linux',
4
+ arch: () => 'arm64',
5
+ EOL: '\n',
6
+ tmpdir: () => '/tmp',
7
+ };
package/shims/os.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import mod from "./os.cjs";
2
+ export function require_os() { return mod; }
3
+ export default mod;
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ createInterface: () => ({
3
+ on: () => {},
4
+ close: () => {},
5
+ }),
6
+ };
@@ -0,0 +1,3 @@
1
+ import mod from "./readline.cjs";
2
+ export function require_readline() { return mod; }
3
+ export default mod;
@@ -0,0 +1,21 @@
1
+ function notSupported(name) {
2
+ return () => {
3
+ throw new Error(
4
+ `[hinkal-rn] snarkjs.${name} is not available on the React Native JS thread. ` +
5
+ "All proof generation must go through the SnarkJS WebView bridge.",
6
+ );
7
+ };
8
+ }
9
+
10
+ module.exports = {
11
+ groth16: {
12
+ fullProve: notSupported("groth16.fullProve"),
13
+ prove: notSupported("groth16.prove"),
14
+ verify: notSupported("groth16.verify"),
15
+ exportSolidityCallData: notSupported("groth16.exportSolidityCallData"),
16
+ },
17
+ zKey: {
18
+ exportVerificationKey: notSupported("zKey.exportVerificationKey"),
19
+ },
20
+ };
21
+ module.exports.default = module.exports;
@@ -0,0 +1,3 @@
1
+ import mod from "./snarkjs.cjs";
2
+ export function require_snarkjs() { return mod; }
3
+ export default mod;
package/shims/url.cjs ADDED
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ pathToFileURL: (p) => ({ href: p }),
3
+ fileURLToPath: (u) => u,
4
+ URL: typeof URL !== "undefined" ? URL : null,
5
+ };
package/shims/url.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import mod from "./url.cjs";
2
+ export function require_url() { return mod; }
3
+ export default mod;
@@ -0,0 +1,7 @@
1
+ module.exports = class Worker {
2
+ constructor() {}
3
+ postMessage() {}
4
+ terminate() {}
5
+ addEventListener() {}
6
+ removeEventListener() {}
7
+ };
@@ -0,0 +1,3 @@
1
+ import mod from "./web-worker.cjs";
2
+ export function require_web_worker() { return mod; }
3
+ export default mod;