Anyhedge formulas
SATS_PER_BCH = 10 ** 8
long_bch = 0.00999985
hedge_bch = 0.03081633
low_liquidation_mult = 0.755
high_liquidation_mult = 5
start_price = 10294
// pragma cashscript ^0.7.5; | |
pragma cashscript ^0.8.0; | |
contract Escrow( | |
bytes20 buyer, // 20 B | |
bytes20 seller, // 20 B | |
bytes20 servicer, // 20 B | |
bytes20 arbiter, // 20 B | |
bytes deliveryFeePool, // 23 B |
<template> | |
<div id="app-container" :class="[darkMode ? 'text-white pt-dark' : 'text-black']"> | |
<HeaderNav | |
title="WebRTC Audio Call" | |
backnavpath="/apps" | |
/> | |
<div class="q-mx-md">Local peer id: {{ localPeerId }}</div> | |
<div class="q-mx-md row items-center"> | |
<q-toggle | |
:model-value="darkMode" |
// pragma cashscript ^0.7.5; | |
pragma cashscript ^0.8.0; | |
contract Escrow( | |
bytes20 buyer, // 20 B | |
bytes20 seller, // 20 B | |
bytes20 servicer, // 20 B | |
bytes20 arbiter, // 20 B | |
bytes deliveryFeePool, // 23 B |
{ | |
"name": "Test Raccoon NFT #1", | |
"description": "Raccoon NFT. For testing purposes", | |
"uris": { | |
"image": "https://images.watchtower.cash/32ba95aef37a41659876064bc4e598e6c788b62b854a9082d211b70fb9fb577f_thumbnail.png" | |
}, | |
"extensions": { | |
"attributes": { | |
"Background": "Green", | |
"Fur": "Red", |
from math import sin, cos, sqrt, atan2, radians | |
# Test function | |
def aerial_distance(origin, destination): | |
# approximate radius of earth in m | |
R = 6373000.0 | |
if isinstance(origin, dict): | |
origin = [origin.get('lat'), origin.get('lng')] | |
elif isinstance(origin, str): | |
origin = origin.split(",", 1) |
import inspect | |
from django.db.models import Q, QuerySet | |
from django.db.models import Model, OneToOneRel, ForeignKey, ManyToManyRel | |
from django.db.models.fields.related_descriptors import ( | |
ReverseOneToOneDescriptor, | |
ReverseManyToOneDescriptor, | |
ManyToManyDescriptor | |
) | |
def get_reverse_relations(value): |
from math import sin, cos, sqrt, atan2, radians | |
def aerial_distance(self, origin, destination): | |
# approximate radius of earth in m | |
R = 6373000.0 | |
if isinstance(origin, dict): | |
origin = [origin.get('lat'), origin.get('lng')] | |
elif isinstance(origin, str): | |
origin = origin.split(",", 1) |
SATS_PER_BCH = 10 ** 8
long_bch = 0.00999985
hedge_bch = 0.03081633
low_liquidation_mult = 0.755
high_liquidation_mult = 5
start_price = 10294
// source: https://github.com/Electron-Cash/Electron-Cash/blob/master/electroncash/paymentrequest.proto | |
// | |
// Simple Bitcoin Payment Protocol messages | |
// | |
// Use fields 1000+ for extensions; | |
// to avoid conflicts, register extensions via pull-req at | |
// https://github.com/bitcoin/bips/bip-0070/extensions.mediawiki | |
// |
import * as crypto from 'crypto' | |
export const aes = { | |
generateKey() { | |
return { | |
password: crypto.randomBytes(16).toString('hex'), | |
iv: crypto.randomBytes(8).toString('hex'), | |
} | |
}, | |
encrypt(data, password, iv) { |