Skip to content

Instantly share code, notes, and snippets.

const ETH_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"
const DAI_TOKEN_ADDRESS = "0x6b175474e89094c44da98b954eedeac495271d0f"
const LUSD_TOKEN_ADDRESS = "0x5f98805A4E8be255a32880FDeC7F6728C6568bA0"
const migrateMakerVaultToLiquity = (dsa, helpers, vaultId) => {
// 1. Look up how much collateral and debt exists in the Maker vault
const vault = await helpers.getMakerResolver().getVaultById(vaultId)
const vaultCollateral = vault.ink
const vaultDebt = vault.debt
@edmulraney
edmulraney / combine-liquity-calls-example-1.js
Last active September 2, 2021 15:38
Combine Liquity function calls via Instadapp SDK
const moveLusdGainToStabilityPoolRecipe = (dsa, frontendTagAddress) => {
const spells = dsa.Spell()
const lusdGainId = 1; // ID reference to the LUSD amount that is claimed
const claimStakingGainsSpell = {
connector: "LIQUITY-A",
method: "claimStakingGains",
args: [0, lusdGainId]
export const asdf = 123
import createThunkStore from './ceate-thunk-store'
import { postUser } from './actions'
import {
POST_USER_REQUESTED,
POST_USER_SUCCEEDED,
POST_USER_FAILED,
} from './action-types'
const API_SERVICE_PATH = './api-service'
import createThunkStore from './create-thunk-store'
import { postUser } from './actions'
import {
POST_USER_REQUESTED,
POST_USER_SUCCEEDED,
POST_USER_FAILED,
} from './action-types'
describe('postUser', () => {
describe('dispatches correct actions', () => {
import createThunkStore from './create-thunk-store'
import {
POST_USER_REQUESTED,
POST_USER_SUCCEEDED,
POST_USER_FAILED,
} from './action-types'
const API_SERVICE_PATH = './api-service'
describe('postUser', () => {
@edmulraney
edmulraney / webpack.config.proxy.dev.server.js
Last active July 18, 2016 08:52
Webpack proxy server config
// some back ends don't respond correctly if origin header isn't set to target host.
devServer: {
proxy: {
"/api": {
ignorePath: true,
target: "http|https://your-api.com/api",
// secure: false, optional for https
changeOrigin: true,
},
},
//
// Copyright (c) 2014 PayPal. All rights reserved.
//
/**
* The PayPalItem class defines an optional itemization for a payment.
* @see https://developer.paypal.com/docs/api/#item-object for more details.
* @param {String} name: Name of the item. 127 characters max
* @param {Number} quantity: Number of units. 10 characters max.
<template>
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Details</h3>
</div>
<div class="panel-body">
<form role="form" class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label">Name</label>
<div class="col-sm-10">
import {transient} from 'aurelia-framework';
@transient()
export class ItemDetail {
constructor(){
this.item = {};
this.item.Name = Math.random() * 1000;
}
activate(params, config) {