@kynesyslabs/demosdk 2.3.8 → 2.3.12
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/README.md +163 -61
- package/build/websdk/GCRGeneration.d.ts +1 -1
- package/build/websdk/GCRGeneration.js +6 -6
- package/build/websdk/GCRGeneration.js.map +1 -1
- package/package.json +115 -117
- package/CHANGELOG.md +0 -5
package/README.md
CHANGED
|
@@ -1,116 +1,218 @@
|
|
|
1
|
-
# Demos
|
|
1
|
+
# Demos SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A JavaScript/TypeScript SDK providing a unified interface for interacting with the Demos network and cross-chain operations.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Node.js 18.0 or higher
|
|
8
|
+
- TypeScript 5.0 or higher (for TypeScript projects)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
4
11
|
|
|
5
12
|
```sh
|
|
13
|
+
npm install @kynesyslabs/demosdk
|
|
14
|
+
# or
|
|
6
15
|
yarn add @kynesyslabs/demosdk
|
|
16
|
+
```
|
|
7
17
|
|
|
8
|
-
|
|
18
|
+
## Features
|
|
9
19
|
|
|
10
|
-
|
|
11
|
-
```
|
|
20
|
+
### Core Modules
|
|
12
21
|
|
|
13
|
-
|
|
22
|
+
- **WebSDK**: Browser-compatible SDK for web applications
|
|
23
|
+
- **Cross-chain Core**: Unified interface for multiple blockchain networks
|
|
24
|
+
- **DemosWork**: Workflow execution engine
|
|
25
|
+
- **Wallet**: Wallet management and cryptographic operations
|
|
26
|
+
- **Bridge**: Cross-chain asset bridging via Rubic protocol
|
|
27
|
+
- **Abstraction**: Chain-agnostic transaction and balance queries
|
|
28
|
+
- **Encryption**: Post-quantum cryptography and zero-knowledge proofs
|
|
14
29
|
|
|
15
|
-
|
|
30
|
+
### Supported Blockchains
|
|
16
31
|
|
|
17
|
-
|
|
32
|
+
- EVM-compatible: Ethereum, BSC, Polygon, Arbitrum, Optimism
|
|
33
|
+
- Non-EVM: Solana, Bitcoin, TON, Near, MultiversX, Cosmos IBC, XRP
|
|
18
34
|
|
|
19
|
-
|
|
20
|
-
yarn build
|
|
21
|
-
```
|
|
35
|
+
## Usage
|
|
22
36
|
|
|
23
|
-
|
|
37
|
+
### Basic Import
|
|
24
38
|
|
|
25
|
-
```
|
|
26
|
-
|
|
39
|
+
```typescript
|
|
40
|
+
import { Demos } from "@kynesyslabs/demosdk/websdk"
|
|
41
|
+
import { prepareXMPayload } from "@kynesyslabs/demosdk/xm-websdk"
|
|
42
|
+
import { DemosWork } from "@kynesyslabs/demosdk/demoswork"
|
|
27
43
|
```
|
|
28
44
|
|
|
29
|
-
|
|
45
|
+
### Module Exports
|
|
30
46
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
47
|
+
The SDK provides multiple entry points:
|
|
48
|
+
|
|
49
|
+
- `@kynesyslabs/demosdk` - Main entry point
|
|
50
|
+
- `@kynesyslabs/demosdk/websdk` - Web SDK components
|
|
51
|
+
- `@kynesyslabs/demosdk/xm-websdk` - Cross-chain web SDK
|
|
52
|
+
- `@kynesyslabs/demosdk/xm-localsdk` - Cross-chain local SDK
|
|
53
|
+
- `@kynesyslabs/demosdk/xmcore` - Cross-chain core functionality
|
|
54
|
+
- `@kynesyslabs/demosdk/demoswork` - Workflow engine
|
|
55
|
+
- `@kynesyslabs/demosdk/wallet` - Wallet utilities
|
|
56
|
+
- `@kynesyslabs/demosdk/abstraction` - Chain abstraction layer
|
|
57
|
+
- `@kynesyslabs/demosdk/bridge` - Bridging functionality
|
|
58
|
+
- `@kynesyslabs/demosdk/encryption` - Cryptographic utilities
|
|
59
|
+
- `@kynesyslabs/demosdk/utils` - Common utilities
|
|
60
|
+
- `@kynesyslabs/demosdk/types` - TypeScript type definitions
|
|
61
|
+
- `@kynesyslabs/demosdk/l2ps` - Layer 2 payment solutions
|
|
62
|
+
|
|
63
|
+
## Quick Start
|
|
34
64
|
|
|
35
|
-
|
|
65
|
+
### Initialize and Connect Wallet
|
|
36
66
|
|
|
37
|
-
```
|
|
67
|
+
```typescript
|
|
38
68
|
import { Demos } from "@kynesyslabs/demosdk/websdk"
|
|
39
|
-
```
|
|
40
69
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
>
|
|
44
|
-
> Changes to the sdks will not be reflected on your project until you rebuild and reinstall the sdk in your project.
|
|
70
|
+
// 1. Initialize Demos SDK (no parameters)
|
|
71
|
+
const demos = new Demos()
|
|
45
72
|
|
|
46
|
-
|
|
73
|
+
// 2. Connect to the network
|
|
74
|
+
const rpc = "https://demosnode.discus.sh"
|
|
75
|
+
await demos.connect(rpc)
|
|
47
76
|
|
|
48
|
-
|
|
77
|
+
// 3. Generate a new mnemonic or use existing one
|
|
78
|
+
const mnemonic = demos.newMnemonic() // Generates 12-word mnemonic
|
|
79
|
+
// const mnemonic = "your existing mnemonic phrase..." // Or use existing
|
|
49
80
|
|
|
50
|
-
|
|
81
|
+
// 4. Connect your wallet
|
|
82
|
+
await demos.connectWallet(mnemonic)
|
|
51
83
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"./module": "./build/module/index.js"
|
|
56
|
-
}
|
|
84
|
+
// 5. Get your wallet address
|
|
85
|
+
const address = demos.getAddress()
|
|
86
|
+
console.log("Wallet address:", address)
|
|
57
87
|
```
|
|
58
88
|
|
|
59
|
-
|
|
89
|
+
### Native Transaction Example
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
// Send native DEM tokens
|
|
93
|
+
const tx = await demos.transfer(
|
|
94
|
+
"0x6690580a02d2da2fefa86e414e92a1146ad5357fd71d594cc561776576857ac5",
|
|
95
|
+
100 // amount in DEM
|
|
96
|
+
)
|
|
60
97
|
|
|
61
|
-
|
|
62
|
-
|
|
98
|
+
// Confirm and broadcast transaction
|
|
99
|
+
const validityData = await demos.confirm(tx)
|
|
100
|
+
const result = await demos.broadcast(validityData)
|
|
63
101
|
```
|
|
64
102
|
|
|
65
|
-
|
|
103
|
+
### Cross-chain Transaction Example
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
import {
|
|
107
|
+
prepareXMPayload,
|
|
108
|
+
prepareXMScript
|
|
109
|
+
} from "@kynesyslabs/demosdk/websdk"
|
|
110
|
+
import { EVM } from "@kynesyslabs/demosdk/xm-websdk"
|
|
111
|
+
|
|
112
|
+
// 1. Create cross-chain payload (e.g., Ethereum Sepolia)
|
|
113
|
+
const evm = await EVM.create("https://rpc.ankr.com/eth_sepolia")
|
|
114
|
+
await evm.connectWallet("your_ethereum_private_key")
|
|
115
|
+
|
|
116
|
+
const evmTx = await evm.preparePay(
|
|
117
|
+
"0xRecipientAddress",
|
|
118
|
+
"0.001" // 0.001 ETH
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
// 2. Create XMScript
|
|
122
|
+
const xmscript = prepareXMScript({
|
|
123
|
+
chain: "eth",
|
|
124
|
+
subchain: "sepolia",
|
|
125
|
+
signedPayloads: [evmTx],
|
|
126
|
+
type: "pay"
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
// 3. Convert to Demos transaction
|
|
130
|
+
const tx = await prepareXMPayload(xmscript, demos)
|
|
131
|
+
|
|
132
|
+
// 4. Confirm and broadcast
|
|
133
|
+
const validityData = await demos.confirm(tx)
|
|
134
|
+
const result = await demos.broadcast(validityData)
|
|
135
|
+
```
|
|
66
136
|
|
|
67
|
-
|
|
137
|
+
## Development
|
|
68
138
|
|
|
69
|
-
|
|
139
|
+
### Building from Source
|
|
70
140
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
141
|
+
```sh
|
|
142
|
+
yarn build
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Local Development
|
|
74
146
|
|
|
75
|
-
|
|
147
|
+
To use the SDK from a local source:
|
|
76
148
|
|
|
77
149
|
```sh
|
|
78
|
-
|
|
150
|
+
# Build the SDK
|
|
151
|
+
yarn build
|
|
152
|
+
|
|
153
|
+
# In your project
|
|
154
|
+
yarn add file:../path/to/sdks
|
|
79
155
|
```
|
|
80
156
|
|
|
81
|
-
|
|
157
|
+
### Testing
|
|
158
|
+
|
|
159
|
+
Run specific test suites:
|
|
82
160
|
|
|
83
|
-
|
|
161
|
+
```sh
|
|
162
|
+
yarn test:multichain # Cross-chain SDK payload generation
|
|
163
|
+
yarn test:tx # Cross-chain transaction tests
|
|
164
|
+
yarn test:demoswork # DemosWork operations
|
|
165
|
+
yarn test:native # Native payment transactions
|
|
166
|
+
yarn test:identities # Identity management
|
|
167
|
+
yarn test:web2 # Web2 proxy functionality
|
|
168
|
+
yarn test:bridge # Bridge service tests
|
|
169
|
+
yarn test:btc # Bitcoin-specific tests
|
|
170
|
+
yarn test:evm # EVM chain tests
|
|
171
|
+
yarn test:pqc # Post-quantum cryptography
|
|
172
|
+
```
|
|
84
173
|
|
|
85
|
-
###
|
|
174
|
+
### Pre-push Hook Setup
|
|
86
175
|
|
|
87
|
-
|
|
176
|
+
Ensure code quality before pushing:
|
|
88
177
|
|
|
89
178
|
```sh
|
|
90
179
|
yarn setup:pre-push
|
|
91
180
|
```
|
|
92
181
|
|
|
93
|
-
|
|
182
|
+
## Publishing
|
|
94
183
|
|
|
95
|
-
|
|
96
|
-
> This hook is not pushed to Github, so you need to run the command again if you reclone the repository.
|
|
184
|
+
The SDK is automatically published to NPM when:
|
|
97
185
|
|
|
98
|
-
|
|
186
|
+
1. The version in `package.json` is incremented
|
|
187
|
+
2. Changes are committed with a message starting with "release"
|
|
188
|
+
3. The commit is pushed to GitHub
|
|
99
189
|
|
|
190
|
+
Example:
|
|
100
191
|
```sh
|
|
101
|
-
|
|
192
|
+
git commit -m "release v2.3.9"
|
|
193
|
+
git push
|
|
194
|
+
```
|
|
102
195
|
|
|
103
|
-
|
|
196
|
+
## Documentation
|
|
104
197
|
|
|
105
|
-
|
|
198
|
+
- **API Reference**: [https://kynesyslabs.github.io/demosdk-api-ref/](https://kynesyslabs.github.io/demosdk-api-ref/)
|
|
199
|
+
- **Developer Guides**: [https://docs.kynesys.xyz/](https://docs.kynesys.xyz/)
|
|
106
200
|
|
|
107
|
-
|
|
201
|
+
## Contributing
|
|
108
202
|
|
|
109
|
-
|
|
203
|
+
We welcome contributions to the Demos SDK. Please ensure:
|
|
110
204
|
|
|
111
|
-
|
|
205
|
+
1. All tests pass before submitting a PR
|
|
206
|
+
2. Code follows the existing style and conventions
|
|
207
|
+
3. New features include appropriate test coverage
|
|
208
|
+
4. Documentation is updated for API changes
|
|
112
209
|
|
|
113
|
-
|
|
210
|
+
## Support
|
|
114
211
|
|
|
115
|
-
|
|
116
|
-
|
|
212
|
+
- **Issues**: [GitHub Issues](https://github.com/kynesyslabs/demosdk/issues)
|
|
213
|
+
- **Discussions**: [GitHub Discussions](https://github.com/kynesyslabs/demosdk/discussions)
|
|
214
|
+
- **Security**: For security issues, please email security@kynesys.xyz
|
|
215
|
+
|
|
216
|
+
## License
|
|
217
|
+
|
|
218
|
+
MIT
|
|
@@ -7,7 +7,7 @@ import { Transaction } from "../types/blockchain/Transaction";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class GCRGeneration {
|
|
9
9
|
static generate(tx: Transaction, isRollback?: boolean): Promise<GCREdit[]>;
|
|
10
|
-
static createGasEdit(account: string, txHash: string, isRollback?: boolean): Promise<GCREdit>;
|
|
10
|
+
static createGasEdit(account: string, txHash: string, isRollback?: boolean, gasAmount?: number): Promise<GCREdit>;
|
|
11
11
|
/**
|
|
12
12
|
* Creates an assignment edit for web2 requests and crosschain operations
|
|
13
13
|
* @param content Transaction content containing type and sender information
|
|
@@ -41,7 +41,8 @@ class GCRGeneration {
|
|
|
41
41
|
if (content.type === "identity") {
|
|
42
42
|
break nonceEdits;
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
var gasAmount = 1; // TODO Implement gas calculation to reach 1 cent per tx
|
|
45
|
+
let gasEdit = await this.createGasEdit(content.from_ed25519_address, tx.hash, isRollback, gasAmount);
|
|
45
46
|
gcrEdits.push(gasEdit);
|
|
46
47
|
}
|
|
47
48
|
catch (e) {
|
|
@@ -57,8 +58,7 @@ class GCRGeneration {
|
|
|
57
58
|
}
|
|
58
59
|
return gcrEdits;
|
|
59
60
|
}
|
|
60
|
-
static async createGasEdit(account, txHash, isRollback = false) {
|
|
61
|
-
var gasAmount = 1; // TODO Implement gas calculation to reach 1 cent per tx
|
|
61
|
+
static async createGasEdit(account, txHash, isRollback = false, gasAmount = 1) {
|
|
62
62
|
// Checking if the gas can be paid is done in the node
|
|
63
63
|
return {
|
|
64
64
|
type: "balance",
|
|
@@ -186,13 +186,13 @@ class HandleIdentityOperations {
|
|
|
186
186
|
const data = structuredClone(payload);
|
|
187
187
|
edit.data = {
|
|
188
188
|
...data,
|
|
189
|
-
timestamp: tx.content.timestamp
|
|
189
|
+
timestamp: tx.content.timestamp,
|
|
190
190
|
};
|
|
191
191
|
edit.referralCode = identityPayload.payload.referralCode;
|
|
192
192
|
break;
|
|
193
193
|
}
|
|
194
194
|
case "pqc_identity_assign": {
|
|
195
|
-
edit.data = identityPayload.payload.map(
|
|
195
|
+
edit.data = identityPayload.payload.map(payload => {
|
|
196
196
|
return {
|
|
197
197
|
...payload,
|
|
198
198
|
timestamp: tx.content.timestamp,
|
|
@@ -210,7 +210,7 @@ class HandleIdentityOperations {
|
|
|
210
210
|
userId: payload.userId,
|
|
211
211
|
proof: payload.proof,
|
|
212
212
|
proofHash: Hashing_1.Hashing.sha256(payload.proof),
|
|
213
|
-
timestamp: tx.content.timestamp
|
|
213
|
+
timestamp: tx.content.timestamp,
|
|
214
214
|
},
|
|
215
215
|
};
|
|
216
216
|
edit.referralCode = identityPayload.payload.referralCode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GCRGeneration.js","sourceRoot":"","sources":["../../../src/websdk/GCRGeneration.ts"],"names":[],"mappings":";;;AAUA,kDAA8C;AAI9C;;;;GAIG;AACH,MAAa,aAAa;IACtB,MAAM,CAAC,KAAK,CAAC,QA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
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"packageManager": "yarn@3.8.7"
|
|
118
|
-
}
|
|
2
|
+
"name": "@kynesyslabs/demosdk",
|
|
3
|
+
"version": "2.3.12",
|
|
4
|
+
"description": "Demosdk is a JavaScript/TypeScript SDK that provides a unified interface for interacting with Demos network",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"types": "build/index.d.ts",
|
|
7
|
+
"author": "Kynesys Labs",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"files": [
|
|
10
|
+
"build/",
|
|
11
|
+
"!build/tests"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": "./build/index.js",
|
|
15
|
+
"./types": "./build/types/index.js",
|
|
16
|
+
"./websdk": "./build/websdk/index.js",
|
|
17
|
+
"./demoswork": "./build/demoswork/index.js",
|
|
18
|
+
"./xmcore": "./build/multichain/core/index.js",
|
|
19
|
+
"./xm-websdk": "./build/multichain/websdk/index.js",
|
|
20
|
+
"./xm-localsdk": "./build/multichain/localsdk/index.js",
|
|
21
|
+
"./wallet": "./build/wallet/index.js",
|
|
22
|
+
"./abstraction": "./build/abstraction/index.js",
|
|
23
|
+
"./l2ps": "./build/l2ps/index.js",
|
|
24
|
+
"./utils": "./build/utils/index.js",
|
|
25
|
+
"./encryption": "./build/encryption/index.js",
|
|
26
|
+
"./bridge": "./build/bridge/index.js"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "rm -rf build && tsc --skipLibCheck && resolve-tspaths && mv build/src/* build/ && rm -rf build/src",
|
|
30
|
+
"typedoc": "typedoc",
|
|
31
|
+
"test": "jest",
|
|
32
|
+
"setup:pre-push": "cp .github/hooks/pre-push .git/hooks/pre-push && chmod +x .git/hooks/pre-push && echo \"Pre-push hook installed\"",
|
|
33
|
+
"test:multichain": "rm -rf build && jest --testMatch '**/tests/**/{coin,evm}*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
|
|
34
|
+
"test:tx": "rm -rf build && jest --testMatch '**/tests/multichain**/fulltx*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
|
|
35
|
+
"test:demoswork": "rm -rf build && jest --testMatch '**/tests/**/demoswork*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
|
|
36
|
+
"test:identities": "rm -rf build && jest --testMatch '**/tests/**/identities.spec*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
|
|
37
|
+
"test:identities:pqc": "rm -rf build && jest --testMatch '**/tests/**/identities.pqc.spec*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
|
|
38
|
+
"test:identities:web2": "rm -rf build && jest --testMatch '**/tests/**/identities.web2*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose --setupFiles dotenv/config",
|
|
39
|
+
"test:native": "rm -rf build && jest --testMatch '**/tests/native*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
|
|
40
|
+
"test:web2": "rm -rf build && jest --testMatch '**/tests/web2*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
|
|
41
|
+
"test:demos": "rm -rf build && jest --testMatch '**/newdemos.spec.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
|
|
42
|
+
"test:rubic-service": "rm -rf build && jest --testMatch '**/tests/**/rubic*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
|
|
43
|
+
"test:btc": "rm -rf build && jest --testMatch '**/tests/multichain**/bitcoin*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
|
|
44
|
+
"test:pqc": "rm -rf build && jest --testMatch '**/tests/encryption/pqc*.ts' --verbose",
|
|
45
|
+
"test:pcq": "yarn test:pqc",
|
|
46
|
+
"test:referrals": "rm -rf build && jest --testMatch '**/tests/**/referrals.spec*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose",
|
|
47
|
+
"test:evm": "rm -rf build && jest --testMatch '**/tests/**/evm.spec*.ts' --testPathIgnorePatterns **/tests/**/chainProvider* **/tests/utils/* **/tests/**/template* --verbose"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@aptos-labs/ts-sdk": "^1.28.0",
|
|
51
|
+
"@bitcoinerlab/secp256k1": "^1.2.0",
|
|
52
|
+
"@cosmjs/proto-signing": "^0.32.3",
|
|
53
|
+
"@cosmjs/stargate": "^0.32.3",
|
|
54
|
+
"@metaplex-foundation/js": "^0.20.1",
|
|
55
|
+
"@multiversx/sdk-core": "^13.16.0",
|
|
56
|
+
"@multiversx/sdk-extension-provider": "^3.0.0",
|
|
57
|
+
"@multiversx/sdk-network-providers": "^2.4.3",
|
|
58
|
+
"@multiversx/sdk-wallet": "^4.4.0",
|
|
59
|
+
"@noble/hashes": "^1.8.0",
|
|
60
|
+
"@noble/post-quantum": "^0.4.0",
|
|
61
|
+
"@project-serum/anchor": "^0.26.0",
|
|
62
|
+
"@roamhq/wrtc": "^0.8.0",
|
|
63
|
+
"@simplewebauthn/browser": "^11.0.0",
|
|
64
|
+
"@simplewebauthn/server": "^11.0.0",
|
|
65
|
+
"@solana/buffer-layout": "^4.0.1",
|
|
66
|
+
"@solana/web3.js": "1.98.0",
|
|
67
|
+
"@ton/core": "^0.56.3",
|
|
68
|
+
"@ton/crypto": "^3.2.0",
|
|
69
|
+
"@ton/ton": "^13.11.2",
|
|
70
|
+
"@types/simple-peer": "^9.11.8",
|
|
71
|
+
"axios": "^1.7.4",
|
|
72
|
+
"big-integer": "^1.6.52",
|
|
73
|
+
"bignumber.js": "^9.1.2",
|
|
74
|
+
"bip32": "^5.0.0-rc.0",
|
|
75
|
+
"bitcoinjs-lib": "^6.1.7",
|
|
76
|
+
"bitcoinjs-message": "^2.2.0",
|
|
77
|
+
"bs58": "^5.0.0",
|
|
78
|
+
"buffer": "^6.0.3",
|
|
79
|
+
"dotenv": "^16.4.7",
|
|
80
|
+
"ecpair": "^3.0.0",
|
|
81
|
+
"ethers": "^6.11.1",
|
|
82
|
+
"falcon-js": "^1.0.0",
|
|
83
|
+
"falcon-sign": "^1.0.4",
|
|
84
|
+
"js-sha3": "^0.9.3",
|
|
85
|
+
"libsodium-wrappers-sumo": "^0.7.15",
|
|
86
|
+
"lodash": "^4.17.21",
|
|
87
|
+
"mlkem": "^2.3.1",
|
|
88
|
+
"near-api-js": "^4.0.4",
|
|
89
|
+
"node-forge": "^1.3.1",
|
|
90
|
+
"node-seal": "^5.1.3",
|
|
91
|
+
"ntru": "^4.0.4",
|
|
92
|
+
"pqcrypto": "^1.0.1",
|
|
93
|
+
"protobufjs": "^7.4.0",
|
|
94
|
+
"ripple-keypairs": "^2.0.0",
|
|
95
|
+
"rubic-sdk": "^5.52.6",
|
|
96
|
+
"simple-peer": "^9.11.1",
|
|
97
|
+
"socket.io-client": "^4.7.2",
|
|
98
|
+
"sphincs": "^3.0.4",
|
|
99
|
+
"superdilithium": "^2.0.6",
|
|
100
|
+
"web3": "^4.9.0",
|
|
101
|
+
"xrpl": "^3.1.0"
|
|
102
|
+
},
|
|
103
|
+
"devDependencies": {
|
|
104
|
+
"@orbs-network/ton-access": "^2.3.3",
|
|
105
|
+
"@types/cors": "^2.8.17",
|
|
106
|
+
"@types/jest": "^29.5.12",
|
|
107
|
+
"@types/node": "^20.12.4",
|
|
108
|
+
"@types/node-forge": "^1.3.11",
|
|
109
|
+
"jest": "^29.7.0",
|
|
110
|
+
"resolve-tspaths": "^0.8.18",
|
|
111
|
+
"ts-jest": "^29.1.2",
|
|
112
|
+
"ts-node": "^10.9.2",
|
|
113
|
+
"typedoc": "^0.26.6",
|
|
114
|
+
"typescript": "^5.4.3"
|
|
115
|
+
}
|
|
116
|
+
}
|