Skip to content

Commit

Permalink
feat: Add ERC20-like Token
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Oct 9, 2018
1 parent 7270fc5 commit 7670944
Show file tree
Hide file tree
Showing 10 changed files with 1,015 additions and 12 deletions.
4 changes: 4 additions & 0 deletions module.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,8 @@ declare module '@solana/web3.js' {
sign(from: Account): void;
serialize(): Buffer;
}

// === src/token-program.js ===
/* TODO */

}
2 changes: 1 addition & 1 deletion src/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ type AccountInfo = {
*
* @typedef {string} SignatureStatus
*/
type SignatureStatus = 'Confirmed' | 'SignatureNotFound' | 'ProgramRuntimeError' | 'GenericFailure';
export type SignatureStatus = 'Confirmed' | 'SignatureNotFound' | 'ProgramRuntimeError' | 'GenericFailure';

/**
* A connection to a fullnode JSON RPC endpoint
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export {Connection} from './connection';
export {PublicKey} from './publickey';
export {SystemProgram} from './system-program';
export {Transaction} from './transaction';
export {Token} from './token-program';
6 changes: 3 additions & 3 deletions src/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const publicKey = (property: string = 'publicKey'): Object => {
};

/**
* Layout for a 256bit unsigned value
* Layout for a 64bit unsigned value
*/
export const uint256 = (property: string = 'uint256'): Object => {
return BufferLayout.blob(32, property);
export const uint64 = (property: string = 'uint64'): Object => {
return BufferLayout.blob(8, property);
};
2 changes: 1 addition & 1 deletion src/publickey.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class PublicKey {
/**
* Create a new PublicKey object
*/
constructor(number: string | Buffer | Array<number>) {
constructor(number: number | string | Buffer | Array<number>) {

for (;;) {
if (typeof number === 'string') {
Expand Down
Loading

0 comments on commit 7670944

Please sign in to comment.