Skip to content

Commit 09af27b

Browse files
authored
feat: add token_type metadata for rosetta ft operations (#1332)
1 parent 7d01085 commit 09af27b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/rosetta-helpers.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ function makeFtBurnOperation(
379379
decimals: ftMetadata.decimals,
380380
symbol: ftMetadata.symbol,
381381
},
382+
metadata: {
383+
token_type: 'ft',
384+
},
382385
},
383386
};
384387

@@ -426,6 +429,9 @@ function makeFtMintOperation(
426429
decimals: ftMetadata.decimals,
427430
symbol: ftMetadata.symbol,
428431
},
432+
metadata: {
433+
token_type: 'ft',
434+
},
429435
},
430436
};
431437

@@ -477,6 +483,9 @@ function makeFtSenderOperation(
477483
decimals: ftMetadata.decimals,
478484
symbol: ftMetadata.symbol,
479485
},
486+
metadata: {
487+
token_type: 'ft',
488+
},
480489
},
481490
coin_change: {
482491
coin_action: CoinAction.CoinSpent,
@@ -541,6 +550,9 @@ function makeFtReceiverOperation(
541550
decimals: ftMetadata.decimals,
542551
symbol: ftMetadata.symbol,
543552
},
553+
metadata: {
554+
token_type: 'ft',
555+
},
544556
},
545557
coin_change: {
546558
coin_action: CoinAction.CoinCreated,

src/tests-rosetta/block-tests.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ describe('/block tests', () => {
170170
symbol: 'NYC',
171171
},
172172
value: '-7500',
173+
metadata: {
174+
token_type: 'ft',
175+
},
173176
},
174177
coin_change: {
175178
coin_action: 'coin_spent',
@@ -193,6 +196,9 @@ describe('/block tests', () => {
193196
symbol: 'NYC',
194197
},
195198
value: '7500',
199+
metadata: {
200+
token_type: 'ft',
201+
},
196202
},
197203
coin_change: {
198204
coin_action: 'coin_created',
@@ -249,6 +255,9 @@ describe('/block tests', () => {
249255
symbol: 'NYC',
250256
},
251257
value: '-100',
258+
metadata: {
259+
token_type: 'ft',
260+
},
252261
},
253262
operation_identifier: {
254263
index: 1,
@@ -294,6 +303,9 @@ describe('/block tests', () => {
294303
symbol: 'NYC',
295304
},
296305
value: '500',
306+
metadata: {
307+
token_type: 'ft',
308+
},
297309
},
298310
operation_identifier: {
299311
index: 1,

0 commit comments

Comments
 (0)