Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add output how-tos #465

Merged
merged 16 commits into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Format
  • Loading branch information
Dr-Electron committed May 23, 2023
commit 7c4328830123db7598d382fd0149c806c5eacbc9
19 changes: 16 additions & 3 deletions bindings/nodejs/examples/how_tos/outputs/output_features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ async function run() {
const nftOutputWithIssuer = await client.buildNftOutput({
nftId: '0x0000000000000000000000000000000000000000000000000000000000000000',
unlockConditions: [addressUnlockCondition],
immutableFeatures: [new IssuerFeature(new Ed25519Address(hexAddress))],
immutableFeatures: [
new IssuerFeature(new Ed25519Address(hexAddress)),
],
});

// Output with metadata feature
Expand Down Expand Up @@ -74,8 +76,19 @@ async function run() {
features: [new TagFeature('0x48656c6c6f2c20576f726c6421')],
});

console.log(JSON.stringify(
[nftOutputWithSender, nftOutputWithIssuer, nftOutputWithMetadata, nftOutputWithImmutableMetadata, nftOutputWithTag], null, 2));
console.log(
JSON.stringify(
[
nftOutputWithSender,
nftOutputWithIssuer,
nftOutputWithMetadata,
nftOutputWithImmutableMetadata,
nftOutputWithTag,
],
null,
2,
),
);
} catch (error) {
console.error('Error: ', error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async function run() {
1,
),
],
})
});

// Output with governor and state controller unlock condition
const aliasOutput = await client.buildAliasOutput({
Expand All @@ -102,8 +102,20 @@ async function run() {
],
});

console.log(JSON.stringify(
[basicOutput, basicOutputWithStorageReturn, basicOutputWithTimelock, basicOutputWithExpiration, aliasOutput, foundryOutput], null, 2));
console.log(
JSON.stringify(
[
basicOutput,
basicOutputWithStorageReturn,
basicOutputWithTimelock,
basicOutputWithExpiration,
aliasOutput,
foundryOutput,
],
null,
2,
),
);
} catch (error) {
console.error('Error: ', error);
}
Expand Down