Skip to content

Instantly share code, notes, and snippets.

@nshen
nshen / sell.ts
Created February 9, 2025 03:42
sell.ts
/*
接口3: 输入钱包和币地址,卖出比例,立即按照当前价格卖出。
依赖:
npm i @jup-ag/api
用法:
@nshen
nshen / get-wallet-details.ts
Last active February 14, 2025 03:49
get-wallet-details.ts
/*
tsx --env-file=.env ./get-wallet-details.ts
接口2: 输入钱包地址,返回钱包的详情
每笔买入交易得到钱包余额,钱包地址,买入金额,买入单价,买入数量,交易签名,代币地址,代币名称,
卖出交易得到钱包余额,钱包地址,卖出金额,卖出单价,卖出数量,交易签名,代币地址,代币名称(最好能算出总价值))
使用方法
@nshen
nshen / listen-buy.ts
Created February 6, 2025 03:06
listen-buy.ts
/*
.env file:
# https://quicknode.com/
HTTP_PROVIDER=https://magical-thrumming-firefly.solana-mainnet.quiknode.pro/<API_KEY>
WSS_PROVIDER=wss://magical-thrumming-firefly.solana-mainnet.quiknode.pro/<API_KEY>
run:
computeVertexNormals() {
const positionAttribute = this.attributes['position'];
if (positionAttribute !== undefined) {
this.addAttribute('normal', { size: 3, data: new Float32Array(positionAttribute.count * 3) });
let normalAttribute = this.attributes['normal'];
const pA = new Vec3(), pB = new Vec3(), pC = new Vec3();
const nA = new Vec3(), nB = new Vec3(), nC = new Vec3();
const cb = new Vec3(), ab = new Vec3();
@nshen
nshen / 0_reuse_code.js
Created March 24, 2017 03:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console