m2m-sentinel-sdk 1.0.2 → 1.0.4

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.
Files changed (41) hide show
  1. package/README.md +44 -28
  2. package/agent_adapter.js +30 -0
  3. package/eliza_plugin.js +84 -0
  4. package/index.js +136 -19
  5. package/m2m_sentinel_sdk.js +1 -12
  6. package/mcp_server.js +172 -0
  7. package/package.json +26 -9
  8. package/typescript/index.ts +135 -35
  9. package/typescript/package.json +4 -3
  10. package/cli/m2m_cli.js +0 -25
  11. package/csharp/M2MSentinel.csproj +0 -9
  12. package/csharp/M2MSentinelClient.cs +0 -67
  13. package/go/client.go +0 -94
  14. package/go/go.mod +0 -3
  15. package/java/M2MSentinelClient.java +0 -67
  16. package/java/pom.xml +0 -20
  17. package/java/src/main/java/com/m2msentinel/M2MSentinelClient.java +0 -69
  18. package/kotlin/M2MSentinelClient.kt +0 -59
  19. package/kotlin/build.gradle.kts +0 -24
  20. package/m2m_sentinel/__init__.py +0 -3
  21. package/m2m_sentinel/client.py +0 -16
  22. package/m2m_sentinel_sdk.py +0 -9
  23. package/php/M2MSentinelClient.php +0 -52
  24. package/php/composer.json +0 -20
  25. package/python/dist/m2m_sentinel-0.1.0-py3-none-any.whl +0 -0
  26. package/python/dist/m2m_sentinel-0.1.0.tar.gz +0 -0
  27. package/python/dist/m2m_sentinel-0.1.1-py3-none-any.whl +0 -0
  28. package/python/dist/m2m_sentinel-0.1.1.tar.gz +0 -0
  29. package/python/m2m_sentinel/__pycache__/client.cpython-314.pyc +0 -0
  30. package/python/m2m_sentinel/client.py +0 -40
  31. package/python/m2m_sentinel.egg-info/PKG-INFO +0 -35
  32. package/python/m2m_sentinel.egg-info/SOURCES.txt +0 -5
  33. package/python/m2m_sentinel.egg-info/dependency_links.txt +0 -1
  34. package/python/m2m_sentinel.egg-info/top_level.txt +0 -1
  35. package/python/setup.py +0 -35
  36. package/ruby/m2m_sentinel.gemspec +0 -17
  37. package/ruby/m2m_sentinel.rb +0 -55
  38. package/rust/Cargo.toml +0 -11
  39. package/rust/src/lib.rs +0 -61
  40. package/swift/M2MSentinelClient.swift +0 -65
  41. package/swift/Package.swift +0 -23
