signet.js 0.0.7 → 0.0.9

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 (183) hide show
  1. package/README.md +8 -1
  2. package/browser/index.browser.cjs +3 -0
  3. package/browser/index.browser.cjs.map +1 -0
  4. package/browser/index.browser.js +3 -0
  5. package/browser/index.browser.js.map +1 -0
  6. package/node/index.node.cjs +3 -0
  7. package/node/index.node.cjs.map +1 -0
  8. package/node/index.node.js +3 -0
  9. package/node/index.node.js.map +1 -0
  10. package/package.json +19 -18
  11. package/types/index.d.cts +1048 -0
  12. package/types/index.d.ts +1048 -0
  13. package/.eslintrc.json +0 -67
  14. package/.prettierrc +0 -1
  15. package/babel.config.js +0 -6
  16. package/docs/dist/.vocs/icons/arrow-diagonal.svg +0 -3
  17. package/docs/dist/.vocs/icons/chevron-down.svg +0 -13
  18. package/docs/dist/.vocs/icons/chevron-up.svg +0 -13
  19. package/docs/dist/.vocs/icons/link.svg +0 -3
  20. package/docs/dist/.vocs/search-index-7b499e25.json +0 -1
  21. package/docs/dist/assets/arbitrary-hash-Cd6eo8ZD.js +0 -309
  22. package/docs/dist/assets/broadcast-tx-CeTEE9yX.js +0 -8
  23. package/docs/dist/assets/btc-rpc-adapter-C-qSHpFV.js +0 -226
  24. package/docs/dist/assets/chain-adapter-interface-B9TpOgQv.js +0 -1280
  25. package/docs/dist/assets/chain-contract-interface-DEku3k45.js +0 -392
  26. package/docs/dist/assets/constructor-73n7bp3b.js +0 -161
  27. package/docs/dist/assets/constructor-Bg7nvLe0.js +0 -14
  28. package/docs/dist/assets/contract-addresses-BYlrAOs3.js +0 -200
  29. package/docs/dist/assets/derive-address-and-public-key-DExrKiGV.js +0 -14
  30. package/docs/dist/assets/finalize-message-signing-W435d71R.js +0 -20
  31. package/docs/dist/assets/finalize-transaction-signing-BIgJ2dnc.js +0 -36
  32. package/docs/dist/assets/finalize-transaction-signing-C--HJs8D.js +0 -24
  33. package/docs/dist/assets/finalize-transaction-signing-CjGmN7d9.js +0 -24
  34. package/docs/dist/assets/finalize-typed-data-signing-CEOp_GWt.js +0 -21
  35. package/docs/dist/assets/get-balance-DBC-i6KG.js +0 -13
  36. package/docs/dist/assets/get-current-signature-deposit-BXm9AzYy.js +0 -6
  37. package/docs/dist/assets/get-current-signature-deposit-nOw4j1MN.js +0 -6
  38. package/docs/dist/assets/get-derived-public-key-BXvfo2m2.js +0 -14
  39. package/docs/dist/assets/get-derived-public-key-DQ1pyiFS.js +0 -14
  40. package/docs/dist/assets/get-latest-key-version-DWlkMCre.js +0 -6
  41. package/docs/dist/assets/get-public-key-B4PFoVqu.js +0 -6
  42. package/docs/dist/assets/get-public-key-B9xkYkD_.js +0 -6
  43. package/docs/dist/assets/index-BFuwoY4w.js +0 -601
  44. package/docs/dist/assets/index-C62Mf-vy.js +0 -426
  45. package/docs/dist/assets/index-D8xhaiVb.js +0 -121
  46. package/docs/dist/assets/index-DTr0DlO0.js +0 -36
  47. package/docs/dist/assets/index-V9dXf-ik.js +0 -457
  48. package/docs/dist/assets/prepare-message-for-signing-DESTq-Hg.js +0 -16
  49. package/docs/dist/assets/prepare-transaction-for-signing-DIKTU0zj.js +0 -33
  50. package/docs/dist/assets/prepare-transaction-for-signing-DV_wkZ5g.js +0 -21
  51. package/docs/dist/assets/prepare-transaction-for-signing-LVDP0COu.js +0 -33
  52. package/docs/dist/assets/prepare-typed-data-for-signing-CWcmJvw0.js +0 -192
  53. package/docs/dist/assets/sign-CwtS5LnB.js +0 -13
  54. package/docs/dist/assets/sign-OQxf9yn7.js +0 -15
  55. package/docs/dist/assets/signet-quick-start-CQK52nVG.js +0 -350
  56. package/docs/dist/assets/sponsor-foreign-chain-gas-C9iWXM8Q.js +0 -1
  57. package/docs/dist/assets/style-CKGXuRqx.css +0 -1
  58. package/docs/dist/examples/arbitrary-hash/index.html +0 -88
  59. package/docs/dist/examples/sponsor-foreign-chain-gas/index.html +0 -21
  60. package/docs/dist/index.html +0 -56
  61. package/docs/dist/initializeTheme.iife.js +0 -1
  62. package/docs/dist/introduction/signet-quick-start/index.html +0 -109
  63. package/docs/dist/primitives/chain-adapter-interface/index.html +0 -515
  64. package/docs/dist/primitives/chain-contract-interface/index.html +0 -306
  65. package/docs/dist/primitives/contract-addresses/index.html +0 -97
  66. package/docs/dist/signet-logo.png +0 -0
  67. package/docs/dist/signetjs/chain-adapters/bitcoin/btc-rpc-adapter/index.html +0 -148
  68. package/docs/dist/signetjs/chain-adapters/bitcoin/finalize-transaction-signing/index.html +0 -41
  69. package/docs/dist/signetjs/chain-adapters/bitcoin/index.html +0 -187
  70. package/docs/dist/signetjs/chain-adapters/bitcoin/prepare-transaction-for-signing/index.html +0 -34
  71. package/docs/dist/signetjs/chain-adapters/broadcast-tx/index.html +0 -28
  72. package/docs/dist/signetjs/chain-adapters/cosmos/finalize-transaction-signing/index.html +0 -41
  73. package/docs/dist/signetjs/chain-adapters/cosmos/index.html +0 -166
  74. package/docs/dist/signetjs/chain-adapters/cosmos/prepare-transaction-for-signing/index.html +0 -43
  75. package/docs/dist/signetjs/chain-adapters/derive-address-and-public-key/index.html +0 -31
  76. package/docs/dist/signetjs/chain-adapters/evm/finalize-message-signing/index.html +0 -38
  77. package/docs/dist/signetjs/chain-adapters/evm/finalize-transaction-signing/index.html +0 -41
  78. package/docs/dist/signetjs/chain-adapters/evm/finalize-typed-data-signing/index.html +0 -39
  79. package/docs/dist/signetjs/chain-adapters/evm/index.html +0 -129
  80. package/docs/dist/signetjs/chain-adapters/evm/prepare-message-for-signing/index.html +0 -31
  81. package/docs/dist/signetjs/chain-adapters/evm/prepare-transaction-for-signing/index.html +0 -34
  82. package/docs/dist/signetjs/chain-adapters/evm/prepare-typed-data-for-signing/index.html +0 -49
  83. package/docs/dist/signetjs/chain-adapters/get-balance/index.html +0 -30
  84. package/docs/dist/signetjs/contracts/evm/constructor/index.html +0 -45
  85. package/docs/dist/signetjs/contracts/evm/get-current-signature-deposit/index.html +0 -26
  86. package/docs/dist/signetjs/contracts/evm/get-derived-public-key/index.html +0 -31
  87. package/docs/dist/signetjs/contracts/evm/get-latest-key-version/index.html +0 -26
  88. package/docs/dist/signetjs/contracts/evm/get-public-key/index.html +0 -26
  89. package/docs/dist/signetjs/contracts/evm/sign/index.html +0 -32
  90. package/docs/dist/signetjs/contracts/near/constructor/index.html +0 -34
  91. package/docs/dist/signetjs/contracts/near/get-current-signature-deposit/index.html +0 -26
  92. package/docs/dist/signetjs/contracts/near/get-derived-public-key/index.html +0 -31
  93. package/docs/dist/signetjs/contracts/near/get-public-key/index.html +0 -26
  94. package/docs/dist/signetjs/contracts/near/sign/index.html +0 -32
  95. package/docs/pages/examples/arbitrary-hash.mdx +0 -73
  96. package/docs/pages/examples/sponsor-foreign-chain-gas.mdx +0 -1
  97. package/docs/pages/index.mdx +0 -36
  98. package/docs/pages/introduction/signet-quick-start.mdx +0 -88
  99. package/docs/pages/primitives/chain-adapter-interface.mdx +0 -45
  100. package/docs/pages/primitives/chain-contract-interface.mdx +0 -52
  101. package/docs/pages/primitives/contract-addresses.mdx +0 -27
  102. package/docs/pages/signetjs/chain-adapters/bitcoin/btc-rpc-adapter.mdx +0 -26
  103. package/docs/pages/signetjs/chain-adapters/bitcoin/finalize-transaction-signing.mdx +0 -47
  104. package/docs/pages/signetjs/chain-adapters/bitcoin/index.mdx +0 -119
  105. package/docs/pages/signetjs/chain-adapters/bitcoin/prepare-transaction-for-signing.mdx +0 -30
  106. package/docs/pages/signetjs/chain-adapters/broadcast-tx.mdx +0 -23
  107. package/docs/pages/signetjs/chain-adapters/cosmos/finalize-transaction-signing.mdx +0 -53
  108. package/docs/pages/signetjs/chain-adapters/cosmos/index.mdx +0 -108
  109. package/docs/pages/signetjs/chain-adapters/cosmos/prepare-transaction-for-signing.mdx +0 -39
  110. package/docs/pages/signetjs/chain-adapters/derive-address-and-public-key.mdx +0 -28
  111. package/docs/pages/signetjs/chain-adapters/evm/finalize-message-signing.mdx +0 -33
  112. package/docs/pages/signetjs/chain-adapters/evm/finalize-transaction-signing.mdx +0 -44
  113. package/docs/pages/signetjs/chain-adapters/evm/finalize-typed-data-signing.mdx +0 -34
  114. package/docs/pages/signetjs/chain-adapters/evm/index.mdx +0 -84
  115. package/docs/pages/signetjs/chain-adapters/evm/prepare-message-for-signing.mdx +0 -26
  116. package/docs/pages/signetjs/chain-adapters/evm/prepare-transaction-for-signing.mdx +0 -30
  117. package/docs/pages/signetjs/chain-adapters/evm/prepare-typed-data-for-signing.mdx +0 -44
  118. package/docs/pages/signetjs/chain-adapters/get-balance.mdx +0 -26
  119. package/docs/pages/signetjs/contracts/evm/constructor.mdx +0 -38
  120. package/docs/pages/signetjs/contracts/evm/get-current-signature-deposit.mdx +0 -17
  121. package/docs/pages/signetjs/contracts/evm/get-derived-public-key.mdx +0 -28
  122. package/docs/pages/signetjs/contracts/evm/get-latest-key-version.mdx +0 -17
  123. package/docs/pages/signetjs/contracts/evm/get-public-key.mdx +0 -17
  124. package/docs/pages/signetjs/contracts/evm/sign.mdx +0 -36
  125. package/docs/pages/signetjs/contracts/near/constructor.mdx +0 -29
  126. package/docs/pages/signetjs/contracts/near/get-current-signature-deposit.mdx +0 -17
  127. package/docs/pages/signetjs/contracts/near/get-derived-public-key.mdx +0 -28
  128. package/docs/pages/signetjs/contracts/near/get-public-key.mdx +0 -17
  129. package/docs/pages/signetjs/contracts/near/sign.mdx +0 -32
  130. package/docs/public/signet-logo.png +0 -0
  131. package/docs/snippets/code/chains.ts +0 -42
  132. package/docs/snippets/code/contract.ts +0 -44
  133. package/docs/snippets/code/evm/contract.ts +0 -24
  134. package/docs/snippets/code/evm/env.ts +0 -16
  135. package/docs/snippets/code/near/env.ts +0 -13
  136. package/hardhat.config.mts +0 -19
  137. package/src/chain-adapters/Bitcoin/BTCRpcAdapter/BTCRpcAdapter.ts +0 -15
  138. package/src/chain-adapters/Bitcoin/BTCRpcAdapter/Mempool/Mempool.ts +0 -101
  139. package/src/chain-adapters/Bitcoin/BTCRpcAdapter/Mempool/index.ts +0 -1
  140. package/src/chain-adapters/Bitcoin/BTCRpcAdapter/Mempool/types.ts +0 -72
  141. package/src/chain-adapters/Bitcoin/BTCRpcAdapter/index.ts +0 -6
  142. package/src/chain-adapters/Bitcoin/Bitcoin.ts +0 -287
  143. package/src/chain-adapters/Bitcoin/index.ts +0 -13
  144. package/src/chain-adapters/Bitcoin/types.ts +0 -48
  145. package/src/chain-adapters/Bitcoin/utils.ts +0 -14
  146. package/src/chain-adapters/ChainAdapter.ts +0 -92
  147. package/src/chain-adapters/Cosmos/Cosmos.ts +0 -258
  148. package/src/chain-adapters/Cosmos/index.ts +0 -8
  149. package/src/chain-adapters/Cosmos/types.ts +0 -35
  150. package/src/chain-adapters/Cosmos/utils.ts +0 -45
  151. package/src/chain-adapters/EVM/EVM.test.ts +0 -238
  152. package/src/chain-adapters/EVM/EVM.ts +0 -337
  153. package/src/chain-adapters/EVM/index.ts +0 -11
  154. package/src/chain-adapters/EVM/types.ts +0 -53
  155. package/src/chain-adapters/EVM/utils.ts +0 -27
  156. package/src/chain-adapters/index.ts +0 -5
  157. package/src/constants.ts +0 -62
  158. package/src/contracts/ChainSignatureContract.ts +0 -65
  159. package/src/contracts/evm/ChainSignaturesContract.ts +0 -323
  160. package/src/contracts/evm/ChainSignaturesContractABI.ts +0 -359
  161. package/src/contracts/evm/errors.ts +0 -52
  162. package/src/contracts/evm/index.ts +0 -10
  163. package/src/contracts/evm/types.ts +0 -39
  164. package/src/contracts/evm/utils.ts +0 -41
  165. package/src/contracts/index.ts +0 -4
  166. package/src/contracts/near/ChainSignatureContract.ts +0 -196
  167. package/src/contracts/near/account.ts +0 -42
  168. package/src/contracts/near/constants.ts +0 -4
  169. package/src/contracts/near/index.ts +0 -10
  170. package/src/contracts/near/signAndSend/index.ts +0 -1
  171. package/src/contracts/near/signAndSend/keypair.ts +0 -178
  172. package/src/contracts/near/transaction.ts +0 -202
  173. package/src/contracts/near/types.ts +0 -71
  174. package/src/index.ts +0 -5
  175. package/src/types.ts +0 -46
  176. package/src/utils/cryptography.ts +0 -141
  177. package/src/utils/index.ts +0 -1
  178. package/src/utils/publicKey.ts +0 -17
  179. package/tsconfig.eslint.json +0 -8
  180. package/tsconfig.json +0 -126
  181. package/tsup.config.ts +0 -58
  182. package/vitest.config.ts +0 -19
  183. package/vocs.config.ts +0 -213
