Ver Fonte

fix(express_relay): Update naming on express relay interfaces (#1358)

* Update naming on express relay interfaces
Amin Moghaddam há 1 ano atrás
pai
commit
0b1135c8d3

+ 6 - 6
express_relay/sdk/solidity/IPERMulticall.sol → express_relay/sdk/solidity/IExpressRelay.sol

@@ -2,14 +2,14 @@
 // Copyright (C) 2024 Lavra Holdings Limited - All Rights Reserved
 pragma solidity ^0.8.0;
 
-interface IPERMulticall {
+interface IExpressRelay {
     // Check if the combination of protocol and permissionKey is allowed within this transaction.
-    // This will return true if and only if it's being called while executing the auction winner call.
-    // @param protocol The address of the protocol that is gating an action behind this permission
-    // @param permissionKey The permission key that is being checked
+    // This will return true if and only if it's being called while executing the auction winner(s) call.
+    // @param protocolFeeReceiver The address of the protocol that is gating an action behind this permission
+    // @param permissionId The id that represents the action being gated
     // @return permissioned True if the permission is allowed, false otherwise
     function isPermissioned(
-        address protocol,
-        bytes calldata permissionKey
+        address protocolFeeReceiver,
+        bytes calldata permissionId
     ) external view returns (bool permissioned);
 }

+ 1 - 1
express_relay/sdk/solidity/IPERFeeReceiver.sol → express_relay/sdk/solidity/IExpressRelayFeeReceiver.sol

@@ -2,7 +2,7 @@
 // Copyright (C) 2024 Lavra Holdings Limited - All Rights Reserved
 pragma solidity ^0.8.0;
 
-interface IPERFeeReceiver {
+interface IExpressRelayFeeReceiver {
     // Receive the proceeds of an auction.
     // @param permissionKey The permission key where the auction was conducted on.
     function receiveAuctionProceedings(

+ 4 - 4
express_relay/sdk/solidity/README.md

@@ -1,4 +1,4 @@
-# Pyth Express Relay Solidity SDK
+# Express Relay Solidity SDK
 
 ## Install
 
@@ -7,7 +7,7 @@
 If you are using Truffle or Hardhat, simply install the NPM package:
 
 ```bash
-npm install @pythnetwork/per-sdk-solidity
+npm install @pythnetwork/express-relay-sdk-solidity
 ```
 
 ### Foundry
@@ -17,11 +17,11 @@ From the root directory of your project, run:
 
 ```bash
 npm init -y
-npm install @pythnetwork/per-sdk-solidity
+npm install @pythnetwork/express-relay-sdk-solidity
 ```
 
 Then add the following line to your `remappings.txt` file:
 
 ```text
-@pythnetwork/per-sdk-solidity/=node_modules/@pythnetwork/per-sdk-solidity
+@pythnetwork/express-relay-sdk-solidity/=node_modules/@pythnetwork/express-relay-sdk-solidity
 ```

+ 2 - 2
express_relay/sdk/solidity/abis/IPERMulticall.json → express_relay/sdk/solidity/abis/IExpressRelay.json

@@ -3,12 +3,12 @@
     "inputs": [
       {
         "internalType": "address",
-        "name": "protocol",
+        "name": "protocolFeeReceiver",
         "type": "address"
       },
       {
         "internalType": "bytes",
-        "name": "permissionKey",
+        "name": "permissionId",
         "type": "bytes"
       }
     ],

+ 0 - 0
express_relay/sdk/solidity/abis/IPERFeeReceiver.json → express_relay/sdk/solidity/abis/IExpressRelayFeeReceiver.json


+ 4 - 4
express_relay/sdk/solidity/package.json

@@ -1,7 +1,7 @@
 {
-  "name": "@pythnetwork/per-sdk-solidity",
-  "version": "0.1.0",
-  "description": "Solidity SDK for interacting with Pyth express relay contracts",
+  "name": "@pythnetwork/express-relay-sdk-solidity",
+  "version": "0.2.0",
+  "description": "Solidity SDK for interacting with Express Relay contracts",
   "repository": {
     "type": "git",
     "url": "https://github.com/pyth-network/pyth-crosschain",
@@ -12,7 +12,7 @@
   },
   "scripts": {
     "format": "npx prettier --write .",
-    "generate-abi": "npx generate-abis IPERMulticall IPERFeeReceiver",
+    "generate-abi": "npx generate-abis IExpressRelay IExpressRelayFeeReceiver",
     "check-abi": "git diff --exit-code abis"
   },
   "keywords": [

+ 7 - 65
package-lock.json

@@ -2132,8 +2132,8 @@
       }
     },
     "express_relay/sdk/solidity": {
-      "name": "@pythnetwork/per-sdk-solidity",
-      "version": "0.1.0",
+      "name": "@pythnetwork/express-relay-sdk-solidity",
+      "version": "0.2.0",
       "license": "Apache-2.0",
       "devDependencies": {
         "abi_generator": "*",
@@ -13601,7 +13601,7 @@
       "resolved": "express_relay/sdk/js",
       "link": true
     },
-    "node_modules/@pythnetwork/per-sdk-solidity": {
+    "node_modules/@pythnetwork/express-relay-sdk-solidity": {
       "resolved": "express_relay/sdk/solidity",
       "link": true
     },
@@ -58739,7 +58739,7 @@
     },
     "target_chains/ethereum/entropy_sdk/solidity": {
       "name": "@pythnetwork/entropy-sdk-solidity",
-      "version": "1.1.3",
+      "version": "1.2.0",
       "license": "Apache-2.0",
       "devDependencies": {
         "abi_generator": "*",
@@ -59314,47 +59314,6 @@
         "typescript": "^4.6.3"
       }
     },
-    "target_chains/solana/sdk/js/solana_utils": {
-      "name": "@pythnetwork/solana-utils",
-      "version": "0.1.0",
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@coral-xyz/anchor": "^0.29.0",
-        "@solana/web3.js": "^1.90.0"
-      },
-      "devDependencies": {
-        "@types/jest": "^29.4.0",
-        "@typescript-eslint/eslint-plugin": "^5.20.0",
-        "@typescript-eslint/parser": "^5.20.0",
-        "eslint": "^8.13.0",
-        "jest": "^29.4.0",
-        "prettier": "^2.6.2",
-        "quicktype": "^23.0.76",
-        "ts-jest": "^29.0.5",
-        "typescript": "^4.6.3"
-      }
-    },
-    "target_chains/solana/sdk/js/pyth_solana_receiver": {
-      "version": "0.1.0",
-      "license": "Apache-2.0",
-      "dependencies": {
-        "@coral-xyz/anchor": "^0.29.0",
-        "@pythnetwork/price-service-sdk": "*",
-        "@pythnetwork/solana-utils": "*",
-        "@solana/web3.js": "^1.90.0"
-      },
-      "devDependencies": {
-        "@types/jest": "^29.4.0",
-        "@typescript-eslint/eslint-plugin": "^5.20.0",
-        "@typescript-eslint/parser": "^5.20.0",
-        "eslint": "^8.13.0",
-        "jest": "^29.4.0",
-        "prettier": "^2.6.2",
-        "quicktype": "^23.0.76",
-        "ts-jest": "^29.0.5",
-        "typescript": "^4.6.3"
-      }
-    },
     "target_chains/solana/sdk/js/pyth_solana_receiver/node_modules/@coral-xyz/anchor": {
       "version": "0.29.0",
       "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.29.0.tgz",
@@ -59421,6 +59380,7 @@
       "version": "0.1.0",
       "license": "Apache-2.0",
       "dependencies": {
+        "@coral-xyz/anchor": "^0.29.0",
         "@solana/web3.js": "^1.90.0"
       },
       "devDependencies": {
@@ -69047,7 +69007,7 @@
         }
       }
     },
-    "@pythnetwork/per-sdk-solidity": {
+    "@pythnetwork/express-relay-sdk-solidity": {
       "version": "file:express_relay/sdk/solidity",
       "requires": {
         "abi_generator": "*",
@@ -71143,24 +71103,6 @@
         "prettier-plugin-solidity": "^1.0.0-rc.1"
       }
     },
-    "@pythnetwork/pyth-solana-receiver": {
-      "version": "file:target_chains/solana/sdk/js/pyth_solana_receiver",
-      "requires": {
-        "@coral-xyz/anchor": "^0.29.0",
-        "@pythnetwork/price-service-sdk": "*",
-        "@pythnetwork/solana-utils": "*",
-        "@solana/web3.js": "^1.90.0",
-        "@types/jest": "^29.4.0",
-        "@typescript-eslint/eslint-plugin": "^5.20.0",
-        "@typescript-eslint/parser": "^5.20.0",
-        "eslint": "^8.13.0",
-        "jest": "^29.4.0",
-        "prettier": "^2.6.2",
-        "quicktype": "^23.0.76",
-        "ts-jest": "^29.0.5",
-        "typescript": "^4.6.3"
-      }
-    },
     "@pythnetwork/pyth-solana-receiver": {
       "version": "file:target_chains/solana/sdk/js/pyth_solana_receiver",
       "requires": {
@@ -71369,7 +71311,7 @@
     "@pythnetwork/solana-utils": {
       "version": "file:target_chains/solana/sdk/js/solana_utils",
       "requires": {
-        "@coral-xyz/anchor": "*",
+        "@coral-xyz/anchor": "^0.29.0",
         "@solana/web3.js": "^1.90.0",
         "@types/jest": "^29.4.0",
         "@typescript-eslint/eslint-plugin": "^5.20.0",