@@ -1,9 +0,0 @@
1
- import requests
2
-
3
- class M2MSentinelSDK:
4
- def __init__(self, api_key):
5
- self.api_key = api_key
6
- self.base_url = "https://m2msentinel.vercel.app/v1"
7
-
8
- def get_token_price(self):
9
- return requests.get(f"{self.base_url}/token/price").json()
@@ -1,52 +0,0 @@
1
- <?php
2
-
3
- class M2MSentinelClient {
4
- public string $base_url;
5
- public string $payout_wallet;
6
-
7
- public function __construct(string $base_url = "https://m2msentinel.vercel.app") {
8
- $this->base_url = rtrim($base_url, "/");
9
- $this->payout_wallet = "0x1C79BfBFA67Ab140f72f0F6888123a70D9DaC23e";
10
- }
11
-
12
- private function get(string $path) {
13
- $url = $this->base_url . $path;
14
- $response = file_get_contents($url);
15
- if ($response === false) {
16
- throw new Exception("Failed to fetch data from API");
17
- }
18
- return json_decode($response, true);
19
- }
20
-
21
- public function audit_contract(string $address) {
22
- return $this->get("/v1/audit/" . urlencode($address));
23
- }
24
-
25
- public function get_dex_metrics() {
26
- return $this->get("/v1/dex/metrics");
27
- }
28
-
29
- public function get_whale_signals() {
30
- return $this->get("/v1/whales/signals");
31
- }
32
-
33
- public function get_token_price(string $symbol) {
34
- return $this->get("/v1/token/price/" . urlencode($symbol));
35
- }
36
-
37
- public function search(string $query) {
38
- return $this->get("/v1/search?q=" . urlencode($query));
39
- }
40
-
41
- public function token_audit_multi() {
42
- return $this->get("/v1/token/audit/multi");
43
- }
44
-
45
- public function get_nft_floor(string $collection) {
46
- return $this->get("/v1/nft/floor?collection=" . urlencode($collection));
47
- }
48
-
49
- public function get_ai_sentiment(string $symbol) {
50
- return $this->get("/v1/ai/sentiment?symbol=" . urlencode($symbol));
51
- }
52
- }
package/php/composer.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "name": "m2m-sentinel/sdk",
3
- "description": "PHP SDK for M2M Sentinel API",
4
- "type": "library",
5
- "license": "MIT",
6
- "authors": [
7
- {
8
- "name": "M2M Sentinel",
9
- "email": "support@m2msentinel.com"
10
- }
11
- ],
12
- "require": {
13
- "php": ">=7.4"
14
- },
15
- "autoload": {
16
- "classmap": [
17
- "M2MSentinelClient.php"
18
- ]
19
- }
20
- }
@@ -1,40 +0,0 @@
1
- import urllib.parse
2
- import urllib.request
3
- import json
4
-
5
- class M2MSentinelClient:
6
- def __init__(self, base_url="https://m2msentinel.vercel.app"):
7
- self.base_url = base_url.rstrip("/")
8
- self.payout_wallet = "0x1C79BfBFA67Ab140f72f0F6888123a70D9DaC23e"
9
-
10
- def _get(self, path):
11
- req = urllib.request.Request(f"{self.base_url}{path}")
12
- with urllib.request.urlopen(req) as response:
13
- return json.loads(response.read().decode())
14
-
15
- def audit_contract(self, address: str):
16
- return self._get(f"/v1/audit/{address}")
17
-
18
- def get_dex_metrics(self):
19
- return self._get("/v1/dex/metrics")
20
-
21
- def get_whale_signals(self):
22
- return self._get("/v1/whales/signals")
23
-
24
- def get_token_price(self, symbol: str):
25
- return self._get(f"/v1/token/price/{symbol}")
26
-
27
- def search(self, query: str):
28
- q = urllib.parse.quote(query)
29
- return self._get(f"/v1/search?q={q}")
30
-
31
- def token_audit_multi(self):
32
- return self._get("/v1/token/audit/multi")
33
-
34
- def get_nft_floor(self, collection: str):
35
- q = urllib.parse.quote(collection)
36
- return self._get(f"/v1/nft/floor?collection={q}")
37
-
38
- def get_ai_sentiment(self, symbol: str):
39
- q = urllib.parse.quote(symbol)
40
- return self._get(f"/v1/ai/sentiment?symbol={q}")
@@ -1,35 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: m2m-sentinel
3
- Version: 0.1.1
4
- Summary: Official Python Client SDK for M2M Sentinel Web3 Security & AI Intelligence Engine
5
- Home-page: https://m2msentinel.vercel.app
6
- Author: M2M Sentinel
7
- Classifier: Programming Language :: Python :: 3
8
- Classifier: License :: OSI Approved :: MIT License
9
- Classifier: Operating System :: OS Independent
10
- Description-Content-Type: text/markdown
11
- Dynamic: author
12
- Dynamic: classifier
13
- Dynamic: description
14
- Dynamic: description-content-type
15
- Dynamic: home-page
16
- Dynamic: summary
17
-
18
- # M2M Sentinel Python SDK
19
-
20
- Autonomous Machine-to-Machine Smart Contract Security Risk Auditor & Web3 AI Intelligence Engine.
21
-
22
- ## Features
23
- - **Smart Contract Bytecode Risk Auditor** (`audit_contract`)
24
- - **Real-Time Whale Move Alerts** (`get_whale_signals`)
25
- - **Cross-DEX Liquidity & Orderbook Metrics** (`get_dex_metrics`)
26
- - **AI Web Intelligence Search Extractor** (`search`)
27
-
28
- ## Quickstart
29
- ```python
30
- from m2m_sentinel.client import M2MSentinelClient
31
-
32
- client = M2MSentinelClient()
33
- report = client.audit_contract("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
34
- print(report)
35
- ```
@@ -1,5 +0,0 @@
1
- setup.py
2
- m2m_sentinel.egg-info/PKG-INFO
3
- m2m_sentinel.egg-info/SOURCES.txt
4
- m2m_sentinel.egg-info/dependency_links.txt
5
- m2m_sentinel.egg-info/top_level.txt
package/python/setup.py DELETED
@@ -1,35 +0,0 @@
1
- from setuptools import setup, find_packages
2
-
3
- setup(
4
- name="m2m-sentinel",
5
- version="0.1.1",
6
- packages=find_packages(),
7
- description="Official Python Client SDK for M2M Sentinel Web3 Security & AI Intelligence Engine",
8
- long_description="""# M2M Sentinel Python SDK
9
-
10
- Autonomous Machine-to-Machine Smart Contract Security Risk Auditor & Web3 AI Intelligence Engine.
11
-
12
- ## Features
13
- - **Smart Contract Bytecode Risk Auditor** (`audit_contract`)
14
- - **Real-Time Whale Move Alerts** (`get_whale_signals`)
15
- - **Cross-DEX Liquidity & Orderbook Metrics** (`get_dex_metrics`)
16
- - **AI Web Intelligence Search Extractor** (`search`)
17
-
18
- ## Quickstart
19
- ```python
20
- from m2m_sentinel.client import M2MSentinelClient
21
-
22
- client = M2MSentinelClient()
23
- report = client.audit_contract("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
24
- print(report)
25
- ```
26
- """,
27
- long_description_content_type="text/markdown",
28
- author="M2M Sentinel",
29
- url="https://m2msentinel.vercel.app",
30
- classifiers=[
31
- "Programming Language :: Python :: 3",
32
- "License :: OSI Approved :: MIT License",
33
- "Operating System :: OS Independent",
34
- ],
35
- )
@@ -1,17 +0,0 @@
1
- Gem::Specification.new do |spec|
2
- spec.name = "m2m_sentinel"
3
- spec.version = "0.1.0"
4
- spec.authors = ["M2M Sentinel"]
5
- spec.email = ["support@m2msentinel.com"]
6
-
7
- spec.summary = "Ruby SDK for M2M Sentinel API"
8
- spec.description = "Client library for the M2M Sentinel API, wrapping endpoints with configured payout wallet."
9
- spec.homepage = "https://m2msentinel.vercel.app"
10
- spec.license = "MIT"
11
-
12
- spec.files = Dir["*.rb"]
13
- spec.require_paths = ["."]
14
-
15
- spec.add_development_dependency "bundler", "~> 2.0"
16
- spec.add_development_dependency "rake", "~> 13.0"
17
- end
@@ -1,55 +0,0 @@
1
- require 'net/http'
2
- require 'json'
3
- require 'uri'
4
-
5
- class M2MSentinelClient
6
- attr_accessor :base_url, :payout_wallet
7
-
8
- def initialize(base_url = 'https://m2msentinel.vercel.app')
9
- @base_url = base_url.chomp('/')
10
- @payout_wallet = '0x1C79BfBFA67Ab140f72f0F6888123a70D9DaC23e'
11
- end
12
-
13
- def audit_contract(address)
14
- get("/v1/audit/#{address}")
15
- end
16
-
17
- def get_dex_metrics
18
- get("/v1/dex/metrics")
19
- end
20
-
21
- def get_whale_signals
22
- get("/v1/whales/signals")
23
- end
24
-
25
- def get_token_price(symbol)
26
- get("/v1/token/price/#{symbol}")
27
- end
28
-
29
- def search(query)
30
- q = URI.encode_www_form_component(query)
31
- get("/v1/search?q=#{q}")
32
- end
33
-
34
- def token_audit_multi
35
- get("/v1/token/audit/multi")
36
- end
37
-
38
- def get_nft_floor(collection)
39
- q = URI.encode_www_form_component(collection)
40
- get("/v1/nft/floor?collection=#{q}")
41
- end
42
-
43
- def get_ai_sentiment(symbol)
44
- q = URI.encode_www_form_component(symbol)
45
- get("/v1/ai/sentiment?symbol=#{q}")
46
- end
47
-
48
- private
49
-
50
- def get(path)
51
- uri = URI("#{@base_url}#{path}")
52
- response = Net::HTTP.get(uri)
53
- JSON.parse(response)
54
- end
55
- end
package/rust/Cargo.toml DELETED
@@ -1,11 +0,0 @@
1
- [package]
2
- name = "m2m_sentinel"
3
- version = "0.1.0"
4
- edition = "2021"
5
-
6
- [dependencies]
7
- reqwest = { version = "0.11", features = ["json"] }
8
- serde = { version = "1.0", features = ["derive"] }
9
- serde_json = "1.0"
10
- tokio = { version = "1", features = ["full"] }
11
- url = "2.2"
package/rust/src/lib.rs DELETED
@@ -1,61 +0,0 @@
1
- use reqwest::{Client, Error};
2
- use serde_json::Value;
3
- use url::form_urlencoded;
4
-
5
- pub struct M2MSentinelClient {
6
- base_url: String,
7
- pub payout_wallet: String,
8
- client: Client,
9
- }
10
-
11
- impl M2MSentinelClient {
12
- pub fn new(base_url: Option<&str>) -> Self {
13
- let base = base_url.unwrap_or("https://m2msentinel.vercel.app").trim_end_matches('/').to_string();
14
- Self {
15
- base_url: base,
16
- payout_wallet: "0x1C79BfBFA67Ab140f72f0F6888123a70D9DaC23e".to_string(),
17
- client: Client::new(),
18
- }
19
- }
20
-
21
- async fn get(&self, path: &str) -> Result<Value, Error> {
22
- let url = format!("{}{}", self.base_url, path);
23
- let res = self.client.get(&url).send().await?;
24
- res.json::<Value>().await
25
- }
26
-
27
- pub async fn audit_contract(&self, address: &str) -> Result<Value, Error> {
28
- self.get(&format!("/v1/audit/{}", address)).await
29
- }
30
-
31
- pub async fn get_dex_metrics(&self) -> Result<Value, Error> {
32
- self.get("/v1/dex/metrics").await
33
- }
34
-
35
- pub async fn get_whale_signals(&self) -> Result<Value, Error> {
36
- self.get("/v1/whales/signals").await
37
- }
38
-
39
- pub async fn get_token_price(&self, symbol: &str) -> Result<Value, Error> {
40
- self.get(&format!("/v1/token/price/{}", symbol)).await
41
- }
42
-
43
- pub async fn search(&self, query: &str) -> Result<Value, Error> {
44
- let encoded: String = form_urlencoded::byte_serialize(query.as_bytes()).collect();
45
- self.get(&format!("/v1/search?q={}", encoded)).await
46
- }
47
-
48
- pub async fn token_audit_multi(&self) -> Result<Value, Error> {
49
- self.get("/v1/token/audit/multi").await
50
- }
51
-
52
- pub async fn get_nft_floor(&self, collection: &str) -> Result<Value, Error> {
53
- let encoded: String = form_urlencoded::byte_serialize(collection.as_bytes()).collect();
54
- self.get(&format!("/v1/nft/floor?collection={}", encoded)).await
55
- }
56
-
57
- pub async fn get_ai_sentiment(&self, symbol: &str) -> Result<Value, Error> {
58
- let encoded: String = form_urlencoded::byte_serialize(symbol.as_bytes()).collect();
59
- self.get(&format!("/v1/ai/sentiment?symbol={}", encoded)).await
60
- }
61
- }
@@ -1,65 +0,0 @@
1
- import Foundation
2
-
3
- public class M2MSentinelClient {
4
- private let baseUrl: String
5
- public let payoutWallet: String = "0x1C79BfBFA67Ab140f72f0F6888123a70D9DaC23e"
6
- private let session: URLSession
7
-
8
- public init(baseUrl: String = "https://m2msentinel.vercel.app", session: URLSession = .shared) {
9
- var url = baseUrl
10
- if url.hasSuffix("/") {
11
- url.removeLast()
12
- }
13
- self.baseUrl = url
14
- self.session = session
15
- }
16
-
17
- private func getRequest(path: String) async throws -> Any {
18
- guard let url = URL(string: baseUrl + path) else {
19
- throw URLError(.badURL)
20
- }
21
- let (data, _) = try await session.data(from: url)
22
- return try JSONSerialization.jsonObject(with: data, options: [])
23
- }
24
-
25
- public func auditContract(address: String) async throws -> Any {
26
- return try await getRequest(path: "/v1/audit/\(address)")
27
- }
28
-
29
- public func getDexMetrics() async throws -> Any {
30
- return try await getRequest(path: "/v1/dex/metrics")
31
- }
32
-
33
- public func getWhaleSignals() async throws -> Any {
34
- return try await getRequest(path: "/v1/whales/signals")
35
- }
36
-
37
- public func getTokenPrice(symbol: String) async throws -> Any {
38
- return try await getRequest(path: "/v1/token/price/\(symbol)")
39
- }
40
-
41
- public func search(query: String) async throws -> Any {
42
- guard let q = query.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else {
43
- throw URLError(.badURL)
44
- }
45
- return try await getRequest(path: "/v1/search?q=\(q)")
46
- }
47
-
48
- public func tokenAuditMulti() async throws -> Any {
49
- return try await getRequest(path: "/v1/token/audit/multi")
50
- }
51
-
52
- public func getNftFloor(collection: String) async throws -> Any {
53
- guard let q = collection.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else {
54
- throw URLError(.badURL)
55
- }
56
- return try await getRequest(path: "/v1/nft/floor?collection=\(q)")
57
- }
58
-
59
- public func getAiSentiment(symbol: String) async throws -> Any {
60
- guard let q = symbol.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else {
61
- throw URLError(.badURL)
62
- }
63
- return try await getRequest(path: "/v1/ai/sentiment?symbol=\(q)")
64
- }
65
- }
@@ -1,23 +0,0 @@
1
- // swift-tools-version:5.5
2
- import PackageDescription
3
-
4
- let package = Package(
5
- name: "M2MSentinel",
6
- platforms: [
7
- .iOS(.v13),
8
- .macOS(.v10_15)
9
- ],
10
- products: [
11
- .library(
12
- name: "M2MSentinel",
13
- targets: ["M2MSentinel"]),
14
- ],
15
- dependencies: [],
16
- targets: [
17
- .target(
18
- name: "M2MSentinel",
19
- dependencies: [],
20
- path: ".",
21
- exclude: ["Package.swift"])
22
- ]
23
- )