Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@polywrap/client-js": "0.0.1-prealpha.89",
"@polywrap/core-js": "0.0.1-prealpha.89",
"@polywrap/ens-plugin-js": "0.0.1-prealpha.89",
"@polywrap/ens-resolver-plugin-js": "0.0.1-prealpha.89",
"@polywrap/ethereum-plugin-js": "0.0.1-prealpha.89",
"@polywrap/ipfs-plugin-js": "0.0.1-prealpha.89",
"@polywrap/os-js": "0.0.1-prealpha.89",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/lib/helpers/client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PluginRegistration } from "@polywrap/core-js";
import { ensPlugin } from "@polywrap/ens-plugin-js";
import { ensResolverPlugin } from "@polywrap/ens-resolver-plugin-js";
import { ethereumPlugin } from "@polywrap/ethereum-plugin-js";
import { ipfsPlugin } from "@polywrap/ipfs-plugin-js";
import { PolywrapClient, defaultIpfsProviders } from "@polywrap/client-js";
Expand All @@ -15,8 +15,8 @@ export function getSimpleClient(config: SimpleClientConfig): PolywrapClient {
const plugins: PluginRegistration[] = [];
if (ensAddress) {
plugins.push({
uri: "wrap://ens/ens.polywrap.eth",
plugin: ensPlugin({
uri: "wrap://ens/ens-resolver.polywrap.eth",
plugin: ensResolverPlugin({
addresses: {
testnet: ensAddress,
},
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/lib/test-env/client-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
PolywrapClientConfig,
defaultIpfsProviders,
} from "@polywrap/client-js";
import { ensPlugin } from "@polywrap/ens-plugin-js";
import { ensResolverPlugin } from "@polywrap/ens-resolver-plugin-js";
import { ethereumPlugin } from "@polywrap/ethereum-plugin-js";
import { ipfsPlugin } from "@polywrap/ipfs-plugin-js";
import { ensAddresses } from "@polywrap/test-env-js";
Expand Down Expand Up @@ -44,8 +44,8 @@ export async function getTestEnvClientConfig(): Promise<
}),
},
{
uri: "wrap://ens/ens.polywrap.eth",
plugin: ensPlugin({
uri: "wrap://ens/ens-resolver.polywrap.eth",
plugin: ensResolverPlugin({
addresses: {
testnet: ensAddress,
},
Expand Down
1 change: 1 addition & 0 deletions packages/js/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@polywrap/sha3-plugin-js": "0.0.1-prealpha.89",
"@polywrap/tracing-js": "0.0.1-prealpha.89",
"@polywrap/uts46-plugin-js": "0.0.1-prealpha.89",
"@polywrap/ens-resolver-plugin-js": "0.0.1-prealpha.89",
"@polywrap/fs-resolver-plugin-js": "0.0.1-prealpha.89",
"@polywrap/ipfs-resolver-plugin-js": "0.0.1-prealpha.89",
"graphql": "15.5.0",
Expand Down
35 changes: 20 additions & 15 deletions packages/js/client/scripts/extractPluginConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const plugins: PluginConfigSource[] = [
files: [
{
name: "build/index.d.ts",
interfaces: ["IpfsPluginConfig"]
}
interfaces: ["IpfsPluginConfig"],
},
],
},
{
Expand All @@ -44,37 +44,42 @@ const plugins: PluginConfigSource[] = [
{
name: "build/Connection.d.ts",
interfaces: ["ConnectionConfig", "ConnectionConfigs"],
types: ["EthereumProvider", "EthereumSigner", "AccountIndex", "Address"],
types: [
"EthereumProvider",
"EthereumSigner",
"AccountIndex",
"Address",
],
},
],
externals: [
{
type: "Signer",
module: "ethers"
module: "ethers",
},
{
type: "ExternalProvider",
module: "@ethersproject/providers"
module: "@ethersproject/providers",
},
{
type: "JsonRpcProvider",
module: "@ethersproject/providers"
}
]
module: "@ethersproject/providers",
},
],
},
{
name: "Ens",
module: "@polywrap/ens-plugin-js",
uri: "wrap://ens/ens.polywrap.eth",
config: "EnsPluginConfig",
module: "@polywrap/ens-resolver-plugin-js",
uri: "wrap://ens/ens-resolver.polywrap.eth",
config: "EnsResolverPluginConfig",
files: [
{
name: "build/index.d.ts",
interfaces: ["EnsPluginConfig", "Addresses"],
interfaces: ["EnsResolverPluginConfig", "Addresses"],
types: ["Address"],
}
]
}
},
],
},
];

function main(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jest.setTimeout(200000);

const defaultPlugins = [
"wrap://ens/ipfs.polywrap.eth",
"wrap://ens/ens.polywrap.eth",
"wrap://ens/ens-resolver.polywrap.eth",
"wrap://ens/ethereum.polywrap.eth",
"wrap://ens/http.polywrap.eth",
"wrap://ens/js-logger.polywrap.eth",
Expand Down
10 changes: 5 additions & 5 deletions packages/js/client/src/__tests__/core/resolveUri.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ describe("resolveUri", () => {
result: {
uri: ipfsUri,
wrapper: false,
implementationUri: new Uri("wrap://ens/ens.polywrap.eth"),
implementationUri: new Uri("wrap://ens/ens-resolver.polywrap.eth"),
},
},
{
Expand Down Expand Up @@ -442,7 +442,7 @@ describe("resolveUri", () => {
result: {
uri: ipfsUri,
wrapper: false,
implementationUri: new Uri("wrap://ens/ens.polywrap.eth"),
implementationUri: new Uri("wrap://ens/ens-resolver.polywrap.eth"),
},
},
{
Expand Down Expand Up @@ -561,7 +561,7 @@ describe("resolveUri", () => {
result: {
uri: ipfsUri,
wrapper: false,
implementationUri: new Uri("wrap://ens/ens.polywrap.eth"),
implementationUri: new Uri("wrap://ens/ens-resolver.polywrap.eth"),
},
},
{
Expand Down Expand Up @@ -697,7 +697,7 @@ describe("resolveUri", () => {
result: {
uri: ipfsUri,
wrapper: false,
implementationUri: new Uri("wrap://ens/ens.polywrap.eth"),
implementationUri: new Uri("wrap://ens/ens-resolver.polywrap.eth"),
},
},
{
Expand Down Expand Up @@ -803,7 +803,7 @@ describe("resolveUri", () => {
result: {
uri: ipfsUri,
wrapper: false,
implementationUri: new Uri("wrap://ens/ens.polywrap.eth"),
implementationUri: new Uri("wrap://ens/ens-resolver.polywrap.eth"),
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions packages/js/client/src/__tests__/core/sanity.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("sanity", () => {
expect(client.getRedirects()).toStrictEqual([]);
expect(client.getPlugins().map((x) => x.uri)).toStrictEqual([
new Uri("wrap://ens/ipfs.polywrap.eth"),
new Uri("wrap://ens/ens.polywrap.eth"),
new Uri("wrap://ens/ens-resolver.polywrap.eth"),
new Uri("wrap://ens/ethereum.polywrap.eth"),
new Uri("wrap://ens/http.polywrap.eth"),
new Uri("wrap://ens/js-logger.polywrap.eth"),
Expand All @@ -33,7 +33,7 @@ describe("sanity", () => {
interface: coreInterfaceUris.uriResolver,
implementations: [
new Uri("wrap://ens/ipfs-resolver.polywrap.eth"),
new Uri("wrap://ens/ens.polywrap.eth"),
new Uri("wrap://ens/ens-resolver.polywrap.eth"),
new Uri("wrap://ens/fs-resolver.polywrap.eth"),
],
},
Expand Down
8 changes: 4 additions & 4 deletions packages/js/client/src/default-client-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { ipfsPlugin } from "@polywrap/ipfs-plugin-js";
import { ipfsResolverPlugin } from "@polywrap/ipfs-resolver-plugin-js";
import { ethereumPlugin } from "@polywrap/ethereum-plugin-js";
import { ensPlugin } from "@polywrap/ens-plugin-js";
import { ensResolverPlugin } from "@polywrap/ens-resolver-plugin-js";
import { graphNodePlugin } from "@polywrap/graph-node-plugin-js";
import { httpPlugin } from "@polywrap/http-plugin-js";
import { fileSystemPlugin } from "@polywrap/fs-plugin-js";
Expand All @@ -42,8 +42,8 @@ export const getDefaultClientConfig = Tracer.traceFunc(
},
// ENS is required for resolving domain to IPFS hashes
{
uri: new Uri("wrap://ens/ens.polywrap.eth"),
plugin: ensPlugin({}),
uri: new Uri("wrap://ens/ens-resolver.polywrap.eth"),
plugin: ensResolverPlugin({}),
},
{
uri: new Uri("wrap://ens/ethereum.polywrap.eth"),
Expand Down Expand Up @@ -99,7 +99,7 @@ export const getDefaultClientConfig = Tracer.traceFunc(
interface: coreInterfaceUris.uriResolver,
implementations: [
new Uri("wrap://ens/ipfs-resolver.polywrap.eth"),
new Uri("wrap://ens/ens.polywrap.eth"),
new Uri("wrap://ens/ens-resolver.polywrap.eth"),
new Uri("wrap://ens/fs-resolver.polywrap.eth"),
],
},
Expand Down
4 changes: 2 additions & 2 deletions packages/js/client/src/pluginConfigs/Ens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable prettier/prettier */

/// Types generated from @polywrap/ens-plugin-js build files:
/// Types generated from @polywrap/ens-resolver-plugin-js build files:
/// build/index.d.ts

export interface EnsPluginConfig {
export interface EnsResolverPluginConfig {
addresses?: Addresses;
}

Expand Down
8 changes: 4 additions & 4 deletions packages/js/client/src/pluginConfigs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@

import { IpfsPluginConfig } from "./Ipfs";
import { EthereumPluginConfig } from "./Ethereum";
import { EnsPluginConfig } from "./Ens";
import { EnsResolverPluginConfig } from "./Ens";

interface PluginConfigs {
ipfs?: IpfsPluginConfig;
ethereum?: EthereumPluginConfig;
ens?: EnsPluginConfig;
ens?: EnsResolverPluginConfig;
}

const modules: Record<string, string> = {
ipfs: "@polywrap/ipfs-plugin-js",
ethereum: "@polywrap/ethereum-plugin-js",
ens: "@polywrap/ens-plugin-js",
ens: "@polywrap/ens-resolver-plugin-js",
};

const uris: Record<string, string> = {
ipfs: "wrap://ens/ipfs.polywrap.eth",
ethereum: "wrap://ens/ethereum.polywrap.eth",
ens: "wrap://ens/ens.polywrap.eth",
ens: "wrap://ens/ens-resolver.polywrap.eth",
};

export { PluginConfigs, modules, uris };
5 changes: 0 additions & 5 deletions packages/js/plugins/ens/src/__tests__/e2e.spec.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/js/plugins/ethereum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"devDependencies": {
"@polywrap/client-js": "0.0.1-prealpha.89",
"@polywrap/ens-plugin-js": "0.0.1-prealpha.89",
"@polywrap/ens-resolver-plugin-js": "0.0.1-prealpha.89",
"@polywrap/ipfs-plugin-js": "0.0.1-prealpha.89",
"@polywrap/test-env-js": "0.0.1-prealpha.89",
"@types/jest": "26.0.8",
Expand Down
14 changes: 7 additions & 7 deletions packages/js/plugins/ethereum/src/__tests__/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { ethereumPlugin } from "..";
import * as Schema from "../wrap";

import { PolywrapClient, defaultIpfsProviders } from "@polywrap/client-js";
import { ensPlugin } from "@polywrap/ens-plugin-js";
import { ensResolverPlugin } from "@polywrap/ens-resolver-plugin-js";
import { ipfsPlugin } from "@polywrap/ipfs-plugin-js";
import {
initTestEnvironment,
stopTestEnvironment,
buildWrapper,
ensAddresses,
providers
providers,
} from "@polywrap/test-env-js";
import { Wallet } from "ethers";

Expand Down Expand Up @@ -37,15 +37,15 @@ describe("Ethereum Plugin", () => {
let registrarAddress: string;
const signer = "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1";

const wrapperPath = `${__dirname}/integration`
const uri = `fs/${wrapperPath}/build`
const wrapperPath = `${__dirname}/integration`;
const uri = `fs/${wrapperPath}/build`;

beforeAll(async () => {
await initTestEnvironment();

ensAddress = ensAddresses.ensAddress;
resolverAddress = ensAddresses.resolverAddress;
registrarAddress = ensAddresses.registrarAddress
registrarAddress = ensAddresses.registrarAddress;

client = new PolywrapClient({
plugins: [
Expand All @@ -71,8 +71,8 @@ describe("Ethereum Plugin", () => {
}),
},
{
uri: "wrap://ens/ens.polywrap.eth",
plugin: ensPlugin({
uri: "wrap://ens/ens-resolver.polywrap.eth",
plugin: ensResolverPlugin({
addresses: {
testnet: ensAddress,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/js/plugins/file-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"devDependencies": {
"@polywrap/client-js": "0.0.1-prealpha.89",
"@polywrap/ens-plugin-js": "0.0.1-prealpha.89",
"@polywrap/ens-resolver-plugin-js": "0.0.1-prealpha.89",
"@polywrap/ethereum-plugin-js": "0.0.1-prealpha.89",
"@polywrap/ipfs-plugin-js": "0.0.1-prealpha.89",
"@polywrap/test-cases": "0.0.1-prealpha.89",
Expand Down
2 changes: 1 addition & 1 deletion packages/js/plugins/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"devDependencies": {
"@polywrap/client-js": "0.0.1-prealpha.89",
"@polywrap/ens-plugin-js": "0.0.1-prealpha.89",
"@polywrap/ens-resolver-plugin-js": "0.0.1-prealpha.89",
"@polywrap/ipfs-plugin-js": "0.0.1-prealpha.89",
"@polywrap/test-env-js": "0.0.1-prealpha.89",
"@types/jest": "26.0.8",
Expand Down
11 changes: 11 additions & 0 deletions packages/js/plugins/uri-resolvers/ens-resolver/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
roots: ["<rootDir>/src"],
testMatch: [
"**/__tests__/**/*.+(ts|tsx|js)",
"**/?(*.)+(spec|test).+(ts|tsx|js)",
],
transform: {
"^.+\\.(ts|tsx)$": "ts-jest",
},
testEnvironment: "node",
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@polywrap/ens-plugin-js",
"name": "@polywrap/ens-resolver-plugin-js",
"description": "Polywrap ENS Javascript Plugin",
"version": "0.0.1-prealpha.89",
"license": "MIT",
Expand All @@ -13,8 +13,8 @@
],
"scripts": {
"build": "rimraf ./build && yarn codegen && tsc --project tsconfig.build.json",
"codegen": "node ../../../../dependencies/node_modules/polywrap/bin/polywrap plugin codegen",
"lint": "eslint --color -c ../../../../.eslintrc.js src/",
"codegen": "node ../../../../../dependencies/node_modules/polywrap/bin/polywrap plugin codegen",
"lint": "eslint --color -c ../../../../../.eslintrc.js src/",
"test": "jest --passWithNoTests --runInBand --verbose",
"test:ci": "jest --passWithNoTests --runInBand --verbose",
"test:watch": "jest --watch --passWithNoTests --verbose"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
format: 0.0.1-prealpha.3
language: plugin/typescript
name: Ens
name: EnsUriResolver
module: ./src/index.ts
schema: ./src/schema.graphql
import_redirects:
- uri: "ens/uri-resolver.core.polywrap.eth"
schema: ../../../core-interfaces/uri-resolver/src/schema.graphql
schema: ../../../../core-interfaces/uri-resolver/src/schema.graphql
Loading