Skip to content

Commit ee037a3

Browse files
committed
Fix annotations of native asset in txbuilder example
1 parent febaa1f commit ee037a3

File tree

2 files changed

+31
-23
lines changed

2 files changed

+31
-23
lines changed

README.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,21 @@ builder.add_input(utxos[0])
117117
# Send 1.5 ADA and a native asset (CHOC) in quantity of 2000 to an address.
118118
builder.add_output(
119119
TransactionOutput(
120-
Address.from_primitive("addr_test1vrm9x2zsux7va6w892g38tvchnzahvcd9tykqf3ygnmwtaqyfg52x"),
120+
Address.from_primitive(
121+
"addr_test1vrm9x2zsux7va6w892g38tvchnzahvcd9tykqf3ygnmwtaqyfg52x"
122+
),
121123
Value.from_primitive(
122-
[1500000,
123-
{
124-
bytes.fromhex("57fca08abbaddee36da742a839f7d83a7e1d2419f1507fcbf3916522"): # Policy ID
125-
{
126-
b'CHOC': 2000
127-
}
128-
}]
129-
)
124+
[
125+
1500000,
126+
{
127+
bytes.fromhex(
128+
"57fca08abbaddee36da742a839f7d83a7e1d2419f1507fcbf3916522" # Policy ID
129+
): {
130+
b"CHOC": 2000 # Asset name and amount
131+
}
132+
},
133+
]
134+
),
130135
)
131136
)
132137

@@ -136,14 +141,17 @@ builder.add_output(
136141
TransactionOutput(
137142
address,
138143
Value.from_primitive(
139-
[2000000,
140-
{
141-
bytes.fromhex("57fca08abbaddee36da742a839f7d83a7e1d2419f1507fcbf3916522"): # Policy ID
142-
{
143-
b'CHOC': 200
144-
}
145-
}]
146-
)
144+
[
145+
2000000,
146+
{
147+
bytes.fromhex(
148+
"57fca08abbaddee36da742a839f7d83a7e1d2419f1507fcbf3916522" # Policy ID
149+
): {
150+
b"CHOC": 200 # Asset name and amount
151+
}
152+
},
153+
]
154+
),
147155
)
148156
)
149157

examples/tx_builder.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
1500000,
4646
{
4747
bytes.fromhex(
48-
"57fca08abbaddee36da742a839f7d83a7e1d2419f1507fcbf3916522"
49-
): { # Policy ID
50-
b"CHOC": 2000
48+
"57fca08abbaddee36da742a839f7d83a7e1d2419f1507fcbf3916522" # Policy ID
49+
): {
50+
b"CHOC": 2000 # Asset name and amount
5151
}
5252
},
5353
]
@@ -65,9 +65,9 @@
6565
2000000,
6666
{
6767
bytes.fromhex(
68-
"57fca08abbaddee36da742a839f7d83a7e1d2419f1507fcbf3916522"
69-
): { # Policy ID
70-
b"CHOC": 200
68+
"57fca08abbaddee36da742a839f7d83a7e1d2419f1507fcbf3916522" # Policy ID
69+
): {
70+
b"CHOC": 200 # Asset name and amount
7171
}
7272
},
7373
]

0 commit comments

Comments
 (0)