@cofhe/sdk 0.1.0 → 0.1.1

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 (110) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/adapters/ethers5.test.ts +174 -0
  3. package/adapters/ethers5.ts +36 -0
  4. package/adapters/ethers6.test.ts +169 -0
  5. package/adapters/ethers6.ts +36 -0
  6. package/adapters/hardhat-node.ts +167 -0
  7. package/adapters/hardhat.hh2.test.ts +159 -0
  8. package/adapters/hardhat.ts +37 -0
  9. package/adapters/index.test.ts +25 -0
  10. package/adapters/index.ts +5 -0
  11. package/adapters/smartWallet.ts +91 -0
  12. package/adapters/test-utils.ts +53 -0
  13. package/adapters/types.ts +6 -0
  14. package/adapters/wagmi.test.ts +156 -0
  15. package/adapters/wagmi.ts +17 -0
  16. package/chains/chains/arbSepolia.ts +14 -0
  17. package/chains/chains/baseSepolia.ts +14 -0
  18. package/chains/chains/hardhat.ts +15 -0
  19. package/chains/chains/sepolia.ts +14 -0
  20. package/chains/chains.test.ts +49 -0
  21. package/chains/defineChain.ts +18 -0
  22. package/chains/index.ts +33 -0
  23. package/chains/types.ts +32 -0
  24. package/core/baseBuilder.ts +138 -0
  25. package/core/client.test.ts +298 -0
  26. package/core/client.ts +308 -0
  27. package/core/config.test.ts +224 -0
  28. package/core/config.ts +213 -0
  29. package/core/decrypt/MockQueryDecrypterAbi.ts +129 -0
  30. package/core/decrypt/cofheMocksSealOutput.ts +57 -0
  31. package/core/decrypt/decryptHandleBuilder.ts +281 -0
  32. package/core/decrypt/decryptUtils.ts +28 -0
  33. package/core/decrypt/tnSealOutput.ts +59 -0
  34. package/core/encrypt/MockZkVerifierAbi.ts +106 -0
  35. package/core/encrypt/cofheMocksZkVerifySign.ts +278 -0
  36. package/core/encrypt/encryptInputsBuilder.test.ts +735 -0
  37. package/core/encrypt/encryptInputsBuilder.ts +512 -0
  38. package/core/encrypt/encryptUtils.ts +64 -0
  39. package/core/encrypt/zkPackProveVerify.ts +273 -0
  40. package/core/error.ts +170 -0
  41. package/core/fetchKeys.test.ts +212 -0
  42. package/core/fetchKeys.ts +170 -0
  43. package/core/index.ts +77 -0
  44. package/core/keyStore.test.ts +226 -0
  45. package/core/keyStore.ts +127 -0
  46. package/core/permits.test.ts +242 -0
  47. package/core/permits.ts +136 -0
  48. package/core/result.test.ts +180 -0
  49. package/core/result.ts +67 -0
  50. package/core/test-utils.ts +45 -0
  51. package/core/types.ts +352 -0
  52. package/core/utils.ts +88 -0
  53. package/dist/adapters.cjs +88 -0
  54. package/dist/adapters.d.cts +14558 -0
  55. package/dist/adapters.d.ts +14558 -0
  56. package/dist/adapters.js +83 -0
  57. package/dist/chains.cjs +101 -0
  58. package/dist/chains.d.cts +99 -0
  59. package/dist/chains.d.ts +99 -0
  60. package/dist/chains.js +1 -0
  61. package/dist/chunk-GZCQQYVI.js +93 -0
  62. package/dist/chunk-KFGPTJ6X.js +2295 -0
  63. package/dist/chunk-LU7BMUUT.js +804 -0
  64. package/dist/core.cjs +3174 -0
  65. package/dist/core.d.cts +16 -0
  66. package/dist/core.d.ts +16 -0
  67. package/dist/core.js +3 -0
  68. package/dist/node.cjs +3090 -0
  69. package/dist/node.d.cts +22 -0
  70. package/dist/node.d.ts +22 -0
  71. package/dist/node.js +90 -0
  72. package/dist/permit-S9CnI6MF.d.cts +333 -0
  73. package/dist/permit-S9CnI6MF.d.ts +333 -0
  74. package/dist/permits.cjs +856 -0
  75. package/dist/permits.d.cts +1056 -0
  76. package/dist/permits.d.ts +1056 -0
  77. package/dist/permits.js +1 -0
  78. package/dist/types-KImPrEIe.d.cts +48 -0
  79. package/dist/types-KImPrEIe.d.ts +48 -0
  80. package/dist/types-PhwGgQvs.d.ts +953 -0
  81. package/dist/types-bB7wLj0q.d.cts +953 -0
  82. package/dist/web.cjs +3067 -0
  83. package/dist/web.d.cts +22 -0
  84. package/dist/web.d.ts +22 -0
  85. package/dist/web.js +64 -0
  86. package/node/client.test.ts +152 -0
  87. package/node/config.test.ts +68 -0
  88. package/node/encryptInputs.test.ts +175 -0
  89. package/node/index.ts +96 -0
  90. package/node/storage.ts +51 -0
  91. package/package.json +15 -3
  92. package/permits/index.ts +67 -0
  93. package/permits/localstorage.test.ts +118 -0
  94. package/permits/permit.test.ts +474 -0
  95. package/permits/permit.ts +396 -0
  96. package/permits/sealing.test.ts +84 -0
  97. package/permits/sealing.ts +131 -0
  98. package/permits/signature.ts +79 -0
  99. package/permits/store.test.ts +128 -0
  100. package/permits/store.ts +168 -0
  101. package/permits/test-utils.ts +20 -0
  102. package/permits/types.ts +174 -0
  103. package/permits/utils.ts +63 -0
  104. package/permits/validation.test.ts +288 -0
  105. package/permits/validation.ts +349 -0
  106. package/web/client.web.test.ts +152 -0
  107. package/web/config.web.test.ts +71 -0
  108. package/web/encryptInputs.web.test.ts +195 -0
  109. package/web/index.ts +97 -0
  110. package/web/storage.ts +20 -0
