@kynesyslabs/demosdk 1.0.21 → 1.0.23

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 (180) hide show
  1. package/build/encryption/Cryptography.d.ts +18 -1
  2. package/build/encryption/Cryptography.js +182 -1
  3. package/build/encryption/Cryptography.js.map +1 -1
  4. package/build/encryption/Hashing.d.ts +1 -1
  5. package/build/encryption/Hashing.js +2 -1
  6. package/build/encryption/Hashing.js.map +1 -1
  7. package/build/encryption/index.d.ts +2 -2
  8. package/build/encryption/index.js +4 -2
  9. package/build/encryption/index.js.map +1 -1
  10. package/build/index.d.ts +1 -0
  11. package/build/index.js +2 -1
  12. package/build/index.js.map +1 -1
  13. package/build/multichain/core/solana.d.ts +16 -29
  14. package/build/multichain/core/solana.js +40 -126
  15. package/build/multichain/core/solana.js.map +1 -1
  16. package/build/multichain/core/types/defaultChain.d.ts +0 -18
  17. package/build/multichain/localsdk/index.d.ts +5 -4
  18. package/build/multichain/localsdk/index.js +3 -1
  19. package/build/multichain/localsdk/index.js.map +1 -1
  20. package/build/multichain/localsdk/solana.d.ts +1 -3
  21. package/build/multichain/localsdk/solana.js +5 -10
  22. package/build/multichain/localsdk/solana.js.map +1 -1
  23. package/build/multichain/websdk/index.d.ts +1 -0
  24. package/build/multichain/websdk/index.js +3 -1
  25. package/build/multichain/websdk/index.js.map +1 -1
  26. package/build/multichain/websdk/solana.d.ts +4 -0
  27. package/build/multichain/websdk/solana.js +11 -0
  28. package/build/multichain/websdk/solana.js.map +1 -0
  29. package/build/types/blockchain/Confirmation.d.ts +9 -0
  30. package/build/types/blockchain/Confirmation.js +23 -0
  31. package/build/types/blockchain/Confirmation.js.map +1 -0
  32. package/build/types/blockchain/WalletTypes.d.ts +3 -0
  33. package/build/types/blockchain/WalletTypes.js +3 -0
  34. package/build/types/blockchain/WalletTypes.js.map +1 -0
  35. package/build/utils/dataManipulation.d.ts +1 -0
  36. package/build/utils/dataManipulation.js +5 -1
  37. package/build/utils/dataManipulation.js.map +1 -1
  38. package/build/utils/getRemoteIP.d.ts +1 -0
  39. package/build/utils/getRemoteIP.js +19 -0
  40. package/build/utils/getRemoteIP.js.map +1 -0
  41. package/build/wallet/Wallet.d.ts +25 -0
  42. package/build/wallet/Wallet.js +94 -0
  43. package/build/wallet/Wallet.js.map +1 -0
  44. package/build/wallet/index.d.ts +1 -0
  45. package/build/wallet/index.js +28 -0
  46. package/build/wallet/index.js.map +1 -0
  47. package/build/websdk/DemosTransactions.d.ts +1 -1
  48. package/build/websdk/DemosTransactions.js +3 -2
  49. package/build/websdk/DemosTransactions.js.map +1 -1
  50. package/build/websdk/demos.d.ts +2 -2
  51. package/package.json +55 -57
  52. package/.eslintignore +0 -6
  53. package/.eslintrc.cjs +0 -31
  54. package/.gitattributes +0 -4
  55. package/.github/workflows/publish.yml +0 -43
  56. package/.github/workflows/test:multichain.yml +0 -35
  57. package/.gitignore +0 -8
  58. package/.prettierrc +0 -13
  59. package/build/tests/multichain/chainProviders.d.ts +0 -29
  60. package/build/tests/multichain/chainProviders.js +0 -34
  61. package/build/tests/multichain/chainProviders.js.map +0 -1
  62. package/build/tests/multichain/evm.test.d.ts +0 -1
  63. package/build/tests/multichain/evm.test.js +0 -53
  64. package/build/tests/multichain/evm.test.js.map +0 -1
  65. package/build/tests/multichain/ibc.test.d.ts +0 -1
  66. package/build/tests/multichain/ibc.test.js +0 -74
  67. package/build/tests/multichain/ibc.test.js.map +0 -1
  68. package/build/tests/multichain/index.d.ts +0 -1
  69. package/build/tests/multichain/index.js +0 -94
  70. package/build/tests/multichain/index.js.map +0 -1
  71. package/build/tests/multichain/multiversx.test.d.ts +0 -1
  72. package/build/tests/multichain/multiversx.test.js +0 -49
  73. package/build/tests/multichain/multiversx.test.js.map +0 -1
  74. package/build/tests/multichain/solana.spec.d.ts +0 -1
  75. package/build/tests/multichain/solana.spec.js +0 -50
  76. package/build/tests/multichain/solana.spec.js.map +0 -1
  77. package/build/tests/multichain/template.test.d.ts +0 -0
  78. package/build/tests/multichain/template.test.js +0 -33
  79. package/build/tests/multichain/template.test.js.map +0 -1
  80. package/build/tests/multichain/xrpl.test.d.ts +0 -1
  81. package/build/tests/multichain/xrpl.test.js +0 -57
  82. package/build/tests/multichain/xrpl.test.js.map +0 -1
  83. package/build/tests/utils/index.d.ts +0 -14
  84. package/build/tests/utils/index.js +0 -34
  85. package/build/tests/utils/index.js.map +0 -1
  86. package/build/tests/utils/wallets.d.ts +0 -21
  87. package/build/tests/utils/wallets.js +0 -48
  88. package/build/tests/utils/wallets.js.map +0 -1
  89. package/build/tests/utils.test.d.ts +0 -1
  90. package/build/tests/utils.test.js +0 -19
  91. package/build/tests/utils.test.js.map +0 -1
  92. package/documentation/multichain/README.md +0 -85
  93. package/documentation/multichain/ibc.md +0 -3
  94. package/documentation/multichain/solana.md +0 -13
  95. package/jest.config.ts +0 -20
  96. package/src/encryption/Cryptography.ts +0 -128
  97. package/src/encryption/FHE/index.ts +0 -35
  98. package/src/encryption/Hashing.ts +0 -20
  99. package/src/encryption/PQC/index.ts +0 -260
  100. package/src/encryption/index.ts +0 -5
  101. package/src/encryption/zK/index.ts +0 -1
  102. package/src/encryption/zK/interactive/index.ts +0 -47
  103. package/src/encryption/zK/primer.ts +0 -71
  104. package/src/index.ts +0 -8
  105. package/src/multichain/archive/btc.ts +0 -72
  106. package/src/multichain/archive/demos.ts +0 -51
  107. package/src/multichain/archive/tron.ts +0 -86
  108. package/src/multichain/archive/xlm.ts +0 -65
  109. package/src/multichain/core/README.md +0 -1
  110. package/src/multichain/core/evm.ts +0 -275
  111. package/src/multichain/core/ibc.ts +0 -318
  112. package/src/multichain/core/index.ts +0 -29
  113. package/src/multichain/core/multiversx.ts +0 -310
  114. package/src/multichain/core/solana.ts +0 -336
  115. package/src/multichain/core/types/defaultChain.ts +0 -254
  116. package/src/multichain/core/types/interfaces.ts +0 -102
  117. package/src/multichain/core/utils.ts +0 -22
  118. package/src/multichain/core/xrp.ts +0 -253
  119. package/src/multichain/index.ts +0 -3
  120. package/src/multichain/localsdk/README.md +0 -1
  121. package/src/multichain/localsdk/evm.ts +0 -77
  122. package/src/multichain/localsdk/ibc.ts +0 -25
  123. package/src/multichain/localsdk/index.ts +0 -4
  124. package/src/multichain/localsdk/multiversx.ts +0 -66
  125. package/src/multichain/localsdk/solana.ts +0 -37
  126. package/src/multichain/localsdk/xrp.ts +0 -56
  127. package/src/multichain/websdk/README.md +0 -1
  128. package/src/multichain/websdk/evm.ts +0 -9
  129. package/src/multichain/websdk/ibc.ts +0 -10
  130. package/src/multichain/websdk/index.ts +0 -4
  131. package/src/multichain/websdk/multiversx.ts +0 -84
  132. package/src/multichain/websdk/xrp.ts +0 -9
  133. package/src/tests/multichain/chainProviders.ts +0 -32
  134. package/src/tests/multichain/evm.test.ts +0 -64
  135. package/src/tests/multichain/ibc.test.ts +0 -93
  136. package/src/tests/multichain/index.ts +0 -105
  137. package/src/tests/multichain/multiversx.test.ts +0 -57
  138. package/src/tests/multichain/solana.spec.ts +0 -56
  139. package/src/tests/multichain/template.test.ts +0 -37
  140. package/src/tests/multichain/xrpl.test.ts +0 -71
  141. package/src/tests/utils/index.ts +0 -34
  142. package/src/tests/utils/wallets.ts +0 -46
  143. package/src/tests/utils.test.ts +0 -21
  144. package/src/types/blockchain/ISignature.ts +0 -6
  145. package/src/types/blockchain/Transaction.ts +0 -34
  146. package/src/types/blockchain/TxFee.ts +0 -5
  147. package/src/types/blockchain/ValidityData.ts +0 -15
  148. package/src/types/blockchain/addressInfo.ts +0 -7
  149. package/src/types/blockchain/blocks.ts +0 -29
  150. package/src/types/blockchain/genesisTypes.ts +0 -39
  151. package/src/types/blockchain/rawTransaction.ts +0 -27
  152. package/src/types/blockchain/statusNative.ts +0 -6
  153. package/src/types/blockchain/statusProperties.ts +0 -8
  154. package/src/types/communication/transmit.ts +0 -27
  155. package/src/types/gls/Operation.ts +0 -25
  156. package/src/types/gls/StateChange.ts +0 -33
  157. package/src/types/index.ts +0 -60
  158. package/src/types/network/ExecutionResult.ts +0 -9
  159. package/src/types/network/SecurityTypes.ts +0 -18
  160. package/src/types/peers/Peer.ts +0 -18
  161. package/src/types/web2/index.ts +0 -76
  162. package/src/types/xm/index.ts +0 -21
  163. package/src/utils/dataManipulation.ts +0 -37
  164. package/src/utils/index.ts +0 -1
  165. package/src/websdk/DemosTransactions.ts +0 -74
  166. package/src/websdk/DemosWebAuth.ts +0 -186
  167. package/src/websdk/Web2Transactions.ts +0 -41
  168. package/src/websdk/XMTransactions.ts +0 -140
  169. package/src/websdk/demos.ts +0 -461
  170. package/src/websdk/index.ts +0 -15
  171. package/src/websdk/rsa.ts +0 -85
  172. package/src/websdk/types/IBuffer.ts +0 -4
  173. package/src/websdk/types/KeyPair.ts +0 -9
  174. package/src/websdk/utils/bufferizer.ts +0 -16
  175. package/src/websdk/utils/forge_converter.ts +0 -72
  176. package/src/websdk/utils/required.ts +0 -44
  177. package/src/websdk/utils/sha256.ts +0 -13
  178. package/src/websdk/utils/skeletons.ts +0 -69
  179. package/tsconfig.json +0 -34
  180. package/yarn.lock +0 -3705
