Sui RPC endpoint दस्तावेज़ | ERPC
Sui RPC endpoint दस्तावेज़
ERPC को अपने Sui RPC endpoint के रूप में unary gRPC-web requests के लिए इस्तेमाल करें। Sui RPC हमारे Global Edge Blockchain Infrastructure के भीतर ERPC के RPC APIs का हिस्सा है, और API key को ERPC Web Dashboard से मैनेज किया जा सकता है।
आप वही RPC key इस्तेमाल कर सकते हैं जो Solana, Ethereum और Avalanche के लिए इस्तेमाल होती है।
अपनी API key को
Authorization: Bearer <YOUR_API_KEY> के रूप में भेजें। Sui SDK service path को base URL में जोड़ता है, इसलिए key api-key query parameter के बजाय header में जाती है।Endpoints
अपने gRPC-web transport के
baseUrl के रूप में इन दोनों में से कोई भी base URL इस्तेमाल करें:text
https://edge.erpc.global/suihttps://edge.erpc.global/suitext
https://sui.erpc.globalhttps://sui.erpc.globalRequests,
/sui.rpc.v2.<Service>/<Method> पर binary gRPC-web (application/grpc-web+proto) POST होते हैं, प्रति unary call एक uncompressed protobuf frame।उदाहरण
यह रहा एक transport configuration का उदाहरण।
typescript
import { GrpcWebFetchTransport } from '@protobuf-ts/grpcweb-transport'
const transport = new GrpcWebFetchTransport({
baseUrl: 'https://sui.erpc.global', // or https://edge.erpc.global/sui
format: 'binary',
meta: { Authorization: 'Bearer <YOUR_API_KEY>' },
})import { GrpcWebFetchTransport } from '@protobuf-ts/grpcweb-transport'
const transport = new GrpcWebFetchTransport({
baseUrl: 'https://sui.erpc.global', // or https://edge.erpc.global/sui
format: 'binary',
meta: { Authorization: 'Bearer <YOUR_API_KEY>' },
})Transport को Sui gRPC API के लिए generate किए गए unary service client को दें।
आप अपनी API key ERPC Web Dashboard पर प्राप्त और verify कर सकते हैं: ERPC Web Dashboard
Batch Requests
Sui में batch requests नहीं हैं। हर HTTP request एक unary call ले जाता है और उसे एक call के रूप में मीटर किया जाता है। Request body अधिकतम 1 MiB हो सकती है।
उपयोग मीटरिंग
उपयोग को tokens में मीटर किया जाता है, और token दर method के अनुसार अलग हो सकती है। हर unary call को एक call के रूप में मीटर किया जाता है।
Free plan की सीमाएँ
Free plan पर, आपका account हर 10 सेकंड में एक request भेज सकता है। यह सीमा endpoint के अनुसार नहीं, बल्कि account के अनुसार गिनी जाती है, इसलिए किसी दूसरी chain को भेजा गया request भी इसमें गिना जा सकता है। इससे जल्दी भेजे गए request का जवाब HTTP
429 से दिया जाता है, और retry-after header प्रतीक्षा का समय सेकंड में बताता है।समर्थित Methods
यह endpoint ये 19 unary gRPC-web methods serve करता है। हर method को
/sui.rpc.v2.<Service>/<Method> पर call किया जाता है, और capitalization बिल्कुल मेल खाना चाहिए।LedgerService(5):GetServiceInfo,GetCheckpoint,GetObject,GetTransaction,GetEpochMovePackageService(4):GetPackage,GetDatatype,GetFunction,ListPackageVersionsNameService(2):LookupName,ReverseLookupNameSignatureVerificationService(1):VerifySignatureStateService(5):GetCoinInfo,GetBalance,ListBalances,ListDynamicFields,ListOwnedObjectsTransactionExecutionService(2):ExecuteTransaction,SimulateTransaction
जो path सूची में नहीं है, उसका जवाब HTTP
400 से दिया जाता है। Native gRPC, text-format gRPC-web, streaming, और BatchGet* calls समर्थित नहीं हैं।Response Status Codes
| HTTP status | अर्थ |
|---|---|
| 200 | सफल unary call। Body application/grpc-web+proto होती है। |
| 400 | समर्थित Methods सूची से बाहर का path, ऐसी body जो एक uncompressed binary gRPC-web frame नहीं है, या 1 MiB से बड़ी body। |
| 401 | API key गुम या अमान्य है, या key पर लगी IP या Origin पाबंदी पूरी नहीं होती। |
| 405 | POST के अलावा कोई अन्य request method। |
| 426 | WebSocket Upgrade का अनुरोध किया गया। यह endpoint केवल HTTP पर काम करता है। |
| 429 | Rate limited, जिसमें Free plan की हर 10 सेकंड में एक request की सीमा भी शामिल है। अगर retry-after header मौजूद है, तो उतने seconds प्रतीक्षा करें। |
| 502 | Upstream call पूरा नहीं हो सका: upstream response विफल रहा, response 8 MiB से बड़ा था, 30 seconds के भीतर कोई जवाब नहीं मिला, या grpc-status 0 के अलावा कुछ और था। |
| 503 | Service अस्थायी रूप से अनुपलब्ध है। |
Sui RPC Methods और Documentation
Standard methods, parameters और specifications की पूरी सूची के लिए official documentation देखें।






