Skip to content

Commit 2bf91cc

Browse files
committed
Adds wc_new_connection KDF method
1 parent af7f1b3 commit 2bf91cc

File tree

5 files changed

+160
-1
lines changed

5 files changed

+160
-1
lines changed

filepathSlugs.json

+12-1
Original file line numberDiff line numberDiff line change
@@ -2054,7 +2054,10 @@
20542054
"filter-criteria",
20552055
"example-4",
20562056
"paging-options",
2057-
"example-5"
2057+
"example-5",
2058+
"wc-conn-ns",
2059+
"eip-155-example",
2060+
"cosmos-example"
20582061
],
20592062
"src/pages/komodo-defi-framework/api/common_structures/lightning/index.mdx": [
20602063
"lightning-network-structures",
@@ -3783,6 +3786,14 @@
37833786
"command",
37843787
"response-2"
37853788
],
3789+
"src/pages/komodo-defi-framework/api/v20-dev/wc_new_connection/index.mdx": [
3790+
"wc-new-connection",
3791+
"arguments",
3792+
"response",
3793+
"examples",
3794+
"command",
3795+
"response-2"
3796+
],
37863797
"src/pages/komodo-defi-framework/changelog/index.mdx": [
37873798
"change-log",
37883799
"komodo-de-fi-framework-v2-3-0-beta",

src/data/sidebar.json

+9
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,15 @@
772772
"href": "/komodo-defi-framework/api/v20/non_fungible_tokens/withdraw_nft/"
773773
}
774774
]
775+
},
776+
{
777+
"title": "WalletConnect Integration",
778+
"links": [
779+
{
780+
"title": "wc_new_connection",
781+
"href": "/komodo-defi-framework/api/v20-dev/wc_new_connection/"
782+
}
783+
]
775784
}
776785
]
777786
},

src/pages/komodo-defi-framework/api/common_structures/index.mdx

