-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bfed17
commit e19022e
Showing
10 changed files
with
110 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,4 @@ js/lib | |
|
||
/node_modules | ||
|
||
js/dist | ||
**/wallet.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './instructions'; | ||
export * from './main'; | ||
export * from './state'; | ||
export * from './utils'; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/// <reference types="node" /> | ||
import { PublicKey, TransactionInstruction } from '@solana/web3.js'; | ||
import { Schedule } from './state'; | ||
export declare enum Instruction { | ||
Init = 0, | ||
Create = 1 | ||
} | ||
export declare function createInitInstruction(systemProgramId: PublicKey, vestingProgramId: PublicKey, payerKey: PublicKey, vestingAccountKey: PublicKey, seeds: Array<Buffer | Uint8Array>): TransactionInstruction; | ||
export declare function createCreateInstruction(vestingProgramId: PublicKey, tokenProgramId: PublicKey, clockSysvarId: PublicKey, vestingAccountKey: PublicKey, vestingTokenAccountKey: PublicKey, sourceTokenAccountOwnerKey: PublicKey, sourceTokenAccountKey: PublicKey, mintAddress: PublicKey, schedule: Schedule, seeds: Array<Buffer | Uint8Array>): TransactionInstruction; | ||
export declare function createUnlockInstruction(vestingProgramId: PublicKey, tokenProgramId: PublicKey, clockSysvarId: PublicKey, vestingAccountKey: PublicKey, vestingTokenAccountKey: PublicKey, destinationTokenAccountKey: PublicKey, seeds: Array<Buffer | Uint8Array>): TransactionInstruction; | ||
export declare function createInitializeUnlockInstruction(vestingProgramId: PublicKey, tokenProgramId: PublicKey, clockSysvarId: PublicKey, vestingAccountKey: PublicKey, vestingTokenAccountKey: PublicKey, destinationTokenAccountKey: PublicKey, seeds: Array<Buffer | Uint8Array>): TransactionInstruction; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/// <reference types="node" /> | ||
import { PublicKey, TransactionInstruction, Connection } from '@solana/web3.js'; | ||
import { ContractInfo, Schedule } from './state'; | ||
/** | ||
* The vesting schedule program ID on mainnet | ||
*/ | ||
export declare const TOKEN_VESTING_PROGRAM_ID: PublicKey; | ||
/** | ||
* This function can be used to lock tokens | ||
* @param connection The Solana RPC connection object | ||
* @param programId The token vesting program ID | ||
* @param seedWord Seed words used to derive the vesting account | ||
* @param payer The fee payer of the transaction | ||
* @param sourceTokenOwner The owner of the source token account (i.e where locked tokens are originating from) | ||
* @param possibleSourceTokenPubkey The source token account (i.e where locked tokens are originating from), if null it defaults to the ATA | ||
* @param destinationTokenPubkey The destination token account i.e where unlocked tokens will be transfered | ||
* @param mintAddress The mint of the tokens being vested | ||
* @param schedule The vesting schedule | ||
* @returns An array of `TransactionInstruction` | ||
*/ | ||
export declare function create(connection: Connection, programId: PublicKey, seedWord: Buffer | Uint8Array, payer: PublicKey, sourceTokenOwner: PublicKey, possibleSourceTokenPubkey: PublicKey | null, destinationTokenPubkey: PublicKey, mintAddress: PublicKey, schedule: Schedule): Promise<Array<TransactionInstruction>>; | ||
/** | ||
* This function can be used to unlock vested tokens | ||
* @param connection The Solana RPC connection object | ||
* @param programId The token vesting program ID | ||
* @param seedWord Seed words used to derive the vesting account | ||
* @param mintAddress The mint of the vested tokens | ||
* @returns An array of `TransactionInstruction` | ||
*/ | ||
export declare function unlock(connection: Connection, programId: PublicKey, seedWord: Buffer | Uint8Array, mintAddress: PublicKey): Promise<Array<TransactionInstruction>>; | ||
/** | ||
* This function can be used to initialize the unlock of vested tokens | ||
* @param connection The Solana RPC connection object | ||
* @param programId The token vesting program ID | ||
* @param seedWord Seed words used to derive the vesting account | ||
* @param mintAddress The mint of the vested tokens | ||
* @returns An array of `TransactionInstruction` | ||
*/ | ||
export declare function initializeUnlock(connection: Connection, programId: PublicKey, seedWord: Buffer | Uint8Array, mintAddress: PublicKey): Promise<Array<TransactionInstruction>>; | ||
/** | ||
* This function can be used retrieve information about a vesting account | ||
* @param connection The Solana RPC connection object | ||
* @param vestingAccountKey The vesting account public key | ||
* @returns A `ContractInfo` object | ||
*/ | ||
export declare function getContractInfo(connection: Connection, vestingAccountKey: PublicKey): Promise<ContractInfo>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/// <reference types="node" /> | ||
import { PublicKey } from '@solana/web3.js'; | ||
import { Numberu64 } from './utils'; | ||
export declare class Schedule { | ||
timeDelta: Numberu64; | ||
amount: Numberu64; | ||
constructor(timeDelta: Numberu64, amount: Numberu64); | ||
toBuffer(): Buffer; | ||
static fromBuffer(buf: Buffer): Schedule; | ||
} | ||
export declare class VestingScheduleHeader { | ||
destinationAddress: PublicKey; | ||
mintAddress: PublicKey; | ||
isInitialized: boolean; | ||
constructor(destinationAddress: PublicKey, mintAddress: PublicKey, isInitialized: boolean); | ||
static fromBuffer(buf: Buffer): VestingScheduleHeader; | ||
} | ||
export declare class ContractInfo { | ||
destinationAddress: PublicKey; | ||
mintAddress: PublicKey; | ||
schedules: Array<Schedule>; | ||
constructor(destinationAddress: PublicKey, mintAddress: PublicKey, schedules: Array<Schedule>); | ||
static fromBuffer(buf: Buffer): ContractInfo | undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/// <reference types="node" /> | ||
import BN from 'bn.js'; | ||
export declare const generateRandomSeed: () => string; | ||
export declare class Numberu64 extends BN { | ||
/** | ||
* Convert to Buffer representation | ||
*/ | ||
toBuffer(): Buffer; | ||
/** | ||
* Construct a Numberu64 from Buffer representation | ||
*/ | ||
static fromBuffer(buffer: any): any; | ||
} | ||
export declare class Numberu32 extends BN { | ||
/** | ||
* Convert to Buffer representation | ||
*/ | ||
toBuffer(): Buffer; | ||
/** | ||
* Construct a Numberu32 from Buffer representation | ||
*/ | ||
static fromBuffer(buffer: any): any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters