@twin.org/dlt-iota 0.0.2-next.9 → 0.0.3-next.10
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 +4 -86
- package/dist/es/index.js +24 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/iota.js +755 -0
- package/dist/es/iota.js.map +1 -0
- package/dist/es/iotaIdentityUtils.js +84 -0
- package/dist/es/iotaIdentityUtils.js.map +1 -0
- package/dist/es/iotaSmartContractUtils.js +416 -0
- package/dist/es/iotaSmartContractUtils.js.map +1 -0
- package/dist/es/models/IAdminCapFields.js +4 -0
- package/dist/es/models/IAdminCapFields.js.map +1 -0
- package/dist/es/models/IContractData.js +4 -0
- package/dist/es/models/IContractData.js.map +1 -0
- package/dist/es/models/IGasReservationResult.js +2 -0
- package/dist/es/models/IGasReservationResult.js.map +1 -0
- package/dist/es/models/IGasStationConfig.js +4 -0
- package/dist/es/models/IGasStationConfig.js.map +1 -0
- package/dist/es/models/IGasStationExecuteResponse.js +4 -0
- package/dist/es/models/IGasStationExecuteResponse.js.map +1 -0
- package/dist/es/models/IGasStationReserveGasResponse.js +2 -0
- package/dist/es/models/IGasStationReserveGasResponse.js.map +1 -0
- package/dist/es/models/IGasStationReserveGasResult.js +2 -0
- package/dist/es/models/IGasStationReserveGasResult.js.map +1 -0
- package/dist/es/models/IIotaClient.js +2 -0
- package/dist/es/models/IIotaClient.js.map +1 -0
- package/dist/es/models/IIotaConfig.js +2 -0
- package/dist/es/models/IIotaConfig.js.map +1 -0
- package/dist/es/models/IIotaControllerCapInfo.js +4 -0
- package/dist/es/models/IIotaControllerCapInfo.js.map +1 -0
- package/dist/es/models/IIotaDryRun.js +2 -0
- package/dist/es/models/IIotaDryRun.js.map +1 -0
- package/dist/es/models/IIotaResponseOptions.js +2 -0
- package/dist/es/models/IIotaResponseOptions.js.map +1 -0
- package/dist/es/models/IIotaTransaction.js +2 -0
- package/dist/es/models/IIotaTransaction.js.map +1 -0
- package/dist/es/models/IIotaTransactionBlockResponse.js +2 -0
- package/dist/es/models/IIotaTransactionBlockResponse.js.map +1 -0
- package/dist/es/models/IMigrationStateFields.js +4 -0
- package/dist/es/models/IMigrationStateFields.js.map +1 -0
- package/dist/es/models/ISmartContractDeployments.js +2 -0
- package/dist/es/models/ISmartContractDeployments.js.map +1 -0
- package/dist/es/models/ISmartContractObject.js +4 -0
- package/dist/es/models/ISmartContractObject.js.map +1 -0
- package/dist/es/models/networkTypes.js +21 -0
- package/dist/es/models/networkTypes.js.map +1 -0
- package/dist/types/index.d.ts +21 -16
- package/dist/types/iota.d.ts +104 -57
- package/dist/types/iotaIdentityUtils.d.ts +23 -0
- package/dist/types/iotaSmartContractUtils.d.ts +20 -18
- package/dist/types/models/IGasStationReserveGasResponse.d.ts +1 -1
- package/dist/types/models/IIotaClient.d.ts +5 -0
- package/dist/types/models/IIotaConfig.d.ts +1 -1
- package/dist/types/models/IIotaControllerCapInfo.d.ts +16 -0
- package/dist/types/models/IIotaTransaction.d.ts +5 -0
- package/dist/types/models/IIotaTransactionBlockResponse.d.ts +5 -0
- package/dist/types/models/ISmartContractDeployments.d.ts +2 -2
- package/docs/changelog.md +198 -59
- package/docs/examples.md +413 -1
- package/docs/reference/classes/Iota.md +359 -159
- package/docs/reference/classes/IotaIdentityUtils.md +65 -0
- package/docs/reference/classes/IotaSmartContractUtils.md +70 -52
- package/docs/reference/index.md +5 -0
- package/docs/reference/interfaces/IAdminCapFields.md +1 -1
- package/docs/reference/interfaces/IContractData.md +10 -10
- package/docs/reference/interfaces/IGasReservationResult.md +3 -3
- package/docs/reference/interfaces/IGasStationConfig.md +2 -2
- package/docs/reference/interfaces/IGasStationExecuteResponse.md +3 -3
- package/docs/reference/interfaces/IGasStationReserveGasResponse.md +3 -3
- package/docs/reference/interfaces/IGasStationReserveGasResult.md +3 -3
- package/docs/reference/interfaces/IIotaConfig.md +18 -18
- package/docs/reference/interfaces/IIotaControllerCapInfo.md +22 -0
- package/docs/reference/interfaces/IIotaDryRun.md +5 -5
- package/docs/reference/interfaces/IIotaResponseOptions.md +4 -4
- package/docs/reference/interfaces/IMigrationStateFields.md +2 -2
- package/docs/reference/interfaces/ISmartContractObject.md +2 -2
- package/docs/reference/type-aliases/IIotaClient.md +5 -0
- package/docs/reference/type-aliases/IIotaTransaction.md +5 -0
- package/docs/reference/type-aliases/IIotaTransactionBlockResponse.md +5 -0
- package/docs/reference/variables/NetworkTypes.md +3 -3
- package/locales/en.json +14 -2
- package/package.json +24 -14
- package/dist/cjs/index.cjs +0 -946
- package/dist/esm/index.mjs +0 -942
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TWIN DLT IOTA
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This package provides utilities for integrating applications with IOTA distributed ledger capabilities, including client construction, transaction submission, sponsored transaction support, and smart contract migration helpers. It is intended for services that need a reliable and repeatable approach to ledger operations without rebuilding common primitives.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -8,94 +8,12 @@ DLT helpers for use with IOTA.
|
|
|
8
8
|
npm install @twin.org/dlt-iota
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Docker
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Quick Setup (Recommended)
|
|
16
|
-
|
|
17
|
-
The simplest way to set up the testing environment using our unified container:
|
|
18
|
-
|
|
19
|
-
```shell
|
|
20
|
-
# Start the unified container with Redis + Gas Station
|
|
21
|
-
docker run -d --name twin-gas-station-test \
|
|
22
|
-
-p 6379:6379 -p 9527:9527 -p 9184:9184 \
|
|
23
|
-
twinfoundation/twin-gas-station-test:latest
|
|
24
|
-
|
|
25
|
-
# Wait a moment for services to start, then verify
|
|
26
|
-
docker exec twin-gas-station-test redis-cli ping # Should return: PONG
|
|
27
|
-
curl http://localhost:9527/ # Should return: OK
|
|
28
|
-
|
|
29
|
-
# Services are ready - you can now run tests
|
|
30
|
-
npm run test
|
|
31
|
-
|
|
32
|
-
# When finished, cleanup
|
|
33
|
-
docker stop twin-gas-station-test && docker rm twin-gas-station-test
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
That's it! The unified container includes:
|
|
37
|
-
|
|
38
|
-
- Redis server (port 6379)
|
|
39
|
-
- IOTA Gas Station (port 9527, metrics 9184)
|
|
40
|
-
- Pre-configured with test keypair and settings
|
|
41
|
-
- Health checks and proper startup sequencing
|
|
42
|
-
|
|
43
|
-
### Alternative Setup Methods
|
|
44
|
-
|
|
45
|
-
For advanced users who prefer alternative setups:
|
|
46
|
-
|
|
47
|
-
#### Option A: Standalone Docker Images
|
|
48
|
-
|
|
49
|
-
If you prefer to run services separately:
|
|
50
|
-
|
|
51
|
-
```shell
|
|
52
|
-
# Pull the required Docker images
|
|
53
|
-
docker pull redis:7-alpine
|
|
54
|
-
docker pull iotaledger/gas-station:latest
|
|
55
|
-
|
|
56
|
-
# Start Redis
|
|
57
|
-
docker run -d --name gas-station-redis -p 6379:6379 redis:7-alpine
|
|
58
|
-
|
|
59
|
-
# Create gas station config file
|
|
60
|
-
cat > gas-station-config.yaml << EOF
|
|
61
|
-
signer-config:
|
|
62
|
-
local:
|
|
63
|
-
keypair: AKT1Ghtd+yNbI9fFCQin3FpiGx8xoUdJMe7iAhoFUm4f
|
|
64
|
-
rpc-host-ip: 0.0.0.0
|
|
65
|
-
rpc-port: 9527
|
|
66
|
-
metrics-port: 9184
|
|
67
|
-
storage-config:
|
|
68
|
-
redis:
|
|
69
|
-
redis_url: "redis://127.0.0.1:6379"
|
|
70
|
-
fullnode-url: "https://api.testnet.iota.cafe"
|
|
71
|
-
coin-init-config:
|
|
72
|
-
target-init-balance: 100000000
|
|
73
|
-
refresh-interval-sec: 86400
|
|
74
|
-
daily-gas-usage-cap: 1500000000000
|
|
75
|
-
access-controller:
|
|
76
|
-
access-policy: disabled
|
|
77
|
-
EOF
|
|
78
|
-
|
|
79
|
-
# Start IOTA Gas Station
|
|
80
|
-
docker run -d --name gas-station \
|
|
81
|
-
-p 9527:9527 -p 9184:9184 \
|
|
82
|
-
-v $(pwd)/gas-station-config.yaml:/config/config.yaml \
|
|
83
|
-
--network host \
|
|
84
|
-
-e GAS_STATION_AUTH=qEyCL6d9BKKFl/tfDGAKeGFkhUlf7FkqiGV7Xw4JUsI= \
|
|
85
|
-
iotaledger/gas-station:latest \
|
|
86
|
-
--config-path /config/config.yaml
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
#### Option B: Docker Compose
|
|
90
|
-
|
|
91
|
-
Using the IOTA gas station repository:
|
|
13
|
+
To perform testing of this component it may be necessary to launch a local instance of the gas station to communicate with.
|
|
92
14
|
|
|
93
15
|
```shell
|
|
94
|
-
|
|
95
|
-
git clone https://github.com/iotaledger/gas-station.git
|
|
96
|
-
cd gas-station/docker
|
|
97
|
-
../target/debug/tool generate-sample-config --docker-compose --config-path config.yaml --network testnet
|
|
98
|
-
GAS_STATION_AUTH=qEyCL6d9BKKFl/tfDGAKeGFkhUlf7FkqiGV7Xw4JUsI= docker-compose up -d
|
|
16
|
+
docker run -d --name twin-gas-station-test -p 6379:6379 -p 9527:9527 -p 9184:9184 -e IOTA_NODE_URL="https://api.testnet.iota.cafe" -e GAS_STATION_AUTH="qEyCL6d9BKKFl/tfDGAKeGFkhUlf7FkqiGV7Xw4JUsI=" twinfoundation/twin-gas-station-test:latest
|
|
99
17
|
```
|
|
100
18
|
|
|
101
19
|
## Examples
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
export * from "./iota.js";
|
|
4
|
+
export * from "./iotaIdentityUtils.js";
|
|
5
|
+
export * from "./iotaSmartContractUtils.js";
|
|
6
|
+
export * from "./models/IAdminCapFields.js";
|
|
7
|
+
export * from "./models/IContractData.js";
|
|
8
|
+
export * from "./models/IGasReservationResult.js";
|
|
9
|
+
export * from "./models/IGasStationConfig.js";
|
|
10
|
+
export * from "./models/IGasStationExecuteResponse.js";
|
|
11
|
+
export * from "./models/IGasStationReserveGasResponse.js";
|
|
12
|
+
export * from "./models/IGasStationReserveGasResult.js";
|
|
13
|
+
export * from "./models/IIotaClient.js";
|
|
14
|
+
export * from "./models/IIotaControllerCapInfo.js";
|
|
15
|
+
export * from "./models/IIotaTransaction.js";
|
|
16
|
+
export * from "./models/IIotaTransactionBlockResponse.js";
|
|
17
|
+
export * from "./models/IIotaConfig.js";
|
|
18
|
+
export * from "./models/IIotaDryRun.js";
|
|
19
|
+
export * from "./models/IIotaResponseOptions.js";
|
|
20
|
+
export * from "./models/IMigrationStateFields.js";
|
|
21
|
+
export * from "./models/ISmartContractDeployments.js";
|
|
22
|
+
export * from "./models/ISmartContractObject.js";
|
|
23
|
+
export * from "./models/networkTypes.js";
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yCAAyC,CAAC;AACxD,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./iota.js\";\nexport * from \"./iotaIdentityUtils.js\";\nexport * from \"./iotaSmartContractUtils.js\";\nexport * from \"./models/IAdminCapFields.js\";\nexport * from \"./models/IContractData.js\";\nexport * from \"./models/IGasReservationResult.js\";\nexport * from \"./models/IGasStationConfig.js\";\nexport * from \"./models/IGasStationExecuteResponse.js\";\nexport * from \"./models/IGasStationReserveGasResponse.js\";\nexport * from \"./models/IGasStationReserveGasResult.js\";\nexport * from \"./models/IIotaClient.js\";\nexport * from \"./models/IIotaControllerCapInfo.js\";\nexport * from \"./models/IIotaTransaction.js\";\nexport * from \"./models/IIotaTransactionBlockResponse.js\";\nexport * from \"./models/IIotaConfig.js\";\nexport * from \"./models/IIotaDryRun.js\";\nexport * from \"./models/IIotaResponseOptions.js\";\nexport * from \"./models/IMigrationStateFields.js\";\nexport * from \"./models/ISmartContractDeployments.js\";\nexport * from \"./models/ISmartContractObject.js\";\nexport * from \"./models/networkTypes.js\";\n"]}
|