Skip to content

Latest commit

 

History

History
171 lines (119 loc) · 5.71 KB

File metadata and controls

171 lines (119 loc) · 5.71 KB

CardanoScriptsAPI

All URIs are relative to https://cardano-mainnet.blockfrost.io/api/v0

Method HTTP request Description
getScript GET /scripts/{script_hash} Specific script
getScriptRedeemers GET /scripts/{script_hash}/redeemers Redeemers of a specific script
getScripts GET /scripts Scripts

getScript

    open class func getScript(scriptHash: String, completion: @escaping (_ data: Script?, _ error: Error?) -> Void)

Specific script

Information about a specific script

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import BlockfrostSwift

let scriptHash = "scriptHash_example" // String | Hash of the script

// Specific script
CardanoScriptsAPI.getScript(scriptHash: scriptHash) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
scriptHash String Hash of the script

Return type

Script

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getScriptRedeemers

    open class func getScriptRedeemers(scriptHash: String, count: Int? = nil, page: Int? = nil, order: SortOrder? = nil, completion: @escaping (_ data: [ScriptRedeemer]?, _ error: Error?) -> Void)

Redeemers of a specific script

List of redeemers of a specific script

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import BlockfrostSwift

let scriptHash = "scriptHash_example" // String | Hash of the script
let count = 987 // Int | The number of results displayed on one page. (optional) (default to 100)
let page = 987 // Int | The page number for listing the results. (optional) (default to 1)
let order = "order_example" // SortOrder | The ordering of items from the point of view of the blockchain, not the page listing itself. By default, we return oldest first, newest last.  (optional) (default to .asc)

// Redeemers of a specific script
CardanoScriptsAPI.getScriptRedeemers(scriptHash: scriptHash, count: count, page: page, order: order) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
scriptHash String Hash of the script
count Int The number of results displayed on one page. [optional] [default to 100]
page Int The page number for listing the results. [optional] [default to 1]
order SortOrder The ordering of items from the point of view of the blockchain, not the page listing itself. By default, we return oldest first, newest last. [optional] [default to .asc]

Return type

[ScriptRedeemer]

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getScripts

    open class func getScripts(count: Int? = nil, page: Int? = nil, order: SortOrder? = nil, completion: @escaping (_ data: [Script]?, _ error: Error?) -> Void)

Scripts

List of scripts.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import BlockfrostSwift

let count = 987 // Int | The number of results displayed on one page. (optional) (default to 100)
let page = 987 // Int | The page number for listing the results. (optional) (default to 1)
let order = "order_example" // SortOrder | The ordering of items from the point of view of the blockchain, not the page listing itself. By default, we return oldest first, newest last.  (optional) (default to .asc)

// Scripts
CardanoScriptsAPI.getScripts(count: count, page: page, order: order) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
count Int The number of results displayed on one page. [optional] [default to 100]
page Int The page number for listing the results. [optional] [default to 1]
order SortOrder The ordering of items from the point of view of the blockchain, not the page listing itself. By default, we return oldest first, newest last. [optional] [default to .asc]

Return type

[Script]

Authorization

ApiKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]