New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@unielon/coin-dogecoin

Package Overview
Dependencies
Maintainers
0
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@unielon/coin-dogecoin

Dogecoin SDK is used to interact with the Dogecoin Mainnet or Testnet, it contains various functions can be used to web3 wallet.

  • 1.1.14
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
372
increased by691.49%
Maintainers
0
Weekly downloads
 
Created
Source

@unielon/coin-dogecoin

Dogecoin SDK is used to interact with the Dogecoin Mainnet or Testnet, it contains various functions can be used to web3 wallet.

What Can Dogecoin SDK Do

  • Deploy drc-20
  • Mint drc-20
  • Deposit WDOGE
  • Withdraw WDOGE
  • Add or remove the liquidity of pairs
  • Swap the liquidity of pairs
  • Create drc20-paris
  • Create Order
  • Cancel Order
  • Trade Order
  • Mint box
  • Deploy box
  • Stake the liquidity of pairs

Getting Started

Installing Dogecoin SDK

npm install @unielon/coin-dogecoin

Using Dogecoin SDK

import { DogeWallet } from "@unielon/coin-dogecoin";
let wallet = new DogeWallet()
let privateKey = "QRJx7uvj55L3oVRADWJfFjJ31H9Beg75xZ2GcmR8rKFNHA4ZacKJ"
const commitTxPrevOutputList: PrevOutput[] = [];
commitTxPrevOutputList.push({
    txId: "3cb1d8da082b2146b8f4c09b06e38eb37f0263ecefb8a52600accc75ccef4c90",
    vOut: 1,
    amount: 793850000,
    address: "DJu5mMUKprfnyBhot2fqCsW9sZCsfdfcrZ",
    privateKey: privateKey,
});
const inscriptionDataList: DrcInscriptionData[] = [];
inscriptionDataList.push({
  contentType: 'text/plain;charset=utf-8',
  body: `{"p":"drc-20","op":"deploy","tick": "GOODS" ,"max": "210000000000", "lim": "1000000"}`,
  revealAddr: 'DJu5mMUKprfnyBhot2fqCsW9sZCsfdfcrZ',
  repeat: repeat || 1
});
const request = {
  commitTxPrevOutputList,
  commitFeeRate: 50000,
  revealFeeRate: 50000,
  inscriptionDataList,
  changeAddress: 'DJu5mMUKprfnyBhot2fqCsW9sZCsfdfcrZ',
};
const res =  await wallet.inscribeDrc(dogeCoin, request)

Deploy drc-20

Inscribe the deploy function to you ordinal compatible wallet with the desired drc-20 parameters set. It's a example of deploy script as following:

{ 
  "p": "drc-20",
  "op": "deploy",
  "tick": "wow",
  "max": "1000000",
  "lim": "100"
}

command parameter description

KeyRequireDescription
pyesProtocol: Helps other systems identify and process drc-20 events
opyesOperation: Type of event (Deploy, Mint, Transfer)
tickyesTicker: letter identifier of the drc-20, equal to 3 or 4 characters
maxyesMax supply: set max supply of the drc-20
limnoMint limit: If letting users mint to themsleves, limit per cardinal

Mint drc-20

Inscribe the mint function to your cardinal compatible wallet. Make sure the ticker matches either a) the drc-20 you deployed in step 1, or b) any drc-20 that has yet to reach its fully diluted supply. Also if the drc-20 has a mint limit, make sure not to surpass this.

It's a example of mint script as following:

{ 
  "p": "drc-20",
  "op": "mint",
  "tick": "wow",
  "amt": "100"
}

command parameter description

KeyRequireDescription
pyesProtocol: Helps other systems identify and process drc-20 events
opyesOperation: Type of event (Deploy, Mint, Transfer)
tickyesTicker: letter identifier of the drc-20, equal to 3 or 4 characters
amtyesAmount to mint: States the amount of the drc-20 to mint. Has to be less than "lim" above if stated

WDOGE

WDOGE is a special kind of drc20. Its mint volume depends entirely on the user’s pledge amount. User can receive wdoge when he/she deposit dogecoin . The amount he/she withdraw is same with he/she deposit. Hence there are two operator of wdoge: withdraw and deposit.

It's the examples of both scripts as following:

{ 
  "p": "wdoge",
  "op": "deposit",
  "tick": "WDOGE(WRAPPED-DOGE)",
  "amt": "100"
}
{ 
  "p": "wdoge",
  "op": "withdraw",
  "tick": "WDOGE(WRAPPED-DOGE)",
  "amt": "100"
}

Add or remove the liquidity of pairs

The user can add or remove the liquidity of pairs, and the liquidity of pairs provide the price. Every add or remove operation inscribe inscriptions to the dogecoin chain. It's a example of add script as following:

{ 
  "p": "pair-v1",
  "op": "add",
  "tick0": "wow",
  "tick1": "doge",
  "amt0": "1000000", 
  "amt1": "1000",
  "addr": "Dxxxxxxxx"
}

It's a example of remove script as following:

{ 
  "p": "pair-v1",
  "op": "remove",
  "tick0": "wow",
  "tick1": "doge",
  "amt": "1000000", 
  "addr": "Dxxxxxxxx"
}

command parameter description

