@dzapio/sdk 2.0.36 → 2.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -1
- package/dist/index.mjs +7 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16547,6 +16547,12 @@ async function classifyBvmAddress(params) {
|
|
|
16547
16547
|
address
|
|
16548
16548
|
};
|
|
16549
16549
|
}
|
|
16550
|
+
var EIP7702_DELEGATION_PREFIX = "0xef0100";
|
|
16551
|
+
var EIP7702_DELEGATION_HEX_LENGTH = 2 + 23 * 2;
|
|
16552
|
+
function isEip7702DelegationCode(bytecode) {
|
|
16553
|
+
const normalized = bytecode.toLowerCase();
|
|
16554
|
+
return normalized.startsWith(EIP7702_DELEGATION_PREFIX) && normalized.length === EIP7702_DELEGATION_HEX_LENGTH;
|
|
16555
|
+
}
|
|
16550
16556
|
async function classifyEvmAddress(params) {
|
|
16551
16557
|
const { chainId, rpcUrls, chainConfig } = params;
|
|
16552
16558
|
const address = formatToken(params.address);
|
|
@@ -16579,7 +16585,7 @@ async function classifyEvmAddress(params) {
|
|
|
16579
16585
|
console.error(`RPC error (getCode): ${message}`);
|
|
16580
16586
|
return null;
|
|
16581
16587
|
}
|
|
16582
|
-
if (!bytecode || bytecode === "0x") {
|
|
16588
|
+
if (!bytecode || bytecode === "0x" || isEip7702DelegationCode(bytecode)) {
|
|
16583
16589
|
return {
|
|
16584
16590
|
valid: true,
|
|
16585
16591
|
kind: "wallet" /* WALLET */,
|
package/dist/index.mjs
CHANGED
|
@@ -16521,6 +16521,12 @@ async function classifyBvmAddress(params) {
|
|
|
16521
16521
|
address
|
|
16522
16522
|
};
|
|
16523
16523
|
}
|
|
16524
|
+
var EIP7702_DELEGATION_PREFIX = "0xef0100";
|
|
16525
|
+
var EIP7702_DELEGATION_HEX_LENGTH = 2 + 23 * 2;
|
|
16526
|
+
function isEip7702DelegationCode(bytecode) {
|
|
16527
|
+
const normalized = bytecode.toLowerCase();
|
|
16528
|
+
return normalized.startsWith(EIP7702_DELEGATION_PREFIX) && normalized.length === EIP7702_DELEGATION_HEX_LENGTH;
|
|
16529
|
+
}
|
|
16524
16530
|
async function classifyEvmAddress(params) {
|
|
16525
16531
|
const { chainId, rpcUrls, chainConfig } = params;
|
|
16526
16532
|
const address = formatToken(params.address);
|
|
@@ -16553,7 +16559,7 @@ async function classifyEvmAddress(params) {
|
|
|
16553
16559
|
console.error(`RPC error (getCode): ${message}`);
|
|
16554
16560
|
return null;
|
|
16555
16561
|
}
|
|
16556
|
-
if (!bytecode || bytecode === "0x") {
|
|
16562
|
+
if (!bytecode || bytecode === "0x" || isEip7702DelegationCode(bytecode)) {
|
|
16557
16563
|
return {
|
|
16558
16564
|
valid: true,
|
|
16559
16565
|
kind: "wallet" /* WALLET */,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dzapio/sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.37",
|
|
4
4
|
"description": "A TypeScript/JavaScript SDK for interacting with the DZap protocol, providing utilities for DeFi operations including Swaps, Bridges, and Zaps.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"source": "src/index.ts",
|