@@ -1,44 +0,0 @@
1
- /**
2
- * INFO Small module to quickly implement a require-like method as seen in Solidity
3
- * NOTE Either causes an exception or returns false if the requirement is not met.
4
- *
5
- * @author TheCookingSenpai
6
- * @date 2/9/2023 - 04:15:18
7
- *
8
- * @param {any} value
9
- * @param {boolean} is_fatal
10
- * @returns {void | boolean}
11
- */
12
- export function required(value: any, is_fatal: boolean = true): void | boolean {
13
- if (!value) {
14
- if (is_fatal) {
15
- throw new Error('Value of ' + value + ' is required and failed');
16
- } else {
17
- return false;
18
- }
19
- }
20
- // Requirements are met
21
- return true;
22
- }
23
-
24
- /**
25
- * Throw an error if a value is nullish
26
- *
27
- * @param {any} value The value to check
28
- * @param {string} msg The help text on error
29
- * @param {boolean} fatal should we raise an error? Default: `true`
30
- *
31
- */
32
- export function _required(value: any, msg: string = 'Missing required element', fatal: boolean = true) {
33
- // INFO: Copied from node repo
34
-
35
- if (!value) {
36
- if (fatal) {
37
- throw new Error('[REQUIRED] ' + msg)
38
- };
39
-
40
- return false;
41
- }
42
-
43
- return true;
44
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * Hashes any string using crypto subtle
3
- */
4
- export async function sha256 (string: string): Promise<string> {
5
- const utf8 = new TextEncoder().encode(string)
6
- const hashBuffer = await crypto.subtle.digest('SHA-256', utf8)
7
- const hashArray = Array.from(new Uint8Array(hashBuffer)) // FIXME Review if it's to change to buffer here
8
- // sourcery skip: inline-immediately-returned-variable
9
- const hashHex = hashArray
10
- .map((bytes) => bytes.toString(16).padStart(2, '0'))
11
- .join('')
12
- return hashHex
13
- }
@@ -1,69 +0,0 @@
1
- import type { Transaction } from '@/types'
2
- import { EnumWeb2Methods } from '@/types/web2'
3
- // TODO This should be a collection of classes now that we use TypeScript
4
- // FIXME ^
5
-
6
- // INFO An empty transaction
7
- const transaction: Transaction = {
8
- content: {
9
- type: '', // string
10
- from: '', // forge.pki.ed25519.BinaryBuffer
11
- to: '', // forge.pki.ed25519.BinaryBuffer
12
- amount: 0, // number
13
- data: ['', ''], // [string, string] // type as string and content in hex string
14
- nonce: 0, // number // Increments every time a transaction is sent from the same account
15
- timestamp: 0, // number // Is the registered unix timestamp when the transaction was sent the first time
16
- transaction_fee: {
17
- network_fee: 0,
18
- rpc_fee: 0,
19
- additional_fee: 0,
20
- },
21
- },
22
- signature: null, // pki.ed25519.BinaryBuffer
23
- hash: '', // string
24
- status: '', // string
25
- blockNumber: null, // number
26
- }
27
-
28
- // INFO An empty crosschain operation object
29
- const crosschain_operation = {
30
- chain: null,
31
- subchain: null,
32
- is_evm: null,
33
- rpc: null,
34
- task: {
35
- type: null,
36
- params: {},
37
- signedPayloads: [],
38
- },
39
- // signedPayloads: []
40
- }
41
-
42
- // INFO An empty web2 request object
43
- const web2_request = {
44
- raw: {
45
- action: '',
46
- parameters: [],
47
- requestedParameters: null, // Means all
48
- method: EnumWeb2Methods.GET,
49
- url: '',
50
- headers: null,
51
- minAttestations: 2,
52
- // Handling the various stages of an IWeb2Request
53
- stage: {
54
- // The one that will handle the response too
55
- origin: {
56
- identity: '',
57
- connection_url: '',
58
- },
59
- // Starting from 0, each attestation it is increased
60
- hop_number: 0,
61
- },
62
- },
63
- result: null,
64
- attestations: new Map(),
65
- hash: '',
66
- signature: '',
67
- }
68
-
69
- export { crosschain_operation, transaction, web2_request }
package/tsconfig.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "strict": true,
4
- "baseUrl": "./src",
5
- "outDir": "./build",
6
- "rootDir": ".",
7
- "declaration": true,
8
- "esModuleInterop": true,
9
- "forceConsistentCasingInFileNames": true,
10
- "allowJs": true,
11
- "lib": ["es2020"],
12
- "strictNullChecks": false,
13
- "target": "es2020",
14
- "module": "commonjs",
15
- "moduleResolution": "node",
16
- "newLine": "LF",
17
- "noEmitOnError": true,
18
- "noFallthroughCasesInSwitch": true,
19
- "noImplicitAny": false,
20
- "noImplicitReturns": true,
21
- "noImplicitOverride": true,
22
- "noUnusedLocals": false,
23
- "noUnusedParameters": false,
24
- "pretty": true,
25
- "removeComments": false,
26
- "resolveJsonModule": true,
27
- "sourceMap": true,
28
- "paths": {
29
- "@/*": ["*"]
30
- }
31
- },
32
- "include": ["src/**/*.ts"],
33
- "exclude": ["src/**/archive/**/*"]
34
- }