Skip to content

Commit

Permalink
fix: getting codegen script running again
Browse files Browse the repository at this point in the history
  • Loading branch information
dafuga committed Jul 28, 2023
1 parent 59ad7e6 commit 5ac4fa0
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 195 deletions.
92 changes: 92 additions & 0 deletions contracts/rewards.gm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import { Contract, Table, TableCursor, QueryOptions, QueryOptions, Query } from "@wharfkit/contract";
import { APIClient, Session, Struct, TransactResult, Asset, Checksum256, Float64, Name, TimePoint, TimePointSec, UInt128, UInt16, UInt32, UInt64, UInt8, AssetType, Checksum256Type, Float64Type, NameType, TimePointType, UInt128Type, UInt16Type, UInt32Type, UInt64Type, UInt8Type } from "@wharfkit/session";
export class _RewardsGm {
private abi = "7b2276657273696f6e223a22656f73696f3a3a6162692f312e32222c227479706573223a5b5d2c2273747275637473223a5b7b226e616d65223a2261646475736572222c2262617365223a22222c226669656c6473223a5b7b226e616d65223a226163636f756e74222c2274797065223a226e616d65227d2c7b226e616d65223a22776569676874222c2274797065223a2275696e743136227d5d7d2c7b226e616d65223a22636c61696d222c2262617365223a22222c226669656c6473223a5b7b226e616d65223a226163636f756e74222c2274797065223a226e616d65227d2c7b226e616d65223a22616d6f756e74222c2274797065223a2261737365743f227d5d7d2c7b226e616d65223a22636f6e666967222c2262617365223a22222c226669656c6473223a5b7b226e616d65223a22746f6b656e5f73796d626f6c222c2274797065223a2273796d626f6c227d2c7b226e616d65223a226f7261636c655f6163636f756e74222c2274797065223a226e616d65227d2c7b226e616d65223a226f7261636c655f7061697273222c2274797065223a226f7261636c655f706169725b5d227d5d7d2c7b226e616d65223a22636f6e666967757265222c2262617365223a22222c226669656c6473223a5b7b226e616d65223a22746f6b656e5f73796d626f6c222c2274797065223a2273796d626f6c227d2c7b226e616d65223a226f7261636c655f6163636f756e74222c2274797065223a226e616d65227d2c7b226e616d65223a226f7261636c655f7061697273222c2274797065223a226f7261636c655f706169725b5d227d5d7d2c7b226e616d65223a2264656c75736572222c2262617365223a22222c226669656c6473223a5b7b226e616d65223a226163636f756e74222c2274797065223a226e616d65227d5d7d2c7b226e616d65223a226f7261636c655f70616972222c2262617365223a22222c226669656c6473223a5b7b226e616d65223a226e616d65222c2274797065223a226e616d65227d2c7b226e616d65223a22707265636973696f6e222c2274797065223a2275696e743136227d5d7d2c7b226e616d65223a2270726963655f696e666f222c2262617365223a22222c226669656c6473223a5b7b226e616d65223a2270616972222c2274797065223a22737472696e67227d2c7b226e616d65223a227072696365222c2274797065223a22666c6f61743634227d2c7b226e616d65223a2274696d657374616d70222c2274797065223a2274696d655f706f696e74227d5d7d2c7b226e616d65223a2272656365697074222c2262617365223a22222c226669656c6473223a5b7b226e616d65223a226163636f756e74222c2274797065223a226e616d65227d2c7b226e616d65223a22616d6f756e74222c2274797065223a226173736574227d2c7b226e616d65223a227469636b6572222c2274797065223a2270726963655f696e666f5b5d227d5d7d2c7b226e616d65223a2275706461746575736572222c2262617365223a22222c226669656c6473223a5b7b226e616d65223a226163636f756e74222c2274797065223a226e616d65227d2c7b226e616d65223a22776569676874222c2274797065223a2275696e743136227d5d7d2c7b226e616d65223a22757365725f726f77222c2262617365223a22222c226669656c6473223a5b7b226e616d65223a226163636f756e74222c2274797065223a226e616d65227d2c7b226e616d65223a22776569676874222c2274797065223a2275696e743136227d2c7b226e616d65223a2262616c616e6365222c2274797065223a226173736574227d5d7d5d2c22616374696f6e73223a5b7b226e616d65223a2261646475736572222c2274797065223a2261646475736572222c2272696361726469616e5f636f6e7472616374223a222d2d2d5c6e737065635f76657273696f6e3a205c22302e322e305c225c6e7469746c653a2041646420757365725c6e73756d6d6172793a2027416464206e65772075736572207b7b6e6f77726170206163636f756e747d7d275c6e69636f6e3a2068747470733a2f2f616c6d6f73742e6469676974616c2f696d616765732f6d6973635f69636f6e2e706e6723366635656139373862303464303365303138623337396132626163346331306235613866653063643565366531356338383832386463393836626539366366665c6e2d2d2d5c6e5c6e7b7b6163636f756e747d7d20697320616464656420746f2074686520726577617264732073686172696e67206c697374207769746820776569676874207b7b7765696768747d7d2e227d2c7b226e616d65223a22636c61696d222c2274797065223a22636c61696d222c2272696361726469616e5f636f6e7472616374223a222d2d2d5c6e737065635f76657273696f6e3a205c22302e322e305c225c6e7469746c653a20436c61696d5c6e73756d6d6172793a2027436c61696d207265776172647320666f72207b7b6e6f77726170206163636f756e747d7d275c6e69636f6e3a2068747470733a2f2f616c6d6f73742e6469676974616c2f696d616765732f636c61696d5f69636f6e2e706e6723626235393766346163633133303539323539313265313865376234636637303864316661656332616138386237613533643837393639653034353136386563665c6e2d2d2d5c6e5c6e7b7b2369665f6861735f76616c756520616d6f756e747d7d5c6e202020207b7b6163636f756e747d7d20636c61696d73207b7b616d6f756e747d7d2066726f6d20746865697220726577617264732062616c616e63652e5c6e7b7b656c73657d7d5c6e202020207b7b6163636f756e747d7d20636c61696d7320746865697220656e7469726520726577617264732062616c616e63652e5c6e7b7b2f69665f6861735f76616c75657d7d227d2c7b226e616d65223a22636f6e666967757265222c2274797065223a22636f6e666967757265222c2272696361726469616e5f636f6e7472616374223a22227d2c7b226e616d65223a2264656c75736572222c2274797065223a2264656c75736572222c2272696361726469616e5f636f6e7472616374223a222d2d2d5c6e737065635f76657273696f6e3a205c22302e322e305c225c6e7469746c653a2044656c65746520757365725c6e73756d6d6172793a202744656c6574652075736572207b7b6e6f77726170206163636f756e747d7d275c6e69636f6e3a2068747470733a2f2f616c6d6f73742e6469676974616c2f696d616765732f6d6973635f69636f6e2e706e6723366635656139373862303464303365303138623337396132626163346331306235613866653063643565366531356338383832386463393836626539366366665c6e2d2d2d5c6e5c6e7b7b6163636f756e747d7d2069732069732072656d6f7665642066726f6d2074686520726577617264732073686172696e67206c6973742e5c6e5c6e55736572732063616e206f6e6c792062652072656d6f76656420696620746865697220726577617264732062616c616e6365206973207a65726f2e227d2c7b226e616d65223a2272656365697074222c2274797065223a2272656365697074222c2272696361726469616e5f636f6e7472616374223a22227d2c7b226e616d65223a2275706461746575736572222c2274797065223a2275706461746575736572222c2272696361726469616e5f636f6e7472616374223a222d2d2d5c6e737065635f76657273696f6e3a205c22302e322e305c225c6e7469746c653a2055706461746520757365725c6e73756d6d6172793a20275570646174652075736572207b7b6e6f77726170206163636f756e747d7d275c6e69636f6e3a2068747470733a2f2f616c6d6f73742e6469676974616c2f696d616765732f6d6973635f69636f6e2e706e6723366635656139373862303464303365303138623337396132626163346331306235613866653063643565366531356338383832386463393836626539366366665c6e2d2d2d5c6e5c6e7b7b6163636f756e747d7d206973207570646174656420746f206861766520776569676874207b7b7765696768747d7d2e227d5d2c227461626c6573223a5b7b226e616d65223a22636f6e666967222c22696e6465785f74797065223a22693634222c226b65795f6e616d6573223a5b5d2c226b65795f7479706573223a5b5d2c2274797065223a22636f6e666967227d2c7b226e616d65223a227573657273222c22696e6465785f74797065223a22693634222c226b65795f6e616d6573223a5b5d2c226b65795f7479706573223a5b5d2c2274797065223a22757365725f726f77227d5d2c2272696361726469616e5f636c6175736573223a5b5d2c226572726f725f6d65737361676573223a5b5d2c226162695f657874656e73696f6e73223a5b5d2c2276617269616e7473223a5b5d7d";
constructor(args: ContractArgs) {
this.abi = ABI.from(this.abi);
this.account = Name.from("rewards.gm");
this.client = args.client;
}
}
export namespace _RewardsGm {
export namespace types {
@Struct.type("adduser")
export class Adduser extends Struct {
@Struct.field("name")
declare account: Name;
@Struct.field("uint16")
declare weight: UInt16;
}
@Struct.type("claim")
export class Claim extends Struct {
@Struct.field("name")
declare account: Name;
@Struct.field("asset?")
declare amount: Asset;
}
@Struct.type("config")
export class Config extends Struct {
@Struct.field("symbol")
declare token_symbol: Symbol;
@Struct.field("name")
declare oracle_account: Name;
@Struct.field("oracle_pair[]")
declare oracle_pairs: _RewardsGm.types.Oracle_pair;
}
@Struct.type("configure")
export class Configure extends Struct {
@Struct.field("symbol")
declare token_symbol: Symbol;
@Struct.field("name")
declare oracle_account: Name;
@Struct.field("oracle_pair[]")
declare oracle_pairs: _RewardsGm.types.Oracle_pair;
}
@Struct.type("deluser")
export class Deluser extends Struct {
@Struct.field("name")
declare account: Name;
}
@Struct.type("oracle_pair")
export class Oracle_pair extends Struct {
@Struct.field("name")
declare name: Name;
@Struct.field("uint16")
declare precision: UInt16;
}
@Struct.type("price_info")
export class Price_info extends Struct {
@Struct.field("string")
declare pair: String;
@Struct.field("float64")
declare price: Float64;
@Struct.field("time_point")
declare timestamp: TimePoint;
}
@Struct.type("receipt")
export class Receipt extends Struct {
@Struct.field("name")
declare account: Name;
@Struct.field("asset")
declare amount: Asset;
@Struct.field("price_info[]")
declare ticker: _RewardsGm.types.Price_info;
}
@Struct.type("updateuser")
export class Updateuser extends Struct {
@Struct.field("name")
declare account: Name;
@Struct.field("uint16")
declare weight: UInt16;
}
@Struct.type("user_row")
export class User_row extends Struct {
@Struct.field("name")
declare account: Name;
@Struct.field("uint16")
declare weight: UInt16;
@Struct.field("asset")
declare balance: Asset;
}
}
}
3 changes: 1 addition & 2 deletions src/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export async function codegen(contractName, abi) {
['Contract', 'Table', 'TableCursor', 'QueryOptions', 'QueryOptions', 'Query'],
'@wharfkit/contract'
)


const {classDeclaration} = await generateContractClass(namespaceName, contractName, abi)

Expand Down Expand Up @@ -60,8 +59,8 @@ export async function codegen(contractName, abi) {
[
importContractStatement,
importCoreStatement,
typesDeclaration,
classDeclaration,
typesDeclaration,
],
ts.factory.createToken(ts.SyntaxKind.EndOfFileToken),
ts.NodeFlags.None
Expand Down
Loading

0 comments on commit 5ac4fa0

Please sign in to comment.