Skip to content

Commit fa2d8a6

Browse files
authored
Merge pull request #84 from lightninglabs/add-tapd
Bump lnc-core version and add Taproot Assets support
2 parents 4b7b320 + dac5d52 commit fa2d8a6

File tree

4 files changed

+38
-7
lines changed

4 files changed

+38
-7
lines changed

demos/kitchen-sink/src/App.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function App() {
2020
const { swapClient } = lnc.loop;
2121
const { trader } = lnc.pool;
2222
const { faradayServer } = lnc.faraday;
23+
const { taprootAssets, mint, universe, assetWallet } = lnc.tapd;
2324

2425
// LND
2526

@@ -79,6 +80,28 @@ function App() {
7980
console.log(insights);
8081
};
8182

83+
// Taproot Assets
84+
85+
const listAssets = async() => {
86+
const assets = await taprootAssets.listAssets();
87+
console.log(assets);
88+
};
89+
90+
const listBatches = async() => {
91+
const assets = await mint.listBatches();
92+
console.log(assets);
93+
};
94+
95+
const listFederationServers = async() => {
96+
const assets = await universe.listFederationServers();
97+
console.log(assets);
98+
};
99+
100+
const nextScriptKey = async() => {
101+
const assets = await assetWallet.nextScriptKey({ keyFamily: 1 })
102+
console.log(assets);
103+
};
104+
82105
return (
83106
<div className="App">
84107
<header className="App-header">
@@ -103,6 +126,11 @@ function App() {
103126
<button onClick={() => auctionFee()}>auctionFee</button>
104127
<h1>Faraday</h1>
105128
<button onClick={() => channelInsights()}>channelInsights</button>
129+
<h1>Taproot Assets</h1>
130+
<button onClick={() => listAssets()}>listAssets</button>
131+
<button onClick={() => listBatches()}>listBatches</button>
132+
<button onClick={() => listFederationServers()}>listFederationServers</button>
133+
<button onClick={() => nextScriptKey()}>nextScriptKey</button>
106134
</header>
107135
</div>
108136
);

lib/lnc.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import {
44
LndApi,
55
LoopApi,
66
PoolApi,
7-
snakeKeysToCamel
7+
snakeKeysToCamel,
8+
TaprootAssetsApi
89
} from '@lightninglabs/lnc-core';
910
import { createRpc } from './api/createRpc';
1011
import { CredentialStore, LncConfig, WasmGlobal } from './types/lnc';
@@ -13,7 +14,7 @@ import { wasmLog as log } from './util/log';
1314

1415
/** The default values for the LncConfig options */
1516
const DEFAULT_CONFIG = {
16-
wasmClientCode: 'https://lightning.engineering/lnc-v0.2.4-alpha.wasm',
17+
wasmClientCode: 'https://lightning.engineering/lnc-v0.2.5-alpha.wasm',
1718
namespace: 'default',
1819
serverHost: 'mailbox.terminal.lightning.today:443'
1920
} as Required<LncConfig>;
@@ -33,6 +34,7 @@ export default class LNC {
3334
loop: LoopApi;
3435
pool: PoolApi;
3536
faraday: FaradayApi;
37+
tapd: TaprootAssetsApi;
3638
lit: LitApi;
3739

3840
constructor(lncConfig?: LncConfig) {
@@ -64,6 +66,7 @@ export default class LNC {
6466
this.loop = new LoopApi(createRpc, this);
6567
this.pool = new PoolApi(createRpc, this);
6668
this.faraday = new FaradayApi(createRpc, this);
69+
this.tapd = new TaprootAssetsApi(createRpc, this);
6770
this.lit = new LitApi(createRpc, this);
6871
}
6972

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"webpack-cli": "4.9.2"
5252
},
5353
"dependencies": {
54-
"@lightninglabs/lnc-core": "0.2.4-alpha",
54+
"@lightninglabs/lnc-core": "0.2.5-alpha",
5555
"crypto-js": "4.1.1"
5656
},
5757
"browser": {

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@
8080
"@jridgewell/resolve-uri" "3.1.0"
8181
"@jridgewell/sourcemap-codec" "1.4.14"
8282

83-
"@lightninglabs/[email protected].4-alpha":
84-
version "0.2.4-alpha"
85-
resolved "https://registry.yarnpkg.com/@lightninglabs/lnc-core/-/lnc-core-0.2.4-alpha.tgz#3864ea91cd57d3340ed250cdff9318ba6dbcfe6e"
86-
integrity sha512-vZQJzMB5tWW/GFxUFyxrfDAGM8Q4jz55vjO4IJyp9Pk8fxBeYEyYJYF8+cJ9/9CKZ7fgX9MPp8m08oOVjJVlhQ==
83+
"@lightninglabs/[email protected].5-alpha":
84+
version "0.2.5-alpha"
85+
resolved "https://registry.yarnpkg.com/@lightninglabs/lnc-core/-/lnc-core-0.2.5-alpha.tgz#4150b9d8002a8dac582edc6216581feb2b613196"
86+
integrity sha512-mdofMCydpNLAf0Abwy81FsuOMIrUqsxR5kZ9Qzjp+E7bZdMntsKY3p0oqq/y3o/6hfrKN7Ornht42Cebc/i9Iw==
8787

8888
"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
8989
version "1.1.2"

0 commit comments

Comments
 (0)