Overview
You’ll find API endpoints and key usage notes below. If you ever need help you can reach out to us. Movement is a fork of Aptos, so developing for both of these chains is very similar. If you’re getting started with Movement, they have some developer docs to help.Use Cases
Shinami’s Gas Station API lets you easily sponsor transactions for your users. MOVE is pulled from a fund you create to power these transactions, managed in Shinami’s dashboard. Shinami facilitates sponsored transactions based on logic determined by you, the app developer. Examples include sponsoring each user’s initial transaction(s) for better onboarding and sponsoring transactions of a particular type that you want to encourage.Authentication, Rate Limits, and Error Handling
Authentication You authenticate via an access key passed in a header"X-Api-Key: ACCESS_KEY") or in the request url (https://api.us1.shinami.com/movement/gas/v1/ACCESS_KEY). We recommend using a request header and not putting access keys in your request URLs for reduced visibility (in logs, etc). These steps are done automatically by our TypeScript SDK.
See our Authentication and API Keys guide for how to set up a Gas-Station access key.
Rate Limits
When you surpass the QPS limit for a key, we return a JSON-RPC error code -32010. We recommend implementing retries with a backoff to handle any rate limits errors that arise. You can also consider batching multiple Move calls into a Move script. You can also adjust the rate limits of your keys to better balance your QPS allotment across your keys.
Error Handling
See our Error Reference for guidance on the errors you may receive from our services, including a section on errors specific to the Movement Gas Station API.
Send your first request
For a quick sample request that doesn’t require building a transaction, ask for the balance of the fund your access key is tied to with gas_getFund.Tutorials with E2E sample code
Check out our TypeScript tutorial for more code samples and details on the end-to-end flow of creating, sponsoring, and executing a transaction. Also, since our Gas Station does not support CORS (browser) requests for security reasons, our Frontend signing + backend sponsorship tutorial .Methods
gas_sponsorTransaction
Sponsor a transaction by having your Shinami Gas Station fund act as the feePayer. Important notes- Gas Station doesn’t support CORS, so you must send requests from your backend. For an overview of all the ways to integrate frontend signing with backend sponsorship, see our Frontend Signing + Backend Sponsorship guide, including tips on serializing and deserializing the necessary data types as you pass them between FE and BE.
- You need to create a Gas Station fund in your Shinami dashboard before you create an access key. When you create a gas station API access key, you assign it to a network (e.g. Testnet) and a fund on that network. For how to do that and find the deposit address, see our Movement Gas Station Help Center page.
- Shinami sponsorship fees: See our Movement Billing FAQ.
- Orderless transactions: We currently don’t support sponsoring orderless transactions but plan to add this support in the future. If you need this support, please reach out to us at
support@shinami.com.
Example Request Template
The TypeScript example uses the Shinami Clients SDK, which you can install with:
{{name}} with the actual value for that name.
Note: transaction.feePayerAddress is updated in-place upon a successful return.
cURL Response Fields
gas_sponsorAndSubmitSignedTransaction
This method first sponsors a transaction with your Shinami Gas Station fund and then submits the transaction to a Movement fullnode for execution. Therefore, you need to obtain all necessary signatures - with wildcard fee payer address0x0 - before calling this method.
Important notes
- Gas Station doesn’t support CORS, so you must send requests from your backend. For an overview of all the ways to integrate frontend signing with backend sponsorship, see our Frontend Signing + Backend Sponsorship guide, including tips on serializing and deserializing the necessary data types as you pass them between FE and BE.
- You need to create a Gas Station fund in your Shinami dashboard before you create an access key. When you create a gas station API access key, you assign it to a network (e.g. Testnet) and a fund on that network. For how to do that and find the deposit address, see our Movement Gas Station Help Center page.
- Shinami sponsorship fees: See our Movement Billing FAQ.
- Orderless transactions: We currently don’t support sponsoring orderless transactions but plan to add this support in the future. If you need this support, please reach out to us at
support@shinami.com.
Example Request Template
The TypeScript example uses the Shinami Clients SDK, which you can install with:
{{name}} with the actual value for that name.
gas_getFund
Get the balance for the Gas Station fund tied to the request’s API access key. When you create a Gas Station access key, you link it to exactly one Gas Station fund. So, when you make this request, we return the balance for the fund that’s tied to the access key you use for the request. To check which fund a Gas Station access key is tied too, see the Movement Gas Station FAQ page of our Help Center Request Parameters None. Example Request Template The TypeScript example uses the Shinami Clients SDK, which you can install with:{{name}} with the actual value for that name.
gas_encodeAndSponsorTransaction
Sponsors a JSON transaction request by providing fee payer info, and encodes it into message bytes for signing. Intended to be used only by clients without BCS encoding capability. If you’re using the Aptos TypeScript SDK you should use sponsorTransaction instead. The full transaction flow for using this API is as follows:- Construct the transaction JSON.
- Call this API to get the encoded message bytes for signing, as well as fee payer address and signature.
- Sender (and any secondary signers) sign the message bytes.
- Submit the transaction JSON together with all signatures to a Movement fullnode for execution (an example of this call and response is shown in the
cURL - submit sponsored tx exampletabs).
- Gas Station doesn’t support CORS, so you must send requests from your backend. For an overview of all the ways to integrate frontend signing with backend sponsorship, see our Frontend Signing + Backend Sponsorship guide, including tips on serializing and deserializing the necessary data types as you pass them between FE and BE.
- You need to create a Gas Station fund in your Shinami dashboard before you create an access key. When you create a gas station API access key, you assign it to a network (e.g. Testnet) and a fund on that network. For how to do that and find the deposit address, see our Movement Gas Station Help Center page.
- Shinami sponsorship fees: See our Movement Billing FAQ.
Example Request Template
Replace all instances of
{{name}} with the actual value for that name.
Appendix
How to build, sponsor, sign, and submit a transaction
This section shows an example of how to build, sponsor, sign, and submit a simple transaction using the Shinami Clients SDK and the Aptos TS SDK. For a high-level image of the sponsorship flow see here. For multiple end-to-end examples, see our Gas Station TypeScript Tutorial. Key requirements- Build your transaction with the fee payer address set to
0x0(this is what happens when you setwithFeePayer: trueas shown below). The sender and any secondary signers can sign the transaction with this address, or with the actual feePayer’s address you obtain from Shinami upon a successful sponsorship. - The transaction’s expiration timestamp must be set to a time within the next hour (as is required by our Gas Station). When you control the generation of the sender’s signature, as with an embedded wallet you control for the user, you can likely use the SDK default, which is 20 seconds from now. When you need to wait on a signature you don’t control, as with a connected wallet where the user must approve a signing message, you can explicitly set it as in the example below.
{{name}} with the actual value for that name.