Skip to content

Commit

Permalink
Merge branch 'main' into feat/safari-support
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Mar 20, 2024
2 parents 5b847ff + 8aa162d commit 127f32c
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@enkryptcom/extension",
"version": "1.35.0",
"version": "1.36.0",
"private": true,
"scripts": {
"zip": "cd dist; zip -r release.zip *;",
Expand Down
2 changes: 2 additions & 0 deletions packages/extension/src/libs/dapp-list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ const lists: Partial<Record<NetworkNames, string>> = {
"https://raw.githubusercontent.com/enkryptcom/dynamic-data/main/dapps/celo.json",
[NetworkNames.MaticZK]:
"https://raw.githubusercontent.com/enkryptcom/dynamic-data/main/dapps/matic-zkevm.json",
[NetworkNames.Bitcoin]:
"https://raw.githubusercontent.com/enkryptcom/dynamic-data/main/dapps/btc.json",
};

export default lists;
4 changes: 4 additions & 0 deletions packages/hw-wallets/src/ledger/ethereum/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ const supportedPaths = {
bip44Paths.ethereumLedger,
bip44Paths.ethereumLedgerLive,
],
[NetworkNames.Avalanche]: [
bip44Paths.ethereumLedger,
bip44Paths.ethereumLedgerLive,
],
[NetworkNames.Goerli]: [bip44Paths.ethereumTestnetLedger],
};
export { supportedPaths };
2 changes: 2 additions & 0 deletions packages/hw-wallets/src/trezor/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { bip44Paths } from "../configs";
const supportedPaths = {
[NetworkNames.Ethereum]: [bip44Paths.ethereum],
[NetworkNames.Matic]: [bip44Paths.ethereum],
[NetworkNames.Avalanche]: [bip44Paths.ethereum],
[NetworkNames.Binance]: [bip44Paths.ethereum],
[NetworkNames.EthereumClassic]: [bip44Paths.ethereumClassic],
[NetworkNames.Goerli]: [bip44Paths.ethereumTestnet],
[NetworkNames.Rootstock]: [bip44Paths.rootstock],
Expand Down
7 changes: 6 additions & 1 deletion packages/name-resolution/src/ens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ class ENSResolver implements BaseResolver {
}

public async init(): Promise<void> {
this.ENSProvider = new ethers.providers.JsonRpcProvider(this.options.node);
this.ENSProvider = new ethers.providers.JsonRpcProvider({
url: this.options.node,
headers: {
"user-agent": "enkrypt/name-resolver",
},
});
}

public async resolveReverseName(address: string): Promise<string | null> {
Expand Down
23 changes: 18 additions & 5 deletions packages/name-resolution/src/sid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,24 @@ class SIDResolver implements BaseResolver {
public async init(): Promise<void> {}

public async resolveReverseName(address: string): Promise<string | null> {
const bnbProvider = new ethers.providers.JsonRpcProvider(this.rpc.node.bnb);
const bnbProvider = new ethers.providers.JsonRpcProvider({
url: this.rpc.node.bnb,
headers: {
"user-agent": "enkrypt/name-resolver",
},
});
const sidBNB = new SID({
provider: bnbProvider,
sidAddress: getSidAddress("56"),
});
const nameBnb = await sidBNB.getName(address);
if (nameBnb) return nameBnb.name;
const arbProvider = new ethers.providers.JsonRpcProvider(this.rpc.node.arb);
const arbProvider = new ethers.providers.JsonRpcProvider({
url: this.rpc.node.arb,
headers: {
"user-agent": "enkrypt/name-resolver",
},
});
const sidArb = new SID({
provider: arbProvider,
sidAddress: getSidAddress("42161"),
Expand All @@ -38,9 +48,12 @@ class SIDResolver implements BaseResolver {
}

public async resolveAddress(name: string): Promise<string | null> {
const provider = new ethers.providers.JsonRpcProvider(
this.rpc.node[getTLD(name)]
);
const provider = new ethers.providers.JsonRpcProvider({
url: this.rpc.node[getTLD(name)],
headers: {
"user-agent": "enkrypt/name-resolver",
},
});
const sid = new SID({
provider,
sidAddress: getSidAddress(getTLD(name) === "bnb" ? "56" : "42161"),
Expand Down
2 changes: 1 addition & 1 deletion packages/name-resolution/tests/resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ describe("Name Resolver resolving", () => {
"0xb5932a6b7d50a966aec6c74c97385412fb497540"
);
expect(name).to.be.eq("spaceid.eth");
}).timeout(10000);
}).timeout(20000);
});
4 changes: 2 additions & 2 deletions packages/name-resolution/tests/sid.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("SID Name resolving", () => {
},
});
await resolver.init();
const address = await resolver.resolveAddress("spaceid.arb", "ARB1");
const address = await resolver.resolveAddress("spaceid.arb");
expect(address).to.be.eq("0xb5932a6B7d50A966AEC6C74C97385412Fb497540");
}).timeout(10000);

Expand Down Expand Up @@ -41,7 +41,7 @@ describe("SID Name resolving", () => {
"0xe5dc07bdcdb8c98850050c7f67de7e164b1ea392"
);
expect(name).to.be.eq(null);
const address = await resolver.resolveAddress("sdfsfsdfsdfsdf.bnb", "BNB");
const address = await resolver.resolveAddress("sdfsfsdfsdfsdf.bnb");
expect(address).to.be.eq(null);
}).timeout(10000);
});
4 changes: 1 addition & 3 deletions packages/swap/tests/changelly.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ describe("Changelly Provider", () => {
expect(quote?.quote.meta.walletIdentifier).to.be.eq(
WalletIdentifier.enkrypt
);
expect(quote?.fromTokenAmount.toString()).to.be.eq(
quote?.minMax.minimumFrom.toString()
);
expect(quote?.fromTokenAmount.toString()).to.be.eq(amount.toString());
expect(quote?.toTokenAmount.gtn(0)).to.be.eq(true);
const swap = await changelly.getSwap(quote!.quote);

Expand Down

1 comment on commit 127f32c

@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.