cat recovery_phrase.txt | cardano-wallet key from-recovery-phrase Shelley > root.prv
cat root.prv | cardano-address key inspect
cardano-wallet key child 1852H/1815H/0H/0/0 < root.prv > payment.prv
cardano-cli key convert-cardano-address-key --shelley-payment-key
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
Mix.install([ | |
{:binpp, "~> 1.1"} | |
]) | |
# version_number taken from docs: | |
# https://postgrespro.com/docs/postgresql/9.4/protocol-message-formats | |
version_number = 196_608 | |
version = <<version_number::signed-32>> | |
whoami = System.cmd("whoami", []) |> elem(0) |> String.trim() |
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
// deno run --allow-env --allow-read --allow-net --allow-write credentials.ts | |
import { mnemonicToEntropy } from "npm:bip39"; | |
import { Blockfrost, C, Lucid, fromHex, generateSeedPhrase } from "npm:lucid-cardano"; | |
type Network = "mainnet" | "testnet"; | |
const harden = (num: number): number => { | |
if (typeof num !== "number") throw new Error("Type number required here!"); | |
return 0x80000000 + num; |
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
SELECT DISTINCT address | |
FROM utxo_view WHERE stake_address_id IN ( | |
SELECT DISTINCT sa.id | |
FROM stake_address sa | |
JOIN ( | |
SELECT d.addr_id, MAX(d.active_epoch_no) AS max_active_epoch_no | |
FROM delegation d | |
GROUP BY d.addr_id | |
) max_epochs ON sa.id = max_epochs.addr_id | |
JOIN stake_registration sr ON (sr.addr_id = sa.id) |
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
// $ deno run -A always_succeeds.ts | |
import { | |
Address, | |
Data, | |
Emulator, | |
generatePrivateKey, | |
Lovelace, | |
Lucid, | |
PrivateKey, | |
SpendingValidator, |
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
import type { NextPage } from 'next' | |
import Head from 'next/head' | |
import WalletConnect from '../components/WalletConnect' | |
import { useStoreActions, useStoreState } from "../utils/store" | |
import Link from 'next/link' | |
import { useState, useEffect } from 'react' | |
import { getAssets } from "../utils/cardano"; | |
import NftGrid from "../components/NftGrid"; | |
import initLucid from '../utils/lucid' | |
import { Lucid, Credential, TxHash, Lovelace, Constr, SpendingValidator, Data, fromText, Unit, MintingPolicy, PolicyId, Address, UTxO, applyParamsToScript, Assets, ScriptHash, Redeemer, paymentCredentialOf, KeyHash, generatePrivateKey, getAddressDetails, toUnit } from 'lucid-cardano' |
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
#!/bin/bash | |
getEpoch(){ | |
CCLI=$(which cardano-cli) | |
"$CCLI" query tip --mainnet | sed -n '3 p'| sed 's/[^0-9]*//g' | |
} | |
# Description : Calculation of days, hours, minutes and seconds from time in seconds | |
timeLeft() { | |
local T=$1 |
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
########################################## | |
# Example of using Protocols in Elixir | |
# | |
# cat .tool-versions | |
# elixir 1.14.3 | |
# erlang 24.3.4 | |
# | |
# Run via: elixir run.exs | |
# | |
############################ |
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
{-# INLINABLE mkValidator #-} | |
-- This should validate if either beneficiary1 has signed the transaction and the current slot is before or at the deadline | |
-- or if beneficiary2 has signed the transaction and the deadline has passed. | |
mkValidator :: VestingDatum -> () -> ScriptContext -> Bool | |
mkValidator datum _ sc = traceIfFalse "cannot grab" (beneficiary1Grab || beneficiary2Grab) | |
where | |
info :: TxInfo | |
info = scriptContextTxInfo sc | |
beneficiary1Grab :: Bool |
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
cardano-cli address key-gen --verification-key-file 02.vkey --signing-key-file 02.skey | |
cardano-cli address build \ | |
--payment-verification-key-file 02.vkey \ | |
--out-file 02.addr --testnet-magic 2 | |
# Optional for debugging | |
## generates key files for staking address | |
cardano-cli stake-address key-gen \ | |
--verification-key-file 01-stake.vkey \ | |
--signing-key-file 01-stake.skey |
NewerOlder