Skip to content

Commit 2fbb208

Browse files
committed
feat: Add ERC20-like Token
1 parent 77f07a0 commit 2fbb208

File tree

10 files changed

+1015
-12
lines changed

10 files changed

+1015
-12
lines changed

module.flow.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,8 @@ declare module '@solana/web3.js' {
9292
sign(from: Account): void;
9393
serialize(): Buffer;
9494
}
95+
96+
// === src/token-program.js ===
97+
/* TODO */
98+
9599
}

src/connection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ type AccountInfo = {
148148
*
149149
* @typedef {string} SignatureStatus
150150
*/
151-
type SignatureStatus = 'Confirmed' | 'SignatureNotFound' | 'ProgramRuntimeError' | 'GenericFailure';
151+
export type SignatureStatus = 'Confirmed' | 'SignatureNotFound' | 'ProgramRuntimeError' | 'GenericFailure';
152152

153153
/**
154154
* A connection to a fullnode JSON RPC endpoint

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ export {Connection} from './connection';
55
export {PublicKey} from './publickey';
66
export {SystemProgram} from './system-program';
77
export {Transaction} from './transaction';
8+
export {Token} from './token-program';

src/layout.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export const publicKey = (property: string = 'publicKey'): Object => {
1111
};
1212

1313
/**
14-
* Layout for a 256bit unsigned value
14+
* Layout for a 64bit unsigned value
1515
*/
16-
export const uint256 = (property: string = 'uint256'): Object => {
17-
return BufferLayout.blob(32, property);
16+
export const uint64 = (property: string = 'uint64'): Object => {
17+
return BufferLayout.blob(8, property);
1818
};

src/publickey.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class PublicKey {
1212
/**
1313
* Create a new PublicKey object
1414
*/
15-
constructor(number: string | Buffer | Array<number>) {
15+
constructor(number: number | string | Buffer | Array<number>) {
1616

1717
for (;;) {
1818
if (typeof number === 'string') {

0 commit comments

Comments
 (0)