+52
Original file line numberDiff line numberDiff line change
@@ -499,3 +499,55 @@ The `PagingOptions` object includes options of page selection to consult when lo
499499
}
500500
```
501501
</CollapsibleSection>
502+
503+
### WcConnNs
504+
505+
The WcConnNs\` object contains details of approved chains, methods and events while connected via [WalletConnect](https://specs.walletconnect.com/2.0/).
506+
507+
| Parameter | Type | Description |
508+
| --------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
509+
| chains | list of strings | A list of chain IDs. For EIP155, refer to [https://chainid.network/](https://chainid.network/). For Cosmos, refer to [https://cosmos.directory/](https://cosmos.directory/) |
510+
| methods | list of strings | A list of approved methods, usable while connected. For EIP155, refer to [https://docs.reown.com/advanced/multichain/rpc-reference/ethereum-rpc](https://docs.reown.com/advanced/multichain/rpc-reference/ethereum-rpc). For Cosmos, refer to [https://docs.reown.com/advanced/multichain/rpc-reference/cosmos-rpc](https://docs.reown.com/advanced/multichain/rpc-reference/cosmos-rpc) |
511+
| events | list of strings | A list of events to track during the connection. For EIP155, refer to [https://docs.reown.com/advanced/providers/ethereum#events](https://docs.reown.com/advanced/providers/ethereum#events). For Cosmos, refer to [https://tutorials.cosmos.network/academy/2-cosmos-concepts/10-events.html](https://tutorials.cosmos.network/academy/2-cosmos-concepts/10-events.html) |
512+
513+
<CollapsibleSection expandedText="Hide Examples" collapsedText="Show Examples">
514+
#### EIP155 Example
515+
516+
```json
517+
{
518+
"chains": [
519+
"eip155:1", // ETH
520+
"eip155:56", // BNB
521+
"eip155:137", // POLYGON
522+
"eip155:43114" // AVAX
523+
],
524+
"methods": [
525+
"eth_sendTransaction",
526+
"eth_signTransaction",
527+
"personal_sign"
528+
],
529+
"events": [
530+
"accountsChanged",
531+
"chainChanged"
532+
]
533+
}
534+
```
535+
536+
#### Cosmos Example
537+
538+
```json
539+
{
540+
"chains": [
541+
"cosmos:cosmoshub-4",
542+
"cosmos:osmosis-1",
543+
"cosmos:irishub-1"
544+
],
545+
"methods": [
546+
"cosmos_signDirect",
547+
"cosmos_signAmino",
548+
"cosmos_getAccounts"
549+
],
550+
"events": []
551+
}
552+
```
553+
</CollapsibleSection>

src/pages/komodo-defi-framework/api/index.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ Below is a table of the currently available legacy, v2.0 and v2.0 (Dev) methods:
148148
| [validateaddress](/komodo-defi-framework/api/legacy/validateaddress/#validateaddress) | | |
149149
| | [verify\_message](/komodo-defi-framework/api/v20/utils/message_signing/#verify-message) | |
150150
| [version](/komodo-defi-framework/api/legacy/version/#version) | | |
151+
| | | [wc\_new\_connection](/komodo-defi-framework/api/v20-dev/wc_new_connection/#wc-new-connection) |
151152
| [withdraw](/komodo-defi-framework/api/legacy/withdraw/#withdraw) | [withdraw](/komodo-defi-framework/api/v20/wallet/tx/withdraw/#withdraw) | |
152153
| | [withdraw\_nft](/komodo-defi-framework/api/v20/non_fungible_tokens/withdraw_nft/#withdraw-nfts) | |
153154
| | [z\_coin\_tx\_history](/komodo-defi-framework/api/v20/wallet/tx/zhtlc_tx_history/#zhtlc-coin-transaction-history) | |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
export const title = "Komodo DeFi Framework Method: Walletconnect: new connection";
2+
export const description =
3+
"The wc_new_connection method returns a connection string which can be scanned as a QR code.";
4+
5+
# wc\_new\_connection
6+
7+
The `wc_new_connection` method returns a connection string which can be scanned as a QR code.
8+
9+
<Note>
10+
A list of EIP155 chain IDs can be viewed at [https://chainid.network/](https://chainid.network/).
11+
For more detailed technical information, check out the [Walletconnect documentation](https://specs.walletconnect.com/2.0).
12+
</Note>
13+
14+
## Arguments
15+
16+
| Structure | Type | Description |
17+
| -------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
18+
| required\_namespaces | object | Contains two [WcConnNs](/komodo-defi-framework/api/common_structures/#wc-conn-ns) objects under the keys `eip155` and `cosmos`, which contain details of approved chains, methods and events while connected. |
19+
20+
## Response
21+
22+
| Structure | Type | Description |
23+
| --------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
24+
| url | string | A WalletConnect URI address ([EIP-1328](https://eips.ethereum.org/EIPS/eip-1328)) used to send a connection request to the bridge server. |
25+
26+
Generally, this WalletConnect URI will be converted into a scanable [QR code](https://www.qr-code-generator.com/) in front end user interfaces, so mobile dapps can easily request a connection.
27+
28+
#### 📌 Examples
29+
30+
#### Command
31+
32+
<CodeGroup title="" tag="POST" label="wc_new_connection" mm2MethodDecorate="true">
33+
```json
34+
{
35+
"method": "wc_new_connection",
36+
"userpass": "RPC_UserP@SSW0RD",
37+
"mmrpc": "2.0",
38+
"params": {
39+
"required_namespaces": {
40+
"eip155": {
41+
"chains": [
42+
"eip155:1",
43+
"eip155:56",
44+
"eip155:137",
45+
"eip155:43114"
46+
],
47+
"methods": [
48+
"eth_sendTransaction",
49+
"eth_signTransaction",
50+
"personal_sign"
51+
],
52+
"events": [
53+
"accountsChanged",
54+
"chainChanged"
55+
]
56+
},
57+
"cosmos": {
58+
"chains": [
59+
"cosmos:cosmoshub-4"
60+
],
61+
"methods": [
62+
"cosmos_signDirect",
63+
"cosmos_signAmino",
64+
"cosmos_getAccounts"
65+
],
66+
"events": []
67+
}
68+
}
69+
}
70+
}
71+
```
72+
</CodeGroup>
73+
74+
<CollapsibleSection expandedText="Hide Response" collapsedText="Show Response">
75+
#### Response
76+
77+
```json
78+
{
79+
"mmrpc": "2.0",
80+
"result": {
81+
"url": "wc:31ad8ac6f21312e01ef7ff656ed5507eb9fdf435662fd86331e00b301e3627bfc14@2?symKey=589807f2063d237adfacc18d9443232785b532eaabe7838162c3d78cc3a9060f&relay-protocol=irn&expiryTimestamp=1741584419"
82+
},
83+
"id": null
84+
}
85+
```
86+
</CollapsibleSection>

0 commit comments

Comments
 (0)