Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cpchain-dapps-language-support

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cpchain-dapps-language-support

CPChain DApps Language Support

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

CPChain DApps Language Support

This is supported for the CPChain DApps Language.

Features

  • Hightlight support for cdl files

Example


/**
 * MetaToken Example
 */

// TODO xxx
// Test DApp
dapp MetaToken {
    chain {
        chain_id = 337
        // Endpoint of the civilian
        endpoint = "https://civilian.cpchain.io"
    }
    contract MetaToken {
        address = "0x111"

        // Transfer event
        event Transfer {
            from address
            to address
            value u256
            a varchar(255)
        }

        when Transfer {
            // ...
            execute {
                self.block.number
                self.tx.from
                self.event.to
            }
        }
    }
    // Account model,真实存储中,表名和字段名在前面加统一的下划线已
    model Account {
        account address pk
        value u256
        name varchar(255)
    }

    model Transaction {
        from address
        to address
        value u256
    }

    when block {
        
    }

    // graphql query/mutation
    api {
        balance () {
            
        }
    }

    cards {
        card {
            html = <div>
                Hello world
            </div>,
        }
    }
}

Requirements

Extension Settings

Known Issues


For more information

  • Visual Studio Code's Markdown Support
  • CPChain
  • TextMate

Enjoy!

FAQs

Package last updated on 25 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc