Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
13085fe
feat: chain abstraction interfaces
ganchoradkov Dec 5, 2024
73c0983
feat: types and tests
ganchoradkov Dec 5, 2024
930457a
refactor: global methods
ganchoradkov Dec 12, 2024
0abec9f
Merge branch 'main' into feat/chain-abstraction
ganchoradkov Dec 16, 2024
2899e74
refactor: updates types
ganchoradkov Dec 17, 2024
0399cd4
feat: adds new chain abstraction methods
ganchoradkov Dec 19, 2024
8989566
feat: mark ca methods experimental, adds polling to status update
ganchoradkov Dec 20, 2024
542f08a
refactor: removes pending fulfilment status as sdk does the polling
ganchoradkov Jan 8, 2025
17e2e40
feat: yttrium in the browser and node
ganchoradkov Jan 23, 2025
541dda1
chore: prettier
ganchoradkov Jan 23, 2025
ce95576
chore: prettier of pack script
ganchoradkov Jan 23, 2025
d82e199
chore: prettier
ganchoradkov Jan 28, 2025
be7c802
chore: latest yttrium
ganchoradkov Jan 30, 2025
eb018c4
chore: adds decimals to fundingFrom type and checks for totalFee with…
ganchoradkov Jan 31, 2025
1e2eb97
refactor: WalletKit chain abstraction to use and expose yttrium types
ganchoradkov Feb 17, 2025
cdb6f4a
chore: yttrium update
ganchoradkov Feb 26, 2025
c72e062
refactor: add types
ganchoradkov Feb 26, 2025
28c13a1
refactor: RN chain abstraction handlers for android
ganchoradkov Mar 5, 2025
68d2a35
feat: ios prepareDetailed & execute
ganchoradkov Mar 7, 2025
676a2b1
Merge branch 'main' into feat/chain-abstraction
ganchoradkov Apr 11, 2025
e1ba23e
chore: ak canary
ganchoradkov Apr 11, 2025
e01e201
Merge branch 'main' into feat/chain-abstraction
ganchoradkov May 14, 2025
926cfe1
chore: rm only modifier
ganchoradkov May 14, 2025
d695d1d
fix: text decoder
ganchoradkov May 14, 2025
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
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"curly": "off",
"prefer-promise-reject-errors": "off"
},
"ignorePatterns": ["dist", "**/node_modules/*"],
"ignorePatterns": ["dist", "**/node_modules/*", "src/libs/yttrium/**"],
"env": {
"browser": true,
"es6": true
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"packages": [
"packages/walletkit"
],
"version": "1.2.3"
"version": "1.2.3-canary-ca-1"
}
182 changes: 173 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@
"eslint-plugin-react": "7.30.1",
"eslint-plugin-standard": "5.0.0",
"lerna": "7.1.4",
"prettier": "2.7.1",
"prettier": "3.4.2",
"rollup": "2.78.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-esbuild": "4.9.3",
"sinon": "14.0.0",
"typescript": "4.7.4",
Expand Down
1 change: 1 addition & 0 deletions packages/walletkit/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/libs/*
10 changes: 6 additions & 4 deletions packages/walletkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,20 @@
"build": "npm run build:pre; npm run build:source; npm run build:types",
"test": "vitest run --dir test --no-threads",
"lint": "eslint -c '../../.eslintrc' --fix './src/**/*.ts'",
"prettier": "prettier --check '{src,test}/**/*.{js,ts,jsx,tsx}'"
"prettier": "prettier --ignore-path ./.prettierignore --check '{src,test}/**/*.{js,ts,jsx,tsx}'"
},
"dependencies": {
"@walletconnect/core": "2.20.1",
"@walletconnect/jsonrpc-provider": "1.0.14",
"@walletconnect/jsonrpc-utils": "1.0.8",
"@walletconnect/logger": "2.1.2",
"@walletconnect/logger": "2.1.2",
"@walletconnect/sign-client": "2.20.1",
"@walletconnect/types": "2.20.1",
"@walletconnect/utils": "2.20.1"
"@walletconnect/utils": "2.20.1",
"brotli": "^1.3.3"
},
"devDependencies": {
"@ethersproject/wallet": "5.7.0"
"@ethersproject/wallet": "5.7.0",
"@types/brotli": "^1.3.3"
}
}
21 changes: 21 additions & 0 deletions packages/walletkit/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export class WalletKit extends IWalletKit {
public static notifications: WalletKitTypes.INotifications = Notifications;
public signConfig: IWalletKit["signConfig"];

// ---------- Chain Abstraction ---------------------- //
public chainAbstraction: IWalletKit["chainAbstraction"];

static async init(opts: WalletKitTypes.Options) {
const client = new WalletKit(opts);
await client.initialize();
Expand All @@ -29,6 +32,13 @@ export class WalletKit extends IWalletKit {
this.core = opts.core;
this.logger = this.core.logger;
this.engine = new Engine(this);
this.chainAbstraction = {
prepare: this.engine.prepare,
status: this.engine.status,
getPrepareDetails: this.engine.getPrepareDetails,
execute: this.engine.execute,
prepareDetailed: this.engine.prepareDetailed,
};
}

// ---------- Events ----------------------------------------------- //
Expand Down Expand Up @@ -186,6 +196,17 @@ export class WalletKit extends IWalletKit {
}
};

// ---------- Chain Abstraction ----------------------------------------------- //

public getERC20Balance: IWalletKit["getERC20Balance"] = async (params) => {
try {
return await this.engine.getERC20Balance(params);
} catch (error: any) {
this.logger.error(error.message);
throw error;
}
};

// ---------- Private ----------------------------------------------- //

private async initialize() {
Expand Down
10 changes: 10 additions & 0 deletions packages/walletkit/src/constants/chainAbstraction.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const FULFILMENT_STATUS = {
completed: "completed",
pending: "pending",
error: "error",
} as const;
export const CAN_FULFIL_STATUS = {
not_required: "not_required",
available: "available",
error: "error",
} as const;
1 change: 1 addition & 0 deletions packages/walletkit/src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./client";
export * from "./request";
export * from "./chainAbstraction";
Loading
Loading