Skip to content

Commit f8f0fbe

Browse files
authored
Merge pull request #315 from Niraj-Kamdar/nk/wrapscan
refactor: use wrapscan URIs
2 parents dc03ca4 + ab4de96 commit f8f0fbe

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

snippets/js/create-client-instance/src/hello-world.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const client = new PolywrapClient();
77
export function helloWorld() {
88
// $start: js-client-hello-world
99
client.invoke({
10-
uri: "ens/wraps.eth:logging@1.0.0",
10+
uri: "wrapscan.io/polywrap/[email protected]",
1111
method: "info",
1212
args: {
1313
message: "Hello World!"

snippets/js/create-client-instance/src/metamask-in-ethereum-plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function metamaskInEthereumPlugin() {
2323
const config = new ClientConfigBuilder()
2424
.addDefaults()
2525
.addPackages({
26-
"wrap://ens/wraps.eth:ethereum-[email protected].0": ethereumProviderPlugin({
26+
"wrapscan.io/polywrap/ethereum-wallet@1.0": ethereumProviderPlugin({
2727
connections: new Connections({
2828
networks: {
2929
goerli: new Connection({

src/docs/clients.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A Client is any library that can resolve and invoke [Wraps](./concepts/wraps).
88
The Polywrap Foundation maintains a number of Clients, most notably:
99

1010
- [Polywrap JS Client](https://github.com/polywrap/javascript-client)
11-
- [Polywrap Python Client](https://github.com/polywrap/python-client)
11+
- [Polywrap Python Client](https://polywrap-client.readthedocs.io)
1212
- [Polywrap Rust Client](https://github.com/polywrap/rust-client)
1313
- [Polywrap Swift Client](https://github.com/polywrap/swift-client)
1414
- [Polywrap Kotlin Client](https://github.com/polywrap/kotlin-client)

src/docs/quick-start.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ At this point, you can already invoke Wraps! In the simple example below, we wil
7474

7575
```javascript
7676
const result = await client.invoke({
77-
uri: "ens/wraps.eth:logger@1.0.0",
77+
uri: "wrapscan.io/polywrap/[email protected]",
7878
method: "log",
7979
args: {
8080
message: "Hello Polywrap!",
@@ -95,7 +95,7 @@ The first line is printed by the Logger Wrap, while the second line shows the st
9595

9696
#### What's going on here?
9797

98-
Using the Polywrap Client, we are invoking the `log` method of a Wrap found under the [WRAP URI](/concepts/uris) `ens/wraps.eth:logger@1.0.0` called the Logger Wrap.
98+
Using the Polywrap Client, we are invoking the `log` method of a Wrap found under the [WRAP URI](/concepts/uris) `wrapscan.io/polywrap/[email protected]` called the Logger Wrap.
9999

100100
Under the hood, through a process we call URI Resolution, the Polywrap Client knows how to fetch and execute the Wrap from decentralized storage.
101101

@@ -124,7 +124,7 @@ We can use the Uniswap Wrap to fetch Uniswap's basic data related to the WETH an
124124

125125
```javascript
126126
const wethResult = await client.invoke({
127-
uri: "ens/uniswap.wraps.eth:v3",
127+
uri: "wrapscan.io/polywrap/uniswap[email protected]",
128128
method: "fetchToken",
129129
args: {
130130
address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
@@ -141,7 +141,7 @@ if(!wethResult.ok) {
141141
console.log("WETH:", wethResult.value);
142142

143143
const usdcResult = await client.invoke({
144-
uri: "ens/uniswap.wraps.eth:v3",
144+
uri: "wrapscan.io/polywrap/uniswap[email protected]",
145145
method: "fetchToken",
146146
args: {
147147
address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
@@ -158,7 +158,7 @@ if(!usdcResult.ok) {
158158
console.log("USDC:", usdcResult.value);
159159

160160
const poolAddressResult = await client.invoke({
161-
uri: "ens/uniswap.wraps.eth:v3",
161+
uri: "wrapscan.io/polywrap/uniswap[email protected]",
162162
method: "getPoolAddress",
163163
args: {
164164
tokenA: wethResult.value,
@@ -192,11 +192,11 @@ First, we will use the Ens Text Record Resolver Wrap to resolve the ENS domain t
192192
// We first want to resolve the ENS address (uniswap.wraps.eth)
193193
// and text record (v3) into an IPFS WRAP URI
194194
const resolutionResult = await client.invoke({
195-
uri: "ens/wraps.eth:ens-text-record-uri-resolver[email protected].0",
195+
uri: "wrapscan.io/polywrap/wrapscan-uri-resolver@1.0",
196196
method: "tryResolveUri",
197197
args: {
198-
authority: "ens",
199-
path: "uniswap.wraps.eth:v3",
198+
authority: "wrapscan.io",
199+
path: "polywrap/uniswap[email protected]",
200200
},
201201
});
202202

@@ -220,7 +220,7 @@ const cid = resolutionResult.value.uri.replace("wrap://ipfs/", "");
220220

221221
// Since the CID is a directory, we need to add a path to the Wrap's manifest file
222222
const catResult = await client.invoke({
223-
uri: "ens/wraps.eth:ipfs-http-client@1.0.0",
223+
uri: "wrapscan.io/polywrap/[email protected]",
224224
method: "cat",
225225
args: {
226226
cid: cid + "/wrap.info",
@@ -339,11 +339,11 @@ In the context of an application project, the Schema file defines which Wraps ou
339339
Taking a look at the file, we can see two `import` statements:
340340

341341
```graphql title="schema.graphql"
342-
#import * into Logging from "ens/wraps.eth:logging@1.0.0"
343-
#import * into Ethereum from "ens/wraps.eth:ethereum@1.0.0"
342+
#import * into Logging from "wrapscan.io/polywrap/[email protected]"
343+
#import * into Ethereum from "wrapscan.io/polywrap/[email protected]"
344344
```
345345

346-
An `import` statement defines which Wraps we are importing, therefore using within our application. Imports are namespaced - the Wrap found under the WRAP URI `ens/wraps.eth:logging@1.0.0` is going to be found within the `Logging_` namespace.
346+
An `import` statement defines which Wraps we are importing, therefore using within our application. Imports are namespaced - the Wrap found under the WRAP URI `wrapscan.io/polywrap/[email protected]` is going to be found within the `Logging_` namespace.
347347

348348
#### Generating types (`codegen`)
349349

@@ -392,7 +392,7 @@ Let's revisit our Uniswap V3 Wrap example from the Quick Start tutorial. If we w
392392

393393
```javascript
394394
const usdcResult = await client.invoke({
395-
uri: "ens/uniswap.wraps.eth:v3",
395+
uri: "wrapscan.io/polywrap/uniswap[email protected]",
396396
method: "fetchToken",
397397
args: {
398398
address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
@@ -404,7 +404,7 @@ const usdcResult = await client.invoke({
404404
Instead, we can now add an `import` statement for the Uniswap V3 Wrap to our `schema.graphql` file:
405405

406406
```graphql title="schema.graphql"
407-
#import * into UniswapV3 from "ens/uniswap.wraps.eth:v3"
407+
#import * into UniswapV3 from "wrapscan.io/polywrap/uniswap[email protected]"
408408
```
409409

410410
Running `codegen` now will add all types defined inside the Uniswap V3 Wrap to our `wrap` folder:

src/docs/tutorials/use-wraps/install-client.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ Some example projects that integrate the JS client can be found [here](https://g
4646
> Where `<project-name>` is replaced with a custom name of your choosing. For example `my-app`.
4747
>
4848
> This command will create a new project folder with a "Hello World" app that
49-
> lets you interact with two simple Wasm wraps at `wrap://ens/wraps.eth:logging@1.0.0` and `wrap://ens/wraps.eth:ethereum@1.0.0`.
49+
> lets you interact with two simple Wasm wraps at `wrap://wrapscan.io/polywrap/logger@1.0` and `wrap://wrapscan.io/polywrap/[email protected]`.

0 commit comments

Comments
 (0)