diff --git a/.eslintrc.json b/.eslintrc.json index 4fc768f..b9aaf20 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,7 +4,11 @@ "es2021": true, "node": true }, - "extends": ["standard-with-typescript", "plugin:prettier/recommended"], + "extends": [ + "plugin:jsdoc/recommended-typescript-error", + "standard-with-typescript", + "plugin:prettier/recommended" + ], "overrides": [ { "env": { @@ -21,7 +25,7 @@ "ecmaVersion": "latest", "sourceType": "module" }, - "plugins": ["prettier", "filenames"], + "plugins": ["jsdoc", "prettier", "filenames"], "rules": { "@typescript-eslint/no-misused-promises": [ "error", diff --git a/package.json b/package.json index a6e4e7b..1320636 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "eslint-config-standard-with-typescript": "^43.0.1", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsdoc": "^48.2.9", "eslint-plugin-n": "^16.6.2", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-promise": "^6.1.1", diff --git a/packages/networks/bitcoin/src/assets/Coin.ts b/packages/networks/bitcoin/src/assets/Coin.ts index 0ba8e44..1132e8b 100644 --- a/packages/networks/bitcoin/src/assets/Coin.ts +++ b/packages/networks/bitcoin/src/assets/Coin.ts @@ -17,36 +17,36 @@ export class Coin implements CoinInterface { provider: Provider /** - * @param {Provider} provider network provider + * @param provider network provider */ constructor(provider?: Provider) { this.provider = provider ?? Provider.instance } /** - * @returns {string} Coin name + * @returns Coin name */ getName(): string { return 'Bitcoin' } /** - * @returns {string} Coin symbol + * @returns Coin symbol */ getSymbol(): string { return 'BTC' } /** - * @returns {number} Decimal value of the coin + * @returns Decimal value of the coin */ getDecimals(): number { return 8 } /** - * @param {WalletAddress} owner Wallet address - * @returns {Promise} Wallet balance as currency of COIN + * @param owner Wallet address + * @returns Wallet balance as currency of COIN */ async getBalance(owner: WalletAddress): Promise { const addressStatsApi = this.provider.createEndpoint('address/' + owner) @@ -57,10 +57,10 @@ export class Coin implements CoinInterface { } /** - * @param {WalletAddress} sender Sender wallet address - * @param {WalletAddress} receiver Receiver wallet address - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Transaction signer + * @param sender Sender wallet address + * @param receiver Receiver wallet address + * @param amount Amount of assets that will be transferred + * @returns Transaction signer */ async transfer( sender: WalletAddress, diff --git a/packages/networks/bitcoin/src/browser/Wallet.ts b/packages/networks/bitcoin/src/browser/Wallet.ts index b5b1763..375d280 100644 --- a/packages/networks/bitcoin/src/browser/Wallet.ts +++ b/packages/networks/bitcoin/src/browser/Wallet.ts @@ -43,8 +43,8 @@ export class Wallet implements WalletInterface} + * @param config connection configuration + * @returns WalletAddress */ async connect(config?: ConnectConfig): Promise { return await new Promise((resolve, reject) => { @@ -125,29 +125,29 @@ export class Wallet implements WalletInterface { return await this.adapter.isDetected() } /** - * @returns {boolean} + * @returns connection status */ async isConnected(): Promise { return await this.adapter.isConnected() } /** - * @returns {Promise} + * @returns wallet address */ async getAddress(): Promise { return await this.walletProvider.getAddress() } /** - * @param {string} message - * @returns {Promise} + * @param message message to sign + * @returns signed message */ async signMessage(message: string): Promise { return await new Promise((resolve, reject) => { @@ -163,8 +163,8 @@ export class Wallet implements WalletInterface} + * @param transactionSigner transaction signer + * @returns transaction id */ async sendTransaction(transactionSigner: TransactionSigner): Promise { const data = transactionSigner.getRawData() @@ -181,9 +181,8 @@ export class Wallet implements WalletInterface void): void { this.walletProvider.on(eventName, callback) diff --git a/packages/networks/bitcoin/src/models/CoinTransaction.ts b/packages/networks/bitcoin/src/models/CoinTransaction.ts index 47fd00f..6ad9770 100644 --- a/packages/networks/bitcoin/src/models/CoinTransaction.ts +++ b/packages/networks/bitcoin/src/models/CoinTransaction.ts @@ -5,7 +5,7 @@ import type { WalletAddress, CoinTransactionInterface, TransferAmount } from '@m export class CoinTransaction extends Transaction implements CoinTransactionInterface { /** - * @returns {Promise} Wallet address of the receiver of transaction + * @returns Wallet address of the receiver of transaction */ async getReceiver(): Promise { const data = await this.getData() @@ -13,14 +13,14 @@ export class CoinTransaction extends Transaction implements CoinTransactionInter } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSender(): Promise { return await this.getSigner() } /** - * @returns {Promise} Amount of coin that will be transferred + * @returns Amount of coin that will be transferred */ async getAmount(): Promise { const data = await this.getData() @@ -28,10 +28,10 @@ export class CoinTransaction extends Transaction implements CoinTransactionInter } /** - * @param {AssetDirectionEnum} direction - Direction of the transaction (asset) - * @param {WalletAddress} address - Wallet address of the receiver or sender of the transaction, dependant on direction - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Status of the transaction + * @param direction - Direction of the transaction (asset) + * @param address - Wallet address of the receiver or sender of the transaction, dependant on direction + * @param amount Amount of assets that will be transferred + * @returns Status of the transaction */ async verifyTransfer( direction: AssetDirectionEnum, diff --git a/packages/networks/bitcoin/src/models/Transaction.ts b/packages/networks/bitcoin/src/models/Transaction.ts index cecc894..61492fd 100644 --- a/packages/networks/bitcoin/src/models/Transaction.ts +++ b/packages/networks/bitcoin/src/models/Transaction.ts @@ -74,8 +74,8 @@ export class Transaction implements TransactionInterface { data: TransactionData | null = null /** - * @param {TransactionId} id Transaction id - * @param {Provider} provider Blockchain network provider + * @param id Transaction id + * @param provider Blockchain network provider */ constructor(id: TransactionId, provider?: Provider) { this.id = id @@ -83,7 +83,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Transaction data + * @returns Transaction data */ async getData(): Promise { if (this.data !== null) { @@ -113,8 +113,8 @@ export class Transaction implements TransactionInterface { } /** - * @param {number} ms - Milliseconds to wait for the transaction to be confirmed. Default is 4000ms - * @returns {Promise} Status of the transaction + * @param ms - Milliseconds to wait for the transaction to be confirmed. Default is 4000ms + * @returns Status of the transaction */ async wait(ms: number = 4000): Promise { return await new Promise((resolve, reject) => { @@ -138,28 +138,28 @@ export class Transaction implements TransactionInterface { } /** - * @returns {TransactionId} Transaction ID + * @returns Transaction ID */ getId(): TransactionId { return this.id } /** - * @returns {Promise} Transaction type + * @returns Transaction type */ async getType(): Promise { return TransactionTypeEnum.COIN } /** - * @returns {string} Transaction URL + * @returns Transaction URL */ getUrl(): string { return this.provider.explorer + 'tx/' + this.id } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSigner(): Promise { const data = await this.getData() @@ -167,7 +167,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Transaction fee + * @returns Transaction fee */ async getFee(): Promise { const data = await this.getData() @@ -175,7 +175,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Block number that transaction + * @returns Block number that transaction */ async getBlockNumber(): Promise { const data = await this.getData() @@ -183,7 +183,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Block timestamp that transaction + * @returns Block timestamp that transaction */ async getBlockTimestamp(): Promise { const data = await this.getData() @@ -191,7 +191,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Confirmation count of the block + * @returns Confirmation count of the block */ async getBlockConfirmationCount(): Promise { const data = await this.getData() @@ -203,7 +203,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Status of the transaction + * @returns Status of the transaction */ async getStatus(): Promise { const data = await this.getData() diff --git a/packages/networks/bitcoin/src/services/Provider.ts b/packages/networks/bitcoin/src/services/Provider.ts index 1553561..6578023 100644 --- a/packages/networks/bitcoin/src/services/Provider.ts +++ b/packages/networks/bitcoin/src/services/Provider.ts @@ -52,7 +52,7 @@ export class Provider implements ProviderInterface} + * @param url - RPC URL + * @returns Connection status */ async checkRpcConnection(url?: string): Promise { try { @@ -94,8 +93,8 @@ export class Provider implements ProviderInterface} + * @param url - Websocket URL + * @returns Connection status */ async checkWsConnection(url?: string): Promise { try { @@ -113,8 +112,7 @@ export class Provider implements ProviderInterface void = () => {} /** - * @param {T} type - Transaction type - * @param {DynamicTransactionListenerFilterType} filter - Transaction listener filter - * @param {Provider} provider - Provider + * @param type - Transaction type + * @param filter - Transaction listener filter + * @param provider - Provider */ constructor(type: T, filter?: DynamicTransactionListenerFilterType, provider?: Provider) { this.type = type @@ -93,7 +93,6 @@ export class TransactionListener< /** * Close the listener - * @returns {void} */ stop(): void { if (this.status) { @@ -104,7 +103,6 @@ export class TransactionListener< /** * Start the listener - * @returns {void} */ start(): void { if (!this.status) { @@ -116,7 +114,7 @@ export class TransactionListener< /** * Get the listener status - * @returns {boolean} Listener status + * @returns Listener status */ getStatus(): boolean { return this.status @@ -124,8 +122,8 @@ export class TransactionListener< /** * Listen to the transaction events - * @param {CallBackType} callback - Transaction listener callback - * @returns {Promise} + * @param callback - Transaction listener callback + * @returns Connection status */ async on(callback: CallBackType): Promise { if (this.webSocket === undefined) { @@ -148,8 +146,7 @@ export class TransactionListener< /** * Trigger the event when a transaction is detected - * @param {TransactionListenerTriggerType} transaction - Transaction data - * @returns {void} + * @param transaction - Transaction data */ trigger(transaction: TransactionListenerTriggerType): void { if (!this.triggeredTransactions.includes(transaction.id)) { @@ -166,8 +163,8 @@ export class TransactionListener< /** * Create message for the listener - * @param {string} receiver - Receiver address - * @returns {string} Message + * @param receiver - Receiver address + * @returns Message */ createMessage(receiver?: string): string { let message @@ -210,8 +207,8 @@ export class TransactionListener< /** * Parse the data - * @param {any} data - Data - * @returns {Values} Parsed data + * @param data - Data + * @returns Parsed data */ getValues(data: any): Values { const values: Values = { @@ -235,7 +232,6 @@ export class TransactionListener< /** * General transaction process - * @returns {void} */ generalProcess(): void { const message = this.createMessage() @@ -260,7 +256,6 @@ export class TransactionListener< /** * Contract transaction process - * @returns {void} */ contractProcess(): void { throw new Error('This method is not implemented for Bitcoin.') @@ -268,7 +263,6 @@ export class TransactionListener< /** * Coin transaction process - * @returns {void} */ coinProcess(): void { const filter = this.filter as DynamicTransactionListenerFilterType @@ -334,7 +328,6 @@ export class TransactionListener< /** * Token transaction process - * @returns {void} */ tokenProcess(): void { throw new Error('This method is not implemented for Bitcoin.') @@ -342,7 +335,6 @@ export class TransactionListener< /** * NFT transaction process - * @returns {void} */ nftProcess(): void { throw new Error('This method is not implemented for Bitcoin.') diff --git a/packages/networks/bitcoin/src/services/TransactionSigner.ts b/packages/networks/bitcoin/src/services/TransactionSigner.ts index e885281..cc1f7b0 100644 --- a/packages/networks/bitcoin/src/services/TransactionSigner.ts +++ b/packages/networks/bitcoin/src/services/TransactionSigner.ts @@ -28,8 +28,8 @@ export class TransactionSigner implements TransactionSignerInterface} Signed transaction data + * @param privateKey - Transaction data + * @returns Signed transaction data */ async sign(privateKey: PrivateKey): Promise { this.rawData.bitcoreLib.sign(privateKey) @@ -49,7 +49,7 @@ export class TransactionSigner implements TransactionSignerInterface} + * @returns Transaction ID */ async send(): Promise { try { @@ -66,7 +66,7 @@ export class TransactionSigner implements TransactionSignerInterface { provider: Provider /** - * @param {Provider} provider network provider + * @param provider network provider */ constructor(provider?: Provider) { this.provider = provider ?? Provider.instance } /** - * @returns {string} Coin name + * @returns Coin name */ getName(): string { return 'example' } /** - * @returns {string} Coin symbol + * @returns Coin symbol */ getSymbol(): string { return 'example' } /** - * @returns {number} Decimal value of the coin + * @returns Decimal value of the coin */ getDecimals(): number { return 18 } /** - * @param {WalletAddress} owner Wallet address - * @returns {Promise} Wallet balance as currency of COIN + * @param owner Wallet address + * @returns Wallet balance as currency of COIN */ async getBalance(owner: WalletAddress): Promise { return 0 } /** - * @param {WalletAddress} sender Sender wallet address - * @param {WalletAddress} receiver Receiver wallet address - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Transaction signer + * @param sender Sender wallet address + * @param receiver Receiver wallet address + * @param amount Amount of assets that will be transferred + * @returns Transaction signer */ async transfer( sender: WalletAddress, diff --git a/packages/networks/boilerplate/src/assets/Contract.ts b/packages/networks/boilerplate/src/assets/Contract.ts index bb7ac41..5b21304 100644 --- a/packages/networks/boilerplate/src/assets/Contract.ts +++ b/packages/networks/boilerplate/src/assets/Contract.ts @@ -18,8 +18,8 @@ export class Contract implements ContractInterface { provider: Provider /** - * @param {ContractAddress} address Contract address - * @param {Provider} provider Blockchain network provider + * @param address Contract address + * @param provider Blockchain network provider */ constructor(address: ContractAddress, provider?: Provider) { this.address = address @@ -27,25 +27,25 @@ export class Contract implements ContractInterface { } /** - * @returns {ContractAddress} Contract address + * @returns Contract address */ getAddress(): ContractAddress { return this.address } /** - * @param {string} method Method name - * @param {unknown[]} args Method parameters - * @returns {Promise} Method result + * @param method Method name + * @param args Method parameters + * @returns Method result */ async callMethod(method: string, ...args: unknown[]): Promise { return {} } /** - * @param {string} method Method name - * @param {unknown[]} args Method parameters - * @returns {Promise} Method result + * @param method Method name + * @param args Method parameters + * @returns Method result */ async callMethodWithCache(method: string, ...args: unknown[]): Promise { if (this.cachedMethods[method] !== undefined) { @@ -56,19 +56,19 @@ export class Contract implements ContractInterface { } /** - * @param {string} method Method name - * @param {unknown[]} args Sender wallet address - * @returns {Promise} Encoded method data + * @param method Method name + * @param args Sender wallet address + * @returns Encoded method data */ async getMethodData(method: string, ...args: unknown[]): Promise { return {} } /** - * @param {string} method Method name - * @param {WalletAddress} from Sender wallet address - * @param {unknown[]} args Method parameters - * @returns {Promise} Encoded method data + * @param method Method name + * @param from Sender wallet address + * @param args Method parameters + * @returns Encoded method data */ async createTransactionData( method: string, diff --git a/packages/networks/boilerplate/src/assets/NFT.ts b/packages/networks/boilerplate/src/assets/NFT.ts index cc04571..5d51432 100644 --- a/packages/networks/boilerplate/src/assets/NFT.ts +++ b/packages/networks/boilerplate/src/assets/NFT.ts @@ -4,56 +4,56 @@ import type { NftId, NftInterface, WalletAddress } from '@multiplechain/types' export class NFT extends Contract implements NftInterface { /** - * @returns {Promise} NFT name + * @returns NFT name */ async getName(): Promise { return 'example' } /** - * @returns {Promise} NFT symbol + * @returns NFT symbol */ async getSymbol(): Promise { return 'example' } /** - * @param {WalletAddress} owner Wallet address - * @returns {Promise} Wallet balance as currency of NFT + * @param owner Wallet address + * @returns Wallet balance as currency of NFT */ async getBalance(owner: WalletAddress): Promise { return 0 } /** - * @param {NftId} nftId NFT ID - * @returns {Promise} Wallet address of the owner of the NFT + * @param nftId NFT ID + * @returns Wallet address of the owner of the NFT */ async getOwner(nftId: NftId): Promise { return 'example' } /** - * @param {NftId} nftId NFT ID - * @returns {Promise} URI of the NFT + * @param nftId NFT ID + * @returns URI of the NFT */ async getTokenURI(nftId: NftId): Promise { return 'example' } /** - * @param {NftId} nftId ID of the NFT that will be transferred - * @returns {Promise} Wallet address of the approved spender + * @param nftId ID of the NFT that will be transferred + * @returns Wallet address of the approved spender */ async getApproved(nftId: NftId): Promise { return 'example' } /** - * @param {WalletAddress} sender Sender address - * @param {WalletAddress} receiver Receiver address - * @param {NftId} nftId NFT ID - * @returns {Promise} Transaction signer + * @param sender Sender address + * @param receiver Receiver address + * @param nftId NFT ID + * @returns Transaction signer */ async transfer( sender: WalletAddress, @@ -64,11 +64,11 @@ export class NFT extends Contract implements NftInterface { } /** - * @param {WalletAddress} spender Spender address - * @param {WalletAddress} owner Owner address - * @param {WalletAddress} receiver Receiver address - * @param {NftId} nftId NFT ID - * @returns {Promise} Transaction signer + * @param spender Spender address + * @param owner Owner address + * @param receiver Receiver address + * @param nftId NFT ID + * @returns Transaction signer */ async transferFrom( spender: WalletAddress, @@ -81,10 +81,10 @@ export class NFT extends Contract implements NftInterface { /** * Gives permission to the spender to spend owner's tokens - * @param {WalletAddress} owner Address of owner of the tokens that will be used - * @param {WalletAddress} spender Address of the spender that will use the tokens of owner - * @param {NftId} nftId ID of the NFT that will be transferred - * @returns {Promise} Transaction signer + * @param owner Address of owner of the tokens that will be used + * @param spender Address of the spender that will use the tokens of owner + * @param nftId ID of the NFT that will be transferred + * @returns Transaction signer */ async approve( owner: WalletAddress, diff --git a/packages/networks/boilerplate/src/assets/Token.ts b/packages/networks/boilerplate/src/assets/Token.ts index 14bb3ed..f539cc1 100644 --- a/packages/networks/boilerplate/src/assets/Token.ts +++ b/packages/networks/boilerplate/src/assets/Token.ts @@ -4,45 +4,45 @@ import type { TokenInterface, TransferAmount, WalletAddress } from '@multiplecha export class Token extends Contract implements TokenInterface { /** - * @returns {Promise} Token name + * @returns Token name */ async getName(): Promise { return 'example' } /** - * @returns {Promise} Token symbol + * @returns Token symbol */ async getSymbol(): Promise { return 'example' } /** - * @returns {Promise} Decimal value of the token + * @returns Decimal value of the token */ async getDecimals(): Promise { return 18 } /** - * @param {WalletAddress} owner Wallet address - * @returns {Promise} Wallet balance as currency of TOKEN + * @param owner Wallet address + * @returns Wallet balance as currency of TOKEN */ async getBalance(owner: WalletAddress): Promise { return 0 } /** - * @returns {Promise} Total supply of the token + * @returns Total supply of the token */ async getTotalSupply(): Promise { return 0 } /** - * @param {WalletAddress} owner Address of owner of the tokens that is being used - * @param {WalletAddress} spender Address of the spender that is using the tokens of owner - * @returns {Promise} Amount of tokens that the spender is allowed to spend + * @param owner Address of owner of the tokens that is being used + * @param spender Address of the spender that is using the tokens of owner + * @returns Amount of tokens that the spender is allowed to spend */ async getAllowance(owner: WalletAddress, spender: WalletAddress): Promise { return 0 @@ -50,10 +50,10 @@ export class Token extends Contract implements TokenInterface /** * transfer() method is the main method for processing transfers for fungible assets (TOKEN, COIN) - * @param {WalletAddress} sender Sender wallet address - * @param {WalletAddress} receiver Receiver wallet address - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Transaction signer + * @param sender Sender wallet address + * @param receiver Receiver wallet address + * @param amount Amount of assets that will be transferred + * @returns Transaction signer */ async transfer( sender: WalletAddress, @@ -64,11 +64,11 @@ export class Token extends Contract implements TokenInterface } /** - * @param {WalletAddress} spender Address of the spender of transaction - * @param {WalletAddress} owner Sender wallet address - * @param {WalletAddress} receiver Receiver wallet address - * @param {TransferAmount} amount Amount of tokens that will be transferred - * @returns {Promise} Transaction signer + * @param spender Address of the spender of transaction + * @param owner Sender wallet address + * @param receiver Receiver wallet address + * @param amount Amount of tokens that will be transferred + * @returns Transaction signer */ async transferFrom( spender: WalletAddress, @@ -81,10 +81,10 @@ export class Token extends Contract implements TokenInterface /** * Gives permission to the spender to spend owner's tokens - * @param {WalletAddress} owner Address of owner of the tokens that will be used - * @param {WalletAddress} spender Address of the spender that will use the tokens of owner - * @param {TransferAmount} amount Amount of the tokens that will be used - * @returns {Promise} Transaction signer + * @param owner Address of owner of the tokens that will be used + * @param spender Address of the spender that will use the tokens of owner + * @param amount Amount of the tokens that will be used + * @returns Transaction signer */ async approve( owner: WalletAddress, diff --git a/packages/networks/boilerplate/src/browser/Wallet.ts b/packages/networks/boilerplate/src/browser/Wallet.ts index 274b221..880ff0f 100644 --- a/packages/networks/boilerplate/src/browser/Wallet.ts +++ b/packages/networks/boilerplate/src/browser/Wallet.ts @@ -30,8 +30,8 @@ export class Wallet implements WalletInterface} + * @param config - Configuration for the connection + * @returns wallet address */ async connect(config?: ConnectConfig): Promise { await this.adapter.connect() @@ -96,46 +96,45 @@ export class Wallet implements WalletInterface { return await this.adapter.isDetected() } /** - * @returns {boolean} + * @returns wallet connected status */ async isConnected(): Promise { return await this.adapter.isConnected() } /** - * @returns {Promise} + * @returns wallet address */ async getAddress(): Promise { return 'wallet address' } /** - * @param {string} message - * @returns {Promise} + * @param message - Message to sign + * @returns signed message */ async signMessage(message: string): Promise { return 'signed message' } /** - * @param {TransactionSigner} transactionSigner - * @returns {Promise} + * @param transactionSigner - Transaction signer + * @returns transaction id */ async sendTransaction(transactionSigner: TransactionSigner): Promise { return 'transaction hash' } /** - * @param {string} eventName - * @param {Function} callback - * @returns {void} + * @param eventName - Event name + * @param callback - Event callback */ on(eventName: string, callback: (...args: any[]) => void): void { 'wallet events' diff --git a/packages/networks/boilerplate/src/browser/adapters/Example.ts b/packages/networks/boilerplate/src/browser/adapters/Example.ts index 54fe875..f1bb4cf 100644 --- a/packages/networks/boilerplate/src/browser/adapters/Example.ts +++ b/packages/networks/boilerplate/src/browser/adapters/Example.ts @@ -8,7 +8,7 @@ declare global { } } -const Example: WalletAdapterInterface = { +const Example: WalletAdapterInterface = { id: 'example', name: 'Example', icon: 'icon base64 string here', diff --git a/packages/networks/boilerplate/src/models/CoinTransaction.ts b/packages/networks/boilerplate/src/models/CoinTransaction.ts index 9c8c8ae..6ba2fef 100644 --- a/packages/networks/boilerplate/src/models/CoinTransaction.ts +++ b/packages/networks/boilerplate/src/models/CoinTransaction.ts @@ -4,31 +4,31 @@ import type { AssetDirectionEnum, CoinTransactionInterface, TransferAmount, Wall export class CoinTransaction extends Transaction implements CoinTransactionInterface { /** - * @returns {Promise} Wallet address of the receiver of transaction + * @returns Wallet address of the receiver of transaction */ async getReceiver(): Promise { return 'example' } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSender(): Promise { return 'example' } /** - * @returns {Promise} Amount of coin that will be transferred + * @returns Amount of coin that will be transferred */ async getAmount(): Promise { return 0 } /** - * @param {AssetDirectionEnum} direction - Direction of the transaction (asset) - * @param {WalletAddress} address - Wallet address of the receiver or sender of the transaction, dependant on direction - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Status of the transaction + * @param direction - Direction of the transaction (asset) + * @param address - Wallet address of the receiver or sender of the transaction, dependant on direction + * @param amount Amount of assets that will be transferred + * @returns Status of the transaction */ async verifyTransfer( direction: AssetDirectionEnum, diff --git a/packages/networks/boilerplate/src/models/ContractTransaction.ts b/packages/networks/boilerplate/src/models/ContractTransaction.ts index 17e94f4..e52bbee 100644 --- a/packages/networks/boilerplate/src/models/ContractTransaction.ts +++ b/packages/networks/boilerplate/src/models/ContractTransaction.ts @@ -3,7 +3,7 @@ import type { ContractAddress, ContractTransactionInterface } from '@multiplecha export class ContractTransaction extends Transaction implements ContractTransactionInterface { /** - * @returns {Promise} Contract address of the transaction + * @returns Contract address of the transaction */ async getAddress(): Promise { return 'example' diff --git a/packages/networks/boilerplate/src/models/NftTransaction.ts b/packages/networks/boilerplate/src/models/NftTransaction.ts index 5280cd8..4b69dcb 100644 --- a/packages/networks/boilerplate/src/models/NftTransaction.ts +++ b/packages/networks/boilerplate/src/models/NftTransaction.ts @@ -4,32 +4,31 @@ import type { NftTransactionInterface, AssetDirectionEnum, WalletAddress, NftId export class NftTransaction extends ContractTransaction implements NftTransactionInterface { /** - * @returns {Promise} Receiver wallet address + * @returns Receiver wallet address */ async getReceiver(): Promise { return 'example' } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSender(): Promise { return 'example' } /** - * @returns {Promise} NFT ID + * @returns NFT ID */ async getNftId(): Promise { return 0 } /** - * @param {AssetDirectionEnum} direction - Direction of the transaction (nft) - * @param {WalletAddress} address - Wallet address of the receiver or sender of the transaction, dependant on direction - * @param {NftId} nftId ID of the NFT that will be transferred - * @override verifyTransfer() in AssetTransactionInterface - * @returns {Promise} Status of the transaction + * @param direction - Direction of the transaction (nft) + * @param address - Wallet address of the receiver or sender of the transaction, dependant on direction + * @param nftId ID of the NFT that will be transferred + * @returns Status of the transaction */ async verifyTransfer( direction: AssetDirectionEnum, diff --git a/packages/networks/boilerplate/src/models/TokenTransaction.ts b/packages/networks/boilerplate/src/models/TokenTransaction.ts index 4da0327..415348e 100644 --- a/packages/networks/boilerplate/src/models/TokenTransaction.ts +++ b/packages/networks/boilerplate/src/models/TokenTransaction.ts @@ -4,31 +4,31 @@ import type { AssetDirectionEnum, TokenTransactionInterface, TransferAmount, Wal export class TokenTransaction extends ContractTransaction implements TokenTransactionInterface { /** - * @returns {Promise} Wallet address of the receiver of transaction + * @returns Wallet address of the receiver of transaction */ async getReceiver(): Promise { return 'example' } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSender(): Promise { return 'example' } /** - * @returns {Promise} Amount of tokens that will be transferred + * @returns Amount of tokens that will be transferred */ async getAmount(): Promise { return 0 } /** - * @param {AssetDirectionEnum} direction - Direction of the transaction (token) - * @param {WalletAddress} address - Wallet address of the owner or spender of the transaction, dependant on direction - * @param {TransferAmount} amount Amount of tokens that will be approved - * @returns {Promise} Status of the transaction + * @param direction - Direction of the transaction (token) + * @param address - Wallet address of the owner or spender of the transaction, dependant on direction + * @param amount Amount of tokens that will be approved + * @returns Status of the transaction */ async verifyTransfer( direction: AssetDirectionEnum, diff --git a/packages/networks/boilerplate/src/models/Transaction.ts b/packages/networks/boilerplate/src/models/Transaction.ts index 1fe3c38..74df4b8 100644 --- a/packages/networks/boilerplate/src/models/Transaction.ts +++ b/packages/networks/boilerplate/src/models/Transaction.ts @@ -31,8 +31,8 @@ export class Transaction implements TransactionInterface { provider: Provider /** - * @param {TransactionId} id Transaction id - * @param {Provider} provider Blockchain network provider + * @param id Transaction id + * @param provider Blockchain network provider */ constructor(id: TransactionId, provider?: Provider) { this.id = id @@ -40,78 +40,78 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Transaction data + * @returns Transaction data */ async getData(): Promise { return {} } /** - * @param {number} ms - Milliseconds to wait for the transaction to be confirmed. Default is 4000ms - * @returns {Promise} Status of the transaction + * @param ms - Milliseconds to wait for the transaction to be confirmed. Default is 4000ms + * @returns Status of the transaction */ async wait(ms: number = 4000): Promise { return await Promise.resolve(TransactionStatusEnum.CONFIRMED) } /** - * @returns {TransactionId} Transaction ID + * @returns Transaction ID */ getId(): TransactionId { return this.id } /** - * @returns {Promise} Type of the transaction + * @returns Type of the transaction */ - getType(): Promise { - return Promise.resolve(TransactionTypeEnum.GENERAL) + async getType(): Promise { + return await Promise.resolve(TransactionTypeEnum.GENERAL) } - + /** - * @returns {string} Transaction URL + * @returns Transaction URL */ getUrl(): string { return 'example' } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSigner(): Promise { return 'example' } /** - * @returns {Promise} Transaction fee + * @returns Transaction fee */ async getFee(): Promise { return 0 } /** - * @returns {Promise} Block number that transaction + * @returns Block number that transaction */ async getBlockNumber(): Promise { return 0 } /** - * @returns {Promise} Block timestamp that transaction + * @returns Block timestamp that transaction */ async getBlockTimestamp(): Promise { return 0 } /** - * @returns {Promise} Confirmation count of the block + * @returns Confirmation count of the block */ async getBlockConfirmationCount(): Promise { return 0 } /** - * @returns {Promise} Status of the transaction + * @returns Status of the transaction */ async getStatus(): Promise { return TransactionStatusEnum.CONFIRMED diff --git a/packages/networks/boilerplate/src/services/Provider.ts b/packages/networks/boilerplate/src/services/Provider.ts index 5b2834d..9f6886d 100644 --- a/packages/networks/boilerplate/src/services/Provider.ts +++ b/packages/networks/boilerplate/src/services/Provider.ts @@ -24,7 +24,7 @@ export class Provider implements ProviderInterface { /** * Get the static instance of the provider - * @returns {Provider} Provider + * @returns Provider instance */ static get instance(): Provider { if (Provider._instance === undefined) { @@ -35,8 +35,7 @@ export class Provider implements ProviderInterface { /** * Initialize the static instance of the provider - * @param {NetworkConfigInterface} network - Network configuration of the provider - * @returns {void} + * @param network - Network configuration of the provider */ static initialize(network: NetworkConfigInterface): void { if (Provider._instance !== undefined) { @@ -47,8 +46,8 @@ export class Provider implements ProviderInterface { /** * Check RPC connection - * @param {string} url - RPC URL - * @returns {Promise} + * @param url - RPC URL + * @returns RPC connection status */ async checkRpcConnection(url?: string): Promise { return true @@ -56,8 +55,8 @@ export class Provider implements ProviderInterface { /** * Check WS connection - * @param {string} url - Websocket URL - * @returns {Promise} + * @param url - Websocket URL + * @returns ws connection status */ async checkWsConnection(url?: string): Promise { return true @@ -65,8 +64,7 @@ export class Provider implements ProviderInterface { /** * Update network configuration of the provider - * @param {NetworkConfigInterface} network - Network configuration - * @returns {void} + * @param network - Network configuration */ update(network: NetworkConfigInterface): void { this.network = network @@ -75,7 +73,7 @@ export class Provider implements ProviderInterface { /** * Get the current network configuration is testnet or not - * @returns {boolean} + * @returns testnet status */ isTestnet(): boolean { return this.network?.testnet ?? false diff --git a/packages/networks/boilerplate/src/services/TransactionListener.ts b/packages/networks/boilerplate/src/services/TransactionListener.ts index 6ee74b7..c283804 100644 --- a/packages/networks/boilerplate/src/services/TransactionListener.ts +++ b/packages/networks/boilerplate/src/services/TransactionListener.ts @@ -50,7 +50,7 @@ export class TransactionListener< * Listener status */ status: boolean = false - + /** * Transaction listener callback */ @@ -60,16 +60,16 @@ export class TransactionListener< * Triggered transactions */ triggeredTransactions: TransactionId[] = [] - + /** * Transaction listener filter */ filter?: DynamicTransactionListenerFilterType | Record /** - * @param {T} type - Transaction type - * @param {DynamicTransactionListenerFilterType} filter - Transaction listener filter - * @param {Provider} provider - Provider + * @param type - Transaction type + * @param filter - Transaction listener filter + * @param provider - Provider */ constructor(type: T, filter?: DynamicTransactionListenerFilterType, provider?: Provider) { this.type = type @@ -79,7 +79,6 @@ export class TransactionListener< /** * Close the listener - * @returns {void} */ stop(): void { if (this.status) { @@ -90,7 +89,6 @@ export class TransactionListener< /** * Start the listener - * @returns {void} */ start(): void { if (!this.status) { @@ -102,7 +100,7 @@ export class TransactionListener< /** * Get the listener status - * @returns {boolean} Listener status + * @returns Listener status */ getStatus(): boolean { return this.status @@ -110,8 +108,8 @@ export class TransactionListener< /** * Listen to the transaction events - * @param {CallBackType} callback - Transaction listener callback - * @returns {Promise} + * @param callback - Transaction listener callback + * @returns listener status */ async on(callback: CallBackType): Promise { this.callbacks.push(callback) @@ -120,8 +118,7 @@ export class TransactionListener< /** * Trigger the event when a transaction is detected - * @param {TransactionListenerTriggerType} transaction - Transaction data - * @returns {void} + * @param transaction - Transaction data */ trigger(transaction: TransactionListenerTriggerType): void { if (!this.triggeredTransactions.includes(transaction.id)) { @@ -134,13 +131,11 @@ export class TransactionListener< /** * General transaction process - * @returns {void} */ generalProcess(): void {} /** * Contract transaction process - * @returns {void} */ contractProcess(): void { const filter = this.filter as ContractTransactionListenerFilterInterface @@ -148,7 +143,6 @@ export class TransactionListener< /** * Coin transaction process - * @returns {void} */ coinProcess(): void { const filter = this.filter as CoinTransactionListenerFilterInterface @@ -156,7 +150,6 @@ export class TransactionListener< /** * Token transaction process - * @returns {void} */ tokenProcess(): void { const filter = this.filter as TokenTransactionListenerFilterInterface @@ -164,7 +157,6 @@ export class TransactionListener< /** * NFT transaction process - * @returns {void} */ nftProcess(): void { const filter = this.filter as NftTransactionListenerFilterInterface diff --git a/packages/networks/boilerplate/src/services/TransactionSigner.ts b/packages/networks/boilerplate/src/services/TransactionSigner.ts index 879ef50..bc6c45c 100644 --- a/packages/networks/boilerplate/src/services/TransactionSigner.ts +++ b/packages/networks/boilerplate/src/services/TransactionSigner.ts @@ -1,7 +1,7 @@ import { Provider } from '../services/Provider' import type { PrivateKey, TransactionId, TransactionSignerInterface } from '@multiplechain/types' -export class TransactionSigner implements TransactionSignerInterface{ +export class TransactionSigner implements TransactionSignerInterface { /** * Transaction data from the blockchain network */ @@ -18,8 +18,8 @@ export class TransactionSigner implements TransactionSignerInterface} Signed transaction data + * @param privateKey - Transaction data + * @returns Signed transaction data */ async sign(privateKey: PrivateKey): Promise { return await Promise.resolve(this) @@ -37,23 +37,21 @@ export class TransactionSigner implements TransactionSignerInterface} + * @returns Transaction ID */ async send(): Promise { return await Promise.resolve('id') } /** - * Get the raw transaction data - * @returns {unknown} + * @returns raw transaction data */ getRawData(): unknown { return this.rawData } /** - * Get the signed transaction data - * @returns {unknown} + * @returns signed transaction data */ getSignedData(): unknown { return this.signedData diff --git a/packages/networks/evm-chains/src/assets/Coin.ts b/packages/networks/evm-chains/src/assets/Coin.ts index 73fc2e8..45a0db4 100644 --- a/packages/networks/evm-chains/src/assets/Coin.ts +++ b/packages/networks/evm-chains/src/assets/Coin.ts @@ -16,14 +16,14 @@ export class Coin implements CoinInterface { provider: Provider /** - * @param {Provider} provider network provider + * @param provider network provider */ constructor(provider?: Provider) { this.provider = provider ?? Provider.instance } /** - * @returns {string} Coin name + * @returns Coin name */ getName(): string { return ( @@ -32,22 +32,22 @@ export class Coin implements CoinInterface { } /** - * @returns {string} Coin symbol + * @returns Coin symbol */ getSymbol(): string { return this.provider.network.nativeCurrency.symbol } /** - * @returns {number} Decimal value of the coin + * @returns Decimal value of the coin */ getDecimals(): number { return this.provider.network.nativeCurrency.decimals } /** - * @param {WalletAddress} owner Wallet address - * @returns {Promise} Wallet balance as currency of COIN + * @param owner Wallet address + * @returns Wallet balance as currency of COIN */ async getBalance(owner: WalletAddress): Promise { const balance = await this.provider.ethers.getBalance(owner) @@ -55,10 +55,10 @@ export class Coin implements CoinInterface { } /** - * @param {WalletAddress} sender Sender wallet address - * @param {WalletAddress} receiver Receiver wallet address - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Transaction signer + * @param sender Sender wallet address + * @param receiver Receiver wallet address + * @param amount Amount of assets that will be transferred + * @returns Transaction signer */ async transfer( sender: WalletAddress, diff --git a/packages/networks/evm-chains/src/assets/Contract.ts b/packages/networks/evm-chains/src/assets/Contract.ts index 109ec0d..abec532 100644 --- a/packages/networks/evm-chains/src/assets/Contract.ts +++ b/packages/networks/evm-chains/src/assets/Contract.ts @@ -36,9 +36,9 @@ export class Contract implements ContractInterface { ethers: Ethers /** - * @param {ContractAddress} address Contract address - * @param {Provider} provider Blockchain network provider - * @param {InterfaceAbi} ABI Contract ABI + * @param address Contract address + * @param provider Blockchain network provider + * @param ABI Contract ABI */ constructor(address: ContractAddress, provider?: Provider, ABI?: InterfaceAbi) { this.ABI = ABI ?? [] @@ -49,25 +49,25 @@ export class Contract implements ContractInterface { } /** - * @returns {ContractAddress} Contract address + * @returns Contract address */ getAddress(): ContractAddress { return this.address } /** - * @param {string} method Method name - * @param {unknown[]} args Method parameters - * @returns {Promise} Method result + * @param method Method name + * @param args Method parameters + * @returns Method result */ async callMethod(method: string, ...args: unknown[]): Promise { return this.ethersContract[method](...args) // eslint-disable-line } /** - * @param {string} method Method name - * @param {unknown[]} args Method parameters - * @returns {Promise} Method result + * @param method Method name + * @param args Method parameters + * @returns Method result */ async callMethodWithCache(method: string, ...args: unknown[]): Promise { if (this.cachedMethods[method] !== undefined) { @@ -78,19 +78,19 @@ export class Contract implements ContractInterface { } /** - * @param {string} method Method name - * @param {unknown[]} args Sender wallet address - * @returns {Promise} Encoded method data + * @param method Method name + * @param args Sender wallet address + * @returns Encoded method data */ async getMethodData(method: string, ...args: unknown[]): Promise { return this.ethersContract.interface.encodeFunctionData(method, args) } /** - * @param {string} method Method name - * @param {WalletAddress} from Sender wallet address - * @param {unknown[]} args Method parameters - * @returns {Promise} Gas limit + * @param method Method name + * @param from Sender wallet address + * @param args Method parameters + * @returns Gas limit */ async getMethodEstimateGas( method: string, @@ -101,10 +101,10 @@ export class Contract implements ContractInterface { } /** - * @param {string} method Method name - * @param {WalletAddress} from Sender wallet address - * @param {unknown[]} args Method parameters - * @returns {Promise} Transaction data + * @param method Method name + * @param from Sender wallet address + * @param args Method parameters + * @returns Transaction data */ async createTransactionData( method: string, diff --git a/packages/networks/evm-chains/src/assets/NFT.ts b/packages/networks/evm-chains/src/assets/NFT.ts index ea4cfa3..25bd179 100644 --- a/packages/networks/evm-chains/src/assets/NFT.ts +++ b/packages/networks/evm-chains/src/assets/NFT.ts @@ -13,55 +13,55 @@ import { export class NFT extends Contract implements NftInterface { /** - * @param {ContractAddress} address Contract address - * @param {Provider} provider Blockchain network provider - * @param {InterfaceAbi} ABI Contract ABI + * @param address Contract address + * @param provider Blockchain network provider + * @param ABI Contract ABI */ constructor(address: ContractAddress, provider?: Provider, ABI?: InterfaceAbi) { super(address, provider, ABI ?? ERC721) } /** - * @returns {Promise} NFT name + * @returns NFT name */ async getName(): Promise { return (await this.callMethodWithCache('name')) as string } /** - * @returns {Promise} NFT symbol + * @returns NFT symbol */ async getSymbol(): Promise { return (await this.callMethodWithCache('symbol')) as string } /** - * @param {WalletAddress} owner Wallet address - * @returns {Promise} Wallet balance as currency of NFT + * @param owner Wallet address + * @returns Wallet balance as currency of NFT */ async getBalance(owner: WalletAddress): Promise { return Number(await this.callMethod('balanceOf', owner)) } /** - * @param {NftId} nftId NFT ID - * @returns {Promise} Wallet address of the owner of the NFT + * @param nftId NFT ID + * @returns Wallet address of the owner of the NFT */ async getOwner(nftId: NftId): Promise { return (await this.callMethod('ownerOf', nftId)) as WalletAddress } /** - * @param {NftId} nftId NFT ID - * @returns {Promise} URI of the NFT + * @param nftId NFT ID + * @returns URI of the NFT */ async getTokenURI(nftId: NftId): Promise { return (await this.callMethodWithCache('tokenURI', nftId)) as string } /** - * @param {NftId} nftId ID of the NFT that will be transferred - * @returns {Promise} Wallet address of the approved spender + * @param nftId ID of the NFT that will be transferred + * @returns Wallet address of the approved spender */ async getApproved(nftId: NftId): Promise { const address = (await this.callMethod('getApproved', nftId)) as WalletAddress @@ -69,10 +69,10 @@ export class NFT extends Contract implements NftInterface { } /** - * @param {WalletAddress} sender Sender address - * @param {WalletAddress} receiver Receiver address - * @param {NftId} nftId NFT ID - * @returns {Promise} Transaction signer + * @param sender Sender address + * @param receiver Receiver address + * @param nftId NFT ID + * @returns Transaction signer */ async transfer( sender: WalletAddress, @@ -83,11 +83,11 @@ export class NFT extends Contract implements NftInterface { } /** - * @param {WalletAddress} spender Spender address - * @param {WalletAddress} owner Owner address - * @param {WalletAddress} receiver Receiver address - * @param {NftId} nftId NFT ID - * @returns {Promise} Transaction signer + * @param spender Spender address + * @param owner Owner address + * @param receiver Receiver address + * @param nftId NFT ID + * @returns Transaction signer */ async transferFrom( spender: WalletAddress, @@ -123,10 +123,10 @@ export class NFT extends Contract implements NftInterface { /** * Gives permission to the spender to spend owner's tokens - * @param {WalletAddress} owner Address of owner of the tokens that will be used - * @param {WalletAddress} spender Address of the spender that will use the tokens of owner - * @param {NftId} nftId ID of the NFT that will be transferred - * @returns {Promise} Transaction signer + * @param owner Address of owner of the tokens that will be used + * @param spender Address of the spender that will use the tokens of owner + * @param nftId ID of the NFT that will be transferred + * @returns Transaction signer */ async approve( owner: WalletAddress, diff --git a/packages/networks/evm-chains/src/assets/Token.ts b/packages/networks/evm-chains/src/assets/Token.ts index 36b5693..2132ee2 100644 --- a/packages/networks/evm-chains/src/assets/Token.ts +++ b/packages/networks/evm-chains/src/assets/Token.ts @@ -14,38 +14,38 @@ import { export class Token extends Contract implements TokenInterface { /** - * @param {ContractAddress} address Contract address - * @param {Provider} provider Blockchain network provider - * @param {InterfaceAbi} ABI Contract ABI + * @param address Contract address + * @param provider Blockchain network provider + * @param ABI Contract ABI */ constructor(address: ContractAddress, provider?: Provider, ABI?: InterfaceAbi) { super(address, provider, ABI ?? ERC20) } /** - * @returns {Promise} Token name + * @returns Token name */ async getName(): Promise { return (await this.callMethodWithCache('name')) as string } /** - * @returns {Promise} Token symbol + * @returns Token symbol */ async getSymbol(): Promise { return (await this.callMethodWithCache('symbol')) as string } /** - * @returns {Promise} Decimal value of the token + * @returns Decimal value of the token */ async getDecimals(): Promise { return Number(await this.callMethodWithCache('decimals')) } /** - * @param {WalletAddress} owner Wallet address - * @returns {Promise} Wallet balance as currency of TOKEN + * @param owner Wallet address + * @returns Wallet balance as currency of TOKEN */ async getBalance(owner: WalletAddress): Promise { const [decimals, balance] = await Promise.all([ @@ -56,7 +56,7 @@ export class Token extends Contract implements TokenInterface } /** - * @returns {Promise} Total supply of the token + * @returns Total supply of the token */ async getTotalSupply(): Promise { const [decimals, totalSupply] = await Promise.all([ @@ -67,9 +67,9 @@ export class Token extends Contract implements TokenInterface } /** - * @param {WalletAddress} owner Address of owner of the tokens that is being used - * @param {WalletAddress} spender Address of the spender that is using the tokens of owner - * @returns {Promise} Amount of tokens that the spender is allowed to spend + * @param owner Address of owner of the tokens that is being used + * @param spender Address of the spender that is using the tokens of owner + * @returns Amount of tokens that the spender is allowed to spend */ async getAllowance(owner: WalletAddress, spender: WalletAddress): Promise { const [decimals, allowance] = await Promise.all([ @@ -81,10 +81,10 @@ export class Token extends Contract implements TokenInterface /** * transfer() method is the main method for processing transfers for fungible assets (TOKEN, COIN) - * @param {WalletAddress} sender Sender wallet address - * @param {WalletAddress} receiver Receiver wallet address - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Transaction signer + * @param sender Sender wallet address + * @param receiver Receiver wallet address + * @param amount Amount of assets that will be transferred + * @returns Transaction signer */ async transfer( sender: WalletAddress, @@ -109,11 +109,11 @@ export class Token extends Contract implements TokenInterface } /** - * @param {WalletAddress} spender Address of the spender of transaction - * @param {WalletAddress} owner Sender wallet address - * @param {WalletAddress} receiver Receiver wallet address - * @param {TransferAmount} amount Amount of tokens that will be transferred - * @returns {Promise} Transaction signer + * @param spender Address of the spender of transaction + * @param owner Sender wallet address + * @param receiver Receiver wallet address + * @param amount Amount of tokens that will be transferred + * @returns Transaction signer */ async transferFrom( spender: WalletAddress, @@ -150,10 +150,10 @@ export class Token extends Contract implements TokenInterface /** * Gives permission to the spender to spend owner's tokens - * @param {WalletAddress} owner Address of owner of the tokens that will be used - * @param {WalletAddress} spender Address of the spender that will use the tokens of owner - * @param {TransferAmount} amount Amount of the tokens that will be used - * @returns {Promise} Transaction signer + * @param owner Address of owner of the tokens that will be used + * @param spender Address of the spender that will use the tokens of owner + * @param amount Amount of the tokens that will be used + * @returns Transaction signer */ async approve( owner: WalletAddress, diff --git a/packages/networks/evm-chains/src/browser/Wallet.ts b/packages/networks/evm-chains/src/browser/Wallet.ts index 2fbf547..4f4218b 100644 --- a/packages/networks/evm-chains/src/browser/Wallet.ts +++ b/packages/networks/evm-chains/src/browser/Wallet.ts @@ -90,8 +90,8 @@ export class Wallet implements WalletInterface} + * @param payload RequestType + * @returns any */ async request(payload: RequestType): Promise { const res = await this.walletProvider.request(payload) @@ -118,44 +118,44 @@ export class Wallet implements WalletInterface} + * @param config - Connection configuration + * @returns WalletAddress */ async connect(config?: ConnectConfig): Promise { return await new Promise((resolve, reject) => { @@ -199,21 +199,21 @@ export class Wallet implements WalletInterface { return await this.adapter.isDetected() } /** - * @returns {boolean} + * @returns boolean */ async isConnected(): Promise { return await this.adapter.isConnected() } /** - * @returns {Promise} + * @returns number */ async getChainId(): Promise { const chainId = await this.request({ method: 'eth_chainId' }) @@ -221,15 +221,15 @@ export class Wallet implements WalletInterface} + * @returns WalletAddress */ async getAddress(): Promise { return (await this.walletProvider.request({ method: 'eth_accounts' }))[0] } /** - * @param {string} message - * @returns {Promise} + * @param message - Message to sign + * @returns SignedMessage */ async signMessage(message: string): Promise { const address = await this.getAddress() @@ -249,8 +249,8 @@ export class Wallet implements WalletInterface} + * @param transactionSigner - Transaction signer + * @returns TransactionId */ async sendTransaction(transactionSigner: TransactionSigner): Promise { return await new Promise((resolve, reject) => { @@ -275,9 +275,8 @@ export class Wallet implements WalletInterface void): void { if (this.adapter?.provider?.on !== undefined) { diff --git a/packages/networks/evm-chains/src/models/CoinTransaction.ts b/packages/networks/evm-chains/src/models/CoinTransaction.ts index afcb1c7..b5243f7 100644 --- a/packages/networks/evm-chains/src/models/CoinTransaction.ts +++ b/packages/networks/evm-chains/src/models/CoinTransaction.ts @@ -5,7 +5,7 @@ import type { WalletAddress, CoinTransactionInterface, TransferAmount } from '@m export class CoinTransaction extends Transaction implements CoinTransactionInterface { /** - * @returns {Promise} Wallet address of the receiver of transaction + * @returns Wallet address of the receiver of transaction */ async getReceiver(): Promise { const data = await this.getData() @@ -13,14 +13,14 @@ export class CoinTransaction extends Transaction implements CoinTransactionInter } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSender(): Promise { return await this.getSigner() } /** - * @returns {Promise} Amount of coin that will be transferred + * @returns Amount of coin that will be transferred */ async getAmount(): Promise { const data = await this.getData() @@ -29,10 +29,10 @@ export class CoinTransaction extends Transaction implements CoinTransactionInter } /** - * @param {AssetDirectionEnum} direction - Direction of the transaction (asset) - * @param {WalletAddress} address - Wallet address of the receiver or sender of the transaction, dependant on direction - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Status of the transaction + * @param direction - Direction of the transaction (asset) + * @param address - Wallet address of the receiver or sender of the transaction, dependant on direction + * @param amount Amount of assets that will be transferred + * @returns Status of the transaction */ async verifyTransfer( direction: AssetDirectionEnum, diff --git a/packages/networks/evm-chains/src/models/ContractTransaction.ts b/packages/networks/evm-chains/src/models/ContractTransaction.ts index 7010857..fb51ce1 100644 --- a/packages/networks/evm-chains/src/models/ContractTransaction.ts +++ b/packages/networks/evm-chains/src/models/ContractTransaction.ts @@ -14,14 +14,13 @@ import type { Provider } from '../services/Provider' export class ContractTransaction extends Transaction implements ContractTransactionInterface { /** - * @type {InterfaceAbi} */ ABI: InterfaceAbi /** - * @param {TransactionId} id Transaction id - * @param {Provider} provider Blockchain network provider - * @param {InterfaceAbi} ABI Contract ABI + * @param id Transaction id + * @param provider Blockchain network provider + * @param ABI Contract ABI */ constructor(id: TransactionId, provider?: Provider, ABI?: InterfaceAbi) { super(id, provider) @@ -29,7 +28,7 @@ export class ContractTransaction extends Transaction implements ContractTransact } /** - * @returns {Promise} Contract address of the transaction + * @returns Contract address of the transaction */ async getAddress(): Promise { const data = await this.getData() @@ -37,8 +36,8 @@ export class ContractTransaction extends Transaction implements ContractTransact } /** - * @param {TransactionResponse} response Transaction response - * @returns {Promise} Decoded transaction data + * @param response Transaction response + * @returns Decoded transaction data */ async decodeData(response?: TransactionResponse): Promise { if (response === undefined) { diff --git a/packages/networks/evm-chains/src/models/NftTransaction.ts b/packages/networks/evm-chains/src/models/NftTransaction.ts index be8e01b..1810fdc 100644 --- a/packages/networks/evm-chains/src/models/NftTransaction.ts +++ b/packages/networks/evm-chains/src/models/NftTransaction.ts @@ -12,16 +12,16 @@ import { TransactionStatusEnum, AssetDirectionEnum } from '@multiplechain/types' export class NftTransaction extends ContractTransaction implements NftTransactionInterface { /** - * @param {TransactionId} id Transaction id - * @param {Provider} provider Blockchain network provider - * @param {InterfaceAbi} ABI Contract ABI + * @param id Transaction id + * @param provider Blockchain network provider + * @param ABI Contract ABI */ constructor(id: TransactionId, provider?: Provider, ABI?: InterfaceAbi) { super(id, provider, ABI ?? (ERC721 as InterfaceAbi)) } /** - * @returns {Promise} Receiver wallet address + * @returns Receiver wallet address */ async getReceiver(): Promise { const decoded = await this.decodeData() @@ -38,7 +38,7 @@ export class NftTransaction extends ContractTransaction implements NftTransactio } /** - * @returns {Promise} Sender wallet address + * @returns Sender wallet address */ async getSender(): Promise { const decoded = await this.decodeData() @@ -55,18 +55,17 @@ export class NftTransaction extends ContractTransaction implements NftTransactio } /** - * @returns {Promise} NFT ID + * @returns NFT ID */ async getNftId(): Promise { return Number((await this.decodeData())?.args[2] ?? 0) } /** - * @param {AssetDirectionEnum} direction - Direction of the transaction (nft) - * @param {WalletAddress} address - Wallet address of the receiver or sender of the transaction, dependant on direction - * @param {NftId} nftId ID of the NFT that will be transferred - * @override verifyTransfer() in AssetTransactionInterface - * @returns {Promise} Status of the transaction + * @param direction - Direction of the transaction (nft) + * @param address - Wallet address of the receiver or sender of the transaction, dependant on direction + * @param nftId ID of the NFT that will be transferred + * @returns Status of the transaction */ async verifyTransfer( direction: AssetDirectionEnum, diff --git a/packages/networks/evm-chains/src/models/TokenTransaction.ts b/packages/networks/evm-chains/src/models/TokenTransaction.ts index 6654856..e7ced31 100644 --- a/packages/networks/evm-chains/src/models/TokenTransaction.ts +++ b/packages/networks/evm-chains/src/models/TokenTransaction.ts @@ -14,16 +14,16 @@ import type { export class TokenTransaction extends ContractTransaction implements TokenTransactionInterface { /** - * @param {TransactionId} id Transaction id - * @param {Provider} provider Blockchain network provider - * @param {InterfaceAbi} ABI Contract ABI + * @param id Transaction id + * @param provider Blockchain network provider + * @param ABI Contract ABI */ constructor(id: TransactionId, provider?: Provider, ABI?: InterfaceAbi) { super(id, provider, ABI ?? (ERC20 as InterfaceAbi)) } /** - * @return {Promise} Receiver wallet address + * @returns Receiver wallet address */ async getReceiver(): Promise { const decoded = await this.decodeData() @@ -40,7 +40,7 @@ export class TokenTransaction extends ContractTransaction implements TokenTransa } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSender(): Promise { const decoded = await this.decodeData() @@ -57,7 +57,7 @@ export class TokenTransaction extends ContractTransaction implements TokenTransa } /** - * @returns {Promise} Amount of tokens that will be transferred + * @returns Amount of tokens that will be transferred */ async getAmount(): Promise { const token = new Token(await this.getAddress()) @@ -74,10 +74,10 @@ export class TokenTransaction extends ContractTransaction implements TokenTransa } /** - * @param {AssetDirectionEnum} direction - Direction of the transaction (token) - * @param {WalletAddress} address - Wallet address of the owner or spender of the transaction, dependant on direction - * @param {TransferAmount} amount Amount of tokens that will be approved - * @returns {Promise} Status of the transaction + * @param direction - Direction of the transaction (token) + * @param address - Wallet address of the owner or spender of the transaction, dependant on direction + * @param amount Amount of tokens that will be approved + * @returns Status of the transaction */ async verifyTransfer( direction: AssetDirectionEnum, diff --git a/packages/networks/evm-chains/src/models/Transaction.ts b/packages/networks/evm-chains/src/models/Transaction.ts index 95f0232..9b823b0 100644 --- a/packages/networks/evm-chains/src/models/Transaction.ts +++ b/packages/networks/evm-chains/src/models/Transaction.ts @@ -63,8 +63,8 @@ export class Transaction implements TransactionInterface { data: TransactionData /** - * @param {TransactionId} id Transaction id - * @param {Provider} provider Blockchain network provider + * @param id Transaction id + * @param provider Blockchain network provider */ constructor(id: TransactionId, provider?: Provider) { this.id = id @@ -73,7 +73,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Transaction data + * @returns Transaction data */ async getData(): Promise { if (this.data?.response !== undefined && this.data?.receipt !== null) { @@ -95,8 +95,8 @@ export class Transaction implements TransactionInterface { } /** - * @param {number} ms - Milliseconds to wait for the transaction to be confirmed. Default is 4000ms - * @returns {Promise} Status of the transaction + * @param ms - Milliseconds to wait for the transaction to be confirmed. Default is 4000ms + * @returns Status of the transaction */ async wait(ms: number = 4000): Promise { return await new Promise((resolve, reject) => { @@ -120,14 +120,14 @@ export class Transaction implements TransactionInterface { } /** - * @returns {TransactionId} Transaction id from the blockchain network + * @returns Transaction id from the blockchain network */ getId(): TransactionId { return this.id } /** - * @returns {Promise} Type of the transaction + * @returns Type of the transaction */ async getType(): Promise { const txData = await this.getData() @@ -160,7 +160,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {string} URL of the transaction on the blockchain explorer + * @returns URL of the transaction on the blockchain explorer */ getUrl(): string { let explorerUrl = this.provider.network.explorerUrl @@ -170,7 +170,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Signer wallet address of the transaction + * @returns Signer wallet address of the transaction */ async getSigner(): Promise { const data = await this.getData() @@ -178,7 +178,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Fee of the transaction + * @returns Fee of the transaction */ async getFee(): Promise { const data = await this.getData() @@ -192,7 +192,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Block number that transaction + * @returns Block number that transaction */ async getBlockNumber(): Promise { const data = await this.getData() @@ -200,7 +200,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Timestamp of the block that transaction + * @returns Timestamp of the block that transaction */ async getBlockTimestamp(): Promise { const blockNumber = await this.getBlockNumber() @@ -209,7 +209,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Confirmation count of the block that transaction + * @returns Confirmation count of the block that transaction */ async getBlockConfirmationCount(): Promise { const blockNumber = await this.getBlockNumber() @@ -219,7 +219,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Status of the transaction + * @returns Status of the transaction */ async getStatus(): Promise { const data = await this.getData() diff --git a/packages/networks/evm-chains/src/services/Ethers.ts b/packages/networks/evm-chains/src/services/Ethers.ts index c9e7fca..30d8bb2 100644 --- a/packages/networks/evm-chains/src/services/Ethers.ts +++ b/packages/networks/evm-chains/src/services/Ethers.ts @@ -39,7 +39,7 @@ export class Ethers { webSocketProvider?: WebSocketProvider /** - * @param {EvmNetworkConfigInterface} network + * @param network - Network configuration of the provider */ constructor(network: EvmNetworkConfigInterface) { this.network = network @@ -47,21 +47,21 @@ export class Ethers { } /** - * @returns {JsonRpcProvider} + * @returns Ethers jsonRpc provider */ public get jsonRpc(): JsonRpcProvider { return this.jsonRpcProvider } /** - * @returns {WebSocketProvider | undefined} + * @returns Ethers webSocket provider */ public get webSocket(): WebSocketProvider | undefined { return this.webSocketProvider } /** - * @returns {Promise} + * @returns Ethers webSocket provider */ public async connectWebSocket(): Promise { return await new Promise((resolve, reject) => { @@ -83,10 +83,10 @@ export class Ethers { } /** - * @param {String} address - * @param {InterfaceAbi} abi - * @param {JsonRpcSigner | JsonRpcProvider} signer - * @returns {Contract} + * @param address contract address + * @param abi contract abi + * @param signer signer of the contract + * @returns contract instance */ public contract( address: string, @@ -97,19 +97,19 @@ export class Ethers { } /** - * @param {PrivateKey} privateKey private key of the wallet - * @param {JsonRpcProvider} provider provider of the blockchain network - * @returns {Wallet} + * @param privateKey private key of the wallet + * @param provider provider of the blockchain network + * @returns wallet instance */ public wallet(privateKey: PrivateKey, provider?: JsonRpcProvider): Wallet { return new Wallet(privateKey, provider ?? this.jsonRpc) } /** - * @param {InterfaceAbi} abi - * @param {string} bytecode - * @param {JsonRpcSigner | JsonRpcProvider} signer - * @returns {ContractFactory} + * @param abi contract abi + * @param bytecode contract bytecode + * @param signer signer of the contract + * @returns contract factory instance */ public contractFactory( abi: InterfaceAbi, @@ -120,8 +120,8 @@ export class Ethers { } /** - * @param {ContractAddress} address - * @returns {Promise} + * @param address contract address + * @returns contract bytecode */ async getByteCode(address: ContractAddress): Promise { try { @@ -138,64 +138,64 @@ export class Ethers { } /** - * @param {TransactionData} data - * @returns {Promise} + * @param data transaction data + * @returns transaction estimate gas */ public async getEstimateGas(data: TransactionData): Promise { return Number(await this.jsonRpcProvider.estimateGas(data)) } /** - * @returns {Promise} + * @returns gas price */ public async getGasPrice(): Promise { return (await this.jsonRpc.send('eth_gasPrice', [])).toString() as string } /** - * @param {WalletAddress} address - * @returns {Promise} + * @param address wallet address + * @returns nonce of the wallet */ public async getNonce(address: WalletAddress): Promise { return await this.jsonRpcProvider.getTransactionCount(address) } /** - * @param {BlockTag | string} block - * @param {boolean} prefetchTxs - * @returns {Promise} + * @param block block number or block hash + * @param prefetchTxs whether to prefetch transactions + * @returns block information */ public async getBlock(block: BlockTag | string, prefetchTxs?: boolean): Promise { return await this.jsonRpcProvider.getBlock(block, prefetchTxs) } /** - * @returns {Promise} + * @returns block number */ async getBlockNumber(): Promise { return await this.jsonRpcProvider.getBlockNumber() } /** - * @param {TransactionId} id - * @returns {Promise} + * @param id transaction id + * @returns transaction information */ async getTransaction(id: TransactionId): Promise { return await this.jsonRpcProvider.getTransaction(id) } /** - * @param {TransactionId} id - * @returns {Promise} + * @param id transaction id + * @returns transaction receipt */ async getTransactionReceipt(id: TransactionId): Promise { return await this.jsonRpcProvider.getTransactionReceipt(id) } /** - * @param {WalletAddress} address - * @param {number} limit how many block to go back - * @returns {Promise} + * @param address wallet address + * @param limit how many block to go back + * @returns transactions */ async getLastTransactions( address: WalletAddress, @@ -237,9 +237,9 @@ export class Ethers { } /** - * @param {WalletAddress} address - * @param {number} limit - * @returns {Promise} + * @param address wallet address + * @param limit how many block to go back + * @returns last transaction */ async getLastTransaction( address: WalletAddress, @@ -267,8 +267,8 @@ export class Ethers { } /** - * @param {WalletAddress} address - * @returns {Promise} + * @param address wallet address + * @returns balance of the wallet */ async getBalance(address: WalletAddress): Promise { return await this.jsonRpcProvider.getBalance(address) diff --git a/packages/networks/evm-chains/src/services/Provider.ts b/packages/networks/evm-chains/src/services/Provider.ts index 70b9592..36016ef 100644 --- a/packages/networks/evm-chains/src/services/Provider.ts +++ b/packages/networks/evm-chains/src/services/Provider.ts @@ -47,7 +47,7 @@ export class Provider implements ProviderInterface { /** * Get the static instance of the provider - * @returns {Provider} Provider + * @returns Provider */ static get instance(): Provider { if (Provider._instance === undefined) { @@ -58,8 +58,7 @@ export class Provider implements ProviderInterface { /** * Initialize the static instance of the provider - * @param {EvmNetworkConfigInterface} network - Network configuration of the provider - * @returns {void} + * @param network - Network configuration of the provider */ static initialize(network: EvmNetworkConfigInterface): void { if (Provider._instance !== undefined) { @@ -70,8 +69,8 @@ export class Provider implements ProviderInterface { /** * Check RPC connection - * @param {string} url - RPC URL - * @returns {Promise} + * @param url - RPC URL + * @returns RPC connection status */ async checkRpcConnection(url?: string): Promise { try { @@ -94,8 +93,8 @@ export class Provider implements ProviderInterface { /** * Check WS connection - * @param {string} url - Websocket URL - * @returns {Promise} + * @param url - Websocket URL + * @returns WS connection status */ async checkWsConnection(url?: string): Promise { try { @@ -113,8 +112,7 @@ export class Provider implements ProviderInterface { /** * Update network configuration of the provider - * @param {EvmNetworkConfigInterface} network - Network configuration of the provider - * @returns {void} + * @param network - Network configuration of the provider */ update(network: EvmNetworkConfigInterface): void { this.network = network @@ -124,7 +122,7 @@ export class Provider implements ProviderInterface { /** * Get the current network configuration is testnet or not - * @returns {boolean} + * @returns Testnet status */ isTestnet(): boolean { return this.network?.testnet ?? false diff --git a/packages/networks/evm-chains/src/services/TransactionListener.ts b/packages/networks/evm-chains/src/services/TransactionListener.ts index cc625ee..0a24e68 100644 --- a/packages/networks/evm-chains/src/services/TransactionListener.ts +++ b/packages/networks/evm-chains/src/services/TransactionListener.ts @@ -95,9 +95,9 @@ export class TransactionListener< filter?: DynamicTransactionListenerFilterType | Record /** - * @param {T} type - Transaction type - * @param {DynamicTransactionListenerFilterType} filter - Transaction listener filter - * @param {Provider} provider - Provider + * @param type - Transaction type + * @param filter - Transaction listener filter + * @param provider - Provider */ constructor(type: T, filter?: DynamicTransactionListenerFilterType, provider?: Provider) { this.type = type @@ -109,7 +109,6 @@ export class TransactionListener< /** * Close the listener - * @returns {void} */ stop(): void { if (this.status) { @@ -120,7 +119,6 @@ export class TransactionListener< /** * Start the listener - * @returns {void} */ start(): void { if (!this.status) { @@ -132,7 +130,7 @@ export class TransactionListener< /** * Get the listener status - * @returns {boolean} - Listener status + * @returns - Listener status */ getStatus(): boolean { return this.status @@ -140,8 +138,8 @@ export class TransactionListener< /** * Listen to the transaction events - * @param {CallBackType} callback - Callback function - * @returns {Promise} + * @param callback - Callback function + * @returns - listener status */ async on(callback: CallBackType): Promise { if (this.webSocket === undefined) { @@ -161,8 +159,7 @@ export class TransactionListener< /** * Trigger the event when a transaction is detected - * @param {TransactionListenerTriggerType} transaction - Transaction data - * @returns {void} + * @param transaction - Transaction data */ trigger(transaction: TransactionListenerTriggerType): void { if (!this.triggeredTransactions.includes(transaction.id)) { @@ -175,7 +172,6 @@ export class TransactionListener< /** * General transaction process - * @returns {void} */ generalProcess(): void { const callback = async (transactionId: string): Promise => { @@ -197,7 +193,6 @@ export class TransactionListener< /** * Contract transaction process - * @returns {void} */ contractProcess(): void { const filter = this @@ -270,7 +265,6 @@ export class TransactionListener< /** * Coin transaction process - * @returns {void} */ coinProcess(): void { const filter = this.filter as DynamicTransactionListenerFilterType @@ -343,7 +337,6 @@ export class TransactionListener< /** * Token transaction process - * @returns {void} */ tokenProcess(): void { const filter = this @@ -411,7 +404,6 @@ export class TransactionListener< /** * NFT transaction process - * @returns {void} */ nftProcess(): void { const filter = this.filter as DynamicTransactionListenerFilterType diff --git a/packages/networks/evm-chains/src/services/TransactionSigner.ts b/packages/networks/evm-chains/src/services/TransactionSigner.ts index b56993f..b863662 100644 --- a/packages/networks/evm-chains/src/services/TransactionSigner.ts +++ b/packages/networks/evm-chains/src/services/TransactionSigner.ts @@ -34,8 +34,8 @@ export class TransactionSigner implements TransactionSignerInterface} Signed transaction data + * @param privateKey - Transaction data + * @returns Signed transaction data */ public async sign(privateKey: PrivateKey): Promise { try { @@ -64,7 +64,7 @@ export class TransactionSigner implements TransactionSignerInterface} Transaction data + * @returns Transaction data */ async send(): Promise { return (await this.provider.ethers.jsonRpc.send('eth_sendRawTransaction', [ @@ -74,7 +74,7 @@ export class TransactionSigner implements TransactionSignerInterface { provider: Provider /** - * @param {Provider} provider network provider + * @param provider network provider */ constructor(provider?: Provider) { this.provider = provider ?? Provider.instance } /** - * @returns {string} Coin name + * @returns Coin name */ getName(): string { return 'Solana' } /** - * @returns {string} Coin symbol + * @returns Coin symbol */ getSymbol(): string { return 'SOL' } /** - * @returns {number} Decimal value of the coin + * @returns Decimal value of the coin */ getDecimals(): number { return 9 } /** - * @param {WalletAddress} owner Wallet address - * @returns {Promise} Wallet balance as currency of COIN + * @param owner Wallet address + * @returns Wallet balance as currency of COIN */ async getBalance(owner: WalletAddress): Promise { return fromLamports(await this.provider.web3.getBalance(new PublicKey(owner))) } /** - * @param {WalletAddress} sender Sender wallet address - * @param {WalletAddress} receiver Receiver wallet address - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Transaction signer + * @param sender Sender wallet address + * @param receiver Receiver wallet address + * @param amount Amount of assets that will be transferred + * @returns Transaction signer */ async transfer( sender: WalletAddress, diff --git a/packages/networks/solana/src/assets/Contract.ts b/packages/networks/solana/src/assets/Contract.ts index 6074d62..c94a40e 100644 --- a/packages/networks/solana/src/assets/Contract.ts +++ b/packages/networks/solana/src/assets/Contract.ts @@ -24,8 +24,8 @@ export class Contract implements ContractInterface { provider: Provider /** - * @param {ContractAddress} address Contract address - * @param {Provider} provider Blockchain network provider + * @param address Contract address + * @param provider Blockchain network provider */ constructor(address: ContractAddress, provider?: Provider) { this.address = address @@ -34,25 +34,25 @@ export class Contract implements ContractInterface { } /** - * @returns {ContractAddress} Contract address + * @returns Contract address */ getAddress(): ContractAddress { return this.address } /** - * @param {string} _method Method name - * @param {unknown[]} _args Method parameters - * @returns {Promise} Method result + * @param _method Method name + * @param _args Method parameters + * @returns Method result */ async callMethod(_method: string, ..._args: unknown[]): Promise { throw new Error('Method not implemented.') } /** - * @param {string} method Method name - * @param {unknown[]} args Method parameters - * @returns {Promise} Method result + * @param method Method name + * @param args Method parameters + * @returns Method result */ async callMethodWithCache(method: string, ...args: unknown[]): Promise { if (this.cachedMethods[method] !== undefined) { @@ -63,19 +63,19 @@ export class Contract implements ContractInterface { } /** - * @param {string} _method Method name - * @param {unknown[]} _args Sender wallet address - * @returns {Promise} Encoded method data + * @param _method Method name + * @param _args Sender wallet address + * @returns Encoded method data */ async getMethodData(_method: string, ..._args: unknown[]): Promise { throw new Error('Method not implemented.') } /** - * @param {string} _method Method name - * @param {WalletAddress} _from Sender wallet address - * @param {unknown[]} _args Method parameters - * @returns {Promise} Encoded method data + * @param _method Method name + * @param _from Sender wallet address + * @param _args Method parameters + * @returns Encoded method data */ async createTransactionData( _method: string, diff --git a/packages/networks/solana/src/assets/NFT.ts b/packages/networks/solana/src/assets/NFT.ts index a199198..1932318 100644 --- a/packages/networks/solana/src/assets/NFT.ts +++ b/packages/networks/solana/src/assets/NFT.ts @@ -30,8 +30,8 @@ export class NFT extends Contract implements NftInterface { metadata: Metadata /** - * @param {PublicKey} pubKey - * @returns {Promise} Metadata of the NFT + * @param pubKey NFT address + * @returns Metadata of the NFT */ async getMetadata(pubKey?: PublicKey): Promise { try { @@ -49,8 +49,8 @@ export class NFT extends Contract implements NftInterface { } /** - * @param {PublicKey} pubKey Program ID - * @returns {Promise} Program ID + * @param pubKey Program ID + * @returns Program ID * @throws {Error} If the program ID is not found */ async getProgramId(pubKey: PublicKey): Promise { @@ -59,22 +59,22 @@ export class NFT extends Contract implements NftInterface { } /** - * @returns {Promise} NFT name + * @returns NFT name */ async getName(): Promise { return (await this.getMetadata())?.name ?? '' } /** - * @returns {Promise} NFT symbol + * @returns NFT symbol */ async getSymbol(): Promise { return (await this.getMetadata())?.symbol ?? '' } /** - * @param {WalletAddress} owner Wallet address - * @returns {Promise} Wallet balance as currency of NFT + * @param owner Wallet address + * @returns Wallet balance as currency of NFT */ async getBalance(owner: WalletAddress): Promise { const metaplex = Metaplex.make(this.provider.web3) @@ -86,8 +86,8 @@ export class NFT extends Contract implements NftInterface { } /** - * @param {NftId} nftId NFT ID - * @returns {Promise} Wallet address of the owner of the NFT + * @param nftId NFT ID + * @returns Wallet address of the owner of the NFT */ async getOwner(nftId: NftId): Promise { const accounts = await this.provider.web3.getTokenLargestAccounts(new PublicKey(nftId)) @@ -98,16 +98,16 @@ export class NFT extends Contract implements NftInterface { } /** - * @param {NftId} nftId NFT ID - * @returns {Promise} URI of the NFT + * @param nftId NFT ID + * @returns URI of the NFT */ async getTokenURI(nftId: NftId): Promise { return (await this.getMetadata(new PublicKey(nftId)))?.uri ?? '' } /** - * @param {NftId} nftId ID of the NFT that will be transferred - * @returns {Promise} Wallet address of the approved spender + * @param nftId ID of the NFT that will be transferred + * @returns Wallet address of the approved spender */ async getApproved(nftId: NftId): Promise { const accounts = await this.provider.web3.getTokenLargestAccounts(new PublicKey(nftId)) @@ -118,10 +118,10 @@ export class NFT extends Contract implements NftInterface { } /** - * @param {WalletAddress} sender Sender address - * @param {WalletAddress} receiver Receiver address - * @param {NftId} nftId NFT ID - * @returns {Promise} Transaction signer + * @param sender Sender address + * @param receiver Receiver address + * @param nftId NFT ID + * @returns Transaction signer */ async transfer( sender: WalletAddress, @@ -132,11 +132,11 @@ export class NFT extends Contract implements NftInterface { } /** - * @param {WalletAddress} spender Spender address - * @param {WalletAddress} owner Owner address - * @param {WalletAddress} receiver Receiver address - * @param {NftId} nftId NFT ID - * @returns {Promise} Transaction signer + * @param spender Spender address + * @param owner Owner address + * @param receiver Receiver address + * @param nftId NFT ID + * @returns Transaction signer */ async transferFrom( spender: WalletAddress, @@ -212,10 +212,10 @@ export class NFT extends Contract implements NftInterface { /** * Gives permission to the spender to spend owner's tokens - * @param {WalletAddress} owner Address of owner of the tokens that will be used - * @param {WalletAddress} spender Address of the spender that will use the tokens of owner - * @param {NftId} nftId ID of the NFT that will be transferred - * @returns {Promise} Transaction signer + * @param owner Address of owner of the tokens that will be used + * @param spender Address of the spender that will use the tokens of owner + * @param nftId ID of the NFT that will be transferred + * @returns Transaction signer */ async approve( owner: WalletAddress, diff --git a/packages/networks/solana/src/assets/Token.ts b/packages/networks/solana/src/assets/Token.ts index 89292af..b67744c 100644 --- a/packages/networks/solana/src/assets/Token.ts +++ b/packages/networks/solana/src/assets/Token.ts @@ -38,7 +38,7 @@ export class Token extends Contract implements TokenInterface /** * Token metadata - * @returns {Promise} Metadata of the token + * @returns Metadata of the token */ async getMetadata(): Promise { if (this.metadata !== undefined) return this.metadata @@ -78,7 +78,7 @@ export class Token extends Contract implements TokenInterface } /** - * @returns {Promise} Program ID + * @returns Program ID */ async getProgramId(): Promise { const accountInfo = await this.provider.web3.getAccountInfo(this.pubKey) @@ -86,7 +86,7 @@ export class Token extends Contract implements TokenInterface } /** - * @returns {Promise} Token name + * @returns Token name */ async getName(): Promise { await this.getMetadata() @@ -94,7 +94,7 @@ export class Token extends Contract implements TokenInterface } /** - * @returns {Promise} Token symbol + * @returns Token symbol */ async getSymbol(): Promise { await this.getMetadata() @@ -102,7 +102,7 @@ export class Token extends Contract implements TokenInterface } /** - * @returns {Promise} Decimal value of the token + * @returns Decimal value of the token */ async getDecimals(): Promise { await this.getMetadata() @@ -110,8 +110,8 @@ export class Token extends Contract implements TokenInterface } /** - * @param {WalletAddress} owner Wallet address - * @returns {Promise} Wallet balance as currency of TOKEN + * @param owner Wallet address + * @returns Wallet balance as currency of TOKEN */ async getBalance(owner: WalletAddress): Promise { try { @@ -131,16 +131,16 @@ export class Token extends Contract implements TokenInterface } /** - * @returns {Promise} Total supply of the token + * @returns Total supply of the token */ async getTotalSupply(): Promise { return (await this.provider.web3.getTokenSupply(this.pubKey)).value.uiAmount ?? 0 } /** - * @param {WalletAddress} owner Address of owner of the tokens that is being used - * @param {WalletAddress} spender Address of the spender that is using the tokens of owner - * @returns {Promise} Amount of tokens that the spender is allowed to spend + * @param owner Address of owner of the tokens that is being used + * @param spender Address of the spender that is using the tokens of owner + * @returns Amount of tokens that the spender is allowed to spend */ async getAllowance(owner: WalletAddress, spender?: WalletAddress): Promise { try { @@ -171,8 +171,8 @@ export class Token extends Contract implements TokenInterface } /** - * @param {number} amount Amount of tokens that will be transferred - * @returns {Promise} Formatted amount + * @param amount Amount of tokens that will be transferred + * @returns Formatted amount */ private async formatAmount(amount: number): Promise { const decimals = await this.getDecimals() @@ -181,10 +181,10 @@ export class Token extends Contract implements TokenInterface /** * transfer() method is the main method for processing transfers for fungible assets (TOKEN, COIN) - * @param {WalletAddress} sender Sender wallet address - * @param {WalletAddress} receiver Receiver wallet address - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Transaction signer + * @param sender Sender wallet address + * @param receiver Receiver wallet address + * @param amount Amount of assets that will be transferred + * @returns Transaction signer */ async transfer( sender: WalletAddress, @@ -195,11 +195,11 @@ export class Token extends Contract implements TokenInterface } /** - * @param {WalletAddress} spender Address of the spender of transaction - * @param {WalletAddress} owner Sender wallet address - * @param {WalletAddress} receiver Receiver wallet address - * @param {TransferAmount} amount Amount of tokens that will be transferred - * @returns {Promise} Transaction signer + * @param spender Address of the spender of transaction + * @param owner Sender wallet address + * @param receiver Receiver wallet address + * @param amount Amount of tokens that will be transferred + * @returns Transaction signer */ async transferFrom( spender: WalletAddress, @@ -283,10 +283,10 @@ export class Token extends Contract implements TokenInterface /** * Gives permission to the spender to spend owner's tokens - * @param {WalletAddress} owner Address of owner of the tokens that will be used - * @param {WalletAddress} spender Address of the spender that will use the tokens of owner - * @param {TransferAmount} amount Amount of the tokens that will be used - * @returns {Promise} Transaction signer + * @param owner Address of owner of the tokens that will be used + * @param spender Address of the spender that will use the tokens of owner + * @param amount Amount of the tokens that will be used + * @returns Transaction signer */ async approve( owner: WalletAddress, diff --git a/packages/networks/solana/src/browser/Wallet.ts b/packages/networks/solana/src/browser/Wallet.ts index 9811554..773d12a 100644 --- a/packages/networks/solana/src/browser/Wallet.ts +++ b/packages/networks/solana/src/browser/Wallet.ts @@ -90,8 +90,8 @@ export class Wallet implements WalletInterface any /** - * @param {WalletAdapterType} adapter - * @param {Provider} provider + * @param adapter - Wallet adapter + * @param provider - Blockchain network provider */ constructor(adapter: WalletAdapterType, provider?: Provider) { this.adapter = adapter @@ -99,44 +99,44 @@ export class Wallet implements WalletInterface} + * @param config - Connection configuration + * @returns Wallet address */ async connect(config?: ConnectConfig): Promise { return await new Promise((resolve, reject) => { @@ -174,29 +174,29 @@ export class Wallet implements WalletInterface { return await this.adapter.isDetected() } /** - * @returns {boolean} + * @returns Connection status */ async isConnected(): Promise { return await this.adapter.isConnected() } /** - * @returns {Promise} + * @returns Wallet address */ async getAddress(): Promise { return this.walletProvider.publicKey?.toBase58() ?? '' } /** - * @param {string} message - * @returns {Promise} + * @param message - Message to sign + * @returns Signed message */ async signMessage(message: string): Promise { return await new Promise((resolve, reject) => { @@ -213,8 +213,8 @@ export class Wallet implements WalletInterface} + * @param transactionSigner - Transaction signer + * @returns Transaction ID */ async sendTransaction(transactionSigner: TransactionSigner): Promise { return await new Promise((resolve, reject) => { @@ -235,9 +235,8 @@ export class Wallet implements WalletInterface void): void { this.walletProvider.on(eventName as keyof WalletAdapterEvents, callback) diff --git a/packages/networks/solana/src/models/CoinTransaction.ts b/packages/networks/solana/src/models/CoinTransaction.ts index 187c55a..8217b3e 100644 --- a/packages/networks/solana/src/models/CoinTransaction.ts +++ b/packages/networks/solana/src/models/CoinTransaction.ts @@ -11,8 +11,8 @@ import { export class CoinTransaction extends Transaction implements CoinTransactionInterface { /** - * @param {ParsedTransactionWithMeta} data Transaction data - * @returns {Promise} Wallet address of the receiver of transaction + * @param data Transaction data + * @returns Wallet address of the receiver of transaction */ findTransferInstruction(data: ParsedTransactionWithMeta): ParsedInstruction | null { return ( @@ -27,7 +27,7 @@ export class CoinTransaction extends Transaction implements CoinTransactionInter } /** - * @returns {Promise} Wallet address of the receiver of transaction + * @returns Wallet address of the receiver of transaction */ async getReceiver(): Promise { const data = await this.getData() @@ -41,7 +41,7 @@ export class CoinTransaction extends Transaction implements CoinTransactionInter } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSender(): Promise { const data = await this.getData() @@ -53,7 +53,7 @@ export class CoinTransaction extends Transaction implements CoinTransactionInter } /** - * @returns {Promise} Amount of coin that will be transferred + * @returns Amount of coin that will be transferred */ async getAmount(): Promise { const data = await this.getData() @@ -67,10 +67,10 @@ export class CoinTransaction extends Transaction implements CoinTransactionInter } /** - * @param {AssetDirectionEnum} direction - Direction of the transaction (asset) - * @param {WalletAddress} address - Wallet address of the receiver or sender of the transaction, dependant on direction - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Status of the transaction + * @param direction - Direction of the transaction (asset) + * @param address - Wallet address of the receiver or sender of the transaction, dependant on direction + * @param amount Amount of assets that will be transferred + * @returns Status of the transaction */ async verifyTransfer( direction: AssetDirectionEnum, diff --git a/packages/networks/solana/src/models/ContractTransaction.ts b/packages/networks/solana/src/models/ContractTransaction.ts index 318e407..48d8873 100644 --- a/packages/networks/solana/src/models/ContractTransaction.ts +++ b/packages/networks/solana/src/models/ContractTransaction.ts @@ -4,8 +4,8 @@ import type { ContractAddress, ContractTransactionInterface } from '@multiplecha export class ContractTransaction extends Transaction implements ContractTransactionInterface { /** - * @param {ParsedTransactionWithMeta} data Transaction data - * @returns {Promise} Wallet address of the receiver of transaction + * @param data Transaction data + * @returns Wallet address of the receiver of transaction */ findTransferInstruction(data: ParsedTransactionWithMeta): ParsedInstruction | null { const length = data.transaction.message.instructions.length @@ -13,7 +13,7 @@ export class ContractTransaction extends Transaction implements ContractTransact } /** - * @returns {Promise} Contract address of the transaction + * @returns Contract address of the transaction */ async getAddress(): Promise { const data = await this.getData() diff --git a/packages/networks/solana/src/models/NftTransaction.ts b/packages/networks/solana/src/models/NftTransaction.ts index afe885d..1e775ed 100644 --- a/packages/networks/solana/src/models/NftTransaction.ts +++ b/packages/networks/solana/src/models/NftTransaction.ts @@ -10,8 +10,8 @@ import type { export class NftTransaction extends ContractTransaction implements NftTransactionInterface { /** - * @param {ParsedTransactionWithMeta} data Transaction data - * @returns {Promise} Wallet address of the receiver of transaction + * @param data Transaction data + * @returns Wallet address of the receiver of transaction */ findTransferInstruction(data: ParsedTransactionWithMeta): ParsedInstruction | null { return ( @@ -26,7 +26,7 @@ export class NftTransaction extends ContractTransaction implements NftTransactio } /** - * @returns {Promise} Contract address of the transaction + * @returns Contract address of the transaction */ async getAddress(): Promise { const data = await this.getData() @@ -52,7 +52,7 @@ export class NftTransaction extends ContractTransaction implements NftTransactio } /** - * @returns {Promise} Receiver wallet address + * @returns Receiver wallet address */ async getReceiver(): Promise { const data = await this.getData() @@ -68,7 +68,7 @@ export class NftTransaction extends ContractTransaction implements NftTransactio } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSender(): Promise { const data = await this.getData() @@ -81,7 +81,7 @@ export class NftTransaction extends ContractTransaction implements NftTransactio } /** - * @returns {Promise} NFT ID + * @returns NFT ID */ async getNftId(): Promise { const data = await this.getData() @@ -94,11 +94,10 @@ export class NftTransaction extends ContractTransaction implements NftTransactio } /** - * @param {AssetDirectionEnum} direction - Direction of the transaction (nft) - * @param {WalletAddress} address - Wallet address of the receiver or sender of the transaction, dependant on direction - * @param {NftId} nftId ID of the NFT that will be transferred - * @override verifyTransfer() in AssetTransactionInterface - * @returns {Promise} Status of the transaction + * @param direction - Direction of the transaction (nft) + * @param address - Wallet address of the receiver or sender of the transaction, dependant on direction + * @param nftId ID of the NFT that will be transferred + * @returns Status of the transaction */ async verifyTransfer( direction: AssetDirectionEnum, diff --git a/packages/networks/solana/src/models/TokenTransaction.ts b/packages/networks/solana/src/models/TokenTransaction.ts index 55590a9..611f97e 100644 --- a/packages/networks/solana/src/models/TokenTransaction.ts +++ b/packages/networks/solana/src/models/TokenTransaction.ts @@ -16,8 +16,8 @@ import type { export class TokenTransaction extends ContractTransaction implements TokenTransactionInterface { /** - * @param {ParsedTransactionWithMeta} data Transaction data - * @returns {Promise} Wallet address of the receiver of transaction + * @param data Transaction data + * @returns Wallet address of the receiver of transaction */ findTransferInstruction(data: ParsedTransactionWithMeta): ParsedInstruction | null { return ( @@ -32,7 +32,7 @@ export class TokenTransaction extends ContractTransaction implements TokenTransa } /** - * @returns {Promise} Contract address of the transaction + * @returns Contract address of the transaction */ async getAddress(): Promise { const data = await this.getData() @@ -58,7 +58,7 @@ export class TokenTransaction extends ContractTransaction implements TokenTransa } /** - * @returns {Promise} Wallet address of the receiver of transaction + * @returns Wallet address of the receiver of transaction */ async getReceiver(): Promise { const data = await this.getData() @@ -75,7 +75,7 @@ export class TokenTransaction extends ContractTransaction implements TokenTransa } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSender(): Promise { const data = await this.getData() @@ -87,7 +87,7 @@ export class TokenTransaction extends ContractTransaction implements TokenTransa } /** - * @returns {Promise} Amount of tokens that will be transferred + * @returns Amount of tokens that will be transferred */ async getAmount(): Promise { const data = await this.getData() @@ -113,10 +113,10 @@ export class TokenTransaction extends ContractTransaction implements TokenTransa } /** - * @param {AssetDirectionEnum} direction - Direction of the transaction (token) - * @param {WalletAddress} address - Wallet address of the owner or spender of the transaction, dependant on direction - * @param {TransferAmount} amount Amount of tokens that will be approved - * @returns {Promise} Status of the transaction + * @param direction - Direction of the transaction (token) + * @param address - Wallet address of the owner or spender of the transaction, dependant on direction + * @param amount Amount of tokens that will be approved + * @returns Status of the transaction */ async verifyTransfer( direction: AssetDirectionEnum, diff --git a/packages/networks/solana/src/models/Transaction.ts b/packages/networks/solana/src/models/Transaction.ts index 7ec690d..3bd4a07 100644 --- a/packages/networks/solana/src/models/Transaction.ts +++ b/packages/networks/solana/src/models/Transaction.ts @@ -35,8 +35,8 @@ export class Transaction implements TransactionInterface} Transaction data + * @returns Transaction data */ async getData(): Promise { if (this.data !== null) { @@ -66,8 +66,8 @@ export class Transaction implements TransactionInterface} Status of the transaction + * @param ms - Milliseconds to wait for the transaction to be confirmed. Default is 4000ms + * @returns Status of the transaction */ async wait(ms: number = 4000): Promise { return await new Promise((resolve, reject) => { @@ -103,14 +103,14 @@ export class Transaction implements TransactionInterface} Type of the transaction + * @returns Type of the transaction */ async getType(): Promise { const data = await this.getData() @@ -151,7 +151,7 @@ export class Transaction implements TransactionInterface} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSigner(): Promise { const data = await this.getData() @@ -175,7 +175,7 @@ export class Transaction implements TransactionInterface} Transaction fee + * @returns Transaction fee */ async getFee(): Promise { const data = await this.getData() @@ -183,7 +183,7 @@ export class Transaction implements TransactionInterface} Block number that transaction + * @returns Block number that transaction */ async getBlockNumber(): Promise { const data = await this.getData() @@ -191,7 +191,7 @@ export class Transaction implements TransactionInterface} Block timestamp that transaction + * @returns Block timestamp that transaction */ async getBlockTimestamp(): Promise { const data = await this.getData() @@ -199,7 +199,7 @@ export class Transaction implements TransactionInterface} Confirmation count of the block + * @returns Confirmation count of the block */ async getBlockConfirmationCount(): Promise { const data = await this.getData() @@ -208,7 +208,7 @@ export class Transaction implements TransactionInterface} Status of the transaction + * @returns Status of the transaction */ async getStatus(): Promise { const data = await this.getData() diff --git a/packages/networks/solana/src/services/Provider.ts b/packages/networks/solana/src/services/Provider.ts index 7d2e92b..3edcb0d 100644 --- a/packages/networks/solana/src/services/Provider.ts +++ b/packages/networks/solana/src/services/Provider.ts @@ -65,7 +65,7 @@ export class Provider implements ProviderInterface { /** * Get the static instance of the provider - * @returns {Provider} Provider + * @returns Provider */ static get instance(): Provider { if (Provider._instance === undefined) { @@ -76,8 +76,7 @@ export class Provider implements ProviderInterface { /** * Initialize the static instance of the provider - * @param {NetworkConfigInterface} network - Network configuration of the provider - * @returns {void} + * @param network - Network configuration of the provider */ static initialize(network: NetworkConfigInterface): void { if (Provider._instance !== undefined) { @@ -88,8 +87,8 @@ export class Provider implements ProviderInterface { /** * Check RPC connection - * @param {string} url - RPC URL - * @returns {Promise} + * @param url - RPC URL + * @returns Connection status */ async checkRpcConnection(url?: string): Promise { try { @@ -111,8 +110,8 @@ export class Provider implements ProviderInterface { /** * Check WS connection - * @param {string} url - Websocket URL - * @returns {Promise} + * @param url - Websocket URL + * @returns Connection status */ async checkWsConnection(url?: string): Promise { try { @@ -130,8 +129,7 @@ export class Provider implements ProviderInterface { /** * Update network configuration of the provider - * @param {NetworkConfigInterface} network - Network configuration of the provider - * @returns {void} + * @param network - Network configuration of the provider */ update(network: NetworkConfigInterface): void { this.network = network @@ -146,7 +144,7 @@ export class Provider implements ProviderInterface { /** * Get the current network configuration is testnet or not - * @returns {boolean} Testnet status + * @returns Testnet status */ isTestnet(): boolean { return this.network?.testnet ?? false diff --git a/packages/networks/solana/src/services/TransactionListener.ts b/packages/networks/solana/src/services/TransactionListener.ts index 0d5e612..1c8cac5 100644 --- a/packages/networks/solana/src/services/TransactionListener.ts +++ b/packages/networks/solana/src/services/TransactionListener.ts @@ -92,9 +92,9 @@ export class TransactionListener< filter?: DynamicTransactionListenerFilterType | Record /** - * @param {T} type - Transaction type - * @param {DynamicTransactionListenerFilterType} filter - Transaction listener filter - * @param {Provider} provider - Provider + * @param type - Transaction type + * @param filter - Transaction listener filter + * @param provider - Provider */ constructor(type: T, filter?: DynamicTransactionListenerFilterType, provider?: Provider) { this.type = type @@ -104,7 +104,6 @@ export class TransactionListener< /** * Close the listener - * @returns {void} */ stop(): void { if (this.status) { @@ -115,7 +114,6 @@ export class TransactionListener< /** * Start the listener - * @returns {void} */ start(): void { if (!this.status) { @@ -127,7 +125,7 @@ export class TransactionListener< /** * Get the listener status - * @returns {boolean} Listener status + * @returns Listener status */ getStatus(): boolean { return this.status @@ -135,8 +133,8 @@ export class TransactionListener< /** * Listen to the transaction events - * @param {CallBackType} callback - Transaction listener callback - * @returns {Promise} + * @param callback - Transaction listener callback + * @returns Listener status */ async on(callback: CallBackType): Promise { if (!this.connected) { @@ -155,8 +153,7 @@ export class TransactionListener< /** * Trigger the event when a transaction is detected - * @param {TransactionListenerTriggerType} transaction - Transaction data - * @returns {void} + * @param transaction - Transaction data */ trigger(transaction: TransactionListenerTriggerType): void { if (!this.triggeredTransactions.includes(transaction.id)) { @@ -169,7 +166,6 @@ export class TransactionListener< /** * General transaction process - * @returns {void} */ generalProcess(): void { let subscriptionId: number @@ -216,8 +212,8 @@ export class TransactionListener< } /** - * @param {(ParsedInstruction | PartiallyDecodedInstruction)[]} instructions - * @returns {boolean} + * @param instructions Instructions + * @returns System program status */ private isSystemProgram( instructions: Array @@ -231,7 +227,6 @@ export class TransactionListener< /** * Contract transaction process - * @returns {void} */ contractProcess(): void { const filter = this @@ -289,7 +284,6 @@ export class TransactionListener< /** * Coin transaction process - * @returns {void} */ coinProcess(): void { const filter = this.filter as DynamicTransactionListenerFilterType @@ -462,7 +456,6 @@ export class TransactionListener< /** * Token transaction process - * @returns {Promise} */ async tokenProcess(): Promise { const callback = async (logs: Logs): Promise => { @@ -508,7 +501,6 @@ export class TransactionListener< /** * NFT transaction process - * @returns {Promise} */ async nftProcess(): Promise { const callback = async (logs: Logs): Promise => { diff --git a/packages/networks/solana/src/services/TransactionSigner.ts b/packages/networks/solana/src/services/TransactionSigner.ts index e9570ca..95c7b2b 100644 --- a/packages/networks/solana/src/services/TransactionSigner.ts +++ b/packages/networks/solana/src/services/TransactionSigner.ts @@ -24,8 +24,8 @@ export class TransactionSigner provider: Provider /** - * @param {RawTransaction} rawData - Transaction data - * @param {Provider} provider - Blockchain network provider + * @param rawData - Transaction data + * @param provider - Blockchain network provider */ constructor(rawData: RawTransaction, provider?: Provider) { this.rawData = rawData @@ -34,8 +34,8 @@ export class TransactionSigner /** * Sign the transaction - * @param {PrivateKey} privateKey - Transaction data - * @returns {Promise} Signed transaction data + * @param privateKey - Transaction data + * @returns Signed transaction data */ async sign(privateKey: PrivateKey): Promise { this.rawData.recentBlockhash = ( @@ -62,8 +62,8 @@ export class TransactionSigner } /** - * @param {string} encodedTransaction - Encoded transaction - * @returns {RawTransaction | VersionedTransaction} Transaction data + * @param encodedTransaction - Encoded transaction + * @returns Transaction data */ private getRawTransaction(encodedTransaction: string): RawTransaction | VersionedTransaction { let recoveredTransaction: RawTransaction | VersionedTransaction @@ -79,7 +79,7 @@ export class TransactionSigner /** * Send the transaction to the blockchain network - * @returns {Promise} + * @returns Transaction ID */ async send(): Promise { return await this.provider.web3.sendRawTransaction(this.signedData) diff --git a/packages/networks/tron/src/assets/Coin.ts b/packages/networks/tron/src/assets/Coin.ts index 26cf68c..6f37e57 100644 --- a/packages/networks/tron/src/assets/Coin.ts +++ b/packages/networks/tron/src/assets/Coin.ts @@ -14,36 +14,36 @@ export class Coin implements CoinInterface { provider: Provider /** - * @param {Provider} provider network provider + * @param provider network provider */ constructor(provider?: Provider) { this.provider = provider ?? Provider.instance } /** - * @returns {string} Coin name + * @returns Coin name */ getName(): string { return 'Tron' } /** - * @returns {string} Coin symbol + * @returns Coin symbol */ getSymbol(): string { return 'TRX' } /** - * @returns {number} Decimal value of the coin + * @returns Decimal value of the coin */ getDecimals(): number { return 6 } /** - * @param {WalletAddress} owner Wallet address - * @returns {Promise} Wallet balance as currency of COIN + * @param owner Wallet address + * @returns Wallet balance as currency of COIN */ async getBalance(owner: WalletAddress): Promise { const balance = await this.provider.tronWeb.trx.getBalance(owner) @@ -51,10 +51,10 @@ export class Coin implements CoinInterface { } /** - * @param {WalletAddress} sender Sender wallet address - * @param {WalletAddress} receiver Receiver wallet address - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Transaction signer + * @param sender Sender wallet address + * @param receiver Receiver wallet address + * @param amount Amount of assets that will be transferred + * @returns Transaction signer */ async transfer( sender: WalletAddress, diff --git a/packages/networks/tron/src/assets/Contract.ts b/packages/networks/tron/src/assets/Contract.ts index ac9f6ab..5d08b8d 100644 --- a/packages/networks/tron/src/assets/Contract.ts +++ b/packages/networks/tron/src/assets/Contract.ts @@ -76,9 +76,9 @@ export class Contract implements ContractInterface { tronContract: TronContract /** - * @param {ContractAddress} address Contract address - * @param {Provider} provider Blockchain network provider - * @param {InterfaceAbi} ABI Contract ABI + * @param address Contract address + * @param provider Blockchain network provider + * @param ABI Contract ABI */ constructor(address: ContractAddress, provider?: Provider, ABI?: InterfaceAbi) { this.ABI = ABI ?? [] @@ -88,7 +88,7 @@ export class Contract implements ContractInterface { } /** - * @returns {Promise} Set Tron contract + * @returns Set Tron contract */ async setTronContract(): Promise { if (this.tronContract !== undefined) return @@ -97,16 +97,16 @@ export class Contract implements ContractInterface { } /** - * @returns {ContractAddress} Contract address + * @returns Contract address */ getAddress(): ContractAddress { return this.address } /** - * @param {string} method Method name - * @param {unknown[]} args Method parameters - * @returns {Promise} Method result + * @param method Method name + * @param args Method parameters + * @returns Method result */ async callMethod(method: string, ...args: unknown[]): Promise { await this.setTronContract() @@ -114,9 +114,9 @@ export class Contract implements ContractInterface { } /** - * @param {string} method Method name - * @param {unknown[]} args Method parameters - * @returns {Promise} Method result + * @param method Method name + * @param args Method parameters + * @returns Method result */ async callMethodWithCache(method: string, ...args: unknown[]): Promise { if (this.cachedMethods[method] !== undefined) { @@ -127,18 +127,19 @@ export class Contract implements ContractInterface { } /** - * @param {string} _method Method name - * @param {unknown[]} _args Sender wallet address - * @returns {Promise} Encoded method data + * @param _method Method name + * @param _args Sender wallet address + * @returns Encoded method data */ async getMethodData(_method: string, ..._args: unknown[]): Promise { throw new Error('Method not implemented.') } /** - * @param {string} _function Method name - * @param {any} parameters Method parameters - * @param {WalletAddress} from Sender wallet address + * @param _function Method name + * @param parameters Method parameters + * @param from Sender wallet address + * @returns Energy estimate */ async getEstimateEnergy( _function: string, @@ -157,8 +158,8 @@ export class Contract implements ContractInterface { } /** - * @param {string} method Method name - * @returns {string} Method output + * @param method Method name + * @returns Method output */ generateFunction(method: string): string { const matchedItem = this.ABI.find((func: FunctionInterface) => func.name === method) @@ -179,9 +180,9 @@ export class Contract implements ContractInterface { } /** - * @param {string} method Method name - * @param {unknown[]} args Method parameters - * @returns {any[]} Method parameters + * @param method Method name + * @param args Method parameters + * @returns Method parameters */ generateParameters(method: string, ...args: unknown[]): any { const matchedItem = this.ABI.find((func: FunctionInterface) => func.name === method) @@ -201,10 +202,10 @@ export class Contract implements ContractInterface { } /** - * @param {string} method Method name - * @param {WalletAddress} from Sender wallet address - * @param {unknown[]} args Method parameters - * @returns {Promise} Encoded method data + * @param method Method name + * @param from Sender wallet address + * @param args Method parameters + * @returns Encoded method data */ async createTransactionData( method: string, diff --git a/packages/networks/tron/src/assets/NFT.ts b/packages/networks/tron/src/assets/NFT.ts index 1e8f9e9..b5384e6 100644 --- a/packages/networks/tron/src/assets/NFT.ts +++ b/packages/networks/tron/src/assets/NFT.ts @@ -12,55 +12,55 @@ import { export class NFT extends Contract implements NftInterface { /** - * @param {ContractAddress} address Contract address - * @param {Provider} provider Blockchain network provider - * @param {InterfaceAbi} ABI Contract ABI + * @param address Contract address + * @param provider Blockchain network provider + * @param ABI Contract ABI */ constructor(address: ContractAddress, provider?: Provider, ABI?: InterfaceAbi) { super(address, provider, ABI ?? TRC721) } /** - * @returns {Promise} NFT name + * @returns NFT name */ async getName(): Promise { return (await this.callMethodWithCache('name')) as string } /** - * @returns {Promise} NFT symbol + * @returns NFT symbol */ async getSymbol(): Promise { return (await this.callMethodWithCache('symbol')) as string } /** - * @param {WalletAddress} owner Wallet address - * @returns {Promise} Wallet balance as currency of NFT + * @param owner Wallet address + * @returns Wallet balance as currency of NFT */ async getBalance(owner: WalletAddress): Promise { return Number(await this.callMethod('balanceOf', owner)) } /** - * @param {NftId} nftId NFT ID - * @returns {Promise} Wallet address of the owner of the NFT + * @param nftId NFT ID + * @returns Wallet address of the owner of the NFT */ async getOwner(nftId: NftId): Promise { return this.provider.tronWeb.address.fromHex(await this.callMethod('ownerOf', nftId)) } /** - * @param {NftId} nftId NFT ID - * @returns {Promise} URI of the NFT + * @param nftId NFT ID + * @returns URI of the NFT */ async getTokenURI(nftId: NftId): Promise { return (await this.callMethodWithCache('tokenURI', nftId)) as string } /** - * @param {NftId} nftId ID of the NFT that will be transferred - * @returns {Promise} Wallet address of the approved spender + * @param nftId ID of the NFT that will be transferred + * @returns Wallet address of the approved spender */ async getApproved(nftId: NftId): Promise { const address = await this.callMethod('getApproved', nftId) @@ -71,10 +71,10 @@ export class NFT extends Contract implements NftInterface { } /** - * @param {WalletAddress} sender Sender address - * @param {WalletAddress} receiver Receiver address - * @param {NftId} nftId NFT ID - * @returns {Promise} Transaction signer + * @param sender Sender address + * @param receiver Receiver address + * @param nftId NFT ID + * @returns Transaction signer */ async transfer( sender: WalletAddress, @@ -85,11 +85,11 @@ export class NFT extends Contract implements NftInterface { } /** - * @param {WalletAddress} spender Spender address - * @param {WalletAddress} owner Owner address - * @param {WalletAddress} receiver Receiver address - * @param {NftId} nftId NFT ID - * @returns {Promise} Transaction signer + * @param spender Spender address + * @param owner Owner address + * @param receiver Receiver address + * @param nftId NFT ID + * @returns Transaction signer */ async transferFrom( spender: WalletAddress, @@ -138,10 +138,10 @@ export class NFT extends Contract implements NftInterface { /** * Gives permission to the spender to spend owner's tokens - * @param {WalletAddress} owner Address of owner of the tokens that will be used - * @param {WalletAddress} spender Address of the spender that will use the tokens of owner - * @param {NftId} nftId ID of the NFT that will be transferred - * @returns {Promise} Transaction signer + * @param owner Address of owner of the tokens that will be used + * @param spender Address of the spender that will use the tokens of owner + * @param nftId ID of the NFT that will be transferred + * @returns Transaction signer */ async approve( owner: WalletAddress, diff --git a/packages/networks/tron/src/assets/Token.ts b/packages/networks/tron/src/assets/Token.ts index f580de0..6cc9a9f 100644 --- a/packages/networks/tron/src/assets/Token.ts +++ b/packages/networks/tron/src/assets/Token.ts @@ -13,38 +13,38 @@ import TRC20 from '../../resources/TRC20.json' export class Token extends Contract implements TokenInterface { /** - * @param {ContractAddress} address Contract address - * @param {Provider} provider Blockchain network provider - * @param {InterfaceAbi} ABI Contract ABI + * @param address Contract address + * @param provider Blockchain network provider + * @param ABI Contract ABI */ constructor(address: ContractAddress, provider?: Provider, ABI?: InterfaceAbi) { super(address, provider, ABI ?? TRC20) } /** - * @returns {Promise} Token name + * @returns Token name */ async getName(): Promise { return (await this.callMethodWithCache('name')) as string } /** - * @returns {Promise} Token symbol + * @returns Token symbol */ async getSymbol(): Promise { return (await this.callMethodWithCache('symbol')) as string } /** - * @returns {Promise} Decimal value of the token + * @returns Decimal value of the token */ async getDecimals(): Promise { return (await this.callMethodWithCache('decimals')) as number } /** - * @param {WalletAddress} owner Wallet address - * @returns {Promise} Wallet balance as currency of TOKEN + * @param owner Wallet address + * @returns Wallet balance as currency of TOKEN */ async getBalance(owner: WalletAddress): Promise { const [decimals, balance] = await Promise.all([ @@ -55,7 +55,7 @@ export class Token extends Contract implements TokenInterface } /** - * @returns {Promise} Total supply of the token + * @returns Total supply of the token */ async getTotalSupply(): Promise { const [decimals, totalSupply] = await Promise.all([ @@ -66,9 +66,9 @@ export class Token extends Contract implements TokenInterface } /** - * @param {WalletAddress} owner Address of owner of the tokens that is being used - * @param {WalletAddress} spender Address of the spender that is using the tokens of owner - * @returns {Promise} Amount of tokens that the spender is allowed to spend + * @param owner Address of owner of the tokens that is being used + * @param spender Address of the spender that is using the tokens of owner + * @returns Amount of tokens that the spender is allowed to spend */ async getAllowance(owner: WalletAddress, spender: WalletAddress): Promise { const [decimals, allowance] = await Promise.all([ @@ -80,10 +80,10 @@ export class Token extends Contract implements TokenInterface /** * transfer() method is the main method for processing transfers for fungible assets (TOKEN, COIN) - * @param {WalletAddress} sender Sender wallet address - * @param {WalletAddress} receiver Receiver wallet address - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Transaction signer + * @param sender Sender wallet address + * @param receiver Receiver wallet address + * @param amount Amount of assets that will be transferred + * @returns Transaction signer */ async transfer( sender: WalletAddress, @@ -115,11 +115,11 @@ export class Token extends Contract implements TokenInterface } /** - * @param {WalletAddress} spender Address of the spender of transaction - * @param {WalletAddress} owner Sender wallet address - * @param {WalletAddress} receiver Receiver wallet address - * @param {TransferAmount} amount Amount of tokens that will be transferred - * @returns {Promise} Transaction signer + * @param spender Address of the spender of transaction + * @param owner Sender wallet address + * @param receiver Receiver wallet address + * @param amount Amount of tokens that will be transferred + * @returns Transaction signer */ async transferFrom( spender: WalletAddress, @@ -170,10 +170,10 @@ export class Token extends Contract implements TokenInterface /** * Gives permission to the spender to spend owner's tokens - * @param {WalletAddress} owner Address of owner of the tokens that will be used - * @param {WalletAddress} spender Address of the spender that will use the tokens of owner - * @param {TransferAmount} amount Amount of the tokens that will be used - * @returns {Promise} Transaction signer + * @param owner Address of owner of the tokens that will be used + * @param spender Address of the spender that will use the tokens of owner + * @param amount Amount of the tokens that will be used + * @returns Transaction signer */ async approve( owner: WalletAddress, diff --git a/packages/networks/tron/src/browser/Wallet.ts b/packages/networks/tron/src/browser/Wallet.ts index e6d8206..f17e61a 100644 --- a/packages/networks/tron/src/browser/Wallet.ts +++ b/packages/networks/tron/src/browser/Wallet.ts @@ -63,8 +63,8 @@ export class Wallet implements WalletInterface} + * @param config - Connection configuration + * @returns Wallet address */ async connect(config?: ConnectConfig): Promise { return await new Promise((resolve, reject) => { @@ -155,36 +155,36 @@ export class Wallet implements WalletInterface { return await this.adapter.isDetected() } /** - * @returns {boolean} + * @returns Wallet connection status */ async isConnected(): Promise { return await this.adapter.isConnected() } /** - * @returns {Promise} + * @returns Wallet chain ID */ async getChainId(): Promise { return this.networkProvider.node.id } /** - * @returns {Promise} + * @returns Wallet address */ async getAddress(): Promise { return this.walletProvider.address ?? '' } /** - * @param {string} message - * @returns {Promise} + * @param message - Message to sign + * @returns Signed message */ async signMessage(message: string): Promise { return await new Promise((resolve, reject) => { @@ -200,8 +200,8 @@ export class Wallet implements WalletInterface} + * @param transactionSigner - Transaction signer + * @returns Transaction ID */ async sendTransaction(transactionSigner: TransactionSigner): Promise { return await new Promise((resolve, reject) => { @@ -229,9 +229,8 @@ export class Wallet implements WalletInterface void): void { if (this.adapter?.provider?.on !== undefined) { diff --git a/packages/networks/tron/src/models/CoinTransaction.ts b/packages/networks/tron/src/models/CoinTransaction.ts index 68e8652..7cb95ff 100644 --- a/packages/networks/tron/src/models/CoinTransaction.ts +++ b/packages/networks/tron/src/models/CoinTransaction.ts @@ -4,7 +4,7 @@ import type { WalletAddress, CoinTransactionInterface, TransferAmount } from '@m export class CoinTransaction extends Transaction implements CoinTransactionInterface { /** - * @returns {Promise} Wallet address of the receiver of transaction + * @returns Wallet address of the receiver of transaction */ async getReceiver(): Promise { const data = await this.getData() @@ -14,14 +14,14 @@ export class CoinTransaction extends Transaction implements CoinTransactionInter } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSender(): Promise { return await this.getSigner() } /** - * @returns {Promise} Amount of coin that will be transferred + * @returns Amount of coin that will be transferred */ async getAmount(): Promise { const data = await this.getData() @@ -33,10 +33,10 @@ export class CoinTransaction extends Transaction implements CoinTransactionInter } /** - * @param {AssetDirectionEnum} direction - Direction of the transaction (asset) - * @param {WalletAddress} address - Wallet address of the receiver or sender of the transaction, dependant on direction - * @param {TransferAmount} amount Amount of assets that will be transferred - * @returns {Promise} Status of the transaction + * @param direction - Direction of the transaction (asset) + * @param address - Wallet address of the receiver or sender of the transaction, dependant on direction + * @param amount Amount of assets that will be transferred + * @returns Status of the transaction */ async verifyTransfer( direction: AssetDirectionEnum, diff --git a/packages/networks/tron/src/models/ContractTransaction.ts b/packages/networks/tron/src/models/ContractTransaction.ts index 30c3fbf..28caae8 100644 --- a/packages/networks/tron/src/models/ContractTransaction.ts +++ b/packages/networks/tron/src/models/ContractTransaction.ts @@ -15,7 +15,7 @@ export interface DecodedInputData { export class ContractTransaction extends Transaction implements ContractTransactionInterface { /** - * @returns {Promise} Contract address of the transaction + * @returns Contract address of the transaction */ async getAddress(): Promise { const data = await this.getData() @@ -25,8 +25,8 @@ export class ContractTransaction extends Transaction implements ContractTransact } /** - * @param {TransactionData} txData Transaction data - * @returns {Promise} Decoded transaction data + * @param txData Transaction data + * @returns Decoded transaction data */ async decodeData(txData?: TransactionData): Promise { if (txData === undefined) { diff --git a/packages/networks/tron/src/models/NftTransaction.ts b/packages/networks/tron/src/models/NftTransaction.ts index 15ba492..3cbba37 100644 --- a/packages/networks/tron/src/models/NftTransaction.ts +++ b/packages/networks/tron/src/models/NftTransaction.ts @@ -4,7 +4,7 @@ import type { NftId, NftTransactionInterface, WalletAddress } from '@multiplecha export class NftTransaction extends ContractTransaction implements NftTransactionInterface { /** - * @returns {Promise} Receiver wallet address + * @returns Receiver wallet address */ async getReceiver(): Promise { const decoded = await this.decodeData() @@ -21,7 +21,7 @@ export class NftTransaction extends ContractTransaction implements NftTransactio } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSender(): Promise { const decoded = await this.decodeData() @@ -38,18 +38,17 @@ export class NftTransaction extends ContractTransaction implements NftTransactio } /** - * @returns {Promise} NFT ID + * @returns NFT ID */ async getNftId(): Promise { return Number((await this.decodeData())?.decodedInput[2] ?? 0) } /** - * @param {AssetDirectionEnum} direction - Direction of the transaction (nft) - * @param {WalletAddress} address - Wallet address of the receiver or sender of the transaction, dependant on direction - * @param {NftId} nftId ID of the NFT that will be transferred - * @override verifyTransfer() in AssetTransactionInterface - * @returns {Promise} Status of the transaction + * @param direction - Direction of the transaction (nft) + * @param address - Wallet address of the receiver or sender of the transaction, dependant on direction + * @param nftId ID of the NFT that will be transferred + * @returns Status of the transaction */ async verifyTransfer( direction: AssetDirectionEnum, diff --git a/packages/networks/tron/src/models/TokenTransaction.ts b/packages/networks/tron/src/models/TokenTransaction.ts index ec35605..deea420 100644 --- a/packages/networks/tron/src/models/TokenTransaction.ts +++ b/packages/networks/tron/src/models/TokenTransaction.ts @@ -6,7 +6,7 @@ import type { WalletAddress, TokenTransactionInterface, TransferAmount } from '@ export class TokenTransaction extends ContractTransaction implements TokenTransactionInterface { /** - * @returns {Promise} Wallet address of the receiver of transaction + * @returns Wallet address of the receiver of transaction */ async getReceiver(): Promise { const decoded = await this.decodeData() @@ -23,7 +23,7 @@ export class TokenTransaction extends ContractTransaction implements TokenTransa } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSender(): Promise { const decoded = await this.decodeData() @@ -40,7 +40,7 @@ export class TokenTransaction extends ContractTransaction implements TokenTransa } /** - * @returns {Promise} Amount of tokens that will be transferred + * @returns Amount of tokens that will be transferred */ async getAmount(): Promise { const token = new Token(await this.getAddress()) @@ -59,10 +59,10 @@ export class TokenTransaction extends ContractTransaction implements TokenTransa } /** - * @param {AssetDirectionEnum} direction - Direction of the transaction (token) - * @param {WalletAddress} address - Wallet address of the owner or spender of the transaction, dependant on direction - * @param {TransferAmount} amount Amount of tokens that will be approved - * @returns {Promise} Status of the transaction + * @param direction - Direction of the transaction (token) + * @param address - Wallet address of the owner or spender of the transaction, dependant on direction + * @param amount Amount of tokens that will be approved + * @returns Status of the transaction */ async verifyTransfer( direction: AssetDirectionEnum, diff --git a/packages/networks/tron/src/models/Transaction.ts b/packages/networks/tron/src/models/Transaction.ts index bf9171c..40a2dd1 100644 --- a/packages/networks/tron/src/models/Transaction.ts +++ b/packages/networks/tron/src/models/Transaction.ts @@ -110,8 +110,8 @@ export class Transaction implements TransactionInterface { data: TransactionData /** - * @param {TransactionId} id Transaction id - * @param {Provider} provider Blockchain network provider + * @param id Transaction id + * @param provider Blockchain network provider */ constructor(id: TransactionId, provider?: Provider) { this.id = id @@ -119,7 +119,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Transaction data + * @returns Transaction data */ async getData(): Promise { try { @@ -139,8 +139,8 @@ export class Transaction implements TransactionInterface { } /** - * @param {number} ms - Milliseconds to wait for the transaction to be confirmed. Default is 4000ms - * @returns {Promise} Status of the transaction + * @param ms - Milliseconds to wait for the transaction to be confirmed. Default is 4000ms + * @returns Status of the transaction */ async wait(ms: number = 4000): Promise { return await new Promise((resolve, reject) => { @@ -164,14 +164,14 @@ export class Transaction implements TransactionInterface { } /** - * @returns {TransactionId} Transaction ID + * @returns Transaction ID */ getId(): TransactionId { return this.id } /** - * @returns {Promise} Type of the transaction + * @returns Type of the transaction */ async getType(): Promise { const data = await this.getData() @@ -203,7 +203,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {string} Transaction URL + * @returns Transaction URL */ getUrl(): string { let explorerUrl = this.provider.node.explorer @@ -213,7 +213,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Wallet address of the sender of transaction + * @returns Wallet address of the sender of transaction */ async getSigner(): Promise { const data = await this.getData() @@ -223,7 +223,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Transaction fee + * @returns Transaction fee */ async getFee(): Promise { const data = await this.getData() @@ -231,7 +231,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Block number that transaction + * @returns Block number that transaction */ async getBlockNumber(): Promise { const data = await this.getData() @@ -239,7 +239,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Block timestamp that transaction + * @returns Block timestamp that transaction */ async getBlockTimestamp(): Promise { const data = await this.getData() @@ -247,7 +247,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Confirmation count of the block + * @returns Confirmation count of the block */ async getBlockConfirmationCount(): Promise { const data = await this.getData() @@ -257,7 +257,7 @@ export class Transaction implements TransactionInterface { } /** - * @returns {Promise} Status of the transaction + * @returns Status of the transaction */ async getStatus(): Promise { const data = await this.getData() diff --git a/packages/networks/tron/src/services/Provider.ts b/packages/networks/tron/src/services/Provider.ts index f3204fc..5871f2b 100644 --- a/packages/networks/tron/src/services/Provider.ts +++ b/packages/networks/tron/src/services/Provider.ts @@ -68,7 +68,7 @@ export class Provider implements ProviderInterface { /** * Get the static instance of the provider - * @returns {Provider} Provider + * @returns Provider */ static get instance(): Provider { if (Provider._instance === undefined) { @@ -79,8 +79,7 @@ export class Provider implements ProviderInterface { /** * Initialize the static instance of the provider - * @param {NetworkConfigInterface} network - Network configuration of the provider - * @returns {void} + * @param network - Network configuration of the provider */ static initialize(network: NetworkConfigInterface): void { if (Provider._instance !== undefined) { @@ -91,8 +90,8 @@ export class Provider implements ProviderInterface { /** * Check RPC connection - * @param {string} _url - RPC URL - * @returns {Promise} + * @param _url - RPC URL + * @returns RPC connection status */ async checkRpcConnection(_url?: string): Promise { return (await this.tronWeb.isConnected()).fullNode @@ -100,8 +99,8 @@ export class Provider implements ProviderInterface { /** * Check WS connection - * @param {string} _url - Websocket URL - * @returns {Promise} + * @param _url - Websocket URL + * @returns WS connection status */ async checkWsConnection(_url?: string): Promise { return (await this.tronWeb.isConnected()).eventServer @@ -109,8 +108,7 @@ export class Provider implements ProviderInterface { /** * Update network configuration of the provider - * @param {NetworkConfigInterface} network - Network configuration of the provider - * @returns {void} + * @param network - Network configuration of the provider */ update(network: NetworkConfigInterface): void { this.network = network @@ -127,7 +125,7 @@ export class Provider implements ProviderInterface { /** * Get the current network configuration is testnet or not - * @returns {boolean} Testnet or not + * @returns Testnet or not */ isTestnet(): boolean { return this.network?.testnet ?? false diff --git a/packages/networks/tron/src/services/TransactionListener.ts b/packages/networks/tron/src/services/TransactionListener.ts index 6af67e6..a5908cb 100644 --- a/packages/networks/tron/src/services/TransactionListener.ts +++ b/packages/networks/tron/src/services/TransactionListener.ts @@ -72,9 +72,9 @@ export class TransactionListener< dynamicStop: () => void = () => {} /** - * @param {T} type - Transaction type - * @param {DynamicTransactionListenerFilterType} filter - Transaction listener filter - * @param {Provider} provider - Provider + * @param type - Transaction type + * @param filter - Transaction listener filter + * @param provider - Provider */ constructor(type: T, filter?: DynamicTransactionListenerFilterType, provider?: Provider) { this.type = type @@ -85,7 +85,6 @@ export class TransactionListener< /** * Close the listener - * @returns {void} */ stop(): void { if (this.status) { @@ -96,7 +95,6 @@ export class TransactionListener< /** * Start the listener - * @returns {void} */ start(): void { if (!this.status) { @@ -108,7 +106,7 @@ export class TransactionListener< /** * Get the listener status - * @returns {boolean} Listener status + * @returns Listener status */ getStatus(): boolean { return this.status @@ -116,8 +114,8 @@ export class TransactionListener< /** * Listen to the transaction events - * @param {CallBackType} callback - Transaction listener callback - * @returns {Promise} + * @param callback - Transaction listener callback + * @returns Promise */ async on(callback: CallBackType): Promise { this.start() @@ -127,8 +125,7 @@ export class TransactionListener< /** * Trigger the event when a transaction is detected - * @param {TransactionListenerTriggerType} transaction - Transaction data - * @returns {void} + * @param transaction - Transaction data */ trigger(transaction: TransactionListenerTriggerType): void { if (!this.triggeredTransactions.includes(transaction.id)) { @@ -141,7 +138,6 @@ export class TransactionListener< /** * General transaction process - * @returns {void} */ generalProcess(): void { // General transaction process @@ -149,7 +145,6 @@ export class TransactionListener< /** * Contract transaction process - * @returns {void} */ contractProcess(): void { // Contract transaction process @@ -157,7 +152,6 @@ export class TransactionListener< /** * Coin transaction process - * @returns {void} */ coinProcess(): void { // Coin transaction process @@ -165,7 +159,6 @@ export class TransactionListener< /** * Token transaction process - * @returns {void} */ tokenProcess(): void { // Token transaction process @@ -173,7 +166,6 @@ export class TransactionListener< /** * NFT transaction process - * @returns {void} */ nftProcess(): void { // NFT transaction process diff --git a/packages/networks/tron/src/services/TransactionSigner.ts b/packages/networks/tron/src/services/TransactionSigner.ts index e6eae80..7aa6479 100644 --- a/packages/networks/tron/src/services/TransactionSigner.ts +++ b/packages/networks/tron/src/services/TransactionSigner.ts @@ -61,8 +61,8 @@ export class TransactionSigner provider: Provider /** - * @param {TransactionData} rawData - Transaction data - * @param {Provider} provider - Blockchain network provider + * @param rawData - Transaction data + * @param provider - Blockchain network provider */ constructor(rawData: TransactionData, provider?: Provider) { this.rawData = rawData @@ -71,8 +71,8 @@ export class TransactionSigner /** * Sign the transaction - * @param {PrivateKey} privateKey - Transaction data - * @returns {Promise} Signed transaction data + * @param privateKey - Transaction data + * @returns Signed transaction data */ async sign(privateKey: PrivateKey): Promise { this.signedData = await this.provider.tronWeb.trx.sign(this.rawData, privateKey) @@ -81,7 +81,7 @@ export class TransactionSigner /** * Send the transaction to the blockchain network - * @returns {Promise} + * @returns Transaction ID */ async send(): Promise { const { transaction } = await this.provider.tronWeb.trx.sendRawTransaction(this.signedData) @@ -91,7 +91,7 @@ export class TransactionSigner /** * Get the raw transaction data - * @returns {TransactionData} + * @returns Transaction data */ getRawData(): TransactionData { return this.rawData @@ -99,7 +99,7 @@ export class TransactionSigner /** * Get the signed transaction data - * @returns {SignedTransactionData} + * @returns Signed transaction data */ getSignedData(): SignedTransactionData { return this.signedData diff --git a/packages/networks/tron/src/services/TronWeb.ts b/packages/networks/tron/src/services/TronWeb.ts index 9104850..e4df81b 100644 --- a/packages/networks/tron/src/services/TronWeb.ts +++ b/packages/networks/tron/src/services/TronWeb.ts @@ -4,8 +4,8 @@ import type { TransactionRawData } from '../assets/Contract' export class TronWeb extends TronWebBase { /** - * @param {TransactionRawData} data - Transaction data - * @returns {Promise} Transaction data + * @param data - Transaction data + * @returns Transaction data */ async triggerContract(data: TransactionRawData): Promise { const response = await this.transactionBuilder.triggerSmartContract( diff --git a/packages/types/src/assets.ts b/packages/types/src/assets.ts index 9bfe383..57789cc 100644 --- a/packages/types/src/assets.ts +++ b/packages/types/src/assets.ts @@ -105,13 +105,11 @@ export interface TokenInterface extends Omit, 'getName' | 'getSymbol'>, ContractInterface { /** - * @override getName() in AssetInterface * @returns {Promise} Name of the asset (long name) */ getName: () => Promise /** - * @override getName() in AssetInterface * @returns {Promise} Symbol of the asset (short name) */ getSymbol: () => Promise @@ -167,20 +165,18 @@ export interface NftInterface extends Omit, 'transfer' | 'getName' | 'getSymbol'>, ContractInterface { /** - * @override getName() in AssetInterface * @returns {Promise} Name of the asset (long name) */ getName: () => Promise /** - * @override getName() in AssetInterface * @returns {Promise} Symbol of the asset (short name) */ getSymbol: () => Promise /** * @param {NftId} nftId ID of the NFT - * @returns {Promise} Wallet address of owner of the NFT + * @returns {Promise} Wallet address of owner of the NFT */ getOwner: (nftId: NftId) => Promise @@ -199,7 +195,6 @@ export interface NftInterface /** * Transfers an NFT - * @override transfer() in AssetInterface * @param {WalletAddress} sender Sender wallet address * @param {WalletAddress} receiver Receiver wallet address * @param {NftId} nftId ID of the NFT that will be transferred diff --git a/packages/types/src/browser.ts b/packages/types/src/browser.ts index 9863054..56c195d 100644 --- a/packages/types/src/browser.ts +++ b/packages/types/src/browser.ts @@ -53,17 +53,17 @@ export interface WalletInterface string /** - * @returns {String} + * @returns {string} */ getName: () => string /** - * @returns {String} + * @returns {string} */ getIcon: () => string @@ -73,14 +73,14 @@ export interface WalletInterface WalletPlatformEnum[] /** - * @returns {String | undefined} + * @returns {string | undefined} */ getDownloadLink: () => string | undefined /** - * @param {String} url + * @param {string} url * @param {UnknownConfig} config - * @returns {String | null} + * @returns {string | null} */ createDeepLink: (url: string, config?: UnknownConfig) => string | null diff --git a/packages/types/src/models.ts b/packages/types/src/models.ts index e8016c8..78c185e 100644 --- a/packages/types/src/models.ts +++ b/packages/types/src/models.ts @@ -132,7 +132,6 @@ export interface NftTransactionInterface getNftId: () => Promise /** - * @override verifyTransfer() in AssetTransactionInterface * @param {AssetDirectionEnum} direction - Direction of the transaction (nft) * @param {WalletAddress} address - Wallet address of the receiver or sender of the transaction, dependant on direction * @param {NftId} nftId ID of the NFT that will be transferred diff --git a/packages/types/src/services/TransactionListenerInterface.ts b/packages/types/src/services/TransactionListenerInterface.ts index 90f9bbb..f61d2c9 100644 --- a/packages/types/src/services/TransactionListenerInterface.ts +++ b/packages/types/src/services/TransactionListenerInterface.ts @@ -152,14 +152,14 @@ export interface TransactionListenerInterface< /** * The 'on' method adds a callback function to the 'callbacks' array and starts the listener. * @param {CallBackType} callback - a function that is triggered when a transaction is detected. - * @return {Promise} + * @returns {Promise} */ on: (callback: CallBackType) => Promise /** * The 'trigger' method is triggered when a transaction is detected. * @param {Transaction} transaction - a transaction that is detected. - * @return {void} + * @returns {void} */ trigger: (transaction: Transaction) => void diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index 64739d3..0e38dab 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -6,6 +6,9 @@ const BASE58_ALPHABET: string = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmno /** * Converts the decimal to hexadecimal + * @param value - number or string + * @param decimals - number + * @returns string */ export const numberToHex = (value: number | string | BigNumber, decimals: number): string => { const length = '1' + '0'.repeat(decimals) @@ -15,6 +18,9 @@ export const numberToHex = (value: number | string | BigNumber, decimals: number /** * Converts the hexadecimal to decimal + * @param value - string + * @param decimals - number + * @returns number */ export const hexToNumber = (value: string, decimals: number): number => { const length = '1' + '0'.repeat(decimals) @@ -25,6 +31,8 @@ export const hexToNumber = (value: string, decimals: number): number => { /** * Converts the given data to Base58 string. Given data may be string or an Uint8Array * If the given data is a string, it'll be converted to Uint8Array inside of the method + * @param input - Uint8Array | string + * @returns string */ export const base58Encode = (input: Uint8Array | string): string => { // Convert input to bytes if it's a string @@ -53,6 +61,8 @@ export const base58Encode = (input: Uint8Array | string): string => { /** * Converts the given string to Base58 as an Uint8Array + * @param input - string + * @returns Uint8Array */ export const base58Decode = (input: string): Uint8Array => { let value = BigInt(0) @@ -70,6 +80,8 @@ export const base58Decode = (input: string): Uint8Array => { /** * Converts the given buffer to a string + * @param input - Buffer + * @returns string */ export const bufferToString = (input: Buffer): string => { return Buffer.from(input).toString('utf8') @@ -77,6 +89,8 @@ export const bufferToString = (input: Buffer): string => { /** * Converts the given string to a buffer + * @param input - string + * @returns Buffer */ export const stringToBuffer = (input: string): Buffer => { return Buffer.from(input, 'utf8') @@ -84,6 +98,8 @@ export const stringToBuffer = (input: string): Buffer => { /** * Checks if given value is numeric + * @param value - string | number + * @returns boolean */ export const isNumeric = (value: string | number): boolean => { return !isNaN(Number(value)) @@ -91,7 +107,7 @@ export const isNumeric = (value: string | number): boolean => { /** * Sleeps the given milliseconds - * @param {number} ms + * @param ms - number * @returns Promise */ export const sleep = async (ms: number): Promise => { @@ -100,8 +116,8 @@ export const sleep = async (ms: number): Promise => { /** * Checks if the given objects are equal - * @param {object} o1 - * @param {object} o2 + * @param o1 - object + * @param o2 - object * @returns boolean */ export const objectsEqual = (o1: object, o2: object): boolean => { @@ -110,7 +126,7 @@ export const objectsEqual = (o1: object, o2: object): boolean => { /** * Converts the given number to a readable string - * @param {number} num + * @param num - number * @returns string */ export const toReadableString = (num: number): string => { @@ -128,8 +144,8 @@ export const toReadableString = (num: number): string => { /** * checks if the given url is a valid websocket url - * @param {string} url - * @returns {Promise} + * @param url - string + * @returns Promise */ export const checkWebSocket = async (url: string): Promise => { return await new Promise((resolve, reject) => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 878c95f..0439428 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,6 +38,9 @@ devDependencies: eslint-plugin-import: specifier: ^2.29.1 version: 2.29.1(@typescript-eslint/parser@6.21.0)(eslint@8.57.0) + eslint-plugin-jsdoc: + specifier: ^48.2.9 + version: 48.2.9(eslint@8.57.0) eslint-plugin-n: specifier: ^16.6.2 version: 16.6.2(eslint@8.57.0) @@ -304,6 +307,18 @@ packages: to-fast-properties: 2.0.0 dev: true + /@es-joy/jsdoccomment@0.43.1: + resolution: {integrity: sha512-I238eDtOolvCuvtxrnqtlBaw0BwdQuYqK7eA6XIonicMdOOOb75mqdIzkGDUbS04+1Di007rgm9snFRNeVrOog==} + engines: {node: '>=16'} + dependencies: + '@types/eslint': 8.56.10 + '@types/estree': 1.0.5 + '@typescript-eslint/types': 7.12.0 + comment-parser: 1.4.1 + esquery: 1.5.0 + jsdoc-type-pratt-parser: 4.0.0 + dev: true + /@esbuild/aix-ppc64@0.19.12: resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} engines: {node: '>=12'} @@ -1093,6 +1108,13 @@ packages: resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} dev: true + /@types/eslint@8.56.10: + resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==} + dependencies: + '@types/estree': 1.0.5 + '@types/json-schema': 7.0.15 + dev: true + /@types/estree@1.0.5: resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} dev: true @@ -1198,6 +1220,11 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true + /@typescript-eslint/types@7.12.0: + resolution: {integrity: sha512-o+0Te6eWp2ppKY3mLCU+YA9pVJxhUJE15FV7kxuD9jgwIAa+w/ycGJBMrYDTpVGUM/tgpa9SeMOugSabWFq7bg==} + engines: {node: ^18.18.0 || >=20.0.0} + dev: true + /@typescript-eslint/typescript-estree@6.21.0(typescript@5.3.3): resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} engines: {node: ^16.0.0 || >=18.0.0} @@ -1454,6 +1481,11 @@ packages: engines: {node: '>=10'} dev: true + /are-docs-informative@0.0.2: + resolution: {integrity: sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==} + engines: {node: '>=14'} + dev: true + /argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: @@ -1820,6 +1852,11 @@ packages: dev: true optional: true + /comment-parser@1.4.1: + resolution: {integrity: sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==} + engines: {node: '>= 12.0.0'} + dev: true + /computeds@0.0.1: resolution: {integrity: sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==} dev: true @@ -2370,6 +2407,25 @@ packages: - supports-color dev: true + /eslint-plugin-jsdoc@48.2.9(eslint@8.57.0): + resolution: {integrity: sha512-ErpKyr2mEUEkcdZ4nwW/cvDjClvAcvJMEXkGGll0wf8sro8h6qeQ3qlZyp1vM1dRk8Ap6rMdke8FnP94QBIaVQ==} + engines: {node: '>=18'} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + dependencies: + '@es-joy/jsdoccomment': 0.43.1 + are-docs-informative: 0.0.2 + comment-parser: 1.4.1 + debug: 4.3.4 + escape-string-regexp: 4.0.0 + eslint: 8.57.0 + esquery: 1.5.0 + semver: 7.6.2 + spdx-expression-parse: 4.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /eslint-plugin-n@16.6.2(eslint@8.57.0): resolution: {integrity: sha512-6TyDmZ1HXoFQXnhCTUjVFULReoBPOAjpuiKELMkeP40yffI/1ZRO+d9ug/VC6fqISo2WkuIBk3cvuRPALaWlOQ==} engines: {node: '>=16.0.0'} @@ -3186,6 +3242,11 @@ packages: argparse: 2.0.1 dev: true + /jsdoc-type-pratt-parser@4.0.0: + resolution: {integrity: sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==} + engines: {node: '>=12.0.0'} + dev: true + /jsdom@24.0.0: resolution: {integrity: sha512-UDS2NayCvmXSXVP6mpTj+73JnNQadZlr9N68189xib2tx5Mls7swlTNao26IoHv46BZJFvXygyRtyXd1feAk1A==} engines: {node: '>=18'} @@ -4007,6 +4068,12 @@ packages: lru-cache: 6.0.0 dev: true + /semver@7.6.2: + resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} + engines: {node: '>=10'} + hasBin: true + dev: true + /set-function-length@1.2.1: resolution: {integrity: sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==} engines: {node: '>= 0.4'} @@ -4101,6 +4168,21 @@ packages: engines: {node: '>=0.10.0'} dev: true + /spdx-exceptions@2.5.0: + resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==} + dev: true + + /spdx-expression-parse@4.0.0: + resolution: {integrity: sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==} + dependencies: + spdx-exceptions: 2.5.0 + spdx-license-ids: 3.0.18 + dev: true + + /spdx-license-ids@3.0.18: + resolution: {integrity: sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==} + dev: true + /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true