@@ -1,17 +0,0 @@
1
- import { CONTRACT_ADDRESSES, ROOT_PUBLIC_KEYS, type CHAINS } from '@constants'
2
- import type { NajPublicKey } from '@types'
3
-
4
- export const getRootPublicKey = (
5
- contractAddress: string,
6
- chain: keyof typeof CHAINS
7
- ): NajPublicKey | undefined => {
8
- const environment = Object.entries(CONTRACT_ADDRESSES[chain]).find(
9
- ([_, address]) => address.toLowerCase() === contractAddress.toLowerCase()
10
- )?.[0] as keyof typeof ROOT_PUBLIC_KEYS | undefined
11
-
12
- if (environment) {
13
- return ROOT_PUBLIC_KEYS[environment]
14
- }
15
-
16
- return undefined
17
- }
@@ -1,8 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "allowJs": true,
4
- "noEmit": true,
5
- "types": ["@types/node"]
6
- },
7
- "include": [".eslintrc.cjs", "src/**/*.ts", "tsup.config.ts"]
8
- }
package/tsconfig.json DELETED
@@ -1,126 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- /* Visit https://aka.ms/tsconfig to read more about this file */
4
-
5
- /* Projects */
6
- // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
- // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
- // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
- // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
- // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
- // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
-
13
- /* Language and Environment */
14
- "target": "ES2020" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
15
- // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
- // "jsx": "preserve", /* Specify what JSX code is generated. */
17
- // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
18
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
- // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
- // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
-
27
- /* Modules */
28
- "module": "ESNext" /* Specify what module code is generated. */,
29
- // "rootDir": "./", /* Specify the root folder within your source files. */
30
- "moduleResolution": "bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
31
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
- "paths": {
33
- "@chain-adapters": ["./src/chain-adapters/index.ts"],
34
- "@contracts": ["./src/contracts/index.ts"],
35
- "@utils": ["./src/utils/index.ts"],
36
- "@constants": ["./src/constants.ts"],
37
- "@types": ["./src/types.ts"],
38
- "@chain-adapters/*": ["./src/chain-adapters/*"],
39
- "@contracts/*": ["./src/contracts/*"],
40
- "@utils/*": ["./src/utils/*"]
41
- } /* Specify a set of entries that re-map imports to additional lookup locations. */,
42
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
43
- // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
44
- // "types": [], /* Specify type package names to be included without being referenced in a source file. */
45
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
46
- // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
47
- // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
48
- // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
49
- // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
50
- // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
51
- "resolveJsonModule": true /* Enable importing .json files. */,
52
- // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
53
- // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
54
-
55
- /* JavaScript Support */
56
- // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
57
- // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
58
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
59
-
60
- /* Emit */
61
- "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
62
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
63
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
64
- // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
65
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
66
- // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
67
- "outDir": "./dist" /* Specify an output folder for all emitted files. */,
68
- // "removeComments": true, /* Disable emitting comments. */
69
- // "noEmit": true, /* Disable emitting files from a compilation. */
70
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
71
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
72
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
73
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
74
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
75
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
76
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
77
- // "newLine": "crlf", /* Set the newline character for emitting files. */
78
- // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
79
- // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
80
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
81
- // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
82
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
83
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
84
-
85
- /* Interop Constraints */
86
- // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
87
- // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
88
- // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
89
- "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
90
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
91
- "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
92
-
93
- /* Type Checking */
94
- "strict": true /* Enable all strict type-checking options. */,
95
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
96
- // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
97
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
98
- // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
99
- // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
100
- // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
101
- // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
102
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
103
- // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
104
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
105
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
106
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
107
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
108
- // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
109
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
110
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
111
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
112
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
113
-
114
- /* Completeness */
115
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
116
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
117
- },
118
- "include": [
119
- "src/**/*.ts",
120
- "src/**/*.d.ts",
121
- "hardhat.config.mts",
122
- "vitest.config.ts",
123
- "tsup.config.ts"
124
- ],
125
- "exclude": ["**/*.test.ts", "**/*.spec.ts", "node_modules", "dist"]
126
- }
package/tsup.config.ts DELETED
@@ -1,58 +0,0 @@
1
- import { resolve } from 'path'
2
-
3
- import { defineConfig } from 'tsup'
4
- import type { Options } from 'tsup'
5
-
6
- export default defineConfig((options) => {
7
- const isNode = options.env?.TARGET === 'node'
8
- const isBrowser = options.env?.TARGET === 'browser'
9
-
10
- if (!isNode && !isBrowser) {
11
- throw new Error(
12
- 'TARGET environment variable must be set to either "node" or "browser"'
13
- )
14
- }
15
-
16
- const target = isNode ? 'node18' : 'esnext'
17
- const platform = isNode ? 'node' : 'browser'
18
- const outDir = `dist/${platform}`
19
-
20
- const config: Options = {
21
- entry: ['src/index.ts'],
22
- format: ['esm', 'cjs'],
23
- target,
24
- platform,
25
- outDir,
26
- outExtension({ format }) {
27
- return {
28
- js: format === 'esm' ? `.${platform}.js` : `.${platform}.cjs`,
29
- }
30
- },
31
- sourcemap: true,
32
- minify: true,
33
- clean: true,
34
- dts: isNode,
35
- external: isNode
36
- ? ['path', 'fs', 'crypto', 'stream', 'util', 'events', 'buffer']
37
- : ['crypto', 'stream', 'util', 'events', 'buffer'],
38
- treeshake: true,
39
- splitting: false,
40
- esbuildOptions(options) {
41
- options.conditions = isNode
42
- ? ['node', 'import', 'default']
43
- : ['browser', 'import', 'default']
44
- options.mainFields = isNode
45
- ? ['module', 'main']
46
- : ['browser', 'module', 'main']
47
- options.alias = {
48
- '@chain-adapters': resolve(__dirname, './src/chain-adapters'),
49
- '@contracts': resolve(__dirname, './src/contracts'),
50
- '@utils': resolve(__dirname, './src/utils'),
51
- '@constants': resolve(__dirname, './src/constants.ts'),
52
- '@types': resolve(__dirname, './src/types.ts'),
53
- }
54
- },
55
- }
56
-
57
- return config
58
- })
package/vitest.config.ts DELETED
@@ -1,19 +0,0 @@
1
- import { resolve } from 'path'
2
-
3
- import { defineConfig } from 'vitest/config'
4
-
5
- export default defineConfig({
6
- test: {
7
- globals: true,
8
- environment: 'node',
9
- },
10
- resolve: {
11
- alias: {
12
- '@chain-adapters': resolve(__dirname, './src/chain-adapters'),
13
- '@contracts': resolve(__dirname, './src/contracts'),
14
- '@utils': resolve(__dirname, './src/utils'),
15
- '@constants': resolve(__dirname, './src/constants.ts'),
16
- '@types': resolve(__dirname, './src/types.ts'),
17
- },
18
- },
19
- })
package/vocs.config.ts DELETED
@@ -1,213 +0,0 @@
1
- import { defineConfig, type Config } from 'vocs'
2
-
3
- export default defineConfig({
4
- title: 'Sig Network',
5
- description:
6
- 'Manage and use cryptographic key(s) across multiple chains or multiple contexts, with on-chain-enforced conditions',
7
- twoslash: {
8
- compilerOptions: {
9
- strict: true,
10
- paths: {
11
- 'signet.js': ['./src'],
12
- '@chain-adapters': ['./src/chain-adapters/index.ts'],
13
- '@contracts': ['./src/contracts/index.ts'],
14
- '@utils': ['./src/utils/index.ts'],
15
- '@constants': ['./src/constants.ts'],
16
- '@types': ['./src/types.ts'],
17
- '@chain-adapters/*': ['./src/chain-adapters/*'],
18
- '@contracts/*': ['./src/contracts/*'],
19
- '@utils/*': ['./src/utils/*'],
20
- },
21
- },
22
- },
23
- logoUrl: 'signet-logo.png',
24
- iconUrl: 'signet-logo.png',
25
- sidebar: [
26
- {
27
- text: 'Introduction',
28
- items: [
29
- { text: 'Introduction to Chain Signatures', link: '/' },
30
- {
31
- text: 'Signet.js Quickstart',
32
- link: '/introduction/signet-quick-start',
33
- },
34
- ],
35
- },
36
- {
37
- text: 'Primitives',
38
- items: [
39
- { text: 'Contract Addresses', link: '/primitives/contract-addresses' },
40
- {
41
- text: 'Chain Adapter Interface',
42
- link: '/primitives/chain-adapter-interface',
43
- },
44
- {
45
- text: 'Chain Contract Interfaces',
46
- link: '/primitives/chain-contract-interface',
47
- },
48
- ],
49
- },
50
- {
51
- text: 'Examples',
52
- items: [
53
- { text: 'Sign arbitrary hash', link: '/examples/arbitrary-hash' },
54
- {
55
- text: 'Use Ethereum chain signatures to securely sponsor gas fees for calling your Base smart contract',
56
- link: '/examples/sponsor-foreign-chain-gas',
57
- },
58
- ],
59
- },
60
- {
61
- text: 'API Reference',
62
- items: [
63
- {
64
- text: 'Chain Adapters',
65
- items: [
66
- {
67
- text: 'EVM Chains',
68
- items: [
69
- { text: 'Overview', link: '/signetjs/chain-adapters/evm' },
70
- {
71
- text: 'prepareTransactionForSigning',
72
- link: '/signetjs/chain-adapters/evm/prepare-transaction-for-signing',
73
- },
74
- {
75
- text: 'finalizeTransactionSigning',
76
- link: '/signetjs/chain-adapters/evm/finalize-transaction-signing',
77
- },
78
- {
79
- text: 'prepareMessageForSigning',
80
- link: '/signetjs/chain-adapters/evm/prepare-message-for-signing',
81
- },
82
- {
83
- text: 'finalizeMessageSigning',
84
- link: '/signetjs/chain-adapters/evm/finalize-message-signing',
85
- },
86
- {
87
- text: 'prepareTypedDataForSigning',
88
- link: '/signetjs/chain-adapters/evm/prepare-typed-data-for-signing',
89
- },
90
- {
91
- text: 'finalizeTypedDataSigning',
92
- link: '/signetjs/chain-adapters/evm/finalize-typed-data-signing',
93
- },
94
- ],
95
- },
96
- {
97
- text: 'Bitcoin',
98
- items: [
99
- { text: 'Overview', link: '/signetjs/chain-adapters/bitcoin' },
100
- {
101
- text: 'RPC Adapter',
102
- link: '/signetjs/chain-adapters/bitcoin/btc-rpc-adapter',
103
- },
104
- {
105
- text: 'prepareTransactionForSigning',
106
- link: '/signetjs/chain-adapters/bitcoin/prepare-transaction-for-signing',
107
- },
108
- {
109
- text: 'finalizeTransactionSigning',
110
- link: '/signetjs/chain-adapters/bitcoin/finalize-transaction-signing',
111
- },
112
- ],
113
- },
114
- {
115
- text: 'Cosmos Chains',
116
- items: [
117
- { text: 'Overview', link: '/signetjs/chain-adapters/cosmos' },
118
- {
119
- text: 'prepareTransactionForSigning',
120
- link: '/signetjs/chain-adapters/cosmos/prepare-transaction-for-signing',
121
- },
122
- {
123
- text: 'finalizeTransactionSigning',
124
- link: '/signetjs/chain-adapters/cosmos/finalize-transaction-signing',
125
- },
126
- ],
127
- },
128
- {
129
- text: 'deriveAddressAndPublicKey',
130
- link: '/signetjs/chain-adapters/derive-address-and-public-key',
131
- },
132
- {
133
- text: 'getBalance',
134
- link: '/signetjs/chain-adapters/get-balance',
135
- },
136
- {
137
- text: 'broadcastTx',
138
- link: '/signetjs/chain-adapters/broadcast-tx',
139
- },
140
- ],
141
- },
142
- {
143
- text: 'Contracts',
144
- items: [
145
- {
146
- text: 'EVM',
147
- items: [
148
- {
149
- text: 'constructor',
150
- link: '/signetjs/contracts/evm/constructor',
151
- },
152
- {
153
- text: 'getCurrentSignatureDeposit',
154
- link: '/signetjs/contracts/evm/get-current-signature-deposit',
155
- },
156
- {
157
- text: 'getDerivedPublicKey',
158
- link: '/signetjs/contracts/evm/get-derived-public-key',
159
- },
160
- {
161
- text: 'getPublicKey',
162
- link: '/signetjs/contracts/evm/get-public-key',
163
- },
164
- {
165
- text: 'getLatestKeyVersion',
166
- link: '/signetjs/contracts/evm/get-latest-key-version',
167
- },
168
- { text: 'sign', link: '/signetjs/contracts/evm/sign' },
169
- ],
170
- },
171
- {
172
- text: 'NEAR',
173
- items: [
174
- {
175
- text: 'constructor',
176
- link: '/signetjs/contracts/near/constructor',
177
- },
178
- {
179
- text: 'getCurrentSignatureDeposit',
180
- link: '/signetjs/contracts/near/get-current-signature-deposit',
181
- },
182
- {
183
- text: 'getDerivedPublicKey',
184
- link: '/signetjs/contracts/near/get-derived-public-key',
185
- },
186
- {
187
- text: 'getPublicKey',
188
- link: '/signetjs/contracts/near/get-public-key',
189
- },
190
- {
191
- text: 'sign',
192
- link: '/signetjs/contracts/near/sign',
193
- },
194
- ],
195
- },
196
- ],
197
- },
198
- ],
199
- },
200
- ],
201
- socials: [
202
- {
203
- icon: 'github',
204
- link: 'https://github.com/sig-net',
205
- },
206
- ],
207
- theme: {
208
- accentColor: {
209
- light: '#00C08B',
210
- dark: '#00E6A6',
211
- },
212
- },
213
- }) as Config