@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.
- package/build/encryption/Cryptography.d.ts +18 -1
- package/build/encryption/Cryptography.js +182 -1
- package/build/encryption/Cryptography.js.map +1 -1
- package/build/encryption/Hashing.d.ts +1 -1
- package/build/encryption/Hashing.js +2 -1
- package/build/encryption/Hashing.js.map +1 -1
- package/build/encryption/index.d.ts +2 -2
- package/build/encryption/index.js +4 -2
- package/build/encryption/index.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/multichain/core/solana.d.ts +16 -29
- package/build/multichain/core/solana.js +40 -126
- package/build/multichain/core/solana.js.map +1 -1
- package/build/multichain/core/types/defaultChain.d.ts +0 -18
- package/build/multichain/localsdk/index.d.ts +5 -4
- package/build/multichain/localsdk/index.js +3 -1
- package/build/multichain/localsdk/index.js.map +1 -1
- package/build/multichain/localsdk/solana.d.ts +1 -3
- package/build/multichain/localsdk/solana.js +5 -10
- package/build/multichain/localsdk/solana.js.map +1 -1
- package/build/multichain/websdk/index.d.ts +1 -0
- package/build/multichain/websdk/index.js +3 -1
- package/build/multichain/websdk/index.js.map +1 -1
- package/build/multichain/websdk/solana.d.ts +4 -0
- package/build/multichain/websdk/solana.js +11 -0
- package/build/multichain/websdk/solana.js.map +1 -0
- package/build/types/blockchain/Confirmation.d.ts +9 -0
- package/build/types/blockchain/Confirmation.js +23 -0
- package/build/types/blockchain/Confirmation.js.map +1 -0
- package/build/types/blockchain/WalletTypes.d.ts +3 -0
- package/build/types/blockchain/WalletTypes.js +3 -0
- package/build/types/blockchain/WalletTypes.js.map +1 -0
- package/build/utils/dataManipulation.d.ts +1 -0
- package/build/utils/dataManipulation.js +5 -1
- package/build/utils/dataManipulation.js.map +1 -1
- package/build/utils/getRemoteIP.d.ts +1 -0
- package/build/utils/getRemoteIP.js +19 -0
- package/build/utils/getRemoteIP.js.map +1 -0
- package/build/wallet/Wallet.d.ts +25 -0
- package/build/wallet/Wallet.js +94 -0
- package/build/wallet/Wallet.js.map +1 -0
- package/build/wallet/index.d.ts +1 -0
- package/build/wallet/index.js +28 -0
- package/build/wallet/index.js.map +1 -0
- package/build/websdk/DemosTransactions.d.ts +1 -1
- package/build/websdk/DemosTransactions.js +3 -2
- package/build/websdk/DemosTransactions.js.map +1 -1
- package/build/websdk/demos.d.ts +2 -2
- package/package.json +55 -57
- package/.eslintignore +0 -6
- package/.eslintrc.cjs +0 -31
- package/.gitattributes +0 -4
- package/.github/workflows/publish.yml +0 -43
- package/.github/workflows/test:multichain.yml +0 -35
- package/.gitignore +0 -8
- package/.prettierrc +0 -13
- package/build/tests/multichain/chainProviders.d.ts +0 -29
- package/build/tests/multichain/chainProviders.js +0 -34
- package/build/tests/multichain/chainProviders.js.map +0 -1
- package/build/tests/multichain/evm.test.d.ts +0 -1
- package/build/tests/multichain/evm.test.js +0 -53
- package/build/tests/multichain/evm.test.js.map +0 -1
- package/build/tests/multichain/ibc.test.d.ts +0 -1
- package/build/tests/multichain/ibc.test.js +0 -74
- package/build/tests/multichain/ibc.test.js.map +0 -1
- package/build/tests/multichain/index.d.ts +0 -1
- package/build/tests/multichain/index.js +0 -94
- package/build/tests/multichain/index.js.map +0 -1
- package/build/tests/multichain/multiversx.test.d.ts +0 -1
- package/build/tests/multichain/multiversx.test.js +0 -49
- package/build/tests/multichain/multiversx.test.js.map +0 -1
- package/build/tests/multichain/solana.spec.d.ts +0 -1
- package/build/tests/multichain/solana.spec.js +0 -50
- package/build/tests/multichain/solana.spec.js.map +0 -1
- package/build/tests/multichain/template.test.d.ts +0 -0
- package/build/tests/multichain/template.test.js +0 -33
- package/build/tests/multichain/template.test.js.map +0 -1
- package/build/tests/multichain/xrpl.test.d.ts +0 -1
- package/build/tests/multichain/xrpl.test.js +0 -57
- package/build/tests/multichain/xrpl.test.js.map +0 -1
- package/build/tests/utils/index.d.ts +0 -14
- package/build/tests/utils/index.js +0 -34
- package/build/tests/utils/index.js.map +0 -1
- package/build/tests/utils/wallets.d.ts +0 -21
- package/build/tests/utils/wallets.js +0 -48
- package/build/tests/utils/wallets.js.map +0 -1
- package/build/tests/utils.test.d.ts +0 -1
- package/build/tests/utils.test.js +0 -19
- package/build/tests/utils.test.js.map +0 -1
- package/documentation/multichain/README.md +0 -85
- package/documentation/multichain/ibc.md +0 -3
- package/documentation/multichain/solana.md +0 -13
- package/jest.config.ts +0 -20
- package/src/encryption/Cryptography.ts +0 -128
- package/src/encryption/FHE/index.ts +0 -35
- package/src/encryption/Hashing.ts +0 -20
- package/src/encryption/PQC/index.ts +0 -260
- package/src/encryption/index.ts +0 -5
- package/src/encryption/zK/index.ts +0 -1
- package/src/encryption/zK/interactive/index.ts +0 -47
- package/src/encryption/zK/primer.ts +0 -71
- package/src/index.ts +0 -8
- package/src/multichain/archive/btc.ts +0 -72
- package/src/multichain/archive/demos.ts +0 -51
- package/src/multichain/archive/tron.ts +0 -86
- package/src/multichain/archive/xlm.ts +0 -65
- package/src/multichain/core/README.md +0 -1
- package/src/multichain/core/evm.ts +0 -275
- package/src/multichain/core/ibc.ts +0 -318
- package/src/multichain/core/index.ts +0 -29
- package/src/multichain/core/multiversx.ts +0 -310
- package/src/multichain/core/solana.ts +0 -336
- package/src/multichain/core/types/defaultChain.ts +0 -254
- package/src/multichain/core/types/interfaces.ts +0 -102
- package/src/multichain/core/utils.ts +0 -22
- package/src/multichain/core/xrp.ts +0 -253
- package/src/multichain/index.ts +0 -3
- package/src/multichain/localsdk/README.md +0 -1
- package/src/multichain/localsdk/evm.ts +0 -77
- package/src/multichain/localsdk/ibc.ts +0 -25
- package/src/multichain/localsdk/index.ts +0 -4
- package/src/multichain/localsdk/multiversx.ts +0 -66
- package/src/multichain/localsdk/solana.ts +0 -37
- package/src/multichain/localsdk/xrp.ts +0 -56
- package/src/multichain/websdk/README.md +0 -1
- package/src/multichain/websdk/evm.ts +0 -9
- package/src/multichain/websdk/ibc.ts +0 -10
- package/src/multichain/websdk/index.ts +0 -4
- package/src/multichain/websdk/multiversx.ts +0 -84
- package/src/multichain/websdk/xrp.ts +0 -9
- package/src/tests/multichain/chainProviders.ts +0 -32
- package/src/tests/multichain/evm.test.ts +0 -64
- package/src/tests/multichain/ibc.test.ts +0 -93
- package/src/tests/multichain/index.ts +0 -105
- package/src/tests/multichain/multiversx.test.ts +0 -57
- package/src/tests/multichain/solana.spec.ts +0 -56
- package/src/tests/multichain/template.test.ts +0 -37
- package/src/tests/multichain/xrpl.test.ts +0 -71
- package/src/tests/utils/index.ts +0 -34
- package/src/tests/utils/wallets.ts +0 -46
- package/src/tests/utils.test.ts +0 -21
- package/src/types/blockchain/ISignature.ts +0 -6
- package/src/types/blockchain/Transaction.ts +0 -34
- package/src/types/blockchain/TxFee.ts +0 -5
- package/src/types/blockchain/ValidityData.ts +0 -15
- package/src/types/blockchain/addressInfo.ts +0 -7
- package/src/types/blockchain/blocks.ts +0 -29
- package/src/types/blockchain/genesisTypes.ts +0 -39
- package/src/types/blockchain/rawTransaction.ts +0 -27
- package/src/types/blockchain/statusNative.ts +0 -6
- package/src/types/blockchain/statusProperties.ts +0 -8
- package/src/types/communication/transmit.ts +0 -27
- package/src/types/gls/Operation.ts +0 -25
- package/src/types/gls/StateChange.ts +0 -33
- package/src/types/index.ts +0 -60
- package/src/types/network/ExecutionResult.ts +0 -9
- package/src/types/network/SecurityTypes.ts +0 -18
- package/src/types/peers/Peer.ts +0 -18
- package/src/types/web2/index.ts +0 -76
- package/src/types/xm/index.ts +0 -21
- package/src/utils/dataManipulation.ts +0 -37
- package/src/utils/index.ts +0 -1
- package/src/websdk/DemosTransactions.ts +0 -74
- package/src/websdk/DemosWebAuth.ts +0 -186
- package/src/websdk/Web2Transactions.ts +0 -41
- package/src/websdk/XMTransactions.ts +0 -140
- package/src/websdk/demos.ts +0 -461
- package/src/websdk/index.ts +0 -15
- package/src/websdk/rsa.ts +0 -85
- package/src/websdk/types/IBuffer.ts +0 -4
- package/src/websdk/types/KeyPair.ts +0 -9
- package/src/websdk/utils/bufferizer.ts +0 -16
- package/src/websdk/utils/forge_converter.ts +0 -72
- package/src/websdk/utils/required.ts +0 -44
- package/src/websdk/utils/sha256.ts +0 -13
- package/src/websdk/utils/skeletons.ts +0 -69
- package/tsconfig.json +0 -34
- 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
|
-
}
|