Provider API Methods
Last updated
Last updated
Using the is the easiest way to format the request strings that get passed down to our actual provider method parameters. Below is all of the methods we support directly on the provider.
Connect
Prompts a connection to a user's Magic Eden Wallet account.
Without using Sats Connect, you could encode your request payload like below. However, takes care of this for you
Property
Type
Description
request
string
The json encoded payload
Promise<getAddressRespose>
array
Array of the connected user’s Address
objects
Address
Response Propertiesaddress
string
The user's BTC address
publicKey
string
A hex string representing the full publicKey of your BTC account. Your address is shortened from this
purpose
enum - 'payment' | 'ordinals'
The purpose of the address is used to indicate whether this address is preferrably used for payments or ordinals/runes
signMessage
Prompts to sign a message with the user's connected Magic Eden Wallet account
Property
Type
Description
request
string
The json encoded payload
Promise<string>
string
String containing the signature
signTransaction
Prompts to sign a PSBT with the user's connected Magic Eden Wallet account.
Property
Type
Description
request
string
The json encoded payload
Promise<SignTransactionResponse>
object
The returned psbt in base64 and the txId
SignTransactionResponse
Response PropertiespsbtBase64
string
The base64 encoded psbt string
txId
string
an optional transaction Id on success
sendBtcTransaction
Prompts to send BTC from the user's connected Magic Eden Wallet account.
Property
Type
Description
request
string
The json encoded payload
Promise<string>
string
String containing the transaction Id
signMultipleTransactions (custom)
Prompts to sign multiple PSBTs under one approval with the user's connected Magic Eden Wallet account. This is currently a private wallet method that is whitelisted to the magic eden marketplace domain
This is a custom feature of the Magic Eden Wallet and thus cannot be invoked with sats-connect, as you have the choice to do with the other provider methods. Rather, you can call this method with a similar request string as signTransaction
You can then pass this stringified request into the provider method like so: window.magicEden.bitcoin.signMultipleTransactions(request)
Property
Type
Description
request
string
The json encoded payload
Promise<SignTransactionResponse[]>
object
Array of the returned psbt in base64 and the txId
SignTransactionResponse
Response PropertiespsbtBase64
string
The base64 encoded psbt string
txId
string
an optional transaction Id on success
Without using Sats Connect, you could encode your request payload like below. However, takes care of this for you
Where protocol accepts either 'BIP322'
or 'ECDSA'
and defaults to the former if no value is provided. By default all signatures will follow the up to date standard, but certain apps require legacy signing. Passing in 'ECDSA'
will ensure legacy signing only for segwit/payment addresses.
Without using Sats Connect, you could encode your request payload like below. However, takes care of this for you
Without using Sats Connect, you could encode your request payload like below. However, takes care of this for you