@twin.org/dlt-iota 0.0.3-next.7 → 0.0.3-next.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.
- package/README.md +2 -2
- package/dist/es/iota.js +12 -10
- package/dist/es/iota.js.map +1 -1
- package/dist/types/iota.d.ts +0 -8
- package/docs/changelog.md +131 -117
- package/docs/reference/classes/Iota.md +6 -22
- package/docs/reference/classes/IotaSmartContractUtils.md +6 -6
- package/docs/reference/interfaces/IContractData.md +4 -4
- package/docs/reference/interfaces/IGasStationExecuteResponse.md +1 -1
- package/docs/reference/interfaces/IGasStationReserveGasResponse.md +1 -1
- package/docs/reference/interfaces/IIotaConfig.md +50 -8
- package/docs/reference/interfaces/IIotaResponseOptions.md +8 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -10,10 +10,10 @@ npm install @twin.org/dlt-iota
|
|
|
10
10
|
|
|
11
11
|
## Docker
|
|
12
12
|
|
|
13
|
-
To perform testing of this component it may be necessary to launch a local instance to communicate with.
|
|
13
|
+
To perform testing of this component it may be necessary to launch a local instance of the gas station to communicate with.
|
|
14
14
|
|
|
15
15
|
```shell
|
|
16
|
-
docker run -d --name twin-
|
|
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
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## Examples
|
package/dist/es/iota.js
CHANGED
|
@@ -23,17 +23,19 @@ export class Iota {
|
|
|
23
23
|
*/
|
|
24
24
|
static DEFAULT_COIN_TYPE = 4218;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Runtime name for the class.
|
|
27
27
|
*/
|
|
28
|
-
static
|
|
28
|
+
static CLASS_NAME = "Iota";
|
|
29
29
|
/**
|
|
30
|
-
* Default
|
|
30
|
+
* Default scan range.
|
|
31
|
+
* @internal
|
|
31
32
|
*/
|
|
32
|
-
static
|
|
33
|
+
static _DEFAULT_SCAN_RANGE = 1000;
|
|
33
34
|
/**
|
|
34
|
-
*
|
|
35
|
+
* Default inclusion timeout.
|
|
36
|
+
* @internal
|
|
35
37
|
*/
|
|
36
|
-
static
|
|
38
|
+
static _DEFAULT_INCLUSION_TIMEOUT = 60;
|
|
37
39
|
/**
|
|
38
40
|
* Create a new IOTA client.
|
|
39
41
|
* @param config The configuration.
|
|
@@ -54,7 +56,7 @@ export class Iota {
|
|
|
54
56
|
config.vaultMnemonicId ??= Iota.DEFAULT_MNEMONIC_SECRET_NAME;
|
|
55
57
|
config.vaultSeedId ??= Iota.DEFAULT_SEED_SECRET_NAME;
|
|
56
58
|
config.coinType ??= Iota.DEFAULT_COIN_TYPE;
|
|
57
|
-
config.inclusionTimeoutSeconds ??= Iota.
|
|
59
|
+
config.inclusionTimeoutSeconds ??= Iota._DEFAULT_INCLUSION_TIMEOUT;
|
|
58
60
|
}
|
|
59
61
|
/**
|
|
60
62
|
* Get addresses for the identity.
|
|
@@ -155,7 +157,7 @@ export class Iota {
|
|
|
155
157
|
await Iota.dryRunTransaction(client, logging, transaction, owner, options.dryRunLabel);
|
|
156
158
|
}
|
|
157
159
|
const seed = await Iota.getSeed(config, vaultConnector, identity);
|
|
158
|
-
const addressKeyPair = Iota.findAddress(config.maxAddressScanRange ?? Iota.
|
|
160
|
+
const addressKeyPair = Iota.findAddress(config.maxAddressScanRange ?? Iota._DEFAULT_SCAN_RANGE, config.coinType ?? Iota.DEFAULT_COIN_TYPE, seed, owner);
|
|
159
161
|
const keypair = Ed25519Keypair.fromSecretKey(addressKeyPair.privateKey);
|
|
160
162
|
try {
|
|
161
163
|
const response = await client.signAndExecuteTransaction({
|
|
@@ -365,7 +367,7 @@ export class Iota {
|
|
|
365
367
|
* @returns The confirmed transaction response.
|
|
366
368
|
*/
|
|
367
369
|
static async waitForTransactionConfirmation(client, digest, config, options) {
|
|
368
|
-
const timeoutMs = (config.inclusionTimeoutSeconds ?? Iota.
|
|
370
|
+
const timeoutMs = (config.inclusionTimeoutSeconds ?? Iota._DEFAULT_INCLUSION_TIMEOUT) * 1000;
|
|
369
371
|
return client.waitForTransaction({
|
|
370
372
|
digest,
|
|
371
373
|
timeout: timeoutMs,
|
|
@@ -416,7 +418,7 @@ export class Iota {
|
|
|
416
418
|
const unsignedTxBytes = await transaction.build({ client });
|
|
417
419
|
// Sign the transaction with the user's private key
|
|
418
420
|
const seed = await Iota.getSeed(config, vaultConnector, identity);
|
|
419
|
-
const addressKeyPair = Iota.findAddress(config.maxAddressScanRange ?? Iota.
|
|
421
|
+
const addressKeyPair = Iota.findAddress(config.maxAddressScanRange ?? Iota._DEFAULT_SCAN_RANGE, config.coinType ?? Iota.DEFAULT_COIN_TYPE, seed, owner);
|
|
420
422
|
const keypair = Ed25519Keypair.fromSecretKey(addressKeyPair.privateKey);
|
|
421
423
|
const signature = await keypair.signTransaction(unsignedTxBytes);
|
|
422
424
|
return await Iota.executeAndConfirmGasStationTransaction(config, client, gasReservation.reservationId, unsignedTxBytes, signature.signature, options);
|
package/dist/es/iota.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iota.js","sourceRoot":"","sources":["../../src/iota.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EACN,SAAS,EACT,SAAS,EACT,YAAY,EACZ,MAAM,EACN,EAAE,EACF,YAAY,EAEZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIzD,OAAO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,CAAC;IACjB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { IotaClient } from \"@iota/iota-sdk/client\";\nimport { Ed25519Keypair } from \"@iota/iota-sdk/keypairs/ed25519\";\nimport { Transaction } from \"@iota/iota-sdk/transactions\";\nimport {\n\tBaseError,\n\tConverter,\n\tGeneralError,\n\tGuards,\n\tIs,\n\tStringHelper,\n\ttype IError\n} from \"@twin.org/core\";\nimport { Bip39, Bip44, KeyType } from \"@twin.org/crypto\";\nimport type { ILoggingComponent } from \"@twin.org/logging-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { IVaultConnector } from \"@twin.org/vault-models\";\nimport { FetchHelper, HttpMethod } from \"@twin.org/web\";\nimport type { IGasReservationResult } from \"./models/IGasReservationResult.js\";\nimport type { IGasStationConfig } from \"./models/IGasStationConfig.js\";\nimport type { IGasStationExecuteResponse } from \"./models/IGasStationExecuteResponse.js\";\nimport type { IGasStationReserveGasResponse } from \"./models/IGasStationReserveGasResponse.js\";\nimport type { IIotaClient } from \"./models/IIotaClient.js\";\nimport type { IIotaConfig } from \"./models/IIotaConfig.js\";\nimport type { IIotaDryRun } from \"./models/IIotaDryRun.js\";\nimport type { IIotaResponseOptions } from \"./models/IIotaResponseOptions.js\";\nimport type { IIotaTransaction } from \"./models/IIotaTransaction.js\";\nimport type { IIotaTransactionBlockResponse } from \"./models/IIotaTransactionBlockResponse.js\";\n\n/**\n * Class for performing operations on IOTA.\n */\nexport class Iota {\n\t/**\n\t * Default name for the mnemonic secret.\n\t */\n\tpublic static readonly DEFAULT_MNEMONIC_SECRET_NAME: string = \"mnemonic\";\n\n\t/**\n\t * Default name for the seed secret.\n\t */\n\tpublic static readonly DEFAULT_SEED_SECRET_NAME: string = \"seed\";\n\n\t/**\n\t * Default coin type.\n\t */\n\tpublic static readonly DEFAULT_COIN_TYPE: number = 4218;\n\n\t/**\n\t * Default scan range.\n\t */\n\tpublic static readonly DEFAULT_SCAN_RANGE: number = 1000;\n\n\t/**\n\t * Default inclusion timeout.\n\t */\n\tpublic static readonly DEFAULT_INCLUSION_TIMEOUT: number = 60;\n\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<Iota>();\n\n\t/**\n\t * Create a new IOTA client.\n\t * @param config The configuration.\n\t * @returns The client instance.\n\t */\n\tpublic static createClient(config: IIotaConfig): IIotaClient {\n\t\tGuards.object(Iota.CLASS_NAME, nameof(config), config);\n\t\tGuards.object(Iota.CLASS_NAME, nameof(config.clientOptions), config.clientOptions);\n\t\tGuards.string(Iota.CLASS_NAME, nameof(config.clientOptions.url), config.clientOptions.url);\n\n\t\treturn new IotaClient(config.clientOptions);\n\t}\n\n\t/**\n\t * Create configuration using defaults where necessary.\n\t * @param config The configuration to populate.\n\t */\n\tpublic static populateConfig(config: IIotaConfig): void {\n\t\tGuards.object<IIotaConfig[\"clientOptions\"]>(\n\t\t\tIota.CLASS_NAME,\n\t\t\tnameof(config.clientOptions),\n\t\t\tconfig.clientOptions\n\t\t);\n\n\t\tconfig.vaultMnemonicId ??= Iota.DEFAULT_MNEMONIC_SECRET_NAME;\n\t\tconfig.vaultSeedId ??= Iota.DEFAULT_SEED_SECRET_NAME;\n\t\tconfig.coinType ??= Iota.DEFAULT_COIN_TYPE;\n\t\tconfig.inclusionTimeoutSeconds ??= Iota.DEFAULT_INCLUSION_TIMEOUT;\n\t}\n\n\t/**\n\t * Get addresses for the identity.\n\t * @param seed The seed to use for generating addresses.\n\t * @param coinType The coin type to use.\n\t * @param accountIndex The account index to get the addresses for.\n\t * @param startAddressIndex The start index for the addresses.\n\t * @param count The number of addresses to generate.\n\t * @param isInternal Whether the addresses are internal.\n\t * @returns The list of addresses.\n\t */\n\tpublic static getAddresses(\n\t\tseed: Uint8Array,\n\t\tcoinType: number,\n\t\taccountIndex: number,\n\t\tstartAddressIndex: number,\n\t\tcount: number,\n\t\tisInternal?: boolean\n\t): string[] {\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(coinType), coinType);\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(accountIndex), accountIndex);\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(startAddressIndex), startAddressIndex);\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(count), count);\n\n\t\tconst addresses: string[] = [];\n\n\t\tfor (let i = startAddressIndex; i < startAddressIndex + count; i++) {\n\t\t\t// Derive the keypair using the seed\n\t\t\tconst keyPair = Bip44.keyPair(\n\t\t\t\tseed,\n\t\t\t\tKeyType.Ed25519,\n\t\t\t\tcoinType ?? Iota.DEFAULT_COIN_TYPE,\n\t\t\t\taccountIndex,\n\t\t\t\tisInternal ?? false,\n\t\t\t\ti\n\t\t\t);\n\n\t\t\tconst keypair = Ed25519Keypair.fromSecretKey(keyPair.privateKey);\n\t\t\taddresses.push(keypair.getPublicKey().toIotaAddress());\n\t\t}\n\n\t\treturn addresses;\n\t}\n\n\t/**\n\t * Get a key pair for the specified index.\n\t * @param seed The seed to use for generating the key pair.\n\t * @param coinType The coin type to use.\n\t * @param accountIndex The account index to get the key pair for.\n\t * @param addressIndex The address index to get the key pair for.\n\t * @param isInternal Whether the address is internal.\n\t * @returns The key pair containing private key and public key.\n\t */\n\tpublic static getKeyPair(\n\t\tseed: Uint8Array,\n\t\tcoinType: number,\n\t\taccountIndex: number,\n\t\taddressIndex: number,\n\t\tisInternal?: boolean\n\t): {\n\t\tprivateKey: Uint8Array;\n\t\tpublicKey: Uint8Array;\n\t} {\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(coinType), coinType);\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(accountIndex), accountIndex);\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(addressIndex), addressIndex);\n\n\t\tconst keyPair = Bip44.keyPair(\n\t\t\tseed,\n\t\t\tKeyType.Ed25519,\n\t\t\tcoinType ?? Iota.DEFAULT_COIN_TYPE,\n\t\t\taccountIndex,\n\t\t\tisInternal ?? false,\n\t\t\taddressIndex\n\t\t);\n\n\t\treturn keyPair;\n\t}\n\n\t/**\n\t * Create a new transaction instance.\n\t * @returns A new transaction instance.\n\t */\n\tpublic static createTransaction(): IIotaTransaction {\n\t\treturn new Transaction();\n\t}\n\n\t/**\n\t * Prepare and post a transaction.\n\t * @param config The configuration.\n\t * @param vaultConnector The vault connector.\n\t * @param logging The logging component.\n\t * @param identity The identity of the user to access the vault keys.\n\t * @param client The client instance.\n\t * @param source The source address.\n\t * @param amount The amount to transfer.\n\t * @param recipient The recipient address.\n\t * @param options The transaction options.\n\t * @returns The transaction result.\n\t */\n\tpublic static async prepareAndPostValueTransaction(\n\t\tconfig: IIotaConfig,\n\t\tvaultConnector: IVaultConnector,\n\t\tlogging: ILoggingComponent | undefined,\n\t\tidentity: string,\n\t\tclient: IIotaClient,\n\t\tsource: string,\n\t\tamount: bigint,\n\t\trecipient: string,\n\t\toptions?: IIotaResponseOptions\n\t): Promise<IIotaTransactionBlockResponse> {\n\t\ttry {\n\t\t\tconst txb = new Transaction();\n\t\t\tconst [coin] = txb.splitCoins(txb.gas, [txb.pure.u64(amount)]);\n\t\t\ttxb.transferObjects([coin], txb.pure.address(recipient));\n\n\t\t\t// Check if gas station configuration is present\n\t\t\tif (Is.object<IGasStationConfig>(config.gasStation)) {\n\t\t\t\treturn await Iota.prepareAndPostGasStationTransaction(\n\t\t\t\t\tconfig,\n\t\t\t\t\tvaultConnector,\n\t\t\t\t\tidentity,\n\t\t\t\t\tclient,\n\t\t\t\t\tsource,\n\t\t\t\t\ttxb\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst result = await Iota.prepareAndPostTransaction(\n\t\t\t\tconfig,\n\t\t\t\tvaultConnector,\n\t\t\t\tlogging,\n\t\t\t\tidentity,\n\t\t\t\tclient,\n\t\t\t\tsource,\n\t\t\t\ttxb,\n\t\t\t\toptions\n\t\t\t);\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tthrow new GeneralError(\n\t\t\t\tIota.CLASS_NAME,\n\t\t\t\t\"valueTransactionFailed\",\n\t\t\t\tundefined,\n\t\t\t\tIota.extractPayloadError(error)\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Prepare and post a transaction.\n\t * @param config The configuration.\n\t * @param vaultConnector The vault connector.\n\t * @param logging The logging component.\n\t * @param identity The identity of the user to access the vault keys.\n\t * @param client The client instance.\n\t * @param owner The owner of the address.\n\t * @param transaction The transaction to execute.\n\t * @param options The transaction options.\n\t * @returns The transaction response.\n\t */\n\tpublic static async prepareAndPostTransaction(\n\t\tconfig: IIotaConfig,\n\t\tvaultConnector: IVaultConnector,\n\t\tlogging: ILoggingComponent | undefined,\n\t\tidentity: string,\n\t\tclient: IIotaClient,\n\t\towner: string,\n\t\ttransaction: IIotaTransaction,\n\t\toptions?: IIotaResponseOptions\n\t): Promise<IIotaTransactionBlockResponse> {\n\t\t// Check if gas station configuration is present\n\t\tif (Is.object<IGasStationConfig>(config.gasStation)) {\n\t\t\treturn Iota.prepareAndPostGasStationTransaction(\n\t\t\t\tconfig,\n\t\t\t\tvaultConnector,\n\t\t\t\tidentity,\n\t\t\t\tclient,\n\t\t\t\towner,\n\t\t\t\ttransaction,\n\t\t\t\toptions\n\t\t\t);\n\t\t}\n\n\t\t// Traditional transaction flow\n\t\t// Dry run the transaction if cost logging is enabled to get the gas and storage costs\n\t\tif (Is.stringValue(options?.dryRunLabel)) {\n\t\t\tawait Iota.dryRunTransaction(client, logging, transaction, owner, options.dryRunLabel);\n\t\t}\n\n\t\tconst seed = await Iota.getSeed(config, vaultConnector, identity);\n\t\tconst addressKeyPair = Iota.findAddress(\n\t\t\tconfig.maxAddressScanRange ?? Iota.DEFAULT_SCAN_RANGE,\n\t\t\tconfig.coinType ?? Iota.DEFAULT_COIN_TYPE,\n\t\t\tseed,\n\t\t\towner\n\t\t);\n\t\tconst keypair = Ed25519Keypair.fromSecretKey(addressKeyPair.privateKey);\n\n\t\ttry {\n\t\t\tconst response = await client.signAndExecuteTransaction({\n\t\t\t\ttransaction,\n\t\t\t\tsigner: keypair,\n\t\t\t\trequestType: \"WaitForLocalExecution\",\n\t\t\t\toptions: {\n\t\t\t\t\tshowEffects: options?.showEffects ?? true,\n\t\t\t\t\tshowEvents: options?.showEvents ?? true,\n\t\t\t\t\tshowObjectChanges: options?.showObjectChanges ?? true\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (options?.waitForConfirmation ?? true) {\n\t\t\t\t// Wait for transaction to be indexed and available over API\n\t\t\t\tconst confirmedTransaction = await Iota.waitForTransactionConfirmation(\n\t\t\t\t\tclient,\n\t\t\t\t\tresponse.digest,\n\t\t\t\t\tconfig,\n\t\t\t\t\t{\n\t\t\t\t\t\tshowEffects: options?.showEffects ?? true,\n\t\t\t\t\t\tshowEvents: options?.showEvents ?? true,\n\t\t\t\t\t\tshowObjectChanges: options?.showObjectChanges ?? true\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\treturn confirmedTransaction;\n\t\t\t}\n\n\t\t\treturn response;\n\t\t} catch (error) {\n\t\t\tthrow new GeneralError(\n\t\t\t\tIota.CLASS_NAME,\n\t\t\t\t\"transactionFailed\",\n\t\t\t\tundefined,\n\t\t\t\tIota.extractPayloadError(error)\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Get the seed from the vault.\n\t * @param config The configuration to use.\n\t * @param vaultConnector The vault connector to use.\n\t * @param identity The identity of the user to access the vault keys.\n\t * @returns The seed.\n\t */\n\tpublic static async getSeed(\n\t\tconfig: IIotaConfig,\n\t\tvaultConnector: IVaultConnector,\n\t\tidentity: string\n\t): Promise<Uint8Array> {\n\t\ttry {\n\t\t\tconst seedBase64 = await vaultConnector.getSecret<string>(\n\t\t\t\tIota.buildSeedKey(identity, config.vaultSeedId)\n\t\t\t);\n\t\t\treturn Converter.base64ToBytes(seedBase64);\n\t\t} catch {}\n\n\t\tconst mnemonic = await vaultConnector.getSecret<string>(\n\t\t\tIota.buildMnemonicKey(identity, config.vaultMnemonicId)\n\t\t);\n\n\t\treturn Bip39.mnemonicToSeed(mnemonic);\n\t}\n\n\t/**\n\t * Find the address in the seed.\n\t * @param maxScanRange The maximum range to scan.\n\t * @param coinType The coin type to use.\n\t * @param seed The seed to use.\n\t * @param address The address to find.\n\t * @returns The address key pair.\n\t * @throws Error if the address is not found.\n\t */\n\tpublic static findAddress(\n\t\tmaxScanRange: number,\n\t\tcoinType: number,\n\t\tseed: Uint8Array,\n\t\taddress: string\n\t): {\n\t\taddress: string;\n\t\tprivateKey: Uint8Array;\n\t\tpublicKey: Uint8Array;\n\t} {\n\t\tfor (let i = 0; i < maxScanRange; i++) {\n\t\t\tconst addressKeyPair = Bip44.address(seed, KeyType.Ed25519, coinType, 0, false, i);\n\n\t\t\tif (addressKeyPair.address === address) {\n\t\t\t\treturn addressKeyPair;\n\t\t\t}\n\t\t}\n\n\t\tthrow new GeneralError(Iota.CLASS_NAME, \"addressNotFound\", { address });\n\t}\n\n\t/**\n\t * Extract error from SDK payload.\n\t * Errors from the IOTA SDK are usually not JSON strings but objects.\n\t * @param error The error to extract.\n\t * @returns The extracted error.\n\t */\n\tpublic static extractPayloadError(error: unknown): IError {\n\t\tif (Is.object<{ code?: string; message?: string; inner?: unknown; cause?: unknown }>(error)) {\n\t\t\tif (!Is.empty(error.inner)) {\n\t\t\t\terror.inner = Iota.extractPayloadError(error.inner);\n\t\t\t}\n\t\t\tif (!Is.empty(error.cause)) {\n\t\t\t\terror.cause = Iota.extractPayloadError(error.cause);\n\t\t\t}\n\n\t\t\tif (error.code === \"InsufficientGas\") {\n\t\t\t\treturn new GeneralError(Iota.CLASS_NAME, \"insufficientFunds\");\n\t\t\t} else if (error.message?.startsWith(\"ErrorObject\")) {\n\t\t\t\tconst msg = /message: \"(.*)\"/.exec(error.message);\n\t\t\t\tif (msg && msg.length > 1) {\n\t\t\t\t\terror = msg[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst baseError = BaseError.fromError(error);\n\t\tif (baseError.name === \"Base\" && !Is.stringValue(baseError.source)) {\n\t\t\tbaseError.name = \"IOTA\";\n\t\t\tbaseError.source = Iota.CLASS_NAME;\n\t\t}\n\t\treturn baseError;\n\t}\n\n\t/**\n\t * Get the key for storing the mnemonic.\n\t * @param identity The identity to use.\n\t * @param vaultMnemonicId The mnemonic ID to use.\n\t * @returns The mnemonic key.\n\t */\n\tpublic static buildMnemonicKey(identity: string, vaultMnemonicId?: string): string {\n\t\treturn `${identity}/${vaultMnemonicId ?? Iota.DEFAULT_MNEMONIC_SECRET_NAME}`;\n\t}\n\n\t/**\n\t * Get the key for storing the seed.\n\t * @param identity The identity to use.\n\t * @param vaultSeedId The seed ID to use.\n\t * @returns The seed key.\n\t */\n\tpublic static buildSeedKey(identity: string, vaultSeedId?: string): string {\n\t\treturn `${identity}/${vaultSeedId ?? Iota.DEFAULT_SEED_SECRET_NAME}`;\n\t}\n\n\t/**\n\t * Check if the package exists on the network.\n\t * @param client The client to use.\n\t * @param packageId The package ID to check.\n\t * @returns True if the package exists, false otherwise.\n\t */\n\tpublic static async packageExistsOnNetwork(\n\t\tclient: IIotaClient,\n\t\tpackageId: string\n\t): Promise<boolean> {\n\t\ttry {\n\t\t\tconst packageObject = await client.getObject({\n\t\t\t\tid: packageId,\n\t\t\t\toptions: {\n\t\t\t\t\tshowType: true\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (\"error\" in packageObject) {\n\t\t\t\tif (packageObject?.error?.code === \"notExists\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tthrow new GeneralError(Iota.CLASS_NAME, \"packageObjectError\", {\n\t\t\t\t\tpackageId,\n\t\t\t\t\terror: packageObject.error\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tthrow new GeneralError(\n\t\t\t\tIota.CLASS_NAME,\n\t\t\t\t\"packageNotFoundOnNetwork\",\n\t\t\t\t{\n\t\t\t\t\tpackageId\n\t\t\t\t},\n\t\t\t\tIota.extractPayloadError(error)\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Dry run a transaction and log the results.\n\t * @param client The IOTA client.\n\t * @param logging The logging component.\n\t * @param txb The transaction to dry run.\n\t * @param sender The sender address.\n\t * @param operation The operation to log.\n\t * @returns void.\n\t */\n\tpublic static async dryRunTransaction(\n\t\tclient: IIotaClient,\n\t\tlogging: ILoggingComponent | undefined,\n\t\ttxb: IIotaTransaction,\n\t\tsender: string,\n\t\toperation: string\n\t): Promise<IIotaDryRun> {\n\t\ttry {\n\t\t\ttxb.setSender(sender);\n\n\t\t\tconst builtTx = await txb.build({\n\t\t\t\tclient,\n\t\t\t\tonlyTransactionKind: false\n\t\t\t});\n\n\t\t\tconst dryRunResult = await client.dryRunTransactionBlock({\n\t\t\t\ttransactionBlock: builtTx\n\t\t\t});\n\n\t\t\tif (dryRunResult.effects.status?.status !== \"success\") {\n\t\t\t\tthrow new GeneralError(Iota.CLASS_NAME, \"dryRunFailed\", {\n\t\t\t\t\terror: dryRunResult.effects?.status?.error\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst result = {\n\t\t\t\tstatus: dryRunResult.effects.status.status,\n\t\t\t\tcosts: {\n\t\t\t\t\tcomputationCost: dryRunResult.effects.gasUsed.computationCost,\n\t\t\t\t\tcomputationCostBurned: dryRunResult.effects.gasUsed.computationCostBurned,\n\t\t\t\t\tstorageCost: dryRunResult.effects.gasUsed.storageCost,\n\t\t\t\t\tstorageRebate: dryRunResult.effects.gasUsed.storageRebate,\n\t\t\t\t\tnonRefundableStorageFee: dryRunResult.effects.gasUsed.nonRefundableStorageFee\n\t\t\t\t},\n\t\t\t\tevents: dryRunResult.events ?? [],\n\t\t\t\tbalanceChanges: dryRunResult.balanceChanges ?? [],\n\t\t\t\tobjectChanges: dryRunResult.objectChanges ?? []\n\t\t\t};\n\n\t\t\tawait logging?.log({\n\t\t\t\tlevel: \"info\",\n\t\t\t\tsource: Iota.CLASS_NAME,\n\t\t\t\tts: Date.now(),\n\t\t\t\tmessage: \"transactionCosts\",\n\t\t\t\tdata: {\n\t\t\t\t\toperation,\n\t\t\t\t\tcost: JSON.stringify(result)\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tif (BaseError.isErrorName(error, GeneralError.CLASS_NAME)) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tthrow new GeneralError(\n\t\t\t\tIota.CLASS_NAME,\n\t\t\t\t\"dryRunFailed\",\n\t\t\t\tundefined,\n\t\t\t\tIota.extractPayloadError(error)\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Wait for a transaction to be indexed and available over the API.\n\t * @param client The IOTA client instance.\n\t * @param digest The digest of the transaction to wait for.\n\t * @param config The IOTA configuration.\n\t * @param options Additional options for the transaction query.\n\t * @param options.showEffects Whether to show effects.\n\t * @param options.showEvents Whether to show events.\n\t * @param options.showObjectChanges Whether to show object changes.\n\t * @returns The confirmed transaction response.\n\t */\n\tpublic static async waitForTransactionConfirmation(\n\t\tclient: IIotaClient,\n\t\tdigest: string,\n\t\tconfig: IIotaConfig,\n\t\toptions?: {\n\t\t\tshowEffects?: boolean;\n\t\t\tshowEvents?: boolean;\n\t\t\tshowObjectChanges?: boolean;\n\t\t}\n\t): Promise<IIotaTransactionBlockResponse> {\n\t\tconst timeoutMs = (config.inclusionTimeoutSeconds ?? Iota.DEFAULT_INCLUSION_TIMEOUT) * 1000;\n\n\t\treturn client.waitForTransaction({\n\t\t\tdigest,\n\t\t\ttimeout: timeoutMs,\n\t\t\toptions: {\n\t\t\t\tshowEffects: options?.showEffects ?? true,\n\t\t\t\tshowEvents: options?.showEvents ?? true,\n\t\t\t\tshowObjectChanges: options?.showObjectChanges ?? true\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Check if the error is an abort error with a specific code.\n\t * @param error The error to check.\n\t * @param code The error code to check for.\n\t * @returns True if the error is an abort error, false otherwise.\n\t */\n\tpublic static isAbortError(error: unknown, code: number): boolean {\n\t\tconst err = BaseError.fromError(error);\n\t\tif (Is.stringValue(err.properties?.error)) {\n\t\t\tconst abortCodeMatch = /abort\\s+code\\s*:\\s*(\\d+)/i.exec(err.properties.error);\n\t\t\treturn abortCodeMatch?.[1] === code.toString();\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Prepare and post a transaction using gas station sponsoring.\n\t * @param config The configuration.\n\t * @param vaultConnector The vault connector.\n\t * @param identity The identity of the user to access the vault keys.\n\t * @param client The client instance.\n\t * @param owner The owner of the address.\n\t * @param transaction The transaction to execute.\n\t * @param options Response options including confirmation behavior.\n\t * @returns The transaction response.\n\t */\n\tpublic static async prepareAndPostGasStationTransaction(\n\t\tconfig: IIotaConfig,\n\t\tvaultConnector: IVaultConnector,\n\t\tidentity: string,\n\t\tclient: IIotaClient,\n\t\towner: string,\n\t\ttransaction: IIotaTransaction,\n\t\toptions?: IIotaResponseOptions\n\t): Promise<IIotaTransactionBlockResponse> {\n\t\tGuards.object(Iota.CLASS_NAME, nameof(config.gasStation), config.gasStation);\n\n\t\ttry {\n\t\t\t// Reserve gas from the gas station\n\t\t\tconst gasBudget = config.gasBudget ?? 50000000;\n\t\t\tconst gasReservation = await Iota.reserveGas(config, gasBudget);\n\n\t\t\t// Set transaction parameters for sponsoring\n\t\t\ttransaction.setSender(owner);\n\t\t\ttransaction.setGasOwner(gasReservation.sponsorAddress);\n\t\t\ttransaction.setGasPayment(gasReservation.gasCoins);\n\t\t\ttransaction.setGasBudget(gasBudget);\n\n\t\t\t// Build and sign transaction\n\t\t\tconst unsignedTxBytes = await transaction.build({ client });\n\n\t\t\t// Sign the transaction with the user's private key\n\t\t\tconst seed = await Iota.getSeed(config, vaultConnector, identity);\n\t\t\tconst addressKeyPair = Iota.findAddress(\n\t\t\t\tconfig.maxAddressScanRange ?? Iota.DEFAULT_SCAN_RANGE,\n\t\t\t\tconfig.coinType ?? Iota.DEFAULT_COIN_TYPE,\n\t\t\t\tseed,\n\t\t\t\towner\n\t\t\t);\n\t\t\tconst keypair = Ed25519Keypair.fromSecretKey(addressKeyPair.privateKey);\n\t\t\tconst signature = await keypair.signTransaction(unsignedTxBytes);\n\n\t\t\treturn await Iota.executeAndConfirmGasStationTransaction(\n\t\t\t\tconfig,\n\t\t\t\tclient,\n\t\t\t\tgasReservation.reservationId,\n\t\t\t\tunsignedTxBytes,\n\t\t\t\tsignature.signature,\n\t\t\t\toptions\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tthrow new GeneralError(\n\t\t\t\tIota.CLASS_NAME,\n\t\t\t\t\"gasStationTransactionFailed\",\n\t\t\t\tundefined,\n\t\t\t\tIota.extractPayloadError(error)\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Reserve gas from the gas station.\n\t * @param config The configuration containing gas station settings.\n\t * @param gasBudget The gas budget to reserve.\n\t * @returns The gas reservation result.\n\t */\n\tpublic static async reserveGas(\n\t\tconfig: IIotaConfig,\n\t\tgasBudget: number\n\t): Promise<IGasReservationResult> {\n\t\tGuards.object(Iota.CLASS_NAME, nameof(config.gasStation), config.gasStation);\n\n\t\tconst requestData = {\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\tgas_budget: gasBudget,\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\treserve_duration_secs: 30\n\t\t};\n\n\t\tconst baseUrl = StringHelper.trimTrailingSlashes(config.gasStation.gasStationUrl);\n\t\tconst result = await FetchHelper.fetchJson<typeof requestData, IGasStationReserveGasResponse>(\n\t\t\tIota.CLASS_NAME,\n\t\t\t`${baseUrl}/v1/reserve_gas`,\n\t\t\tHttpMethod.POST,\n\t\t\trequestData,\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${config.gasStation.gasStationAuthToken}`\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tconst apiResponse = result.result;\n\n\t\treturn {\n\t\t\tsponsorAddress: apiResponse.sponsor_address,\n\t\t\treservationId: apiResponse.reservation_id,\n\t\t\tgasCoins: apiResponse.gas_coins\n\t\t};\n\t}\n\n\t/**\n\t * Execute a sponsored transaction through the gas station.\n\t * @param config The configuration containing gas station settings.\n\t * @param reservationId The reservation ID from gas reservation.\n\t * @param transactionBytes The unsigned transaction bytes.\n\t * @param userSignature The user's signature.\n\t * @returns The transaction response.\n\t */\n\tpublic static async executeGasStationTransaction(\n\t\tconfig: IIotaConfig,\n\t\treservationId: number,\n\t\ttransactionBytes: Uint8Array,\n\t\tuserSignature: string\n\t): Promise<IIotaTransactionBlockResponse> {\n\t\tGuards.object<IGasStationConfig>(Iota.CLASS_NAME, nameof(config.gasStation), config.gasStation);\n\n\t\tconst requestData = {\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\treservation_id: reservationId,\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\ttx_bytes: Converter.bytesToBase64(transactionBytes),\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\tuser_sig: userSignature\n\t\t};\n\n\t\tconst baseUrl = StringHelper.trimTrailingSlashes(config.gasStation.gasStationUrl);\n\t\tconst result = await FetchHelper.fetchJson<typeof requestData, IGasStationExecuteResponse>(\n\t\t\tIota.CLASS_NAME,\n\t\t\t`${baseUrl}/v1/execute_tx`,\n\t\t\tHttpMethod.POST,\n\t\t\trequestData,\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${config.gasStation.gasStationAuthToken}`\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tconst effectsData = result.effects;\n\n\t\t// Match IotaTransactionBlockResponse format\n\t\treturn {\n\t\t\tdigest: effectsData.transactionDigest,\n\t\t\teffects: effectsData as unknown,\n\t\t\tevents: [],\n\t\t\tobjectChanges: [],\n\t\t\tconfirmedLocalExecution: true\n\t\t} as unknown as IIotaTransactionBlockResponse;\n\t}\n\n\t/**\n\t * Execute and confirm a gas station transaction.\n\t * @param config The configuration containing gas station settings.\n\t * @param client The IOTA client for confirmation.\n\t * @param reservationId The reservation ID from gas reservation.\n\t * @param transactionBytes The unsigned transaction bytes.\n\t * @param userSignature The user's signature.\n\t * @param options Response options including confirmation behavior.\n\t * @returns The transaction response (confirmed if waitForConfirmation is true).\n\t */\n\tpublic static async executeAndConfirmGasStationTransaction(\n\t\tconfig: IIotaConfig,\n\t\tclient: IIotaClient,\n\t\treservationId: number,\n\t\ttransactionBytes: Uint8Array,\n\t\tuserSignature: string,\n\t\toptions?: IIotaResponseOptions\n\t): Promise<IIotaTransactionBlockResponse> {\n\t\tGuards.object<IGasStationConfig>(Iota.CLASS_NAME, nameof(config.gasStation), config.gasStation);\n\n\t\tconst response = await Iota.executeGasStationTransaction(\n\t\t\tconfig,\n\t\t\treservationId,\n\t\t\ttransactionBytes,\n\t\t\tuserSignature\n\t\t);\n\n\t\tif (options?.waitForConfirmation ?? true) {\n\t\t\tconst confirmedTransaction = await Iota.waitForTransactionConfirmation(\n\t\t\t\tclient,\n\t\t\t\tresponse.digest,\n\t\t\t\tconfig,\n\t\t\t\t{\n\t\t\t\t\tshowEffects: options?.showEffects ?? true,\n\t\t\t\t\tshowEvents: options?.showEvents ?? true,\n\t\t\t\t\tshowObjectChanges: options?.showObjectChanges ?? true\n\t\t\t\t}\n\t\t\t);\n\n\t\t\treturn confirmedTransaction;\n\t\t}\n\n\t\treturn response;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"iota.js","sourceRoot":"","sources":["../../src/iota.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EACN,SAAS,EACT,SAAS,EACT,YAAY,EACZ,MAAM,EACN,EAAE,EACF,YAAY,EAEZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,C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AC;QAED,OAAO,QAAQ,CAAC;IACjB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { IotaClient } from \"@iota/iota-sdk/client\";\nimport { Ed25519Keypair } from \"@iota/iota-sdk/keypairs/ed25519\";\nimport { Transaction } from \"@iota/iota-sdk/transactions\";\nimport {\n\tBaseError,\n\tConverter,\n\tGeneralError,\n\tGuards,\n\tIs,\n\tStringHelper,\n\ttype IError\n} from \"@twin.org/core\";\nimport { Bip39, Bip44, KeyType } from \"@twin.org/crypto\";\nimport type { ILoggingComponent } from \"@twin.org/logging-models\";\nimport { nameof } from \"@twin.org/nameof\";\nimport type { IVaultConnector } from \"@twin.org/vault-models\";\nimport { FetchHelper, HttpMethod } from \"@twin.org/web\";\nimport type { IGasReservationResult } from \"./models/IGasReservationResult.js\";\nimport type { IGasStationConfig } from \"./models/IGasStationConfig.js\";\nimport type { IGasStationExecuteResponse } from \"./models/IGasStationExecuteResponse.js\";\nimport type { IGasStationReserveGasResponse } from \"./models/IGasStationReserveGasResponse.js\";\nimport type { IIotaClient } from \"./models/IIotaClient.js\";\nimport type { IIotaConfig } from \"./models/IIotaConfig.js\";\nimport type { IIotaDryRun } from \"./models/IIotaDryRun.js\";\nimport type { IIotaResponseOptions } from \"./models/IIotaResponseOptions.js\";\nimport type { IIotaTransaction } from \"./models/IIotaTransaction.js\";\nimport type { IIotaTransactionBlockResponse } from \"./models/IIotaTransactionBlockResponse.js\";\n\n/**\n * Class for performing operations on IOTA.\n */\nexport class Iota {\n\t/**\n\t * Default name for the mnemonic secret.\n\t */\n\tpublic static readonly DEFAULT_MNEMONIC_SECRET_NAME: string = \"mnemonic\";\n\n\t/**\n\t * Default name for the seed secret.\n\t */\n\tpublic static readonly DEFAULT_SEED_SECRET_NAME: string = \"seed\";\n\n\t/**\n\t * Default coin type.\n\t */\n\tpublic static readonly DEFAULT_COIN_TYPE: number = 4218;\n\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = nameof<Iota>();\n\n\t/**\n\t * Default scan range.\n\t * @internal\n\t */\n\tprivate static readonly _DEFAULT_SCAN_RANGE: number = 1000;\n\n\t/**\n\t * Default inclusion timeout.\n\t * @internal\n\t */\n\tprivate static readonly _DEFAULT_INCLUSION_TIMEOUT: number = 60;\n\n\t/**\n\t * Create a new IOTA client.\n\t * @param config The configuration.\n\t * @returns The client instance.\n\t */\n\tpublic static createClient(config: IIotaConfig): IIotaClient {\n\t\tGuards.object(Iota.CLASS_NAME, nameof(config), config);\n\t\tGuards.object(Iota.CLASS_NAME, nameof(config.clientOptions), config.clientOptions);\n\t\tGuards.string(Iota.CLASS_NAME, nameof(config.clientOptions.url), config.clientOptions.url);\n\n\t\treturn new IotaClient(config.clientOptions);\n\t}\n\n\t/**\n\t * Create configuration using defaults where necessary.\n\t * @param config The configuration to populate.\n\t */\n\tpublic static populateConfig(config: IIotaConfig): void {\n\t\tGuards.object<IIotaConfig[\"clientOptions\"]>(\n\t\t\tIota.CLASS_NAME,\n\t\t\tnameof(config.clientOptions),\n\t\t\tconfig.clientOptions\n\t\t);\n\n\t\tconfig.vaultMnemonicId ??= Iota.DEFAULT_MNEMONIC_SECRET_NAME;\n\t\tconfig.vaultSeedId ??= Iota.DEFAULT_SEED_SECRET_NAME;\n\t\tconfig.coinType ??= Iota.DEFAULT_COIN_TYPE;\n\t\tconfig.inclusionTimeoutSeconds ??= Iota._DEFAULT_INCLUSION_TIMEOUT;\n\t}\n\n\t/**\n\t * Get addresses for the identity.\n\t * @param seed The seed to use for generating addresses.\n\t * @param coinType The coin type to use.\n\t * @param accountIndex The account index to get the addresses for.\n\t * @param startAddressIndex The start index for the addresses.\n\t * @param count The number of addresses to generate.\n\t * @param isInternal Whether the addresses are internal.\n\t * @returns The list of addresses.\n\t */\n\tpublic static getAddresses(\n\t\tseed: Uint8Array,\n\t\tcoinType: number,\n\t\taccountIndex: number,\n\t\tstartAddressIndex: number,\n\t\tcount: number,\n\t\tisInternal?: boolean\n\t): string[] {\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(coinType), coinType);\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(accountIndex), accountIndex);\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(startAddressIndex), startAddressIndex);\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(count), count);\n\n\t\tconst addresses: string[] = [];\n\n\t\tfor (let i = startAddressIndex; i < startAddressIndex + count; i++) {\n\t\t\t// Derive the keypair using the seed\n\t\t\tconst keyPair = Bip44.keyPair(\n\t\t\t\tseed,\n\t\t\t\tKeyType.Ed25519,\n\t\t\t\tcoinType ?? Iota.DEFAULT_COIN_TYPE,\n\t\t\t\taccountIndex,\n\t\t\t\tisInternal ?? false,\n\t\t\t\ti\n\t\t\t);\n\n\t\t\tconst keypair = Ed25519Keypair.fromSecretKey(keyPair.privateKey);\n\t\t\taddresses.push(keypair.getPublicKey().toIotaAddress());\n\t\t}\n\n\t\treturn addresses;\n\t}\n\n\t/**\n\t * Get a key pair for the specified index.\n\t * @param seed The seed to use for generating the key pair.\n\t * @param coinType The coin type to use.\n\t * @param accountIndex The account index to get the key pair for.\n\t * @param addressIndex The address index to get the key pair for.\n\t * @param isInternal Whether the address is internal.\n\t * @returns The key pair containing private key and public key.\n\t */\n\tpublic static getKeyPair(\n\t\tseed: Uint8Array,\n\t\tcoinType: number,\n\t\taccountIndex: number,\n\t\taddressIndex: number,\n\t\tisInternal?: boolean\n\t): {\n\t\tprivateKey: Uint8Array;\n\t\tpublicKey: Uint8Array;\n\t} {\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(coinType), coinType);\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(accountIndex), accountIndex);\n\t\tGuards.integer(Iota.CLASS_NAME, nameof(addressIndex), addressIndex);\n\n\t\tconst keyPair = Bip44.keyPair(\n\t\t\tseed,\n\t\t\tKeyType.Ed25519,\n\t\t\tcoinType ?? Iota.DEFAULT_COIN_TYPE,\n\t\t\taccountIndex,\n\t\t\tisInternal ?? false,\n\t\t\taddressIndex\n\t\t);\n\n\t\treturn keyPair;\n\t}\n\n\t/**\n\t * Create a new transaction instance.\n\t * @returns A new transaction instance.\n\t */\n\tpublic static createTransaction(): IIotaTransaction {\n\t\treturn new Transaction();\n\t}\n\n\t/**\n\t * Prepare and post a transaction.\n\t * @param config The configuration.\n\t * @param vaultConnector The vault connector.\n\t * @param logging The logging component.\n\t * @param identity The identity of the user to access the vault keys.\n\t * @param client The client instance.\n\t * @param source The source address.\n\t * @param amount The amount to transfer.\n\t * @param recipient The recipient address.\n\t * @param options The transaction options.\n\t * @returns The transaction result.\n\t */\n\tpublic static async prepareAndPostValueTransaction(\n\t\tconfig: IIotaConfig,\n\t\tvaultConnector: IVaultConnector,\n\t\tlogging: ILoggingComponent | undefined,\n\t\tidentity: string,\n\t\tclient: IIotaClient,\n\t\tsource: string,\n\t\tamount: bigint,\n\t\trecipient: string,\n\t\toptions?: IIotaResponseOptions\n\t): Promise<IIotaTransactionBlockResponse> {\n\t\ttry {\n\t\t\tconst txb = new Transaction();\n\t\t\tconst [coin] = txb.splitCoins(txb.gas, [txb.pure.u64(amount)]);\n\t\t\ttxb.transferObjects([coin], txb.pure.address(recipient));\n\n\t\t\t// Check if gas station configuration is present\n\t\t\tif (Is.object<IGasStationConfig>(config.gasStation)) {\n\t\t\t\treturn await Iota.prepareAndPostGasStationTransaction(\n\t\t\t\t\tconfig,\n\t\t\t\t\tvaultConnector,\n\t\t\t\t\tidentity,\n\t\t\t\t\tclient,\n\t\t\t\t\tsource,\n\t\t\t\t\ttxb\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst result = await Iota.prepareAndPostTransaction(\n\t\t\t\tconfig,\n\t\t\t\tvaultConnector,\n\t\t\t\tlogging,\n\t\t\t\tidentity,\n\t\t\t\tclient,\n\t\t\t\tsource,\n\t\t\t\ttxb,\n\t\t\t\toptions\n\t\t\t);\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tthrow new GeneralError(\n\t\t\t\tIota.CLASS_NAME,\n\t\t\t\t\"valueTransactionFailed\",\n\t\t\t\tundefined,\n\t\t\t\tIota.extractPayloadError(error)\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Prepare and post a transaction.\n\t * @param config The configuration.\n\t * @param vaultConnector The vault connector.\n\t * @param logging The logging component.\n\t * @param identity The identity of the user to access the vault keys.\n\t * @param client The client instance.\n\t * @param owner The owner of the address.\n\t * @param transaction The transaction to execute.\n\t * @param options The transaction options.\n\t * @returns The transaction response.\n\t */\n\tpublic static async prepareAndPostTransaction(\n\t\tconfig: IIotaConfig,\n\t\tvaultConnector: IVaultConnector,\n\t\tlogging: ILoggingComponent | undefined,\n\t\tidentity: string,\n\t\tclient: IIotaClient,\n\t\towner: string,\n\t\ttransaction: IIotaTransaction,\n\t\toptions?: IIotaResponseOptions\n\t): Promise<IIotaTransactionBlockResponse> {\n\t\t// Check if gas station configuration is present\n\t\tif (Is.object<IGasStationConfig>(config.gasStation)) {\n\t\t\treturn Iota.prepareAndPostGasStationTransaction(\n\t\t\t\tconfig,\n\t\t\t\tvaultConnector,\n\t\t\t\tidentity,\n\t\t\t\tclient,\n\t\t\t\towner,\n\t\t\t\ttransaction,\n\t\t\t\toptions\n\t\t\t);\n\t\t}\n\n\t\t// Traditional transaction flow\n\t\t// Dry run the transaction if cost logging is enabled to get the gas and storage costs\n\t\tif (Is.stringValue(options?.dryRunLabel)) {\n\t\t\tawait Iota.dryRunTransaction(client, logging, transaction, owner, options.dryRunLabel);\n\t\t}\n\n\t\tconst seed = await Iota.getSeed(config, vaultConnector, identity);\n\t\tconst addressKeyPair = Iota.findAddress(\n\t\t\tconfig.maxAddressScanRange ?? Iota._DEFAULT_SCAN_RANGE,\n\t\t\tconfig.coinType ?? Iota.DEFAULT_COIN_TYPE,\n\t\t\tseed,\n\t\t\towner\n\t\t);\n\t\tconst keypair = Ed25519Keypair.fromSecretKey(addressKeyPair.privateKey);\n\n\t\ttry {\n\t\t\tconst response = await client.signAndExecuteTransaction({\n\t\t\t\ttransaction,\n\t\t\t\tsigner: keypair,\n\t\t\t\trequestType: \"WaitForLocalExecution\",\n\t\t\t\toptions: {\n\t\t\t\t\tshowEffects: options?.showEffects ?? true,\n\t\t\t\t\tshowEvents: options?.showEvents ?? true,\n\t\t\t\t\tshowObjectChanges: options?.showObjectChanges ?? true\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (options?.waitForConfirmation ?? true) {\n\t\t\t\t// Wait for transaction to be indexed and available over API\n\t\t\t\tconst confirmedTransaction = await Iota.waitForTransactionConfirmation(\n\t\t\t\t\tclient,\n\t\t\t\t\tresponse.digest,\n\t\t\t\t\tconfig,\n\t\t\t\t\t{\n\t\t\t\t\t\tshowEffects: options?.showEffects ?? true,\n\t\t\t\t\t\tshowEvents: options?.showEvents ?? true,\n\t\t\t\t\t\tshowObjectChanges: options?.showObjectChanges ?? true\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\treturn confirmedTransaction;\n\t\t\t}\n\n\t\t\treturn response;\n\t\t} catch (error) {\n\t\t\tthrow new GeneralError(\n\t\t\t\tIota.CLASS_NAME,\n\t\t\t\t\"transactionFailed\",\n\t\t\t\tundefined,\n\t\t\t\tIota.extractPayloadError(error)\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Get the seed from the vault.\n\t * @param config The configuration to use.\n\t * @param vaultConnector The vault connector to use.\n\t * @param identity The identity of the user to access the vault keys.\n\t * @returns The seed.\n\t */\n\tpublic static async getSeed(\n\t\tconfig: IIotaConfig,\n\t\tvaultConnector: IVaultConnector,\n\t\tidentity: string\n\t): Promise<Uint8Array> {\n\t\ttry {\n\t\t\tconst seedBase64 = await vaultConnector.getSecret<string>(\n\t\t\t\tIota.buildSeedKey(identity, config.vaultSeedId)\n\t\t\t);\n\t\t\treturn Converter.base64ToBytes(seedBase64);\n\t\t} catch {}\n\n\t\tconst mnemonic = await vaultConnector.getSecret<string>(\n\t\t\tIota.buildMnemonicKey(identity, config.vaultMnemonicId)\n\t\t);\n\n\t\treturn Bip39.mnemonicToSeed(mnemonic);\n\t}\n\n\t/**\n\t * Find the address in the seed.\n\t * @param maxScanRange The maximum range to scan.\n\t * @param coinType The coin type to use.\n\t * @param seed The seed to use.\n\t * @param address The address to find.\n\t * @returns The address key pair.\n\t * @throws Error if the address is not found.\n\t */\n\tpublic static findAddress(\n\t\tmaxScanRange: number,\n\t\tcoinType: number,\n\t\tseed: Uint8Array,\n\t\taddress: string\n\t): {\n\t\taddress: string;\n\t\tprivateKey: Uint8Array;\n\t\tpublicKey: Uint8Array;\n\t} {\n\t\tfor (let i = 0; i < maxScanRange; i++) {\n\t\t\tconst addressKeyPair = Bip44.address(seed, KeyType.Ed25519, coinType, 0, false, i);\n\n\t\t\tif (addressKeyPair.address === address) {\n\t\t\t\treturn addressKeyPair;\n\t\t\t}\n\t\t}\n\n\t\tthrow new GeneralError(Iota.CLASS_NAME, \"addressNotFound\", { address });\n\t}\n\n\t/**\n\t * Extract error from SDK payload.\n\t * Errors from the IOTA SDK are usually not JSON strings but objects.\n\t * @param error The error to extract.\n\t * @returns The extracted error.\n\t */\n\tpublic static extractPayloadError(error: unknown): IError {\n\t\tif (Is.object<{ code?: string; message?: string; inner?: unknown; cause?: unknown }>(error)) {\n\t\t\tif (!Is.empty(error.inner)) {\n\t\t\t\terror.inner = Iota.extractPayloadError(error.inner);\n\t\t\t}\n\t\t\tif (!Is.empty(error.cause)) {\n\t\t\t\terror.cause = Iota.extractPayloadError(error.cause);\n\t\t\t}\n\n\t\t\tif (error.code === \"InsufficientGas\") {\n\t\t\t\treturn new GeneralError(Iota.CLASS_NAME, \"insufficientFunds\");\n\t\t\t} else if (error.message?.startsWith(\"ErrorObject\")) {\n\t\t\t\tconst msg = /message: \"(.*)\"/.exec(error.message);\n\t\t\t\tif (msg && msg.length > 1) {\n\t\t\t\t\terror = msg[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst baseError = BaseError.fromError(error);\n\t\tif (baseError.name === \"Base\" && !Is.stringValue(baseError.source)) {\n\t\t\tbaseError.name = \"IOTA\";\n\t\t\tbaseError.source = Iota.CLASS_NAME;\n\t\t}\n\t\treturn baseError;\n\t}\n\n\t/**\n\t * Get the key for storing the mnemonic.\n\t * @param identity The identity to use.\n\t * @param vaultMnemonicId The mnemonic ID to use.\n\t * @returns The mnemonic key.\n\t */\n\tpublic static buildMnemonicKey(identity: string, vaultMnemonicId?: string): string {\n\t\treturn `${identity}/${vaultMnemonicId ?? Iota.DEFAULT_MNEMONIC_SECRET_NAME}`;\n\t}\n\n\t/**\n\t * Get the key for storing the seed.\n\t * @param identity The identity to use.\n\t * @param vaultSeedId The seed ID to use.\n\t * @returns The seed key.\n\t */\n\tpublic static buildSeedKey(identity: string, vaultSeedId?: string): string {\n\t\treturn `${identity}/${vaultSeedId ?? Iota.DEFAULT_SEED_SECRET_NAME}`;\n\t}\n\n\t/**\n\t * Check if the package exists on the network.\n\t * @param client The client to use.\n\t * @param packageId The package ID to check.\n\t * @returns True if the package exists, false otherwise.\n\t */\n\tpublic static async packageExistsOnNetwork(\n\t\tclient: IIotaClient,\n\t\tpackageId: string\n\t): Promise<boolean> {\n\t\ttry {\n\t\t\tconst packageObject = await client.getObject({\n\t\t\t\tid: packageId,\n\t\t\t\toptions: {\n\t\t\t\t\tshowType: true\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif (\"error\" in packageObject) {\n\t\t\t\tif (packageObject?.error?.code === \"notExists\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tthrow new GeneralError(Iota.CLASS_NAME, \"packageObjectError\", {\n\t\t\t\t\tpackageId,\n\t\t\t\t\terror: packageObject.error\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} catch (error) {\n\t\t\tthrow new GeneralError(\n\t\t\t\tIota.CLASS_NAME,\n\t\t\t\t\"packageNotFoundOnNetwork\",\n\t\t\t\t{\n\t\t\t\t\tpackageId\n\t\t\t\t},\n\t\t\t\tIota.extractPayloadError(error)\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Dry run a transaction and log the results.\n\t * @param client The IOTA client.\n\t * @param logging The logging component.\n\t * @param txb The transaction to dry run.\n\t * @param sender The sender address.\n\t * @param operation The operation to log.\n\t * @returns void.\n\t */\n\tpublic static async dryRunTransaction(\n\t\tclient: IIotaClient,\n\t\tlogging: ILoggingComponent | undefined,\n\t\ttxb: IIotaTransaction,\n\t\tsender: string,\n\t\toperation: string\n\t): Promise<IIotaDryRun> {\n\t\ttry {\n\t\t\ttxb.setSender(sender);\n\n\t\t\tconst builtTx = await txb.build({\n\t\t\t\tclient,\n\t\t\t\tonlyTransactionKind: false\n\t\t\t});\n\n\t\t\tconst dryRunResult = await client.dryRunTransactionBlock({\n\t\t\t\ttransactionBlock: builtTx\n\t\t\t});\n\n\t\t\tif (dryRunResult.effects.status?.status !== \"success\") {\n\t\t\t\tthrow new GeneralError(Iota.CLASS_NAME, \"dryRunFailed\", {\n\t\t\t\t\terror: dryRunResult.effects?.status?.error\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst result = {\n\t\t\t\tstatus: dryRunResult.effects.status.status,\n\t\t\t\tcosts: {\n\t\t\t\t\tcomputationCost: dryRunResult.effects.gasUsed.computationCost,\n\t\t\t\t\tcomputationCostBurned: dryRunResult.effects.gasUsed.computationCostBurned,\n\t\t\t\t\tstorageCost: dryRunResult.effects.gasUsed.storageCost,\n\t\t\t\t\tstorageRebate: dryRunResult.effects.gasUsed.storageRebate,\n\t\t\t\t\tnonRefundableStorageFee: dryRunResult.effects.gasUsed.nonRefundableStorageFee\n\t\t\t\t},\n\t\t\t\tevents: dryRunResult.events ?? [],\n\t\t\t\tbalanceChanges: dryRunResult.balanceChanges ?? [],\n\t\t\t\tobjectChanges: dryRunResult.objectChanges ?? []\n\t\t\t};\n\n\t\t\tawait logging?.log({\n\t\t\t\tlevel: \"info\",\n\t\t\t\tsource: Iota.CLASS_NAME,\n\t\t\t\tts: Date.now(),\n\t\t\t\tmessage: \"transactionCosts\",\n\t\t\t\tdata: {\n\t\t\t\t\toperation,\n\t\t\t\t\tcost: JSON.stringify(result)\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tif (BaseError.isErrorName(error, GeneralError.CLASS_NAME)) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tthrow new GeneralError(\n\t\t\t\tIota.CLASS_NAME,\n\t\t\t\t\"dryRunFailed\",\n\t\t\t\tundefined,\n\t\t\t\tIota.extractPayloadError(error)\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Wait for a transaction to be indexed and available over the API.\n\t * @param client The IOTA client instance.\n\t * @param digest The digest of the transaction to wait for.\n\t * @param config The IOTA configuration.\n\t * @param options Additional options for the transaction query.\n\t * @param options.showEffects Whether to show effects.\n\t * @param options.showEvents Whether to show events.\n\t * @param options.showObjectChanges Whether to show object changes.\n\t * @returns The confirmed transaction response.\n\t */\n\tpublic static async waitForTransactionConfirmation(\n\t\tclient: IIotaClient,\n\t\tdigest: string,\n\t\tconfig: IIotaConfig,\n\t\toptions?: {\n\t\t\tshowEffects?: boolean;\n\t\t\tshowEvents?: boolean;\n\t\t\tshowObjectChanges?: boolean;\n\t\t}\n\t): Promise<IIotaTransactionBlockResponse> {\n\t\tconst timeoutMs = (config.inclusionTimeoutSeconds ?? Iota._DEFAULT_INCLUSION_TIMEOUT) * 1000;\n\n\t\treturn client.waitForTransaction({\n\t\t\tdigest,\n\t\t\ttimeout: timeoutMs,\n\t\t\toptions: {\n\t\t\t\tshowEffects: options?.showEffects ?? true,\n\t\t\t\tshowEvents: options?.showEvents ?? true,\n\t\t\t\tshowObjectChanges: options?.showObjectChanges ?? true\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Check if the error is an abort error with a specific code.\n\t * @param error The error to check.\n\t * @param code The error code to check for.\n\t * @returns True if the error is an abort error, false otherwise.\n\t */\n\tpublic static isAbortError(error: unknown, code: number): boolean {\n\t\tconst err = BaseError.fromError(error);\n\t\tif (Is.stringValue(err.properties?.error)) {\n\t\t\tconst abortCodeMatch = /abort\\s+code\\s*:\\s*(\\d+)/i.exec(err.properties.error);\n\t\t\treturn abortCodeMatch?.[1] === code.toString();\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Prepare and post a transaction using gas station sponsoring.\n\t * @param config The configuration.\n\t * @param vaultConnector The vault connector.\n\t * @param identity The identity of the user to access the vault keys.\n\t * @param client The client instance.\n\t * @param owner The owner of the address.\n\t * @param transaction The transaction to execute.\n\t * @param options Response options including confirmation behavior.\n\t * @returns The transaction response.\n\t */\n\tpublic static async prepareAndPostGasStationTransaction(\n\t\tconfig: IIotaConfig,\n\t\tvaultConnector: IVaultConnector,\n\t\tidentity: string,\n\t\tclient: IIotaClient,\n\t\towner: string,\n\t\ttransaction: IIotaTransaction,\n\t\toptions?: IIotaResponseOptions\n\t): Promise<IIotaTransactionBlockResponse> {\n\t\tGuards.object(Iota.CLASS_NAME, nameof(config.gasStation), config.gasStation);\n\n\t\ttry {\n\t\t\t// Reserve gas from the gas station\n\t\t\tconst gasBudget = config.gasBudget ?? 50000000;\n\t\t\tconst gasReservation = await Iota.reserveGas(config, gasBudget);\n\n\t\t\t// Set transaction parameters for sponsoring\n\t\t\ttransaction.setSender(owner);\n\t\t\ttransaction.setGasOwner(gasReservation.sponsorAddress);\n\t\t\ttransaction.setGasPayment(gasReservation.gasCoins);\n\t\t\ttransaction.setGasBudget(gasBudget);\n\n\t\t\t// Build and sign transaction\n\t\t\tconst unsignedTxBytes = await transaction.build({ client });\n\n\t\t\t// Sign the transaction with the user's private key\n\t\t\tconst seed = await Iota.getSeed(config, vaultConnector, identity);\n\t\t\tconst addressKeyPair = Iota.findAddress(\n\t\t\t\tconfig.maxAddressScanRange ?? Iota._DEFAULT_SCAN_RANGE,\n\t\t\t\tconfig.coinType ?? Iota.DEFAULT_COIN_TYPE,\n\t\t\t\tseed,\n\t\t\t\towner\n\t\t\t);\n\t\t\tconst keypair = Ed25519Keypair.fromSecretKey(addressKeyPair.privateKey);\n\t\t\tconst signature = await keypair.signTransaction(unsignedTxBytes);\n\n\t\t\treturn await Iota.executeAndConfirmGasStationTransaction(\n\t\t\t\tconfig,\n\t\t\t\tclient,\n\t\t\t\tgasReservation.reservationId,\n\t\t\t\tunsignedTxBytes,\n\t\t\t\tsignature.signature,\n\t\t\t\toptions\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tthrow new GeneralError(\n\t\t\t\tIota.CLASS_NAME,\n\t\t\t\t\"gasStationTransactionFailed\",\n\t\t\t\tundefined,\n\t\t\t\tIota.extractPayloadError(error)\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Reserve gas from the gas station.\n\t * @param config The configuration containing gas station settings.\n\t * @param gasBudget The gas budget to reserve.\n\t * @returns The gas reservation result.\n\t */\n\tpublic static async reserveGas(\n\t\tconfig: IIotaConfig,\n\t\tgasBudget: number\n\t): Promise<IGasReservationResult> {\n\t\tGuards.object(Iota.CLASS_NAME, nameof(config.gasStation), config.gasStation);\n\n\t\tconst requestData = {\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\tgas_budget: gasBudget,\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\treserve_duration_secs: 30\n\t\t};\n\n\t\tconst baseUrl = StringHelper.trimTrailingSlashes(config.gasStation.gasStationUrl);\n\t\tconst result = await FetchHelper.fetchJson<typeof requestData, IGasStationReserveGasResponse>(\n\t\t\tIota.CLASS_NAME,\n\t\t\t`${baseUrl}/v1/reserve_gas`,\n\t\t\tHttpMethod.POST,\n\t\t\trequestData,\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${config.gasStation.gasStationAuthToken}`\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tconst apiResponse = result.result;\n\n\t\treturn {\n\t\t\tsponsorAddress: apiResponse.sponsor_address,\n\t\t\treservationId: apiResponse.reservation_id,\n\t\t\tgasCoins: apiResponse.gas_coins\n\t\t};\n\t}\n\n\t/**\n\t * Execute a sponsored transaction through the gas station.\n\t * @param config The configuration containing gas station settings.\n\t * @param reservationId The reservation ID from gas reservation.\n\t * @param transactionBytes The unsigned transaction bytes.\n\t * @param userSignature The user's signature.\n\t * @returns The transaction response.\n\t */\n\tpublic static async executeGasStationTransaction(\n\t\tconfig: IIotaConfig,\n\t\treservationId: number,\n\t\ttransactionBytes: Uint8Array,\n\t\tuserSignature: string\n\t): Promise<IIotaTransactionBlockResponse> {\n\t\tGuards.object<IGasStationConfig>(Iota.CLASS_NAME, nameof(config.gasStation), config.gasStation);\n\n\t\tconst requestData = {\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\treservation_id: reservationId,\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\ttx_bytes: Converter.bytesToBase64(transactionBytes),\n\t\t\t// eslint-disable-next-line camelcase\n\t\t\tuser_sig: userSignature\n\t\t};\n\n\t\tconst baseUrl = StringHelper.trimTrailingSlashes(config.gasStation.gasStationUrl);\n\t\tconst result = await FetchHelper.fetchJson<typeof requestData, IGasStationExecuteResponse>(\n\t\t\tIota.CLASS_NAME,\n\t\t\t`${baseUrl}/v1/execute_tx`,\n\t\t\tHttpMethod.POST,\n\t\t\trequestData,\n\t\t\t{\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${config.gasStation.gasStationAuthToken}`\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tconst effectsData = result.effects;\n\n\t\t// Match IotaTransactionBlockResponse format\n\t\treturn {\n\t\t\tdigest: effectsData.transactionDigest,\n\t\t\teffects: effectsData as unknown,\n\t\t\tevents: [],\n\t\t\tobjectChanges: [],\n\t\t\tconfirmedLocalExecution: true\n\t\t} as unknown as IIotaTransactionBlockResponse;\n\t}\n\n\t/**\n\t * Execute and confirm a gas station transaction.\n\t * @param config The configuration containing gas station settings.\n\t * @param client The IOTA client for confirmation.\n\t * @param reservationId The reservation ID from gas reservation.\n\t * @param transactionBytes The unsigned transaction bytes.\n\t * @param userSignature The user's signature.\n\t * @param options Response options including confirmation behavior.\n\t * @returns The transaction response (confirmed if waitForConfirmation is true).\n\t */\n\tpublic static async executeAndConfirmGasStationTransaction(\n\t\tconfig: IIotaConfig,\n\t\tclient: IIotaClient,\n\t\treservationId: number,\n\t\ttransactionBytes: Uint8Array,\n\t\tuserSignature: string,\n\t\toptions?: IIotaResponseOptions\n\t): Promise<IIotaTransactionBlockResponse> {\n\t\tGuards.object<IGasStationConfig>(Iota.CLASS_NAME, nameof(config.gasStation), config.gasStation);\n\n\t\tconst response = await Iota.executeGasStationTransaction(\n\t\t\tconfig,\n\t\t\treservationId,\n\t\t\ttransactionBytes,\n\t\t\tuserSignature\n\t\t);\n\n\t\tif (options?.waitForConfirmation ?? true) {\n\t\t\tconst confirmedTransaction = await Iota.waitForTransactionConfirmation(\n\t\t\t\tclient,\n\t\t\t\tresponse.digest,\n\t\t\t\tconfig,\n\t\t\t\t{\n\t\t\t\t\tshowEffects: options?.showEffects ?? true,\n\t\t\t\t\tshowEvents: options?.showEvents ?? true,\n\t\t\t\t\tshowObjectChanges: options?.showObjectChanges ?? true\n\t\t\t\t}\n\t\t\t);\n\n\t\t\treturn confirmedTransaction;\n\t\t}\n\n\t\treturn response;\n\t}\n}\n"]}
|
package/dist/types/iota.d.ts
CHANGED
|
@@ -24,14 +24,6 @@ export declare class Iota {
|
|
|
24
24
|
* Default coin type.
|
|
25
25
|
*/
|
|
26
26
|
static readonly DEFAULT_COIN_TYPE: number;
|
|
27
|
-
/**
|
|
28
|
-
* Default scan range.
|
|
29
|
-
*/
|
|
30
|
-
static readonly DEFAULT_SCAN_RANGE: number;
|
|
31
|
-
/**
|
|
32
|
-
* Default inclusion timeout.
|
|
33
|
-
*/
|
|
34
|
-
static readonly DEFAULT_INCLUSION_TIMEOUT: number;
|
|
35
27
|
/**
|
|
36
28
|
* Runtime name for the class.
|
|
37
29
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -1,292 +1,306 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.0.3-next.
|
|
3
|
+
## [0.0.3-next.9](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.3-next.8...dlt-iota-v0.0.3-next.9) (2026-05-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* private statics ([f6b3684](https://github.com/iotaledger/twin-dlt/commit/f6b3684469256e62d55c250663780d70106b1343))
|
|
9
|
+
|
|
10
|
+
## [0.0.3-next.8](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.3-next.7...dlt-iota-v0.0.3-next.8) (2026-03-16)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Miscellaneous Chores
|
|
14
|
+
|
|
15
|
+
* **dlt-iota:** Synchronize repo versions
|
|
16
|
+
|
|
17
|
+
## [0.0.3-next.7](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.3-next.6...dlt-iota-v0.0.3-next.7) (2026-03-13)
|
|
4
18
|
|
|
5
19
|
|
|
6
20
|
### Bug Fixes
|
|
7
21
|
|
|
8
|
-
* buffer usage required for identity ([#60](https://github.com/
|
|
22
|
+
* buffer usage required for identity ([#60](https://github.com/iotaledger/twin-dlt/issues/60)) ([0ba7d16](https://github.com/iotaledger/twin-dlt/commit/0ba7d165662b0083aa2b4c1325dd8c2e65defa2e))
|
|
9
23
|
|
|
10
|
-
## [0.0.3-next.6](https://github.com/
|
|
24
|
+
## [0.0.3-next.6](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.3-next.5...dlt-iota-v0.0.3-next.6) (2026-03-12)
|
|
11
25
|
|
|
12
26
|
|
|
13
27
|
### Features
|
|
14
28
|
|
|
15
|
-
* add IotaIdentityUtils to resolve IOTA identity controller cap info ([#57](https://github.com/
|
|
29
|
+
* add IotaIdentityUtils to resolve IOTA identity controller cap info ([#57](https://github.com/iotaledger/twin-dlt/issues/57)) ([f15281a](https://github.com/iotaledger/twin-dlt/commit/f15281af3b2812bde5130a1813f9c0143f1462bf))
|
|
16
30
|
|
|
17
|
-
## [0.0.3-next.5](https://github.com/
|
|
31
|
+
## [0.0.3-next.5](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.3-next.4...dlt-iota-v0.0.3-next.5) (2026-03-03)
|
|
18
32
|
|
|
19
33
|
|
|
20
34
|
### Miscellaneous Chores
|
|
21
35
|
|
|
22
36
|
* **dlt-iota:** Synchronize repo versions
|
|
23
37
|
|
|
24
|
-
## [0.0.3-next.4](https://github.com/
|
|
38
|
+
## [0.0.3-next.4](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.3-next.3...dlt-iota-v0.0.3-next.4) (2026-02-25)
|
|
25
39
|
|
|
26
40
|
|
|
27
41
|
### Features
|
|
28
42
|
|
|
29
|
-
* support more abort code errors formats ([b6d0d88](https://github.com/
|
|
43
|
+
* support more abort code errors formats ([b6d0d88](https://github.com/iotaledger/twin-dlt/commit/b6d0d880e62175de2d0d0c80d5df8c84605a6759))
|
|
30
44
|
|
|
31
|
-
## [0.0.3-next.3](https://github.com/
|
|
45
|
+
## [0.0.3-next.3](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.3-next.2...dlt-iota-v0.0.3-next.3) (2026-02-25)
|
|
32
46
|
|
|
33
47
|
|
|
34
48
|
### Features
|
|
35
49
|
|
|
36
|
-
* add context id features ([#51](https://github.com/
|
|
37
|
-
* add validate-locales ([8465099](https://github.com/
|
|
38
|
-
* adding gas station docker image config ([#24](https://github.com/
|
|
39
|
-
* blend transaction methods ([#13](https://github.com/
|
|
40
|
-
* bytecode change detection ([#43](https://github.com/
|
|
41
|
-
* consolidate environment management ([#41](https://github.com/
|
|
42
|
-
* eslint migration to flat config ([da1d12d](https://github.com/
|
|
43
|
-
* gas station integration ([#17](https://github.com/
|
|
44
|
-
* Get Key Pair method in the iota dlt ([#5](https://github.com/
|
|
45
|
-
* github action simplification and readme update ([#25](https://github.com/
|
|
46
|
-
* improve error handling ([179188d](https://github.com/
|
|
47
|
-
* improve prepareAndPostGasStationTransaction with options parameter ([#20](https://github.com/
|
|
48
|
-
* rebased release ([8ce044b](https://github.com/
|
|
49
|
-
* support alternate abort error format ([3e7ffa1](https://github.com/
|
|
50
|
-
* support alternate abort error format ([72c4136](https://github.com/
|
|
51
|
-
* update dependencies ([bfbe8fc](https://github.com/
|
|
52
|
-
* update dependencies ([f7b71c2](https://github.com/
|
|
53
|
-
* update framework core ([79fc4b9](https://github.com/
|
|
54
|
-
* upgrade capabilities ([#32](https://github.com/
|
|
55
|
-
* use shared store mechanism ([#10](https://github.com/
|
|
50
|
+
* add context id features ([#51](https://github.com/iotaledger/twin-dlt/issues/51)) ([fb68498](https://github.com/iotaledger/twin-dlt/commit/fb6849897957904ec90cf6368153aeff3bef261a))
|
|
51
|
+
* add validate-locales ([8465099](https://github.com/iotaledger/twin-dlt/commit/8465099626ab1891d419a35870fae447efc3008d))
|
|
52
|
+
* adding gas station docker image config ([#24](https://github.com/iotaledger/twin-dlt/issues/24)) ([0663303](https://github.com/iotaledger/twin-dlt/commit/06633039598ccfe5b1cf0d72332327fc151dc5c9))
|
|
53
|
+
* blend transaction methods ([#13](https://github.com/iotaledger/twin-dlt/issues/13)) ([763a93c](https://github.com/iotaledger/twin-dlt/commit/763a93cf30eaa3872ac56fa9cef512d58cdb0208))
|
|
54
|
+
* bytecode change detection ([#43](https://github.com/iotaledger/twin-dlt/issues/43)) ([528469c](https://github.com/iotaledger/twin-dlt/commit/528469c1e4f032c6a936a9724a692abe403d92f6))
|
|
55
|
+
* consolidate environment management ([#41](https://github.com/iotaledger/twin-dlt/issues/41)) ([add1618](https://github.com/iotaledger/twin-dlt/commit/add161828e5dc42880fb0a5f9d3e61e611cf92bb))
|
|
56
|
+
* eslint migration to flat config ([da1d12d](https://github.com/iotaledger/twin-dlt/commit/da1d12dcf5b24e7ba6204f540c27de191bca098e))
|
|
57
|
+
* gas station integration ([#17](https://github.com/iotaledger/twin-dlt/issues/17)) ([23c7c96](https://github.com/iotaledger/twin-dlt/commit/23c7c96858dd6a91d01306983080e1eb8860115a))
|
|
58
|
+
* Get Key Pair method in the iota dlt ([#5](https://github.com/iotaledger/twin-dlt/issues/5)) ([3179854](https://github.com/iotaledger/twin-dlt/commit/31798540b9b8be68079ba1696b29a11c84c40fa5))
|
|
59
|
+
* github action simplification and readme update ([#25](https://github.com/iotaledger/twin-dlt/issues/25)) ([b1a3988](https://github.com/iotaledger/twin-dlt/commit/b1a3988fd5e8b4bef31208a2da6d0d5fff13758d))
|
|
60
|
+
* improve error handling ([179188d](https://github.com/iotaledger/twin-dlt/commit/179188dce9bbc6add5f537cb83e50cac817e5cf9))
|
|
61
|
+
* improve prepareAndPostGasStationTransaction with options parameter ([#20](https://github.com/iotaledger/twin-dlt/issues/20)) ([778365d](https://github.com/iotaledger/twin-dlt/commit/778365d535965fb67583db93d9611bfbb944b64d))
|
|
62
|
+
* rebased release ([8ce044b](https://github.com/iotaledger/twin-dlt/commit/8ce044b93a596415852b1f7b75c3e315fe2c6b6f))
|
|
63
|
+
* support alternate abort error format ([3e7ffa1](https://github.com/iotaledger/twin-dlt/commit/3e7ffa117f4bfc121da8cdc79f69d762b35a1638))
|
|
64
|
+
* support alternate abort error format ([72c4136](https://github.com/iotaledger/twin-dlt/commit/72c41364f0ff8fd5e5859a096c05eaba46e353c7))
|
|
65
|
+
* update dependencies ([bfbe8fc](https://github.com/iotaledger/twin-dlt/commit/bfbe8fcfda80aa59d04f4ade3e4012e5291c8877))
|
|
66
|
+
* update dependencies ([f7b71c2](https://github.com/iotaledger/twin-dlt/commit/f7b71c24274b71e2d37c26c4a7e5e6d9df1dc9b7))
|
|
67
|
+
* update framework core ([79fc4b9](https://github.com/iotaledger/twin-dlt/commit/79fc4b961bd755437cad98d733ca9e25476bc03f))
|
|
68
|
+
* upgrade capabilities ([#32](https://github.com/iotaledger/twin-dlt/issues/32)) ([437219f](https://github.com/iotaledger/twin-dlt/commit/437219f0f784ec38353c01e1c8ce6bfba3b1b530))
|
|
69
|
+
* use shared store mechanism ([#10](https://github.com/iotaledger/twin-dlt/issues/10)) ([ce36214](https://github.com/iotaledger/twin-dlt/commit/ce36214577f02cbb9642f831cb2c21335c31cc9a))
|
|
56
70
|
|
|
57
71
|
|
|
58
72
|
### Bug Fixes
|
|
59
73
|
|
|
60
|
-
* added missing dependency ([#35](https://github.com/
|
|
61
|
-
* isAbortError static method ([2544c92](https://github.com/
|
|
62
|
-
* missing dependency ([40ec9bc](https://github.com/
|
|
63
|
-
* modifying logging type param ([#36](https://github.com/
|
|
74
|
+
* added missing dependency ([#35](https://github.com/iotaledger/twin-dlt/issues/35)) ([c280e8a](https://github.com/iotaledger/twin-dlt/commit/c280e8aba583a957f89929dbe5105352e59c4c3f))
|
|
75
|
+
* isAbortError static method ([2544c92](https://github.com/iotaledger/twin-dlt/commit/2544c926a5f0c4505e9f2c23d4380ced368f8470))
|
|
76
|
+
* missing dependency ([40ec9bc](https://github.com/iotaledger/twin-dlt/commit/40ec9bce5936c801f22d499fe1098884b2c1974d))
|
|
77
|
+
* modifying logging type param ([#36](https://github.com/iotaledger/twin-dlt/issues/36)) ([b884fcc](https://github.com/iotaledger/twin-dlt/commit/b884fccef5bea5c6818cf8bfa8af197d3622cac6))
|
|
64
78
|
|
|
65
|
-
## [0.0.3-next.2](https://github.com/
|
|
79
|
+
## [0.0.3-next.2](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.3-next.1...dlt-iota-v0.0.3-next.2) (2026-02-25)
|
|
66
80
|
|
|
67
81
|
|
|
68
82
|
### Features
|
|
69
83
|
|
|
70
|
-
* support alternate abort error format ([72c4136](https://github.com/
|
|
84
|
+
* support alternate abort error format ([72c4136](https://github.com/iotaledger/twin-dlt/commit/72c41364f0ff8fd5e5859a096c05eaba46e353c7))
|
|
71
85
|
|
|
72
86
|
|
|
73
87
|
### Bug Fixes
|
|
74
88
|
|
|
75
|
-
* missing dependency ([40ec9bc](https://github.com/
|
|
89
|
+
* missing dependency ([40ec9bc](https://github.com/iotaledger/twin-dlt/commit/40ec9bce5936c801f22d499fe1098884b2c1974d))
|
|
76
90
|
|
|
77
|
-
## [0.0.3-next.1](https://github.com/
|
|
91
|
+
## [0.0.3-next.1](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.3-next.0...dlt-iota-v0.0.3-next.1) (2025-11-11)
|
|
78
92
|
|
|
79
93
|
|
|
80
94
|
### Features
|
|
81
95
|
|
|
82
|
-
* add context id features ([#51](https://github.com/
|
|
83
|
-
* add validate-locales ([8465099](https://github.com/
|
|
84
|
-
* adding gas station docker image config ([#24](https://github.com/
|
|
85
|
-
* blend transaction methods ([#13](https://github.com/
|
|
86
|
-
* bytecode change detection ([#43](https://github.com/
|
|
87
|
-
* consolidate environment management ([#41](https://github.com/
|
|
88
|
-
* eslint migration to flat config ([da1d12d](https://github.com/
|
|
89
|
-
* gas station integration ([#17](https://github.com/
|
|
90
|
-
* Get Key Pair method in the iota dlt ([#5](https://github.com/
|
|
91
|
-
* github action simplification and readme update ([#25](https://github.com/
|
|
92
|
-
* improve error handling ([179188d](https://github.com/
|
|
93
|
-
* improve prepareAndPostGasStationTransaction with options parameter ([#20](https://github.com/
|
|
94
|
-
* rebased release ([8ce044b](https://github.com/
|
|
95
|
-
* update dependencies ([f7b71c2](https://github.com/
|
|
96
|
-
* update framework core ([79fc4b9](https://github.com/
|
|
97
|
-
* upgrade capabilities ([#32](https://github.com/
|
|
98
|
-
* use shared store mechanism ([#10](https://github.com/
|
|
96
|
+
* add context id features ([#51](https://github.com/iotaledger/twin-dlt/issues/51)) ([fb68498](https://github.com/iotaledger/twin-dlt/commit/fb6849897957904ec90cf6368153aeff3bef261a))
|
|
97
|
+
* add validate-locales ([8465099](https://github.com/iotaledger/twin-dlt/commit/8465099626ab1891d419a35870fae447efc3008d))
|
|
98
|
+
* adding gas station docker image config ([#24](https://github.com/iotaledger/twin-dlt/issues/24)) ([0663303](https://github.com/iotaledger/twin-dlt/commit/06633039598ccfe5b1cf0d72332327fc151dc5c9))
|
|
99
|
+
* blend transaction methods ([#13](https://github.com/iotaledger/twin-dlt/issues/13)) ([763a93c](https://github.com/iotaledger/twin-dlt/commit/763a93cf30eaa3872ac56fa9cef512d58cdb0208))
|
|
100
|
+
* bytecode change detection ([#43](https://github.com/iotaledger/twin-dlt/issues/43)) ([528469c](https://github.com/iotaledger/twin-dlt/commit/528469c1e4f032c6a936a9724a692abe403d92f6))
|
|
101
|
+
* consolidate environment management ([#41](https://github.com/iotaledger/twin-dlt/issues/41)) ([add1618](https://github.com/iotaledger/twin-dlt/commit/add161828e5dc42880fb0a5f9d3e61e611cf92bb))
|
|
102
|
+
* eslint migration to flat config ([da1d12d](https://github.com/iotaledger/twin-dlt/commit/da1d12dcf5b24e7ba6204f540c27de191bca098e))
|
|
103
|
+
* gas station integration ([#17](https://github.com/iotaledger/twin-dlt/issues/17)) ([23c7c96](https://github.com/iotaledger/twin-dlt/commit/23c7c96858dd6a91d01306983080e1eb8860115a))
|
|
104
|
+
* Get Key Pair method in the iota dlt ([#5](https://github.com/iotaledger/twin-dlt/issues/5)) ([3179854](https://github.com/iotaledger/twin-dlt/commit/31798540b9b8be68079ba1696b29a11c84c40fa5))
|
|
105
|
+
* github action simplification and readme update ([#25](https://github.com/iotaledger/twin-dlt/issues/25)) ([b1a3988](https://github.com/iotaledger/twin-dlt/commit/b1a3988fd5e8b4bef31208a2da6d0d5fff13758d))
|
|
106
|
+
* improve error handling ([179188d](https://github.com/iotaledger/twin-dlt/commit/179188dce9bbc6add5f537cb83e50cac817e5cf9))
|
|
107
|
+
* improve prepareAndPostGasStationTransaction with options parameter ([#20](https://github.com/iotaledger/twin-dlt/issues/20)) ([778365d](https://github.com/iotaledger/twin-dlt/commit/778365d535965fb67583db93d9611bfbb944b64d))
|
|
108
|
+
* rebased release ([8ce044b](https://github.com/iotaledger/twin-dlt/commit/8ce044b93a596415852b1f7b75c3e315fe2c6b6f))
|
|
109
|
+
* update dependencies ([f7b71c2](https://github.com/iotaledger/twin-dlt/commit/f7b71c24274b71e2d37c26c4a7e5e6d9df1dc9b7))
|
|
110
|
+
* update framework core ([79fc4b9](https://github.com/iotaledger/twin-dlt/commit/79fc4b961bd755437cad98d733ca9e25476bc03f))
|
|
111
|
+
* upgrade capabilities ([#32](https://github.com/iotaledger/twin-dlt/issues/32)) ([437219f](https://github.com/iotaledger/twin-dlt/commit/437219f0f784ec38353c01e1c8ce6bfba3b1b530))
|
|
112
|
+
* use shared store mechanism ([#10](https://github.com/iotaledger/twin-dlt/issues/10)) ([ce36214](https://github.com/iotaledger/twin-dlt/commit/ce36214577f02cbb9642f831cb2c21335c31cc9a))
|
|
99
113
|
|
|
100
114
|
|
|
101
115
|
### Bug Fixes
|
|
102
116
|
|
|
103
|
-
* added missing dependency ([#35](https://github.com/
|
|
104
|
-
* isAbortError static method ([2544c92](https://github.com/
|
|
105
|
-
* modifying logging type param ([#36](https://github.com/
|
|
117
|
+
* added missing dependency ([#35](https://github.com/iotaledger/twin-dlt/issues/35)) ([c280e8a](https://github.com/iotaledger/twin-dlt/commit/c280e8aba583a957f89929dbe5105352e59c4c3f))
|
|
118
|
+
* isAbortError static method ([2544c92](https://github.com/iotaledger/twin-dlt/commit/2544c926a5f0c4505e9f2c23d4380ced368f8470))
|
|
119
|
+
* modifying logging type param ([#36](https://github.com/iotaledger/twin-dlt/issues/36)) ([b884fcc](https://github.com/iotaledger/twin-dlt/commit/b884fccef5bea5c6818cf8bfa8af197d3622cac6))
|
|
106
120
|
|
|
107
|
-
## [0.0.2-next.11](https://github.com/
|
|
121
|
+
## [0.0.2-next.11](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.2-next.10...dlt-iota-v0.0.2-next.11) (2025-10-09)
|
|
108
122
|
|
|
109
123
|
|
|
110
124
|
### Features
|
|
111
125
|
|
|
112
|
-
* add validate-locales ([8465099](https://github.com/
|
|
126
|
+
* add validate-locales ([8465099](https://github.com/iotaledger/twin-dlt/commit/8465099626ab1891d419a35870fae447efc3008d))
|
|
113
127
|
|
|
114
|
-
## [0.0.2-next.10](https://github.com/
|
|
128
|
+
## [0.0.2-next.10](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.2-next.9...dlt-iota-v0.0.2-next.10) (2025-09-29)
|
|
115
129
|
|
|
116
130
|
|
|
117
131
|
### Miscellaneous Chores
|
|
118
132
|
|
|
119
133
|
* **dlt-iota:** Synchronize repo versions
|
|
120
134
|
|
|
121
|
-
## [0.0.2-next.9](https://github.com/
|
|
135
|
+
## [0.0.2-next.9](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.2-next.8...dlt-iota-v0.0.2-next.9) (2025-09-22)
|
|
122
136
|
|
|
123
137
|
|
|
124
138
|
### Features
|
|
125
139
|
|
|
126
|
-
* bytecode change detection ([#43](https://github.com/
|
|
140
|
+
* bytecode change detection ([#43](https://github.com/iotaledger/twin-dlt/issues/43)) ([528469c](https://github.com/iotaledger/twin-dlt/commit/528469c1e4f032c6a936a9724a692abe403d92f6))
|
|
127
141
|
|
|
128
|
-
## [0.0.2-next.8](https://github.com/
|
|
142
|
+
## [0.0.2-next.8](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.2-next.7...dlt-iota-v0.0.2-next.8) (2025-09-10)
|
|
129
143
|
|
|
130
144
|
|
|
131
145
|
### Features
|
|
132
146
|
|
|
133
|
-
* consolidate environment management ([#41](https://github.com/
|
|
147
|
+
* consolidate environment management ([#41](https://github.com/iotaledger/twin-dlt/issues/41)) ([add1618](https://github.com/iotaledger/twin-dlt/commit/add161828e5dc42880fb0a5f9d3e61e611cf92bb))
|
|
134
148
|
|
|
135
|
-
## [0.0.2-next.7](https://github.com/
|
|
149
|
+
## [0.0.2-next.7](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.2-next.6...dlt-iota-v0.0.2-next.7) (2025-08-29)
|
|
136
150
|
|
|
137
151
|
|
|
138
152
|
### Features
|
|
139
153
|
|
|
140
|
-
* eslint migration to flat config ([da1d12d](https://github.com/
|
|
154
|
+
* eslint migration to flat config ([da1d12d](https://github.com/iotaledger/twin-dlt/commit/da1d12dcf5b24e7ba6204f540c27de191bca098e))
|
|
141
155
|
|
|
142
|
-
## [0.0.2-next.6](https://github.com/
|
|
156
|
+
## [0.0.2-next.6](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.2-next.5...dlt-iota-v0.0.2-next.6) (2025-08-27)
|
|
143
157
|
|
|
144
158
|
|
|
145
159
|
### Miscellaneous Chores
|
|
146
160
|
|
|
147
161
|
* **dlt-iota:** Synchronize repo versions
|
|
148
162
|
|
|
149
|
-
## [0.0.2-next.5](https://github.com/
|
|
163
|
+
## [0.0.2-next.5](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.2-next.4...dlt-iota-v0.0.2-next.5) (2025-08-25)
|
|
150
164
|
|
|
151
165
|
|
|
152
166
|
### Bug Fixes
|
|
153
167
|
|
|
154
|
-
* added missing dependency ([#35](https://github.com/
|
|
155
|
-
* modifying logging type param ([#36](https://github.com/
|
|
168
|
+
* added missing dependency ([#35](https://github.com/iotaledger/twin-dlt/issues/35)) ([c280e8a](https://github.com/iotaledger/twin-dlt/commit/c280e8aba583a957f89929dbe5105352e59c4c3f))
|
|
169
|
+
* modifying logging type param ([#36](https://github.com/iotaledger/twin-dlt/issues/36)) ([b884fcc](https://github.com/iotaledger/twin-dlt/commit/b884fccef5bea5c6818cf8bfa8af197d3622cac6))
|
|
156
170
|
|
|
157
|
-
## [0.0.2-next.4](https://github.com/
|
|
171
|
+
## [0.0.2-next.4](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.2-next.3...dlt-iota-v0.0.2-next.4) (2025-08-22)
|
|
158
172
|
|
|
159
173
|
|
|
160
174
|
### Features
|
|
161
175
|
|
|
162
|
-
* upgrade capabilities ([#32](https://github.com/
|
|
176
|
+
* upgrade capabilities ([#32](https://github.com/iotaledger/twin-dlt/issues/32)) ([437219f](https://github.com/iotaledger/twin-dlt/commit/437219f0f784ec38353c01e1c8ce6bfba3b1b530))
|
|
163
177
|
|
|
164
|
-
## [0.0.2-next.3](https://github.com/
|
|
178
|
+
## [0.0.2-next.3](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.2-next.2...dlt-iota-v0.0.2-next.3) (2025-08-20)
|
|
165
179
|
|
|
166
180
|
|
|
167
181
|
### Features
|
|
168
182
|
|
|
169
|
-
* update framework core ([79fc4b9](https://github.com/
|
|
183
|
+
* update framework core ([79fc4b9](https://github.com/iotaledger/twin-dlt/commit/79fc4b961bd755437cad98d733ca9e25476bc03f))
|
|
170
184
|
|
|
171
|
-
## [0.0.2-next.2](https://github.com/
|
|
185
|
+
## [0.0.2-next.2](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.2-next.1...dlt-iota-v0.0.2-next.2) (2025-07-25)
|
|
172
186
|
|
|
173
187
|
|
|
174
188
|
### Miscellaneous Chores
|
|
175
189
|
|
|
176
190
|
* **dlt-iota:** Synchronize repo versions
|
|
177
191
|
|
|
178
|
-
## [0.0.2-next.1](https://github.com/
|
|
192
|
+
## [0.0.2-next.1](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.2-next.0...dlt-iota-v0.0.2-next.1) (2025-07-16)
|
|
179
193
|
|
|
180
194
|
|
|
181
195
|
### Features
|
|
182
196
|
|
|
183
|
-
* adding gas station docker image config ([#24](https://github.com/
|
|
184
|
-
* blend transaction methods ([#13](https://github.com/
|
|
185
|
-
* gas station integration ([#17](https://github.com/
|
|
186
|
-
* Get Key Pair method in the iota dlt ([#5](https://github.com/
|
|
187
|
-
* github action simplification and readme update ([#25](https://github.com/
|
|
188
|
-
* improve error handling ([179188d](https://github.com/
|
|
189
|
-
* improve prepareAndPostGasStationTransaction with options parameter ([#20](https://github.com/
|
|
190
|
-
* rebased release ([8ce044b](https://github.com/
|
|
191
|
-
* update dependencies ([f7b71c2](https://github.com/
|
|
192
|
-
* use shared store mechanism ([#10](https://github.com/
|
|
197
|
+
* adding gas station docker image config ([#24](https://github.com/iotaledger/twin-dlt/issues/24)) ([0663303](https://github.com/iotaledger/twin-dlt/commit/06633039598ccfe5b1cf0d72332327fc151dc5c9))
|
|
198
|
+
* blend transaction methods ([#13](https://github.com/iotaledger/twin-dlt/issues/13)) ([763a93c](https://github.com/iotaledger/twin-dlt/commit/763a93cf30eaa3872ac56fa9cef512d58cdb0208))
|
|
199
|
+
* gas station integration ([#17](https://github.com/iotaledger/twin-dlt/issues/17)) ([23c7c96](https://github.com/iotaledger/twin-dlt/commit/23c7c96858dd6a91d01306983080e1eb8860115a))
|
|
200
|
+
* Get Key Pair method in the iota dlt ([#5](https://github.com/iotaledger/twin-dlt/issues/5)) ([3179854](https://github.com/iotaledger/twin-dlt/commit/31798540b9b8be68079ba1696b29a11c84c40fa5))
|
|
201
|
+
* github action simplification and readme update ([#25](https://github.com/iotaledger/twin-dlt/issues/25)) ([b1a3988](https://github.com/iotaledger/twin-dlt/commit/b1a3988fd5e8b4bef31208a2da6d0d5fff13758d))
|
|
202
|
+
* improve error handling ([179188d](https://github.com/iotaledger/twin-dlt/commit/179188dce9bbc6add5f537cb83e50cac817e5cf9))
|
|
203
|
+
* improve prepareAndPostGasStationTransaction with options parameter ([#20](https://github.com/iotaledger/twin-dlt/issues/20)) ([778365d](https://github.com/iotaledger/twin-dlt/commit/778365d535965fb67583db93d9611bfbb944b64d))
|
|
204
|
+
* rebased release ([8ce044b](https://github.com/iotaledger/twin-dlt/commit/8ce044b93a596415852b1f7b75c3e315fe2c6b6f))
|
|
205
|
+
* update dependencies ([f7b71c2](https://github.com/iotaledger/twin-dlt/commit/f7b71c24274b71e2d37c26c4a7e5e6d9df1dc9b7))
|
|
206
|
+
* use shared store mechanism ([#10](https://github.com/iotaledger/twin-dlt/issues/10)) ([ce36214](https://github.com/iotaledger/twin-dlt/commit/ce36214577f02cbb9642f831cb2c21335c31cc9a))
|
|
193
207
|
|
|
194
208
|
|
|
195
209
|
### Bug Fixes
|
|
196
210
|
|
|
197
|
-
* isAbortError static method ([2544c92](https://github.com/
|
|
211
|
+
* isAbortError static method ([2544c92](https://github.com/iotaledger/twin-dlt/commit/2544c926a5f0c4505e9f2c23d4380ced368f8470))
|
|
198
212
|
|
|
199
213
|
## 0.0.1 (2025-07-08)
|
|
200
214
|
|
|
201
215
|
|
|
202
216
|
### Features
|
|
203
217
|
|
|
204
|
-
* adding gas station docker image config ([#24](https://github.com/
|
|
205
|
-
* blend transaction methods ([#13](https://github.com/
|
|
206
|
-
* gas station integration ([#17](https://github.com/
|
|
207
|
-
* Get Key Pair method in the iota dlt ([#5](https://github.com/
|
|
208
|
-
* github action simplification and readme update ([#25](https://github.com/
|
|
209
|
-
* improve error handling ([179188d](https://github.com/
|
|
210
|
-
* improve prepareAndPostGasStationTransaction with options parameter ([#20](https://github.com/
|
|
211
|
-
* rebased release ([8ce044b](https://github.com/
|
|
212
|
-
* release to production ([fe6a7f7](https://github.com/
|
|
213
|
-
* update dependencies ([f7b71c2](https://github.com/
|
|
214
|
-
* use shared store mechanism ([#10](https://github.com/
|
|
218
|
+
* adding gas station docker image config ([#24](https://github.com/iotaledger/twin-dlt/issues/24)) ([0663303](https://github.com/iotaledger/twin-dlt/commit/06633039598ccfe5b1cf0d72332327fc151dc5c9))
|
|
219
|
+
* blend transaction methods ([#13](https://github.com/iotaledger/twin-dlt/issues/13)) ([763a93c](https://github.com/iotaledger/twin-dlt/commit/763a93cf30eaa3872ac56fa9cef512d58cdb0208))
|
|
220
|
+
* gas station integration ([#17](https://github.com/iotaledger/twin-dlt/issues/17)) ([23c7c96](https://github.com/iotaledger/twin-dlt/commit/23c7c96858dd6a91d01306983080e1eb8860115a))
|
|
221
|
+
* Get Key Pair method in the iota dlt ([#5](https://github.com/iotaledger/twin-dlt/issues/5)) ([3179854](https://github.com/iotaledger/twin-dlt/commit/31798540b9b8be68079ba1696b29a11c84c40fa5))
|
|
222
|
+
* github action simplification and readme update ([#25](https://github.com/iotaledger/twin-dlt/issues/25)) ([b1a3988](https://github.com/iotaledger/twin-dlt/commit/b1a3988fd5e8b4bef31208a2da6d0d5fff13758d))
|
|
223
|
+
* improve error handling ([179188d](https://github.com/iotaledger/twin-dlt/commit/179188dce9bbc6add5f537cb83e50cac817e5cf9))
|
|
224
|
+
* improve prepareAndPostGasStationTransaction with options parameter ([#20](https://github.com/iotaledger/twin-dlt/issues/20)) ([778365d](https://github.com/iotaledger/twin-dlt/commit/778365d535965fb67583db93d9611bfbb944b64d))
|
|
225
|
+
* rebased release ([8ce044b](https://github.com/iotaledger/twin-dlt/commit/8ce044b93a596415852b1f7b75c3e315fe2c6b6f))
|
|
226
|
+
* release to production ([fe6a7f7](https://github.com/iotaledger/twin-dlt/commit/fe6a7f751138ea92ac22c70438261b0cea6fb238))
|
|
227
|
+
* update dependencies ([f7b71c2](https://github.com/iotaledger/twin-dlt/commit/f7b71c24274b71e2d37c26c4a7e5e6d9df1dc9b7))
|
|
228
|
+
* use shared store mechanism ([#10](https://github.com/iotaledger/twin-dlt/issues/10)) ([ce36214](https://github.com/iotaledger/twin-dlt/commit/ce36214577f02cbb9642f831cb2c21335c31cc9a))
|
|
215
229
|
|
|
216
230
|
|
|
217
231
|
### Bug Fixes
|
|
218
232
|
|
|
219
|
-
* isAbortError static method ([2544c92](https://github.com/
|
|
233
|
+
* isAbortError static method ([2544c92](https://github.com/iotaledger/twin-dlt/commit/2544c926a5f0c4505e9f2c23d4380ced368f8470))
|
|
220
234
|
|
|
221
|
-
## [0.0.1-next.29](https://github.com/
|
|
235
|
+
## [0.0.1-next.29](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.1-next.28...dlt-iota-v0.0.1-next.29) (2025-06-26)
|
|
222
236
|
|
|
223
237
|
|
|
224
238
|
### Features
|
|
225
239
|
|
|
226
|
-
* improve error handling ([179188d](https://github.com/
|
|
240
|
+
* improve error handling ([179188d](https://github.com/iotaledger/twin-dlt/commit/179188dce9bbc6add5f537cb83e50cac817e5cf9))
|
|
227
241
|
|
|
228
|
-
## [0.0.1-next.28](https://github.com/
|
|
242
|
+
## [0.0.1-next.28](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.1-next.27...dlt-iota-v0.0.1-next.28) (2025-06-23)
|
|
229
243
|
|
|
230
244
|
|
|
231
245
|
### Features
|
|
232
246
|
|
|
233
|
-
* improve prepareAndPostGasStationTransaction with options parameter ([#20](https://github.com/
|
|
247
|
+
* improve prepareAndPostGasStationTransaction with options parameter ([#20](https://github.com/iotaledger/twin-dlt/issues/20)) ([778365d](https://github.com/iotaledger/twin-dlt/commit/778365d535965fb67583db93d9611bfbb944b64d))
|
|
234
248
|
|
|
235
|
-
## [0.0.1-next.27](https://github.com/
|
|
249
|
+
## [0.0.1-next.27](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.1-next.26...dlt-iota-v0.0.1-next.27) (2025-06-18)
|
|
236
250
|
|
|
237
251
|
|
|
238
252
|
### Features
|
|
239
253
|
|
|
240
|
-
* gas station integration ([#17](https://github.com/
|
|
254
|
+
* gas station integration ([#17](https://github.com/iotaledger/twin-dlt/issues/17)) ([23c7c96](https://github.com/iotaledger/twin-dlt/commit/23c7c96858dd6a91d01306983080e1eb8860115a))
|
|
241
255
|
|
|
242
|
-
## [0.0.1-next.26](https://github.com/
|
|
256
|
+
## [0.0.1-next.26](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.1-next.25...dlt-iota-v0.0.1-next.26) (2025-06-12)
|
|
243
257
|
|
|
244
258
|
|
|
245
259
|
### Features
|
|
246
260
|
|
|
247
|
-
* update dependencies ([f7b71c2](https://github.com/
|
|
261
|
+
* update dependencies ([f7b71c2](https://github.com/iotaledger/twin-dlt/commit/f7b71c24274b71e2d37c26c4a7e5e6d9df1dc9b7))
|
|
248
262
|
|
|
249
|
-
## [0.0.1-next.25](https://github.com/
|
|
263
|
+
## [0.0.1-next.25](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.1-next.24...dlt-iota-v0.0.1-next.25) (2025-05-21)
|
|
250
264
|
|
|
251
265
|
|
|
252
266
|
### Bug Fixes
|
|
253
267
|
|
|
254
|
-
* isAbortError static method ([2544c92](https://github.com/
|
|
268
|
+
* isAbortError static method ([2544c92](https://github.com/iotaledger/twin-dlt/commit/2544c926a5f0c4505e9f2c23d4380ced368f8470))
|
|
255
269
|
|
|
256
|
-
## [0.0.1-next.24](https://github.com/
|
|
270
|
+
## [0.0.1-next.24](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.1-next.23...dlt-iota-v0.0.1-next.24) (2025-05-21)
|
|
257
271
|
|
|
258
272
|
|
|
259
273
|
### Features
|
|
260
274
|
|
|
261
|
-
* blend transaction methods ([#13](https://github.com/
|
|
275
|
+
* blend transaction methods ([#13](https://github.com/iotaledger/twin-dlt/issues/13)) ([763a93c](https://github.com/iotaledger/twin-dlt/commit/763a93cf30eaa3872ac56fa9cef512d58cdb0208))
|
|
262
276
|
|
|
263
|
-
## [0.0.1-next.23](https://github.com/
|
|
277
|
+
## [0.0.1-next.23](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.1-next.22...dlt-iota-v0.0.1-next.23) (2025-05-06)
|
|
264
278
|
|
|
265
279
|
|
|
266
280
|
### Features
|
|
267
281
|
|
|
268
|
-
* rebased release ([8ce044b](https://github.com/
|
|
282
|
+
* rebased release ([8ce044b](https://github.com/iotaledger/twin-dlt/commit/8ce044b93a596415852b1f7b75c3e315fe2c6b6f))
|
|
269
283
|
|
|
270
|
-
## [0.0.1-next.22](https://github.com/
|
|
284
|
+
## [0.0.1-next.22](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.1-next.21...dlt-iota-v0.0.1-next.22) (2025-04-17)
|
|
271
285
|
|
|
272
286
|
|
|
273
287
|
### Features
|
|
274
288
|
|
|
275
|
-
* use shared store mechanism ([#10](https://github.com/
|
|
289
|
+
* use shared store mechanism ([#10](https://github.com/iotaledger/twin-dlt/issues/10)) ([ce36214](https://github.com/iotaledger/twin-dlt/commit/ce36214577f02cbb9642f831cb2c21335c31cc9a))
|
|
276
290
|
|
|
277
|
-
## [0.0.1-next.21](https://github.com/
|
|
291
|
+
## [0.0.1-next.21](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.1-next.20...dlt-iota-v0.0.1-next.21) (2025-04-17)
|
|
278
292
|
|
|
279
293
|
|
|
280
294
|
### Miscellaneous Chores
|
|
281
295
|
|
|
282
296
|
* **dlt-iota:** Synchronize repo versions
|
|
283
297
|
|
|
284
|
-
## [0.0.1-next.20](https://github.com/
|
|
298
|
+
## [0.0.1-next.20](https://github.com/iotaledger/twin-dlt/compare/dlt-iota-v0.0.1-next.19...dlt-iota-v0.0.1-next.20) (2025-03-28)
|
|
285
299
|
|
|
286
300
|
|
|
287
301
|
### Features
|
|
288
302
|
|
|
289
|
-
* Get Key Pair method in the iota dlt ([#5](https://github.com/
|
|
303
|
+
* Get Key Pair method in the iota dlt ([#5](https://github.com/iotaledger/twin-dlt/issues/5)) ([3179854](https://github.com/iotaledger/twin-dlt/commit/31798540b9b8be68079ba1696b29a11c84c40fa5))
|
|
290
304
|
|
|
291
305
|
## v0.0.1-next.19
|
|
292
306
|
|
|
@@ -38,22 +38,6 @@ Default coin type.
|
|
|
38
38
|
|
|
39
39
|
***
|
|
40
40
|
|
|
41
|
-
### DEFAULT\_SCAN\_RANGE {#default_scan_range}
|
|
42
|
-
|
|
43
|
-
> `readonly` `static` **DEFAULT\_SCAN\_RANGE**: `number` = `1000`
|
|
44
|
-
|
|
45
|
-
Default scan range.
|
|
46
|
-
|
|
47
|
-
***
|
|
48
|
-
|
|
49
|
-
### DEFAULT\_INCLUSION\_TIMEOUT {#default_inclusion_timeout}
|
|
50
|
-
|
|
51
|
-
> `readonly` `static` **DEFAULT\_INCLUSION\_TIMEOUT**: `number` = `60`
|
|
52
|
-
|
|
53
|
-
Default inclusion timeout.
|
|
54
|
-
|
|
55
|
-
***
|
|
56
|
-
|
|
57
41
|
### CLASS\_NAME {#class_name}
|
|
58
42
|
|
|
59
43
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
@@ -246,9 +230,9 @@ The vault connector.
|
|
|
246
230
|
|
|
247
231
|
##### logging
|
|
248
232
|
|
|
249
|
-
|
|
233
|
+
`ILoggingComponent` \| `undefined`
|
|
250
234
|
|
|
251
|
-
|
|
235
|
+
The logging component.
|
|
252
236
|
|
|
253
237
|
##### identity
|
|
254
238
|
|
|
@@ -316,9 +300,9 @@ The vault connector.
|
|
|
316
300
|
|
|
317
301
|
##### logging
|
|
318
302
|
|
|
319
|
-
|
|
303
|
+
`ILoggingComponent` \| `undefined`
|
|
320
304
|
|
|
321
|
-
|
|
305
|
+
The logging component.
|
|
322
306
|
|
|
323
307
|
##### identity
|
|
324
308
|
|
|
@@ -571,9 +555,9 @@ The IOTA client.
|
|
|
571
555
|
|
|
572
556
|
##### logging
|
|
573
557
|
|
|
574
|
-
|
|
558
|
+
`ILoggingComponent` \| `undefined`
|
|
575
559
|
|
|
576
|
-
|
|
560
|
+
The logging component.
|
|
577
561
|
|
|
578
562
|
##### txb
|
|
579
563
|
|
|
@@ -58,9 +58,9 @@ The wallet connector for address generation.
|
|
|
58
58
|
|
|
59
59
|
##### logging
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
`ILoggingComponent` \| `undefined`
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
Optional logging component.
|
|
64
64
|
|
|
65
65
|
##### gasBudget
|
|
66
66
|
|
|
@@ -146,9 +146,9 @@ The wallet connector for address generation.
|
|
|
146
146
|
|
|
147
147
|
##### logging
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
`ILoggingComponent` \| `undefined`
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
Optional logging component.
|
|
152
152
|
|
|
153
153
|
##### gasBudget
|
|
154
154
|
|
|
@@ -228,9 +228,9 @@ The wallet connector for address generation.
|
|
|
228
228
|
|
|
229
229
|
##### logging
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
`ILoggingComponent` \| `undefined`
|
|
232
232
|
|
|
233
|
-
|
|
233
|
+
Optional logging component.
|
|
234
234
|
|
|
235
235
|
##### gasBudget
|
|
236
236
|
|
|
@@ -22,7 +22,7 @@ Base64-encoded package bytecode
|
|
|
22
22
|
|
|
23
23
|
### deployedPackageId? {#deployedpackageid}
|
|
24
24
|
|
|
25
|
-
> `optional` **deployedPackageId
|
|
25
|
+
> `optional` **deployedPackageId?**: `string`
|
|
26
26
|
|
|
27
27
|
Package ID from actual deployment
|
|
28
28
|
|
|
@@ -30,7 +30,7 @@ Package ID from actual deployment
|
|
|
30
30
|
|
|
31
31
|
### lastDeployedPackageId? {#lastdeployedpackageid}
|
|
32
32
|
|
|
33
|
-
> `optional` **lastDeployedPackageId
|
|
33
|
+
> `optional` **lastDeployedPackageId?**: `string`
|
|
34
34
|
|
|
35
35
|
Previous deployed package ID for upgrade chain tracking
|
|
36
36
|
|
|
@@ -38,7 +38,7 @@ Previous deployed package ID for upgrade chain tracking
|
|
|
38
38
|
|
|
39
39
|
### upgradeCapabilityId? {#upgradecapabilityid}
|
|
40
40
|
|
|
41
|
-
> `optional` **upgradeCapabilityId
|
|
41
|
+
> `optional` **upgradeCapabilityId?**: `string`
|
|
42
42
|
|
|
43
43
|
UpgradeCap object ID for package upgrades
|
|
44
44
|
|
|
@@ -46,6 +46,6 @@ UpgradeCap object ID for package upgrades
|
|
|
46
46
|
|
|
47
47
|
### migrationStateId? {#migrationstateid}
|
|
48
48
|
|
|
49
|
-
> `optional` **migrationStateId
|
|
49
|
+
> `optional` **migrationStateId?**: `string`
|
|
50
50
|
|
|
51
51
|
Migration state ID for tracking contract migrations
|
|
@@ -22,47 +22,77 @@ The network the operations are being performed on.
|
|
|
22
22
|
|
|
23
23
|
### vaultMnemonicId? {#vaultmnemonicid}
|
|
24
24
|
|
|
25
|
-
> `optional` **vaultMnemonicId
|
|
25
|
+
> `optional` **vaultMnemonicId?**: `string`
|
|
26
26
|
|
|
27
27
|
The id of the entry in the vault containing the mnemonic.
|
|
28
28
|
|
|
29
|
+
#### Default
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
mnemonic
|
|
33
|
+
```
|
|
34
|
+
|
|
29
35
|
***
|
|
30
36
|
|
|
31
37
|
### vaultSeedId? {#vaultseedid}
|
|
32
38
|
|
|
33
|
-
> `optional` **vaultSeedId
|
|
39
|
+
> `optional` **vaultSeedId?**: `string`
|
|
34
40
|
|
|
35
41
|
The id of the entry in the vault containing the seed.
|
|
36
42
|
|
|
43
|
+
#### Default
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
seed
|
|
47
|
+
```
|
|
48
|
+
|
|
37
49
|
***
|
|
38
50
|
|
|
39
51
|
### coinType? {#cointype}
|
|
40
52
|
|
|
41
|
-
> `optional` **coinType
|
|
53
|
+
> `optional` **coinType?**: `number`
|
|
42
54
|
|
|
43
55
|
The coin type.
|
|
44
56
|
|
|
57
|
+
#### Default
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
IOTA 4218
|
|
61
|
+
```
|
|
62
|
+
|
|
45
63
|
***
|
|
46
64
|
|
|
47
65
|
### maxAddressScanRange? {#maxaddressscanrange}
|
|
48
66
|
|
|
49
|
-
> `optional` **maxAddressScanRange
|
|
67
|
+
> `optional` **maxAddressScanRange?**: `number`
|
|
50
68
|
|
|
51
69
|
The maximum range to scan for addresses.
|
|
52
70
|
|
|
71
|
+
#### Default
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
1000
|
|
75
|
+
```
|
|
76
|
+
|
|
53
77
|
***
|
|
54
78
|
|
|
55
79
|
### inclusionTimeoutSeconds? {#inclusiontimeoutseconds}
|
|
56
80
|
|
|
57
|
-
> `optional` **inclusionTimeoutSeconds
|
|
81
|
+
> `optional` **inclusionTimeoutSeconds?**: `number`
|
|
58
82
|
|
|
59
83
|
The length of time to wait for the inclusion of a transaction in seconds.
|
|
60
84
|
|
|
85
|
+
#### Default
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
60
|
|
89
|
+
```
|
|
90
|
+
|
|
61
91
|
***
|
|
62
92
|
|
|
63
93
|
### gasStation? {#gasstation}
|
|
64
94
|
|
|
65
|
-
> `optional` **gasStation
|
|
95
|
+
> `optional` **gasStation?**: [`IGasStationConfig`](IGasStationConfig.md)
|
|
66
96
|
|
|
67
97
|
Gas station configuration for sponsored transactions.
|
|
68
98
|
If provided, transactions will be processed through the gas station.
|
|
@@ -71,14 +101,26 @@ If provided, transactions will be processed through the gas station.
|
|
|
71
101
|
|
|
72
102
|
### gasBudget? {#gasbudget}
|
|
73
103
|
|
|
74
|
-
> `optional` **gasBudget
|
|
104
|
+
> `optional` **gasBudget?**: `number`
|
|
75
105
|
|
|
76
106
|
The default gas budget for all transactions (including sponsored and direct).
|
|
77
107
|
|
|
108
|
+
#### Default
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
50000000
|
|
112
|
+
```
|
|
113
|
+
|
|
78
114
|
***
|
|
79
115
|
|
|
80
116
|
### enableCostLogging? {#enablecostlogging}
|
|
81
117
|
|
|
82
|
-
> `optional` **enableCostLogging
|
|
118
|
+
> `optional` **enableCostLogging?**: `boolean`
|
|
83
119
|
|
|
84
120
|
Enable cost logging for transactions.
|
|
121
|
+
|
|
122
|
+
#### Default
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
false
|
|
126
|
+
```
|
|
@@ -10,14 +10,20 @@ Configuration for IOTA.
|
|
|
10
10
|
|
|
11
11
|
### waitForConfirmation? {#waitforconfirmation}
|
|
12
12
|
|
|
13
|
-
> `optional` **waitForConfirmation
|
|
13
|
+
> `optional` **waitForConfirmation?**: `boolean`
|
|
14
14
|
|
|
15
15
|
Wait for confirmation of the transaction.
|
|
16
16
|
|
|
17
|
+
#### Default
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
true
|
|
21
|
+
```
|
|
22
|
+
|
|
17
23
|
***
|
|
18
24
|
|
|
19
25
|
### dryRunLabel? {#dryrunlabel}
|
|
20
26
|
|
|
21
|
-
> `optional` **dryRunLabel
|
|
27
|
+
> `optional` **dryRunLabel?**: `string`
|
|
22
28
|
|
|
23
29
|
Dry run the transaction with this label, if not set no dry run will occur.
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/dlt-iota",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.9",
|
|
4
4
|
"description": "IOTA distributed ledger utilities for clients, transactions, and contract operations.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/
|
|
7
|
+
"url": "git+https://github.com/iotaledger/dlt.git",
|
|
8
8
|
"directory": "packages/dlt-iota"
|
|
9
9
|
},
|
|
10
10
|
"author": "cornel.filip@iota.org",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@iota/bcs": "1.
|
|
18
|
-
"@iota/identity-wasm": "1.9.
|
|
19
|
-
"@iota/iota-sdk": "1.
|
|
17
|
+
"@iota/bcs": "1.6.0",
|
|
18
|
+
"@iota/identity-wasm": "1.9.5-beta.1",
|
|
19
|
+
"@iota/iota-sdk": "1.13.0",
|
|
20
20
|
"@twin.org/core": "next",
|
|
21
21
|
"@twin.org/crypto": "next",
|
|
22
22
|
"@twin.org/logging-models": "next",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"dlt"
|
|
50
50
|
],
|
|
51
51
|
"bugs": {
|
|
52
|
-
"url": "git+https://github.com/
|
|
52
|
+
"url": "git+https://github.com/iotaledger/dlt/issues"
|
|
53
53
|
},
|
|
54
54
|
"homepage": "https://twindev.org"
|
|
55
55
|
}
|