@@ -0,0 +1,16 @@
1
+ import { C as CofhesdkClientParams, a as CofhesdkClient } from './types-bB7wLj0q.cjs';
2
+ export { f as CofhesdkClientConnectionState, h as CofhesdkClientPermits, b as CofhesdkConfig, M as CofhesdkError, N as CofhesdkErrorCode, Q as CofhesdkErrorParams, d as CofhesdkInputConfig, e as CofhesdkInternalConfig, a5 as DecryptHandlesBuilder, a4 as EncryptInputsBuilder, B as EncryptSetStateFn, K as EncryptStep, H as Encryptable, o as EncryptableAddress, i as EncryptableBool, E as EncryptableItem, A as EncryptableToEncryptedItemInputMap, n as EncryptableUint128, k as EncryptableUint16, l as EncryptableUint32, m as EncryptableUint64, j as EncryptableUint8, y as EncryptedAddressInput, r as EncryptedBoolInput, q as EncryptedItemInput, z as EncryptedItemInputs, p as EncryptedNumber, w as EncryptedUint128Input, t as EncryptedUint16Input, x as EncryptedUint256Input, u as EncryptedUint32Input, v as EncryptedUint64Input, s as EncryptedUint8Input, G as FheAllUTypes, a0 as FheKeyDeserializer, F as FheTypes, D as FheUintUTypes, I as IStorage, a2 as KeysStorage, a3 as KeysStore, L as LiteralToPrimitive, P as Primitive, Z as Result, R as ResultErr, T as ResultErrOrInternal, V as ResultHttpError, S as ResultOk, W as ResultValidationError, U as UnsealedItem, a6 as ZkBuilderAndCrsGenerator, c as createCofhesdkConfigBase, a1 as createKeysStore, _ as fetchKeys, $ as fetchMultichainKeys, g as getCofhesdkConfigItem, O as isCofhesdkError, J as isEncryptableItem, X as resultWrapper, Y as resultWrapperSync } from './types-bB7wLj0q.cjs';
3
+ import './permit-S9CnI6MF.cjs';
4
+ import 'zod';
5
+ import 'viem';
6
+ import './types-KImPrEIe.cjs';
7
+ import 'zustand/vanilla';
8
+
9
+ /**
10
+ * Creates a CoFHE SDK client instance (base implementation)
11
+ * @param {CofhesdkClientParams} opts - Initialization options including config and platform-specific serializers
12
+ * @returns {CofhesdkClient} - The CoFHE SDK client instance
13
+ */
14
+ declare function createCofhesdkClientBase(opts: CofhesdkClientParams): CofhesdkClient;
15
+
16
+ export { CofhesdkClient, CofhesdkClientParams, createCofhesdkClientBase };
package/dist/core.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { C as CofhesdkClientParams, a as CofhesdkClient } from './types-PhwGgQvs.js';
2
+ export { f as CofhesdkClientConnectionState, h as CofhesdkClientPermits, b as CofhesdkConfig, M as CofhesdkError, N as CofhesdkErrorCode, Q as CofhesdkErrorParams, d as CofhesdkInputConfig, e as CofhesdkInternalConfig, a5 as DecryptHandlesBuilder, a4 as EncryptInputsBuilder, B as EncryptSetStateFn, K as EncryptStep, H as Encryptable, o as EncryptableAddress, i as EncryptableBool, E as EncryptableItem, A as EncryptableToEncryptedItemInputMap, n as EncryptableUint128, k as EncryptableUint16, l as EncryptableUint32, m as EncryptableUint64, j as EncryptableUint8, y as EncryptedAddressInput, r as EncryptedBoolInput, q as EncryptedItemInput, z as EncryptedItemInputs, p as EncryptedNumber, w as EncryptedUint128Input, t as EncryptedUint16Input, x as EncryptedUint256Input, u as EncryptedUint32Input, v as EncryptedUint64Input, s as EncryptedUint8Input, G as FheAllUTypes, a0 as FheKeyDeserializer, F as FheTypes, D as FheUintUTypes, I as IStorage, a2 as KeysStorage, a3 as KeysStore, L as LiteralToPrimitive, P as Primitive, Z as Result, R as ResultErr, T as ResultErrOrInternal, V as ResultHttpError, S as ResultOk, W as ResultValidationError, U as UnsealedItem, a6 as ZkBuilderAndCrsGenerator, c as createCofhesdkConfigBase, a1 as createKeysStore, _ as fetchKeys, $ as fetchMultichainKeys, g as getCofhesdkConfigItem, O as isCofhesdkError, J as isEncryptableItem, X as resultWrapper, Y as resultWrapperSync } from './types-PhwGgQvs.js';
3
+ import './permit-S9CnI6MF.js';
4
+ import 'zod';
5
+ import 'viem';
6
+ import './types-KImPrEIe.js';
7
+ import 'zustand/vanilla';
8
+
9
+ /**
10
+ * Creates a CoFHE SDK client instance (base implementation)
11
+ * @param {CofhesdkClientParams} opts - Initialization options including config and platform-specific serializers
12
+ * @returns {CofhesdkClient} - The CoFHE SDK client instance
13
+ */
14
+ declare function createCofhesdkClientBase(opts: CofhesdkClientParams): CofhesdkClient;
15
+
16
+ export { CofhesdkClient, CofhesdkClientParams, createCofhesdkClientBase };
package/dist/core.js ADDED
@@ -0,0 +1,3 @@
1
+ export { CofhesdkError, CofhesdkErrorCode, DecryptHandlesBuilder, EncryptInputsBuilder, EncryptStep, Encryptable, FheAllUTypes, FheTypes, FheUintUTypes, ResultErr, ResultErrOrInternal, ResultHttpError, ResultOk, ResultValidationError, createCofhesdkClientBase, createCofhesdkConfigBase, createKeysStore, fetchKeys, fetchMultichainKeys, getCofhesdkConfigItem, isCofhesdkError, isEncryptableItem, resultWrapper, resultWrapperSync } from './chunk-KFGPTJ6X.js';
2
+ import './chunk-GZCQQYVI.js';
3
+ import './chunk-LU7BMUUT.js';