Skip to content

Commit

Permalink
add nft issue
Browse files Browse the repository at this point in the history
  • Loading branch information
anyxem committed Oct 14, 2024
1 parent 8b20386 commit 83b35fb
Show file tree
Hide file tree
Showing 8 changed files with 1,138 additions and 310 deletions.
43 changes: 33 additions & 10 deletions src/pages/SendCustomOutput/SendCustomOutput.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,15 @@ export const getInfoAboutOutput = (output) => {
allFields: {
token_id: parsedOutput.token_id,
destination: parsedOutput.destination,
'data.name': parsedOutput.data.name,
'data.ticker': parsedOutput.data.ticker,
'data.additional_metadata_uri':
parsedOutput.data.additional_metadata_uri,
'data.creator': parsedOutput.data.creator,
'data.description.string': parsedOutput.data.description.string,
'data.icon_uri': parsedOutput.data.icon_uri,
'data.media_hash.string': parsedOutput.data.media_hash.string,
'data.media_uri': parsedOutput.data.media_uri,
'data.name.string': parsedOutput.data.name.string,
'data.ticker.string': parsedOutput.data.ticker.string,
},
}
}
Expand Down Expand Up @@ -80,23 +87,21 @@ export const getTemplate = (name) => {
if (name === 'IssueFungibleToken') {
return {
type: 'IssueFungibleToken',
//authority: '_AUTHORITY',
authority: 'tmt1q9r4gz3aevjm38yq8ycd6gl3kqd25xh4jqzjthdc',
authority: '',
is_freezable: false,
metadata_uri: {
hex: '',
string:
'ipfs://bafybeid7qggkecapxm5ysv7beococ5x7zdz3ro43jfj7oxhi327k62xhsq/TKNTNXM1.json',
string: '',
},
number_of_decimals: 8,
token_ticker: {
hex: '',
string: 'KTNAA',
string: '',
},
total_supply: {
amount: {
atoms: '',
decimal: '100',
decimal: '',
},
type: 'Unlimited',
},
Expand All @@ -108,8 +113,26 @@ export const getTemplate = (name) => {
token_id: '',
destination: '',
data: {
name: '',
ticker: '',
additional_metadata_uri: '',
creator: null,
description: {
hex: '',
string: '',
},
icon_uri: '',
media_hash: {
hex: '',
string: null,
},
media_uri: '',
name: {
hex: '',
string: '',
},
ticker: {
hex: '',
string: '',
},
},
}
}
Expand Down
15 changes: 15 additions & 0 deletions src/pages/SendCustomOutput/SendCustomOutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,21 @@ const SendCustomOutput = () => {
} else if (id === 'metadata_uri.string') {
data['metadata_uri']['string'] = event.target.value
data['metadata_uri']['hex'] = stringToHex(event.target.value)
} else if (id === 'data.description.string') {
data['data']['description']['string'] = event.target.value
data['data']['description']['hex'] = stringToHex(event.target.value)
} else if (id === 'data.media_hash.string') {
data['data']['media_hash']['string'] = event.target.value
data['data']['media_hash']['hex'] = stringToHex(event.target.value)
} else if (id === 'data.name.string') {
data['data']['name']['string'] = event.target.value
data['data']['name']['hex'] = stringToHex(event.target.value)
} else if (id === 'data.ticker.string') {
data['data']['ticker']['string'] = event.target.value
data['data']['ticker']['hex'] = stringToHex(event.target.value)
} else if (id.includes('.')) {
const [key, subKey] = id.split('.')
data[key][subKey] = event.target.value
} else {
data[id] = event.target.value
}
Expand Down
Loading

0 comments on commit 83b35fb

Please sign in to comment.