-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
94 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import type { Block } from 'blockly'; | ||
import Blockly from 'blockly'; | ||
|
||
import MichelsonLiteral from '@tezwell/michelson-sdk/literal'; | ||
import MichelsonType from '@tezwell/michelson-sdk/type'; | ||
import SmartTSTypes from '@tezwell/smartts-sdk/core/type'; | ||
import SmartTSLiterals from '@tezwell/smartts-sdk/core/literal'; | ||
import SmartML from '../generators/SmartML'; | ||
import BlockKind from '../enums/BlockKind'; | ||
import Michelson from '../generators/Michelson'; | ||
|
||
const BytesBlock = { | ||
type: BlockKind.bytes_literal, | ||
message0: 'Bytes %1', | ||
args0: [ | ||
{ | ||
type: 'field_input', | ||
name: 'bytes', | ||
text: '', | ||
check: 'String', | ||
}, | ||
], | ||
output: ['Literal', 'Bytes'], | ||
colour: 190, | ||
}; | ||
|
||
Blockly.Blocks[BlockKind.bytes_literal] = { | ||
init: function () { | ||
this.jsonInit(BytesBlock); | ||
this.setPreviousStatement(false); | ||
this.setNextStatement(false); | ||
}, | ||
}; | ||
|
||
SmartML.addBlock(BlockKind.string_literal, { | ||
toType: () => { | ||
return SmartTSTypes.TString; | ||
}, | ||
toValue: (block: Block) => { | ||
return SmartTSLiterals.Bytes(block.getFieldValue('bytes')); | ||
}, | ||
}); | ||
Michelson.addBlock(BlockKind.string_literal, { | ||
toType: () => { | ||
return MichelsonType.TBytes(); | ||
}, | ||
toMichelson: (block: Block) => { | ||
return MichelsonLiteral.Bytes(block.getFieldValue('bytes')); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
{ | ||
"storage_prefix": "@VisualTez", | ||
"networks": [ | ||
"mainnet", | ||
"hangzhounet", | ||
"ithacanet" | ||
], | ||
"node_monitor": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const isDevelopment = () => process.env.NODE_ENV === 'development'; |