Skip to content

Commit

Permalink
Roll version
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Meeseeks committed Mar 7, 2024
1 parent d67a141 commit 57ceb8f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@crocswap-libs/sdk",
"version": "0.3.3",
"version": "0.3.4",
"description": "🛠🐊🛠 An SDK for building applications on top of CrocSwap",
"author": "Ben Wolski <ben@crocodilelabs.io>",
"repository": "https://github.com/CrocSwap/sdk.git",
Expand Down
21 changes: 15 additions & 6 deletions src/examples/demo.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
import { CrocEnv } from '../croc';
import { ethers } from 'ethers';
//import { CrocPositionView } from '../position';

//const ETH = ethers.constants.AddressZero
//const DAI = "0xdc31Ee1784292379Fbb2964b3B9C4124D8F89C60"

// Scroll
const USDC = "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4"
//const USDC = "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4"

// Mainnet
//const USDC = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"

// Sepolia
//const USDC = "0x60bBA138A74C5e7326885De5090700626950d509"

// Blast
const USDB = "0x4300000000000000000000000000000000000003"

// deepcode ignore HardcodedSecret: testnet dummy key
const KEY = process.env.WALLET_KEY || "0x7c5e2cfbba7b00ba95e5ed7cd80566021da709442e147ad3e08f23f5044a3d5a"

async function demo() {
const wallet = new ethers.Wallet(KEY)

const croc = new CrocEnv("scroll", wallet)
const croc = new CrocEnv("blast", wallet)

//let tx = croc.token(USDB).approve()
//let tx = croc.tokenEth().deposit(0.01, wallet.address)
//let tx = croc.token(USDB).deposit(100, wallet.address)
//console.log(await tx)

//console.log(await croc.approveBypassRouter())
//console.log(await croc.token(USDC).approveRouter(100))

console.log((await croc.buy(USDC, 5).withEth().useRouter().swap()))
//console.log((await croc.buy(USDC, 5).withEth().useRouter().swap()))
/*console.log((await croc.sell(USDC, 0.01).forEth().useBypass().swap()))
console.log((await croc.sellEth(0.00001).for(USDC).useBypass().swap()))
console.log((await croc.buyEth(0.00001).with(USDC).useBypass().swap()))*/
Expand Down Expand Up @@ -225,9 +232,11 @@ async function demo() {
/*console.log((await croc.tokenEth().balance("benwolski.eth")).toString())
console.log(await croc.tokenEth().balanceDisplay("benwolski.eth"))*/

/*croc.slotReader().isHotPathOpen().then(console.log)
croc.slotReader().isHotPathOpen().then(console.log)
console.log(await croc.slotReader().proxyContract(1))
console.log(await croc.slotReader().proxyContract(131))*/
console.log(await croc.slotReader().proxyContract(131))

console.log(await croc.poolEthQuote(USDB).curveState())
}

demo()

0 comments on commit 57ceb8f

Please sign in to comment.