@buildwithsygma/sygmaprotocol-widget
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

Sygmaprotocol Lit Widget

Dependencies

To integrate the Widget into any project that uses web components you will need to add the following dependencies:

yarn add @buildwithsygma/sygmaprotocol-widget @buildwithsygma/sygma-sdk-core

Code integration

To add the Wdiget to your existing codebase import the dependency and add the custom tag into your render method.

import { LitElement, html } from 'lit'
import { customElement, property } from 'lit/decorators.js'
import '@buildwithsygma/sygmaprotocol-widget'

@customElement('my-element')
export class MyElement extends LitElement {
  render() {
    return html`
      <div>
        <sygmaprotocol-widget></sygmaprotocol-widget>
      </div>
    `
  }

}

declare global {
  interface HTMLElementTagNameMap {
    'my-element': MyElement
  }
}

You can also pass properties into the Widget to customize it's behaviour:

render() {
    return html`
      <div>
        <sygmaprotocol-widget 
        .environment=${'mainnet'} 
        .whitelistedSourceNetworks=${['sepolia']} 
        .whitelistedDestinationNetworks=${['cronos']}
        ></sygmaprotocol-widget>
      </div>
    `
  }

You can check here all the available properties.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.1
    20
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.1
    20
  • 0.2.0
    56
  • 0.1.2
    3

Package Sidebar

Install

npm i @buildwithsygma/sygmaprotocol-widget

Weekly Downloads

79

Version

0.2.1

License

LGPL-3.0-or-later

Unpacked Size

22 MB

Total Files

202

Last publish

Collaborators

  • buildwithsygma