ts: more scaffolding
This commit is contained in:
parent
520fb915fc
commit
e6208bf241
|
@ -0,0 +1,29 @@
|
||||||
|
import { PublicKey } from "@solana/web3.js";
|
||||||
|
import { Program } from "../program/index.js";
|
||||||
|
import Provider from "../provider.js";
|
||||||
|
import { DexCoder } from "../coder/dex/index.js";
|
||||||
|
|
||||||
|
const DEX_PROGRAM_ID = new PublicKey(
|
||||||
|
// TODO
|
||||||
|
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
||||||
|
);
|
||||||
|
|
||||||
|
export function program(provider?: Provider): Program<Dex> {
|
||||||
|
return new Program<Dex>(IDL, DEX_PROGRAM_ID, provider, new DexCoder(IDL));
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
export type Dex = {
|
||||||
|
version: "0.1.0";
|
||||||
|
name: "spl_token";
|
||||||
|
instructions: [];
|
||||||
|
accounts: [];
|
||||||
|
};
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
export const IDL: Dex = {
|
||||||
|
version: "0.1.0",
|
||||||
|
name: "spl_token",
|
||||||
|
instructions: [],
|
||||||
|
accounts: [],
|
||||||
|
};
|
|
@ -1,10 +1,16 @@
|
||||||
import { Program } from "../index.js";
|
import { Program } from "../index.js";
|
||||||
import { program as tokenProgram, SplToken } from "./token.js";
|
import { program as tokenProgram, SplToken } from "./token.js";
|
||||||
|
import { program as dexProgram, Dex } from "./dex.js";
|
||||||
|
|
||||||
export { SplToken } from "./token.js";
|
export { SplToken } from "./token.js";
|
||||||
|
export { Dex } from "./dex.js";
|
||||||
|
|
||||||
export class Spl {
|
export class Spl {
|
||||||
public static token(): Program<SplToken> {
|
public static token(): Program<SplToken> {
|
||||||
return tokenProgram();
|
return tokenProgram();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static dex(): Program<Dex> {
|
||||||
|
return dexProgram();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue