Skip to content

Commit

Permalink
Some bindings changes
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Oct 4, 2023
1 parent 05fd9c7 commit 503b23f
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 377 deletions.
1 change: 0 additions & 1 deletion bindings/nodejs/examples/client/13-build-account-output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ async function run() {
const accountOutput = await client.buildAccountOutput({
accountId:
'0x0000000000000000000000000000000000000000000000000000000000000000',
stateMetadata: utf8ToHex('hello'),
unlockConditions: [
new StateControllerAddressUnlockCondition(
new Ed25519Address(hexAddress),
Expand Down

This file was deleted.

This file was deleted.

29 changes: 1 addition & 28 deletions bindings/nodejs/lib/types/block/output/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,39 +177,15 @@ abstract class ImmutableFeaturesOutput extends CommonOutput {
}
}

/**
* Base class for state metadata outputs.
*/
abstract class StateMetadataOutput extends ImmutableFeaturesOutput {
readonly stateMetadata?: HexEncodedString;

/**
* @param type The type of output.
* @param amount The amount of the output.
* @param unlockConditions The unlock conditions for the output.
*/
constructor(
type: OutputType,
amount: u64,
unlockConditions: UnlockCondition[],
) {
super(type, amount, unlockConditions);
}
}

/**
* An Account output.
*/
class AccountOutput extends StateMetadataOutput {
class AccountOutput extends ImmutableFeaturesOutput {
/**
* Unique identifier of the account, which is the BLAKE2b-256 hash of the Output ID that created it.
* Unless its a newly created account, then the id is zeroed.
*/
readonly accountId: HexEncodedString;
/**
* A counter that must increase by 1 every time the account output is state transitioned.
*/
readonly stateIndex: number;
/**
* A counter that denotes the number of foundries created by this account output.
*/
Expand All @@ -223,21 +199,18 @@ class AccountOutput extends StateMetadataOutput {
* @param amount The amount of the output.
* @param mana The amount of stored mana.
* @param accountId The account ID as hex-encoded string.
* @param stateIndex A counter that must increase by 1 every time the account output is state transitioned.
* @param foundryCounter A counter that denotes the number of foundries created by this account output.
* @param unlockConditions The unlock conditions of the output.
*/
constructor(
amount: u64,
mana: u64,
accountId: HexEncodedString,
stateIndex: number,
foundryCounter: number,
unlockConditions: UnlockCondition[],
) {
super(OutputType.Account, amount, unlockConditions);
this.accountId = accountId;
this.stateIndex = stateIndex;
this.foundryCounter = foundryCounter;
this.mana = mana;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ export interface AccountOutputBuilderParams extends BasicOutputBuilderParams {
* Unique identifier of an account, which is the BLAKE2b-256 hash of the Output ID that created it.
*/
accountId: HexEncodedString;
/**
* A counter that must increase by 1 every time the account output is state transitioned.
*/
stateIndex?: number;
/**
* Metadata that can only be changed by the state controller.
*/
stateMetadata?: HexEncodedString;
/**
* A counter that denotes the number of foundries created by this account output.
*/
Expand Down
2 changes: 0 additions & 2 deletions bindings/nodejs/lib/types/wallet/transaction-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,4 @@ export interface AccountOutputParams {
immutableMetadata?: HexEncodedString;
/** Hex encoded bytes */
metadata?: HexEncodedString;
/** Hex encoded bytes */
stateMetadata?: HexEncodedString;
}

This file was deleted.

Loading

0 comments on commit 503b23f

Please sign in to comment.