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
762 changes: 214 additions & 548 deletions bun.lock

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,27 @@
"node": ">=20.0.0"
},
"dependencies": {
"@reown/walletkit": "^1.2.10",
"elliptic": "^6.6.1",
"js-sha3": "^0.9.3",
"near-api-js": "^6.3.0",
"viem": "^2.37.5"
"viem": "^2.37.8"
},
"devDependencies": {
"@types/elliptic": "^6.4.18",
"@types/jest": "^30.0.0",
"@types/node": "^24.3.1",
"@typescript-eslint/eslint-plugin": "^8.43.0",
"@typescript-eslint/parser": "^8.43.0",
"@types/node": "^24.5.2",
"@typescript-eslint/eslint-plugin": "^8.44.1",
"@typescript-eslint/parser": "^8.44.1",
"dotenv": "^17.2.2",
"eslint": "^9.35.0",
"eslint": "^9.36.0",
"ethers": "^6.15.0",
"opensea-js": "^7.2.1",
"prettier": "^3.6.2",
"ts-jest": "^29.4.1",
"ts-jest": "^29.4.4",
"tsx": "^4.20.5",
"typescript": "^5.9.2"
},
"overrides": {
"@noble/curves": "^1.9.7"
}
}
66 changes: 0 additions & 66 deletions src/beta.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/chains/ethereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
IMpcContract,
NearEncodedSignRequest,
} from "..";
import { Beta } from "../beta";
import { requestRouter } from "../utils";

/**
Expand All @@ -35,7 +34,6 @@ export class NearEthAdapter {
readonly mpcContract: IMpcContract;
readonly address: Address;
readonly derivationPath: string;
readonly beta: Beta;

private constructor(config: {
mpcContract: IMpcContract;
Expand All @@ -45,7 +43,6 @@ export class NearEthAdapter {
this.mpcContract = config.mpcContract;
this.derivationPath = config.derivationPath;
this.address = config.sender;
this.beta = new Beta(this);
}

/**
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ export * from "./utils";
/// Files
export * from "./mpcContract";
export * from "./setup";
/// Beta features
export * from "./beta";
53 changes: 0 additions & 53 deletions tests/unit/ethereum.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,58 +29,5 @@ describe("ethereum", () => {

const request = await adapter.mpcSignRequest(transaction);
expect(request.actions.length).toEqual(1);

await expect(
adapter.beta.handleSessionRequest({
params: {
chainId: "11155111",
request: { method: "poop", params: [] },
},
})
).rejects.toThrow(
`Unsupported sign method poop: Available sign methods ${signMethods}`
);

const ethSign = await adapter.beta.handleSessionRequest({
params: {
chainId: "11155111",
request: {
method: "eth_sign",
params: [adapter.address, "0x"],
},
},
});

expect(ethSign).toStrictEqual({
nearPayload: {
signerId: "farmface.testnet",
receiverId: mpcContractId,
actions: [
{
type: "FunctionCall",
params: {
methodName: "sign",
args: {
request: {
path: "ethereum,1",
payload: [
95, 53, 220, 233, 139, 164, 251, 162, 85, 48, 160, 38, 237,
128, 178, 206, 205, 170, 49, 9, 27, 164, 149, 139, 153, 181,
46, 161, 208, 104, 173, 173,
],
key_version: 0,
},
},
gas: "250000000000000",
// This isn't deterministic.
deposit: ethSign.nearPayload.actions[0]?.params.deposit,
},
},
],
},
evmMessage: "",
hashToSign:
"0x5f35dce98ba4fba25530a026ed80b2cecdaa31091ba4958b99b52ea1d068adad",
});
});
});