deso-protocol / rosetta-deso

Rosetta API implementation for DeSo
MIT License
22 stars 15 forks source link

Unknown Values of Creator_coin Transactions in Rosetta #37

Open bmalepaty opened 2 years ago

bmalepaty commented 2 years ago

Transaction Hash: 812749496fcbe7f87b5385888083da5c00cc814f5b6e4d926492142f2f81eebe Rosetta Response: "operations": [ { "operation_identifier": { "index": 0 }, "type": "INPUT", "status": "SUCCESS", "account": { "address": "BC1YLjGbnv2HM8nWbXprgeEUVCDbQ3WQwdTs3HZpF5rqDqe5T5bT5yU" }, "amount": { "value": "-29018911", "currency": { "symbol": "DESO", "decimals": 9 } } }, { "operation_identifier": { "index": 1 }, "type": "OUTPUT", "status": "SUCCESS", "account": { "address": "BC1YLhi8duT4tn93bFDNyV1WhUyTeU49wBxRhXjY11cSmR429JAb3dZ" }, "amount": { "value": "2901577", "currency": { "symbol": "DESO", "decimals": 9 } } }, { "operation_identifier": { "index": 2 }, "type": "OUTPUT", "status": "SUCCESS", "account": { "address": "BC1YLhi8duT4tn93bFDNyV1WhUyTeU49wBxRhXjY11cSmR429JAb3dZ", "sub_account": { "address": "CREATOR_COIN" } }, "amount": { "value": "26114198", "currency": { "symbol": "DESO", "decimals": 9 } } } ], "metadata": { "CreatorCoinToSellNanos": 0, "DeSoToAddNanos": 0, "DeSoToSellNanos": 29018677, "MinCreatorCoinExpectedNanos": 3865000, "MinDeSoExpectedNanos": 0, "OperationType": 0, "ProfilePublicKey": "AwyG8i9RBZ4BfLngPK8bj1GR0okrkmLWfu+t2lB4BpIp" } },

The value in operation_identifier.index=0 specifies the amount of DeSo transferred by the buyer. This value is debited from the buyer's account. What value gets credited into seller's account? What do the values in _operationidentifier.index=1 and _operationidentifier.index=2 signify? What values indicate the amount of creator coins bought? How does the transfer of creator coins change the wallet balance?

nasmithan commented 1 year ago

What value gets credited into seller's account?

29018911 is debited from the sender BC1YLjGbnv2HM8nWbXprgeEUVCDbQ3WQwdTs3HZpF5rqDqe5T5bT5yU 2901577 is credited to BC1YLhi8duT4tn93bFDNyV1WhUyTeU49wBxRhXjY11cSmR429JAb3dZ 26114198 is credited to BC1YLhi8duT4tn93bFDNyV1WhUyTeU49wBxRhXjY11cSmR429JAb3dZ The difference, 3136 is burnt as a fee.

What do the values in operation_identifier.index=1 and operation_identifier.index=2 signify?

It just means it's index 0, index 1, and index 2 in an array.

What values indicate the amount of creator coins bought?

You'll probably need someone from the DeSo team to explain, I'm not familiar with CREATOR_COINs.

How does the transfer of creator coins change the wallet balance?

Probably another question for the DeSo team, assuming it's a non standard transfer.