KeyRequireDescription
pyesProtocol: Helps other systems identify and process drc-20 events
opyesOperation: Type of event (create, add, remove, swap)
tickyesTicker: letter identifier of the two drc-20
amtyesAmount: the amount of add or remove drc-20
addroptionaladd liquidity operation get reward of the pairs operation

Swap the liquidity of pairs

Any user can swap one drc-20 for another drc-20 using the drc-20 pairs. Every swap operation inscribe inscriptions to the dogecoin chain. It's a example of create script as following:

{ 
  "p": "pair-v1",
  "op": "swap",
  "tick0": "wow",
  "tick1": "doge",
  "amt0": "10", 
  "amt1": "1",
}

command parameter description

KeyRequireDescription
pyesProtocol: Helps other systems identify and process drc-20 events
opyesOperation: Type of event (create, add, remove, swap)
tickyesTicker: letter identifier of the two drc-20, user transfer from first drc-20 for second drc-20
amtyesAmount: the amount of swap drc-20, the user balance remove the first one of first drc-20 and get the second one of second drc-20

Create drc20-pairs

Inscribe the drc20-pairs function to your compatible wallet with the desired drc-20 parameters set. Here's an example of a create script:

{ 
  "p": "pair-v1",
  "op": "create",
  "tick0": "wow",
  "tick1": "doge",
  "addr": "Dxxxxxxxx"
}

Create Order

Makers can create a depending order at the price they expect. Every order create operation inscribe inscriptions to the dogecoin chain. It's a example of create script as following:

{ 
  "p": "order-v1",
  "op": "create",
  "tick0": "wow",
  "tick1": "doge",
  "amt0": "10", 
  "amt1": "1",
}

command parameter description

KeyRequireDescription
pyesProtocol: Helps other systems identify and process drc-20 events
opyesOperation: Type of event (create,)
tick0yesThe drc20 type makers sell
tick1yesThe drc20 type makers buy
amt0yesThe drc20 amount makers buy
amt1yesThe drc20 amount makers buy

Cancel Order

Makers can cancel a depending order at the amount they expect. Every order cancel operation inscribes inscriptions to the dogecoin chain. Here's an example of a cancel script:

{ 
  "p": "order-v1",
  "op": "cancel",
  "exid": "xxxxxxxxxxxxxxxxx",
  "amt0": "10"
}

command parameter description

KeyRequireDescription
pyesProtocol: Helps other systems identify and process drc-20 events
opyesOperation: Type of event (cancel)
exidyesThe depending order id
amt0yesThe drc20 amount makers suppose to cancel

Trade Order

Takers can fill the orders created by the makers. Every order trade operation inscribe inscriptions to the dogecoin chain. It's a example of create script as following:

{ 
  "p": "order-v1",
  "op": "trade",
  "exid": "xxxxxxxxxxxxxxxxx",
  "amt1": "10",
}

command parameter description

KeyRequireDescription
pyesProtocol: Helps other systems identify and process drc-20 events
opyesOperation: Type of event (trade)
exidyesThe depending order id
amt1yesThe drc20 amount makers suppose to trade, it's the drc20 type makers buy

Mint box

Anyone mint a box drc20 token. It's a example of create script as following:

{ 
  "p": "box-v1",
  "op": "mint",
  "tick0": "unix",
  "amt1": "10",
}

command parameter description

KeyRequireDescription
pyesProtocol: Helps other systems identify and process drc-20 events
opyesOperation: Type of event (mint)
tick0yesThe drc20 type which will be mint
amt1yesThe amount which pay tick1 for tick0

Deploy box

Anyone deploy a box drc20 token. He/she can create a deploy a inscription. This inscription contains the token which will deploy and the token which provide liquidity. For example, 50% of the deployment amount will be used for user minting, while the remaining 50% will be automatically added to liquidity after minting is completed.

It's a example of create script as following:

{ 
  "p": "box-v1",
  "op": "deploy",
  "tick0": "unix",
  "tick1": "wdoge",
  "max": "10000",
  "amt0": "5000", 
  "amt1": "0",
  "liqamt": "5000",
  "liqblock": "5xxxxxx"
}

command parameter description

KeyRequireDescription
pyesProtocol: Helps other systems identify and process drc-20 events
opyesOperation: Type of event (deploy)
tick0yesThe drc20 type which will be mint
tick1yesThe drc20 type for establishing trading pairs, it should be a token with consensus value, such as wdoge
maxyesThe total amount of the deploying token
amt0yesThe amount of the deploying token which reserved for mining(pre-sale tokens)
amt1noReserved
liqamtyesThe amount of token1 which will fill in the pairs
liqblockyesThe ending block height of box drc20 pre-sale

Stake the liquidity of pairs

Any user who add liquidity of unix/wdoge pairs can stake their lp to get some reward, or any user stake their unix to get reward. The operation inscribe inscriptinos to the dogecoin chain. It's a example of create script as following:

{ 
  "p": "stake-v1",
  "op": "stake", ["unstake", "getallreward"]
  "tick": "unix-doge", ["unix"]
  "amt": "10", 
}

command parameter description

KeyRequireDescription
pyesProtocol: Helps other systems identify and process drc-20 events
opyesOperation: Type of event, stake or unstake
tickyesTicker: support unix-doge or unix
amtyesAmount: the liquidity of the tick0-tick1 pair

License: MIT

FAQs

Package last updated on 09 Feb 2025

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