From 8c2dac5b5964846f981943aab4e3e680cd4060f7 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 27 Mar 2023 08:55:41 -0400 Subject: [PATCH] *Add dist --- dist/client.d.ts | 7 +++++++ dist/client.d.ts.map | 1 + dist/client.js | 11 +++++++++++ dist/index.d.ts | 3 +++ dist/index.d.ts.map | 1 + dist/index.js | 2 ++ dist/provider.d.ts | 12 ++++++++++++ dist/provider.d.ts.map | 1 + dist/provider.js | 11 +++++++++++ 9 files changed, 49 insertions(+) create mode 100644 dist/client.d.ts create mode 100644 dist/client.d.ts.map create mode 100644 dist/client.js create mode 100644 dist/index.d.ts create mode 100644 dist/index.d.ts.map create mode 100644 dist/index.js create mode 100644 dist/provider.d.ts create mode 100644 dist/provider.d.ts.map create mode 100644 dist/provider.js diff --git a/dist/client.d.ts b/dist/client.d.ts new file mode 100644 index 0000000..eb924f5 --- /dev/null +++ b/dist/client.d.ts @@ -0,0 +1,7 @@ +import { Client } from "@lumeweb/libkernel-universal"; +export declare class EthClient extends Client { + ready(): Promise; + method(method: string, params: any): Promise; +} +export declare const createClient: (...args: any) => EthClient; +//# sourceMappingURL=client.d.ts.map \ No newline at end of file diff --git a/dist/client.d.ts.map b/dist/client.d.ts.map new file mode 100644 index 0000000..d35c911 --- /dev/null +++ b/dist/client.d.ts.map @@ -0,0 +1 @@ +{"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"} \ No newline at end of file diff --git a/dist/client.js b/dist/client.js new file mode 100644 index 0000000..af424a7 --- /dev/null +++ b/dist/client.js @@ -0,0 +1,11 @@ +import { Client, factory } from "@lumeweb/libkernel-universal"; +const RPC_MODULE = "AAAkzekB6FeX9sW2oBKOZ32G_2oU2oQWJIE9Iv4p6xBVGw"; +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); diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..8042cc5 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3 @@ +export { createClient } from "./client.js"; +export { createProvider } from "./provider.js"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/index.d.ts.map b/dist/index.d.ts.map new file mode 100644 index 0000000..ae554c6 --- /dev/null +++ b/dist/index.d.ts.map @@ -0,0 +1 @@ +{"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"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..6484bd2 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,2 @@ +export { createClient } from "./client.js"; +export { createProvider } from "./provider.js"; diff --git a/dist/provider.d.ts b/dist/provider.d.ts new file mode 100644 index 0000000..802d85b --- /dev/null +++ b/dist/provider.d.ts @@ -0,0 +1,12 @@ +import { Eip1193Provider, ethers } from "ethers"; +export declare class Provider implements Eip1193Provider { + private client; + request(args: RequestArguments): Promise; +} +interface RequestArguments { + readonly method: string; + readonly params?: readonly unknown[] | object; +} +export declare function createProvider(): ethers.BrowserProvider; +export {}; +//# sourceMappingURL=provider.d.ts.map \ No newline at end of file diff --git a/dist/provider.d.ts.map b/dist/provider.d.ts.map new file mode 100644 index 0000000..eb1b992 --- /dev/null +++ b/dist/provider.d.ts.map @@ -0,0 +1 @@ +{"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"} \ No newline at end of file diff --git a/dist/provider.js b/dist/provider.js new file mode 100644 index 0000000..70347b4 --- /dev/null +++ b/dist/provider.js @@ -0,0 +1,11 @@ +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()); +}