Skip to main content

Changelog

December 2024 Updates

December 2024

New Chain Support

Several new blockchain networks have been added to the cross-chain SDK:

NEAR Protocol

Full support for NEAR blockchain including:
  • Token transfers with preparePay and preparePays
  • Account creation and deletion
  • Message signing and verification
  • See NEAR documentation for details

Cosmos Hub (ATOM)

IBC-compatible Cosmos Hub support:
  • Native ATOM transfers via IBC SDK
  • Uses existing IBC infrastructure with Cosmos-specific configuration
  • Testnet: rpc.provider-sentry-01.ics-testnet.polypore.xyz
  • Mainnet: cosmos-rpc.publicnode.com

Bitcoin (BTC)

SegWit (P2WPKH) Bitcoin support:
  • Native BTC transfers
  • UTXO management and balance checking
  • See BTC documentation for details

Polygon (Amoy Testnet)

EVM-compatible Polygon support:
  • Polygon Amoy testnet for development
  • Polygon mainnet support
  • Chain ID: 137 (mainnet), 80002 (Amoy)

XRP Ledger Send Functionality

Enhanced XRPL support with full send capabilities:
  • Token transfers via preparePay
  • Multiple transfer support via preparePays
  • See XRPL documentation for details

Identity Verification Updates

GitHub OAuth Flow

New OAuth-based identity verification for GitHub:
  • Seamless one-click authentication
  • Node-signed attestations with 5-minute validity
  • Complementary to existing gist-based verification
  • See GitHub identity documentation for details

Discord Identity Support

Full Discord identity verification:

Infrastructure Improvements

  • Improved error handling in multichain executors
  • Enhanced logging with log rotation support
  • Node diagnostic tooling (node-doctor)

The HTTP Rewrite

August 20th, 2024 The SDK with the HTTP rewrite of the demos object is published at @kynesyslabs/demosdk-http on NPM.
import { demos } from "@kynesyslabs/demosdk-http/websdk"

Connecting to a node

To connect to a node, use the connect method.
const rpc_url = "http://localhost:53550"

await demos.connect(rpc_url)
assert(demos.connected === true)
This will ping the rpc and return a true if the rpc is found, or throw an error. Once connected, you can now make unauthenticated requests (node calls).
const lastBlockHash = await demos.getLastBlockHash()

Connecting a wallet

To make authenticated calls to the node (eg. confirming or broadcasting transactions), you need to connect a keypair to the demos object.
const identity = demos.DemosWebAuth.getInstance()
await identity.create()

const pubKey = await demos.connectWallet(identity.keypair.privateKey)
assert(demos.walletConnected === true)
You can also connect a wallet using a mnemonic.
const mnemonic = "property gym walk decorate laundry grab cabin outer artist nest castle vote"

const pubKey = await demos.connectWallet(mnemonic, {
    isSeed: true,
})
Or if you have a bip39 seed.
const mnemonic = "property gym walk decorate laundry grab cabin outer artist nest castle vote"
const seed = bip39.mnemonicToSeedSync(mnemonic)

const pubKey = await demos.connectWallet(seed, {
    isSeed: true,
})
The process of converting a mnemonic to a keypair is defined at Cryptography.newFromSeed (in @/encryption/Cryptography.ts).
You can get the address of the connected wallet using the demos.getAddress() method.
With the wallet connected, you can now send authenticated requests to the node.
const validityData = await demos.confirm(tx)

Resetting the demos object

Once you’re done, you can reset the demos object.
demos.disconnect()
Calling demos.disconnect won’t log out the DemosWebAuth instance. You need to call identity.logout() to reset that.

Decoupling DemosWebAuth from the websdk

August 30th, 2024 We’ve decoupled the DemosWebAuth from the helper methods and objects in the websdk. That simply means that you’ll now need to pass the keypair to the methods that need it, instead of them reference the global DemosWebAuth instance. Here’s a list of affected methods:

1. DemosTransactions.sign

This method was previously using the global DemosWebAuth instance to sign transactions. Now you need to pass the keypair to the method.
// from:
DemosTransactions.sign(raw_tx: Transaction)

// to:
DemosTransactions.sign(raw_tx: Transaction, keypair: IKeyPair)
You can use the keypair connected to the demos object with DemosTransactions.sign you can call demos.tx.sign(tx) instead.

2. prepareWeb2Payload

The prepareWeb2Payload method now requires payload parameters and a keypair for signing the Transaction.
// from:
prepareWeb2Payload(
    action = "GET",
    url = "https://icanhazip.com",
    ...
)

// to:
prepareWeb2Payload(
    params: IPrepareWeb2PayloadParams = {
        action: "GET",
        url: "https://icanhazip.com",
        ...
    },
    keypair: IKeyPair,
)
To use the keypair connected to the demos object with prepareWeb2Payload, you can call demos.web2.preparePayload(params) instead.

3. prepareXMPayload

The prepareXMPayload method now requires a XMScript and a keypair for signing the Transaction.
// from:
prepareXMPayload(xm_payload: XMScript)

// to:
prepareXMPayload(xm_payload: XMScript, keypair: IKeyPair)
To use the keypair connected to the demos object with prepareXMPayload, you can call demos.xm.preparePayload(xm_payload) instead.

4. Wallet.transfer

// from:
Wallet.transfer(to: Address, amount: number)

// to:
Wallet.transfer(to: Address, amount: number, keypair: IKeyPair)