Skip to content

Commit

Permalink
Fix Account::prepareBurn() return type (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thoralf-M authored Aug 21, 2023
1 parent 5495d88 commit c0094b2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
6 changes: 6 additions & 0 deletions bindings/nodejs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security -->

## 1.0.6 - 2023-MM-DD

### Fixed

- `Account::prepareBurn()` return type;

## 1.0.5 - 2023-08-18

### Added
Expand Down
35 changes: 20 additions & 15 deletions bindings/nodejs/lib/wallet/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ export class Account {
* @param burn The outputs to burn
* @param transactionOptions The options to define a `RemainderValueStrategy`
* or custom inputs.
* @returns The resulting transaction.
* @returns The prepared transaction.
*/
async prepareBurn(
burn: Burn,
transactionOptions?: TransactionOptions,
): Promise<Transaction> {
): Promise<PreparedTransaction> {
const response = await this.methodHandler.callAccountMethod(
this.meta.index,
{
Expand All @@ -137,8 +137,13 @@ export class Account {
},
},
);
const parsed = JSON.parse(response) as Response<Transaction>;
return plainToInstance(Transaction, parsed.payload);
const parsed = JSON.parse(
response,
) as Response<PreparedTransactionData>;
return new PreparedTransaction(
plainToInstance(PreparedTransactionData, parsed.payload),
this,
);
}

/**
Expand All @@ -149,7 +154,7 @@ export class Account {
* @param burnAmount The to be burned amount.
* @param transactionOptions The options to define a `RemainderValueStrategy`
* or custom inputs.
* @returns The transaction.
* @returns The prepared transaction.
*/
async prepareBurnNativeToken(
tokenId: string,
Expand Down Expand Up @@ -181,7 +186,7 @@ export class Account {
* @param nftId The NftId.
* @param transactionOptions The options to define a `RemainderValueStrategy`
* or custom inputs.
* @returns The transaction.
* @returns The prepared transaction.
*/
async prepareBurnNft(
nftId: string,
Expand Down Expand Up @@ -234,7 +239,7 @@ export class Account {
* equal to the output consolidation threshold.
* @param force Force consolidation on addresses where the threshold isn't met.
* @param outputConsolidationThreshold A default threshold is used if this is omitted.
* @returns The consolidation transaction.
* @returns The prepared consolidation transaction.
*/
async prepareConsolidateOutputs(
params: ConsolidationParams,
Expand Down Expand Up @@ -262,7 +267,7 @@ export class Account {
* @param params The alias output options.
* @param transactionOptions The options to define a `RemainderValueStrategy`
* or custom inputs.
* @returns A transaction object.
* @returns The prepared transaction.
*/
async prepareCreateAliasOutput(
params?: AliasOutputParams,
Expand Down Expand Up @@ -294,7 +299,7 @@ export class Account {
* @param meltAmount To be melted amount.
* @param transactionOptions The options to define a `RemainderValueStrategy`
* or custom inputs.
* @returns The transaction.
* @returns The prepared transaction.
*/
async prepareMeltNativeToken(
tokenId: string,
Expand Down Expand Up @@ -347,7 +352,7 @@ export class Account {
* @param aliasId The AliasId.
* @param transactionOptions The options to define a `RemainderValueStrategy`
* or custom inputs.
* @returns The transaction.
* @returns The prepared transaction.
*/
async prepareDestroyAlias(
aliasId: string,
Expand Down Expand Up @@ -381,7 +386,7 @@ export class Account {
* @param foundryId The FoundryId.
* @param transactionOptions The options to define a `RemainderValueStrategy`
* or custom inputs.
* @returns The transaction.
* @returns The prepared transaction.
*/
async prepareDestroyFoundry(
foundryId: string,
Expand Down Expand Up @@ -792,7 +797,7 @@ export class Account {
* @param mintAmount To be minted amount.
* @param transactionOptions The options to define a `RemainderValueStrategy`
* or custom inputs.
* @returns The minting transaction.
* @returns The prepared minting transaction.
*/
async prepareMintNativeToken(
tokenId: string,
Expand Down Expand Up @@ -867,7 +872,7 @@ export class Account {
* @param params The options for minting nfts.
* @param transactionOptions The options to define a `RemainderValueStrategy`
* or custom inputs.
* @returns The minting transaction.
* @returns The prepared minting transaction.
*/
async prepareMintNfts(
params: MintNftParams[],
Expand Down Expand Up @@ -1109,7 +1114,7 @@ export class Account {
* @param params Addresses amounts and native tokens.
* @param transactionOptions The options to define a `RemainderValueStrategy`
* or custom inputs.
* @returns The sent transaction.
* @returns The prepared transaction.
*/
async prepareSendNativeTokens(
params: SendNativeTokensParams[],
Expand Down Expand Up @@ -1140,7 +1145,7 @@ export class Account {
* @param params Addresses and nft ids.
* @param transactionOptions The options to define a `RemainderValueStrategy`
* or custom inputs.
* @returns The sent transaction.
* @returns The prepared transaction.
*/
async prepareSendNft(
params: SendNftParams[],
Expand Down
4 changes: 4 additions & 0 deletions bindings/wasm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security -->

## 1.0.6 - 2023-MM-DD

Same changes as https://github.com/iotaledger/iota-sdk/blob/develop/bindings/nodejs/CHANGELOG.md.

## 1.0.5 - 2023-08-18

Same changes as https://github.com/iotaledger/iota-sdk/blob/develop/bindings/nodejs/CHANGELOG.md.
Expand Down

0 comments on commit c0094b2

Please sign in to comment.