Skip to content

Instantly share code, notes, and snippets.

@saibakatar
saibakatar / Coinmarketcap API
Created Mar 4, 2021 — forked from erajanraja24/Coinmarketcap API
Configure Coinmarketcap API on Google sheets
View Coinmarketcap API
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',
View gist:86790f002a696e453f93ed625371ebdc
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*)
View gist:709b8d33ecc83bc8d205a7821d85601e
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
View gist:daf7d07f210b288f6495a9e8cbc28803
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*)
View gist:77781635267fd5191cc564ae20e38e28
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;
@saibakatar
saibakatar / gist:969321353d4b6116b5ccb04233e460c3
Created Oct 18, 2018
Block Number declaration in Scilla
View gist:969321353d4b6116b5ccb04233e460c3
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;
View gist:2dd3a8f3d048fa9ee5a70204129f7a49
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*)
View gist:436c75df6da75c694245e70a23d4785b
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*)
View gist:8310754a24f6ca79535e14340516435b
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;
@saibakatar
saibakatar / gist:3a3959eca79709762ff286d5f9c2913e
Created Oct 18, 2018
Unsigned Integer declaration in Scilla
View gist:3a3959eca79709762ff286d5f9c2913e
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;