Skip to content

Commit

Permalink
Revert "feat: added SNS name resolver"
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke authored Jul 23, 2024
1 parent fc65990 commit 86958e5
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 141 deletions.
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,5 @@
"resolutions": {
"@ledgerhq/compressjs": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.2.1.tgz",
"@noble/hashes": "^1.4.0"
},
"dependencies": {
"@bonfida/sns-warp-evm": "^0.0.4"
}
}
3 changes: 0 additions & 3 deletions packages/extension/src/libs/name-resolver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ class GenericNameResolver {
arb: "https://nodes.mewapi.io/rpc/arb",
},
},
sns: {
network: "mainnet",
},
});
}

Expand Down
10 changes: 1 addition & 9 deletions packages/name-resolution/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import ENSResolver from "./ens";
import SNSResolver from "./sns";
import { CoinType, NameResolverOptions } from "./types";
import UDResolver from "./ud";
import RNSResolver from "./rns";
Expand All @@ -8,8 +7,6 @@ import SIDResolver from "./sid";
class NameResolver {
ens: ENSResolver;

sns: SNSResolver;

rns: RNSResolver;

ud: UDResolver;
Expand All @@ -20,13 +17,11 @@ class NameResolver {

constructor(options: NameResolverOptions) {
this.ens = new ENSResolver(options.ens);
this.sns = new SNSResolver(options.sns);
this.rns = new RNSResolver();
this.ud = new UDResolver();
this.sid = new SIDResolver(options.sid);
this.initDone = Promise.all([
this.ens.init(),
this.sns.init(),
this.rns.init(),
this.ud.init(),
this.sid.init(),
Expand All @@ -37,7 +32,6 @@ class NameResolver {
return this.initDone.then(() =>
Promise.all([
this.ens.resolveReverseName(address),
this.sns.resolveReverseName(address),
this.sid.resolveReverseName(address),
this.rns.resolveReverseName(address),
this.ud.resolveReverseName(address),
Expand All @@ -56,8 +50,6 @@ class NameResolver {
coin: CoinType = "ETH"
): Promise<string | null> {
return this.initDone.then(() => {
if (this.sns.isSupportedName(name))
return this.sns.resolveAddress(name, coin);
if (this.sid.isSupportedName(name)) return this.sid.resolveAddress(name);
if (this.rns.isSupportedName(name))
return this.rns.resolveAddress(name, coin);
Expand All @@ -70,5 +62,5 @@ class NameResolver {
});
}
}
export { ENSResolver, SNSResolver, UDResolver, CoinType };
export { ENSResolver, UDResolver, CoinType };
export default NameResolver;
66 changes: 0 additions & 66 deletions packages/name-resolution/src/sns/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions packages/name-resolution/src/sns/types.ts

This file was deleted.

6 changes: 1 addition & 5 deletions packages/name-resolution/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ENSOptions } from "./ens/types";
import { SIDOptions } from "./sid/types";
import { SNSOptions } from "./sns/types";

export type CoinType =
| "BTC"
Expand Down Expand Up @@ -138,9 +137,7 @@ export type CoinType =
| "NRG"
| "ARB1"
| "CELO"
| "AVAXC"
| "BASE";

| "AVAXC";

export abstract class BaseResolver {
name: string;
Expand All @@ -160,5 +157,4 @@ export abstract class BaseResolver {
export interface NameResolverOptions {
ens: ENSOptions;
sid: SIDOptions;
sns: SNSOptions;
}
6 changes: 0 additions & 6 deletions packages/name-resolution/tests/resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ describe("Name Resolver resolving", () => {
arb: "https://nodes.mewapi.io/rpc/arb",
},
},
sns: {
network: "testnet",
},
});
let address = await resolver.resolveAddress("test.eth", "ETH");
expect(address).to.be.eq("0xeefB13C7D42eFCc655E528dA6d6F7bBcf9A2251d");
Expand All @@ -37,9 +34,6 @@ describe("Name Resolver resolving", () => {
arb: "https://nodes.mewapi.io/rpc/arb",
},
},
sns: {
network: "testnet",
},
});
let name = await resolver.resolveReverseName(
"0xe5dc07bdcdb8c98850050c7f67de7e164b1ea391"
Expand Down
26 changes: 0 additions & 26 deletions packages/name-resolution/tests/sns.test.ts

This file was deleted.

12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1754,17 +1754,6 @@ __metadata:
languageName: node
linkType: hard

"@bonfida/sns-warp-evm@npm:^0.0.4":
version: 0.0.4
resolution: "@bonfida/sns-warp-evm@npm:0.0.4"
peerDependencies:
"@ethersproject/address": ^5.7.0
"@ethersproject/hash": ^5.7.0
"@ethersproject/providers": ^5.7.2
checksum: ad7e8c8a157f3c79668d8704eecb96708384f54f07088aaabcfb4798984d5d93082ddc80bb5b020e114d6bf9769781205aad53a1a9aa3c652558a6985b24a36f
languageName: node
linkType: hard

"@cardano-foundation/ledgerjs-hw-app-cardano@npm:^6.0.1":
version: 6.0.1
resolution: "@cardano-foundation/ledgerjs-hw-app-cardano@npm:6.0.1"
Expand Down Expand Up @@ -14886,7 +14875,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "enkrypt@workspace:."
dependencies:
"@bonfida/sns-warp-evm": ^0.0.4
"@commitlint/cli": ^19.3.0
"@commitlint/config-conventional": ^19.2.2
"@swc/core": ^1.6.3
Expand Down

1 comment on commit 86958e5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.