Skip to content

Commit 4f5342a

Browse files
committed
update getdrep and bump version
1 parent dcfd85c commit 4f5342a

File tree

26 files changed

+226
-151
lines changed

26 files changed

+226
-151
lines changed

apps/playground/src/components/cardano/connect-browser-wallet/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export function CommonCardanoWallet() {
2525
return (
2626
<CardanoWallet
2727
label={"Connect a Wallet"}
28-
extensions={[95]}
2928
cardanoPeerConnect={{
3029
dAppInfo: {
3130
name: "Mesh SDK",
@@ -52,12 +51,11 @@ export function CommonCardanoWallet() {
5251
injectFn={async () => await checkIfMetamaskInstalled("preprod")}
5352
isDark={isDark}
5453
persist={true}
55-
web3Services={{
56-
networkId: 0,
57-
fetcher: provider,
58-
submitter: provider,
59-
// projectId: "2237ce83-ca27-4383-bd43-987cb1e64307",
60-
}}
54+
// web3Services={{
55+
// networkId: 0,
56+
// fetcher: provider,
57+
// submitter: provider,
58+
// }}
6159
/>
6260
);
6361
}

apps/playground/src/pages/apis/wallets/browserwallet/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const ReactPage: NextPage = () => {
5151

5252
{ label: "Get supported extensions", to: "getSupportedExtensions" },
5353
{ label: "Get extensions", to: "getExtensions" },
54-
{ label: "Get DRep ID Key", to: "getDRep" },
54+
{ label: "Get DRep ID", to: "getDRep" },
5555
{ label: "Get registered stakekeys", to: "getRegisteredpubstakekeys" },
5656
{
5757
label: "Get unregistered stakekeys",
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import LiveCodeDemo from "~/components/sections/live-code-demo";
2+
import TwoColumnsScroll from "~/components/sections/two-columns-scroll";
3+
import Codeblock from "~/components/text/codeblock";
4+
import useMeshWallet from "~/contexts/mesh-wallet";
5+
6+
export default function MeshWalletGetDRep() {
7+
return (
8+
<TwoColumnsScroll
9+
sidebarTo="getDRep"
10+
title="Get DRep"
11+
leftSection={Left()}
12+
rightSection={Right()}
13+
/>
14+
);
15+
}
16+
17+
function Left() {
18+
let codeSample = ``;
19+
codeSample += `{\n`;
20+
codeSample += ` "publicKey": "6984e406dd81...39e43d798fe1a89ab",\n`;
21+
codeSample += ` "publicKeyHash": "9f7f4b78...df83bd227e943e9808450",\n`;
22+
codeSample += ` "dRepIDCip105": "drep1vz0h7jmc...0axqgg5q4dls5u"\n`;
23+
codeSample += `}\n`;
24+
25+
return (
26+
<>
27+
<p>
28+
Get the key, hash, and bech32 encoding of the DRep ID. The DRep ID is a
29+
unique identifier for the user&apos;s wallet.
30+
</p>
31+
<p>Example:</p>
32+
<Codeblock data={codeSample} />
33+
</>
34+
);
35+
}
36+
37+
function Right() {
38+
const { getWallet } = useMeshWallet();
39+
async function runDemo() {
40+
const wallet = getWallet();
41+
let results = wallet.getDRep();
42+
return results;
43+
}
44+
return (
45+
<LiveCodeDemo
46+
title="Get DRep ID Key"
47+
subtitle="Get the key, hash, and bech32 address of the DRep ID"
48+
code={`await wallet.getDRep();`}
49+
runCodeFunction={runDemo}
50+
/>
51+
);
52+
}

apps/playground/src/pages/apis/wallets/meshwallet/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import MeshWalletGetAssets from "./get-assets";
1111
import MeshWalletGetBalance from "./get-balance";
1212
import MeshWalletGetChangeAddress from "./get-change-address";
1313
import MeshWalletGetCollateral from "./get-collateral";
14+
import MeshWalletGetDRep from "./get-drep";
1415
import MeshWalletGetLovelace from "./get-lovelace";
1516
import MeshWalletGetNetworkId from "./get-networkid";
1617
import MeshWalletGetPolicyIdAssets from "./get-policyid-assets";
@@ -44,6 +45,7 @@ const ReactPage: NextPage = () => {
4445
{ label: "Get lovelace", to: "getLovelace" },
4546
{ label: "Get policy IDs", to: "getPolicyIds" },
4647
{ label: "Get collection of assets", to: "getPolicyIdAssets" },
48+
{ label: "Get DRep ID", to: "getDRep" },
4749
];
4850

4951
return (
@@ -84,6 +86,7 @@ const ReactPage: NextPage = () => {
8486
<MeshWalletGetLovelace />
8587
<MeshWalletGetPolicyIds />
8688
<MeshWalletGetPolicyIdAssets />
89+
<MeshWalletGetDRep />
8790
</SidebarFullwidth>
8891
</>
8992
);

apps/playground/src/pages/react/ui-components/connect-wallet.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ function Left() {
4242
codePersist += ` persist={true}\n`;
4343
codePersist += `/>\n`;
4444

45-
let codeCip95 = `<CardanoWallet\n`;
46-
codeCip95 += ` extensions={[95]}\n`;
47-
codeCip95 += `/>\n`;
48-
4945
let codeBurner = `<CardanoWallet\n`;
5046
codeBurner += ` burnerWallet={{\n`;
5147
codeBurner += ` networkId: 0,\n`;
@@ -114,15 +110,6 @@ function Left() {
114110
is connected.
115111
</p>
116112

117-
<h3>CIP 95</h3>
118-
<p>
119-
You can also provide an <code>extensions</code> object to enable
120-
specific CIPs. For example, to enable{" "}
121-
<Link href="https://cips.cardano.org/cip/CIP-95">CIP-95</Link>, you
122-
would pass:
123-
</p>
124-
<Codeblock data={codeCip95} />
125-
126113
<h3>Decentralized WebRTC dApp-Wallet Communication (CIP 45)</h3>
127114
<p>
128115
<Link href="https://cips.cardano.org/cip/CIP-45">CIP-45</Link> is a

0 commit comments

Comments
 (0)