Skip to content

Instantly share code, notes, and snippets.

@fbslo
Created February 7, 2022 23:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fbslo/48b1150a2fb92184e340508d519deaa7 to your computer and use it in GitHub Desktop.
Save fbslo/48b1150a2fb92184e340508d519deaa7 to your computer and use it in GitHub Desktop.
import { token } from "./proto/token";
export class Token {
_name: string;
_symbol: string;
_decimals: i64;
_totalSupply: i64;
constructor() {
this._name = "Koinos Test Token";
this._symbol = "KTT";
this._decimals = 18;
this._totalSupply = 0;
}
name(args: token.name_arguments): token.name_result {
const res = new token.name_result();
res.value = this._name;
return res;
}
symbol(args: token.symbol_arguments): token.symbol_result {
const res = new token.symbol_result();
res.value = this._symbol;
return res;
}
decimals(args: token.decimals_arguments): token.decimals_result {
const res = new token.decimals_result();
res.value = this._decimals;
return res;
}
totalSupply(args: token.totalSupply_arguments): token.totalSupply_result {
const res = new token.totalSupply_result();
res.value = this._totalSupply;
return res;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment