.derupt-ext

Developers can extend the functionality of Derupt by creating Extensions for user to use.

More Details Coming Soon

(sample extensions coming soon)

Extension Contract Metadata

The extension contract metadata represents the top level summary of the extension.

{
  "name": "Transfer CC too",
  "description": "https://stackers.cc/derupt-ext-metadata.json",
  "image": "https://stackers.cc/more-cc.gif"
}

Extension Description Metadata

The extension description metadata enables greater control over the integration and functionality of the Extension within the Derupt UX/UI, facilitating for you:

  • Extension Information Summary (info):

    • A general Summary / Explanation of the Extension

  • Availability for specific Core Operation (ops):

    • To enable use of the Extension by Derupt Core Operations

  • Applicable Transaction Post Conditions (postconditions):

    • Set the appropriate type: ft, nft, and or stx

  • Function Arguments from the User (argsFromUser)

    • To enable the applicable argument input fields to be rendered and supplied by the user. (render set visibility of the argument input field to the user in the Extension options modal) (label set the label you want to apply to the visible field) (order set the rendered order of argument input fields) (optional representative if input field is an optional input [false means the argument input field is required, true means the argument input field is optional])

{
    "info":"Extension to Transfer a AMOUNT of CC to a PRINCIPAL (TESTNET)",
    "ops":[
        {
            "send-message":false
        },
        {
            "like-message":true
        },
        {
            "dislike-message":true
        },
        {
            "favorable-reply-message":true
        },
        {
            "unfavorable-reply-message":true
        },
        {
            "gift-message":true
        }
    ],
    "postconditions":[
        {
            "type":"ft",
            "contractAddress":"ST1ZK0A249B4SWAHVXD70R13P6B5HNKZAA0WNTJTR.cryptocash-token:cryptocash"
        }
    ],
    "argsFromUser":{
        "0":{
            "uint":{
                "render":true,
                "label":"Amount",
                "order":0,
                "optional":false
            },
            "principal":{
                "render":true,
                "label":"Recipient Principal",
                "order":1,
                "optional":false
            }
        },
        "1":{
            "string-utf8-256":{
                "render":false,
                "label":null,
                "order":null,
                "optional":null
            },
            "string-ascii-256":{
                "render":false,
                "label":null,
                "order":null,
                "optional":null
            },
            "uint":{
                "render":false,
                "label":null,
                "order":null,
                "optional":null
            },
            "int":{
                "render":false,
                "label":null,
                "order":null,
                "optional":null
            },
            "principal":{
                "render":false,
                "label":null,
                "order":null,
                "optional":null
            },
            "bool":{
                "render":false,
                "label":null,
                "order":null,
                "optional":null
            },
            "buff-34":{
                "render":false,
                "label":null,
                "order":null,
                "optional":null
            },
            "proxy-buff-204":{
                "render":false,
                "label":null,
                "order":null,
                "optional":null
            }
        }
    }
}

Extension Metadata sample: array 0 is all that should be included, but we have included array 1 as well to show you the max length and types available. The number of arrays are 0 - 9 (10 arrays, with 8 arguments each)

Extension Contract Metadata pointers is updated via update-metadata

Extension Description Metadata is updated via derupt-ext-metadata.json (or equivalent)

Extensions must follow.derupt-ext-trait standard

Extension execution exec-ext-func function, taking extras as an argument. Developers should define the requiredArgsFromUser to ensure specific fields are presented to the user during use, to obtain the users input if needed. Extension(s) contract calls are made in the .derupt-core-yyyymmdd.

Users can have only 1 extension called, per core function call: eg

  • can have 1 ext called during send-message

  • can have 1 ext called during like-message

  • can have 1 ext called during dislike-message

  • can have 1 ext called during favorable-reply-message

  • can have 1 ext called during unfavorable-reply-message

  • can have 1 ext called during gift-message

(note: users can change the enabled extension over time)

Last updated