diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 0000000..afcfba3 --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,24 @@ +name: Build and Deploy +on: + push: + branches: + - main +jobs: + build-and-deploy: + concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + + - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. + run: | + cd ts + yarn install --frozen-lockfile + yarn docs + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4.3.3 + with: + branch: gh-pages # The branch the action should deploy to. + folder: ts/docs # The folder the action should deploy. diff --git a/ts/docs/classes/Coin.html b/ts/docs/classes/Coin.html index d3cb9be..c833ee1 100644 --- a/ts/docs/classes/Coin.html +++ b/ts/docs/classes/Coin.html @@ -1 +1 @@ -Coin | serum-dev-tools
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Coin

Index

Constructors

  • new Coin(symbol: string, decimals: number, mint: PublicKey, mintAuthority: Keypair, freezeAuthority: Keypair): Coin
  • Parameters

    • symbol: string
    • decimals: number
    • mint: PublicKey
    • mintAuthority: Keypair
    • freezeAuthority: Keypair

    Returns Coin

Properties

decimals: number
freezeAuthority: Keypair
mint: PublicKey
mintAuthority: Keypair
symbol: string

Methods

  • fundAccount(decimalAmount: number, owner: Keypair, connection: Connection): Promise<void>
  • Parameters

    • decimalAmount: number
    • owner: Keypair
    • connection: Connection

    Returns Promise<void>

  • getBalance(owner: Keypair, connection: Connection): Promise<RpcResponseAndContext<TokenAmount>>
  • Parameters

    • owner: Keypair
    • connection: Connection

    Returns Promise<RpcResponseAndContext<TokenAmount>>

Generated using TypeDoc

\ No newline at end of file +Coin | serum-dev-tools
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Coin

Index

Constructors

  • new Coin(symbol: string, decimals: number, mint: PublicKey, mintAuthority: Keypair, freezeAuthority: Keypair): Coin
  • Parameters

    • symbol: string
    • decimals: number
    • mint: PublicKey
    • mintAuthority: Keypair
    • freezeAuthority: Keypair

    Returns Coin

Properties

decimals: number
freezeAuthority: Keypair
mint: PublicKey
mintAuthority: Keypair
symbol: string

Methods

  • fundAccount(decimalAmount: number, owner: Keypair, connection: Connection): Promise<void>
  • Parameters

    • decimalAmount: number
    • owner: Keypair
    • connection: Connection

    Returns Promise<void>

  • getBalance(owner: Keypair, connection: Connection): Promise<RpcResponseAndContext<TokenAmount>>
  • Parameters

    • owner: Keypair
    • connection: Connection

    Returns Promise<RpcResponseAndContext<TokenAmount>>

Generated using TypeDoc

\ No newline at end of file diff --git a/ts/docs/classes/Dex.html b/ts/docs/classes/Dex.html index e851cca..f14cd58 100644 --- a/ts/docs/classes/Dex.html +++ b/ts/docs/classes/Dex.html @@ -1 +1 @@ -Dex | serum-dev-tools
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Dex

Index

Constructors

  • new Dex(address: PublicKey, connection: Connection): Dex
  • Parameters

    • address: PublicKey
    • connection: Connection

    Returns Dex

Properties

address: PublicKey
coins: Coin[]
connection: Connection
markets: DexMarket[]

Methods

  • createCoin(symbol: string, decimals: number, payer: Keypair, mintAuthority: Keypair, freezeAuthority: Keypair): Promise<Coin>
  • Parameters

    • symbol: string
    • decimals: number
    • payer: Keypair
    • mintAuthority: Keypair
    • freezeAuthority: Keypair

    Returns Promise<Coin>

  • getCoin(symbol: string): Coin

Generated using TypeDoc

\ No newline at end of file +Dex | serum-dev-tools
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Dex

Index

Constructors

  • new Dex(address: PublicKey, connection: Connection): Dex
  • Parameters

    • address: PublicKey
    • connection: Connection

    Returns Dex

Properties

address: PublicKey
coins: Coin[]
connection: Connection
markets: DexMarket[]

Methods

  • createCoin(symbol: string, decimals: number, payer: Keypair, mintAuthority: Keypair, freezeAuthority: Keypair): Promise<Coin>
  • Parameters

    • symbol: string
    • decimals: number
    • payer: Keypair
    • mintAuthority: Keypair
    • freezeAuthority: Keypair

    Returns Promise<Coin>

  • getCoin(symbol: string): Coin

Generated using TypeDoc

\ No newline at end of file diff --git a/ts/docs/classes/DexMarket.html b/ts/docs/classes/DexMarket.html index 98d438f..0ee4a48 100644 --- a/ts/docs/classes/DexMarket.html +++ b/ts/docs/classes/DexMarket.html @@ -1 +1 @@ -DexMarket | serum-dev-tools
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DexMarket

Hierarchy

  • DexMarket

