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
function getCryptoPrice() { | |
var sh1=SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1"); | |
var sh2=SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet2"); | |
//Make sure that you got the API key from Coinmarketcap API dashboard and paste it in sheet_1 on cell B1 | |
var apiKey=sh1.getRange(1, 2).getValue(); | |
var url="https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC" | |
var requestOptions = { | |
method: 'GET', |
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
contract Maps() | |
field a: Map ByStr20 String = Emp ByStr20 String (*declaring variable a with no value*) | |
field b: Map ByStr20 Int32 = let c = Emp ByStr20 Int32 in | |
let d = 0x1234567890123456789012345678901234567896 in | |
let e = Int32 5 in | |
builtin put c d e (*declaring variable b with fixed value*) | |
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
contract Pairs() | |
field a: Pair (String) (Uint32) = | |
let c= "Hello" in | |
let d = Uint32 5 in | |
Pair {(String) (Uint32)} c d (*declaring variable a with no value*) | |
field b: Pair (String) (Option Uint32) = | |
let e= "" in | |
let f = None {Uint32} in |
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
contract Lists() | |
field a: List(Int32)= Nil {Int32} (*declaring variable a with no value*) | |
field b: List(Int32) = let c = Nil {Int32} in | |
let d = Int32 5 in | |
Cons{Int32} d c (*declaring variable b with fixed value*) | |
transition update_value() | |
(*updating variable a*) |
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
contract Boolean() | |
field a : Option Bool = None {Bool} (*declaring variable a with no value*) | |
field b : Bool = True (*declaring variable b with some fixed value*) | |
transition update_value() | |
(*updating variable a*) | |
c = False; (*declaring variable c in the transition*) | |
tmp = Some {Bool} c; |
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
contract Block() | |
field a: Option BNum = None {BNum} (*declaring variable a with no value*) | |
field b : BNum = BNum 5 (*declaring variable b with some fixed value*) | |
transition update_value() | |
(*updating variable a*) | |
c = BNum 6; (*declaring variable c with fixed value in the transition*) | |
tmp = Some {BNum} c; |
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
contract Address() | |
field a: Option ByStr20 = None {ByStr20} (*declaring variable a with no value*) | |
field b: ByStr20 = 0x1234567890123456789012345678901234567890 | |
(*declaring variable b with some fixed value*) | |
transition update_value() | |
(*updating variable a*) |
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
contract Hash() | |
field a: Option ByStr32 = None {ByStr32} (*declaring variable a with no value*) | |
field b: ByStr32 = 0x123456789012345678901234567890123456789012345678901234567890abff | |
(*declaring variable b with some fixed value*) | |
transition update_value() | |
(*updating variable a*) | |
c = 0xabff567890123456789012345678901234567890123456789012345678901234; (*declaring variable c with fixed value in the transition*) |
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
contract Strings() | |
field a : String = "" (*declaring variable a with no value*) | |
field b : String = "hello" (*declaring variable b with a fixed value*) | |
transition update_value() | |
(*updating variable a*) | |
c = "hi"; (*declaring variable c with fixed value in the transition*) | |
a:= c; |
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
contract Uint() | |
field a: Option Uint32 = None {Uint32} (*declaring variable a with no value*) | |
field b: Uint32 = Uint32 5 (*declaring variable b with a fixed value*) | |
transition update_value() | |
(*updating variable a*) | |
c = Uint32 6; (*declaring variable c with fixed value in the transition*) | |
tmp = Some {Uint32} c; |
NewerOlder