refactor: move to new build system and sdks

This commit is contained in:
Derrick Hammer 2023-07-14 04:34:31 -04:00
parent 53e1d1b481
commit f89046fdab
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
14 changed files with 18282 additions and 89 deletions

5
.presetterrc.json Normal file
View File

@ -0,0 +1,5 @@
{
"preset": [
"@lumeweb/node-library-preset"
]
}

7
dist/client.d.ts vendored
View File

@ -1,7 +0,0 @@
import { Client } from "@lumeweb/libkernel-universal";
export declare class EthClient extends Client {
ready(): Promise<any>;
method(method: string, params: any): Promise<any>;
}
export declare const createClient: (...args: any) => EthClient;
//# sourceMappingURL=client.d.ts.map

View File

@ -1 +0,0 @@
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAW,MAAM,8BAA8B,CAAC;AAI/D,qBAAa,SAAU,SAAQ,MAAM;IACtB,KAAK;IAGL,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG;CAGhD;AAED,eAAO,MAAM,YAAY,6BAA4C,CAAC"}

11
dist/client.js vendored
View File

@ -1,11 +0,0 @@
import { Client, factory } from "@lumeweb/libkernel-universal";
const RPC_MODULE = "AABzXaYbh-KuCx3ZUUz-oeeMQsZb3kR1BbYSQ-8LSsBmAA";
export class EthClient extends Client {
async ready() {
return this.callModuleReturn("ready");
}
async method(method, params) {
return this.callModuleReturn(method, params);
}
}
export const createClient = factory(EthClient, RPC_MODULE);

3
dist/index.d.ts vendored
View File

@ -1,3 +0,0 @@
export { createClient } from "./client.js";
export { createProvider } from "./provider.js";
//# sourceMappingURL=index.d.ts.map

1
dist/index.d.ts.map vendored
View File

@ -1 +0,0 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}

2
dist/index.js vendored
View File

@ -1,2 +0,0 @@
export { createClient } from "./client.js";
export { createProvider } from "./provider.js";

12
dist/provider.d.ts vendored
View File

@ -1,12 +0,0 @@
import { Eip1193Provider, ethers } from "ethers";
export declare class Provider implements Eip1193Provider {
private client;
request(args: RequestArguments): Promise<unknown>;
}
interface RequestArguments {
readonly method: string;
readonly params?: readonly unknown[] | object;
}
export declare function createProvider(): ethers.BrowserProvider;
export {};
//# sourceMappingURL=provider.d.ts.map

View File

@ -1 +0,0 @@
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGjD,qBAAa,QAAS,YAAW,eAAe;IAC9C,OAAO,CAAC,MAAM,CAA6B;IAE9B,OAAO,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;CAG/D;AAED,UAAU,gBAAgB;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,CAAC;CAC/C;AAED,wBAAgB,cAAc,IAAI,MAAM,CAAC,eAAe,CAEvD"}

11
dist/provider.js vendored
View File

@ -1,11 +0,0 @@
import { ethers } from "ethers";
import { createClient } from "./client.js";
export class Provider {
client = createClient();
async request(args) {
return this.client.method(args.method, args.params);
}
}
export function createProvider() {
return new ethers.BrowserProvider(new Provider());
}

18253
npm-shrinkwrap.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,23 +2,30 @@
"name": "@lumeweb/kernel-eth-client", "name": "@lumeweb/kernel-eth-client",
"version": "0.1.0", "version": "0.1.0",
"type": "module", "type": "module",
"main": "dist/index.js", "main": "lib/index.js",
"dependencies": { "repository": {
"@lumeweb/libkernel-universal": "git+https://git.lumeweb.com/LumeWeb/libkernel-universal.git", "type": "git",
"@lumeweb/rpc-client": "git+https://git.lumeweb.com/LumeWeb/rpc-client.git", "url": "gitea@git.lumeweb.com:LumeWeb/kernel-eth-client.git"
"buffer": "^6.0.3",
"ethers": "^6.2.2",
"libkernel": "^0.1.48",
"libkmodule": "^0.2.53",
"libskynet": "^0.0.62"
}, },
"devDependencies": { "devDependencies": {
"@lumeweb/cfg": "git+https://git.lumeweb.com/LumeWeb/cfg.git", "@lumeweb/node-library-preset": "^0.2.7",
"@lumeweb/interface-relay": "git+https://git.lumeweb.com/LumeWeb/interface-relay.git", "ethers": "^6.6.3",
"@types/b4a": "^1.6.0", "presetter": "*"
"@types/node": "^18.15.5", },
"@types/node-cache": "^4.2.5", "readme": "ERROR: No README data found!",
"prettier": "^2.8.6", "_id": "@lumeweb/kernel-eth-client@0.1.0",
"typescript": "^5.0.2" "scripts": {
"prepare": "presetter bootstrap",
"build": "run build",
"semantic-release": "semantic-release"
},
"dependencies": {
"@lumeweb/libkernel": "^0.1.0-develop.16"
},
"files": [
"lib"
],
"publishConfig": {
"access": "public"
} }
} }

View File

@ -1,4 +1,4 @@
import { Client, factory } from "@lumeweb/libkernel-universal"; import { Client, factory } from "@lumeweb/libkernel/module";
const RPC_MODULE = "AABzXaYbh-KuCx3ZUUz-oeeMQsZb3kR1BbYSQ-8LSsBmAA"; const RPC_MODULE = "AABzXaYbh-KuCx3ZUUz-oeeMQsZb3kR1BbYSQ-8LSsBmAA";

View File

@ -1,23 +0,0 @@
{
"compilerOptions": {
"declaration": true,
"strict": true,
"module": "esnext",
"target": "esnext",
"esModuleInterop": true,
"sourceMap": false,
"rootDir": "src",
"outDir": "dist",
"typeRoots": [
"node_modules/@types",
],
"moduleResolution": "nodenext",
"declarationMap": true,
"declarationDir": "dist",
"emitDeclarationOnly": false,
"allowJs": true
},
"include": [
"src"
]
}