Index

Constructors

  • new DexMarket(address: PublicKey, serumMarket: Market, baseCoin: Coin, quoteCoin: Coin): DexMarket

Properties

address: PublicKey
baseCoin: Coin
marketSymbol: string
quoteCoin: Coin
serumMarket: Market

Methods

  • cancelOrder(connection: Connection, owner: Keypair, serumMarket: Market, order: Order): Promise<string>
  • Parameters

    • connection: Connection
    • owner: Keypair
    • serumMarket: Market
    • order: Order

    Returns Promise<string>

  • createMarketAccountsInstructions(accounts: MarketAccounts, payer: Keypair, connection: Connection, dexProgram: PublicKey): Promise<TransactionInstruction[]>
  • Parameters

    • accounts: MarketAccounts
    • payer: Keypair
    • connection: Connection
    • dexProgram: PublicKey

    Returns Promise<TransactionInstruction[]>

  • createMarketVaultsTransaction(payer: Keypair, vaultOwner: PublicKey, baseVault: Keypair, quoteVault: Keypair, baseCoin: Coin, quoteCoin: Coin, connection: Connection): Promise<Transaction>
  • Parameters

    • payer: Keypair
    • vaultOwner: PublicKey
    • baseVault: Keypair
    • quoteVault: Keypair
    • baseCoin: Coin
    • quoteCoin: Coin
    • connection: Connection

    Returns Promise<Transaction>

  • getCancelOrderTransaction(connection: Connection, owner: Keypair, serumMarket: Market, order: Order): Promise<TransactionWithSigners>
  • getOrCreateOpenOrderAccount(owner: Keypair, serumMarket: Market, connection: Connection): Promise<OpenOrders>
  • Parameters

    • owner: Keypair
    • serumMarket: Market
    • connection: Connection

    Returns Promise<OpenOrders>

  • getPlaceOrderTransaction(connection: Connection, owner: Keypair, serumMarket: Market, side: "buy" | "sell", size: number, price: number): Promise<TransactionWithSigners>
  • load(connection: Connection, programID: PublicKey, marketAddress: PublicKey, baseCoin: Coin, quoteCoin: Coin): Promise<DexMarket>
  • Parameters

    • connection: Connection
    • programID: PublicKey
    • marketAddress: PublicKey
    • baseCoin: Coin
    • quoteCoin: Coin

    Returns Promise<DexMarket>

  • placeOrder(connection: Connection, owner: Keypair, serumMarket: Market, side: "buy" | "sell", size: number, price: number): Promise<string>
  • Parameters

    • connection: Connection
    • owner: Keypair
    • serumMarket: Market
    • side: "buy" | "sell"
    • size: number
    • price: number

    Returns Promise<string>

  • sanityCheck(serumMarket: Market, price: number, size: number): void
  • Parameters

    • serumMarket: Market
    • price: number
    • size: number

    Returns void

Generated using TypeDoc

\ No newline at end of file +DexMarket | serum-dev-tools
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DexMarket

Hierarchy

  • DexMarket

Index

Constructors

  • new DexMarket(address: PublicKey, serumMarket: Market, baseCoin: Coin, quoteCoin: Coin): DexMarket

Properties

address: PublicKey
baseCoin: Coin
marketSymbol: string
quoteCoin: Coin
serumMarket: Market

Methods

  • cancelOrder(connection: Connection, owner: Keypair, serumMarket: Market, order: Order): Promise<string>
  • Parameters

    • connection: Connection
    • owner: Keypair
    • serumMarket: Market
    • order: Order

    Returns Promise<string>

  • createMarketAccountsInstructions(accounts: MarketAccounts, payer: Keypair, connection: Connection, dexProgram: PublicKey): Promise<TransactionInstruction[]>
  • Parameters

    • accounts: MarketAccounts
    • payer: Keypair
    • connection: Connection
    • dexProgram: PublicKey

    Returns Promise<TransactionInstruction[]>

  • createMarketVaultsTransaction(payer: Keypair, vaultOwner: PublicKey, baseVault: Keypair, quoteVault: Keypair, baseCoin: Coin, quoteCoin: Coin, connection: Connection): Promise<Transaction>
  • Parameters

    • payer: Keypair
    • vaultOwner: PublicKey
    • baseVault: Keypair
    • quoteVault: Keypair
    • baseCoin: Coin
    • quoteCoin: Coin
    • connection: Connection

    Returns Promise<Transaction>

  • getCancelOrderTransaction(connection: Connection, owner: Keypair, serumMarket: Market, order: Order): Promise<TransactionWithSigners>
  • getOrCreateOpenOrderAccount(owner: Keypair, serumMarket: Market, connection: Connection): Promise<OpenOrders>
  • Parameters

    • owner: Keypair
    • serumMarket: Market
    • connection: Connection

    Returns Promise<OpenOrders>

  • getPlaceOrderTransaction(connection: Connection, owner: Keypair, serumMarket: Market, side: "buy" | "sell", size: number, price: number): Promise<TransactionWithSigners>
  • load(connection: Connection, programID: PublicKey, marketAddress: PublicKey, baseCoin: Coin, quoteCoin: Coin): Promise<DexMarket>
  • Parameters

    • connection: Connection
    • programID: PublicKey
    • marketAddress: PublicKey
    • baseCoin: Coin
    • quoteCoin: Coin

    Returns Promise<DexMarket>

  • placeOrder(connection: Connection, owner: Keypair, serumMarket: Market, side: "buy" | "sell", size: number, price: number): Promise<string>
  • Parameters

    • connection: Connection
    • owner: Keypair
    • serumMarket: Market
    • side: "buy" | "sell"
    • size: number
    • price: number

    Returns Promise<string>

  • sanityCheck(serumMarket: Market, price: number, size: number): void
  • Parameters

    • serumMarket: Market
    • price: number
    • size: number

    Returns void

Generated using TypeDoc

\ No newline at end of file diff --git a/ts/docs/classes/FileKeypair.html b/ts/docs/classes/FileKeypair.html index 2511e79..7014aa8 100644 --- a/ts/docs/classes/FileKeypair.html +++ b/ts/docs/classes/FileKeypair.html @@ -1 +1 @@ -FileKeypair | serum-dev-tools
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FileKeypair

Hierarchy

  • FileKeypair

Index

Constructors

  • new FileKeypair(filePath: string, keypair: Keypair): FileKeypair

Properties

filePath: string
keypair: Keypair

Methods

  • withKeypair(filePath: string, keypair: Keypair): FileKeypair

Generated using TypeDoc

\ No newline at end of file +FileKeypair | serum-dev-tools
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FileKeypair

Hierarchy

  • FileKeypair

Index

Constructors

  • new FileKeypair(filePath: string, keypair: Keypair): FileKeypair

Properties

filePath: string
keypair: Keypair

Methods

  • withKeypair(filePath: string, keypair: Keypair): FileKeypair

Generated using TypeDoc

\ No newline at end of file diff --git a/ts/docs/interfaces/MarketAccounts.html b/ts/docs/interfaces/MarketAccounts.html index 56ee1ba..8d85c0d 100644 --- a/ts/docs/interfaces/MarketAccounts.html +++ b/ts/docs/interfaces/MarketAccounts.html @@ -1 +1 @@ -MarketAccounts | serum-dev-tools
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MarketAccounts

Hierarchy

  • MarketAccounts

Index

Properties

asks: Keypair
bids: Keypair
eventQueue: Keypair
market: Keypair
requestQueue: Keypair

Generated using TypeDoc

\ No newline at end of file +MarketAccounts | serum-dev-tools
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MarketAccounts

Hierarchy

  • MarketAccounts

Index

Properties

asks: Keypair
bids: Keypair
eventQueue: Keypair
market: Keypair
requestQueue: Keypair

Generated using TypeDoc

\ No newline at end of file diff --git a/ts/docs/modules.html b/ts/docs/modules.html index 4741d6c..2672f44 100644 --- a/ts/docs/modules.html +++ b/ts/docs/modules.html @@ -1 +1 @@ -serum-dev-tools
Options
All
  • Public
  • Public/Protected
  • All
Menu

serum-dev-tools

Index

Type aliases

MarketArgs: { feeRate: number; lotSize: number; quoteDustThreshold: BN; tickSize: number }

Type declaration

  • feeRate: number
  • lotSize: number
  • quoteDustThreshold: BN
  • tickSize: number
TransactionWithSigners: { signers: Signer[]; transaction: Transaction }

Type declaration

  • signers: Signer[]
  • transaction: Transaction

Generated using TypeDoc

\ No newline at end of file +serum-dev-tools
Options
All
  • Public
  • Public/Protected
  • All
Menu

serum-dev-tools

Index

Type aliases

MarketArgs: { feeRate: number; lotSize: number; quoteDustThreshold: BN; tickSize: number }

Type declaration

  • feeRate: number
  • lotSize: number
  • quoteDustThreshold: BN
  • tickSize: number
TransactionWithSigners: { signers: Signer[]; transaction: Transaction }

Type declaration

  • signers: Signer[]
  • transaction: Transaction

Generated using TypeDoc

\ No newline at end of file diff --git a/ts/package.json b/ts/package.json index 401a297..66c1785 100644 --- a/ts/package.json +++ b/ts/package.json @@ -14,7 +14,8 @@ "build": "rm -rf dist/; tsc", "test": "ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts", "prepare": "cd .. && husky install ts/.husky", - "lint": "eslint --fix" + "lint": "eslint --fix", + "docs": "typedoc --entryPoints src/index.ts" }, "lint-staged": { "src/**/*.ts": [