Skip to content

Commit

Permalink
feat: support for third party wearables (v2) (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
marianogoldman authored Jul 19, 2024
1 parent 13d84e2 commit 426e5a3
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 277 deletions.
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@ npm i @dcl/urn-resolver
import { parseUrn } from '@dcl/urn-resolver'

const parsed = await parseUrn("urn:decentraland:sepolia:LAND:-10,-13?atBlock=151231111")
=> {
uri: URL {
href: 'urn:decentraland:sepolia:LAND:-10,-13?atBlock=151231111',
protocol: 'urn:',
pathname: 'decentraland:sepolia:LAND:-10,-13',
search: '?atBlock=151231111',
searchParams: URLSearchParams { 'atBlock' => '151231111' },
},
blockchain: 'ethereum',
type: 'blockchain-asset',
network: 'sepolia',
contractAddress: '0x7a73483784ab79257bb11b96fd62a2c3ae4fb75b',
id: '0xfffffffffffffffffffffffffffffff6fffffffffffffffffffffffffffffff3',
x: -10,
y: -13
}
// returns
// {
// uri: URL {
// href: 'urn:decentraland:sepolia:LAND:-10,-13?atBlock=151231111',
// protocol: 'urn:',
// pathname: 'decentraland:sepolia:LAND:-10,-13',
// search: '?atBlock=151231111',
// searchParams: URLSearchParams { 'atBlock' => '151231111' },
// },
// blockchain: 'ethereum',
// type: 'blockchain-asset',
// network: 'sepolia',
// contractAddress: '0x7a73483784ab79257bb11b96fd62a2c3ae4fb75b',
// id: '0xfffffffffffffffffffffffffffffff6fffffffffffffffffffffffffffffff3',
// x: -10,
// y: -13
// }
```

# Registered routes
Expand All @@ -39,9 +40,10 @@ const parsed = await parseUrn("urn:decentraland:sepolia:LAND:-10,-13?atBlock=151
- `decentraland:{network}:collections-v2:{contract(0x[a-fA-F0-9]+)}:{id}:{tokenId}`: Resolve an ethereum wearable item from collections v2 by contract address and token id
- `decentraland:{network}:LAND:{x},{y}`: Resolves the ethereum asset of a LAND position.
- `decentraland:{network}:LAND:{tokenId}`: Resolves the ethereum asset of a LAND by tokenId.
- `decentraland:{network}:collections-thirdparty:{thirdPartyName}:{collectionId}:{itemId}`: Resolves the ethereum asset of an item of a third party collection, currently only supported on polygon
- `decentraland:{network}:collections-thirdparty:{thirdPartyName}`: Resolves the ethereum asset of a third party provider, currently only supported on polygon
- `decentraland:{network}:collections-thirdparty:{thirdPartyName}:{collectionId}`: Resolves the ethereum asset of a third party collection, currently only supported on polygon
- `decentraland:{network}:collections-thirdparty:{thirdPartyName}`: Resolves the ethereum asset of all collections from a third party, currently only supported on polygon
- `decentraland:{network}:collections-thirdparty:{thirdPartyName}:{collectionId}:{itemId}`: Resolves the ethereum asset of a third party collection asset, currently only supported on polygon
- `decentraland:{network}:collections-thirdparty:{thirdPartyName}:{collectionId}:{itemId}:{nftChain}:{nftContractAddress(0x[a-fA-F0-9]+)}:{nftTokenId([0-9]+)}`: Resolves the ethereum asset of a third party collection item, currently only supported on polygon

# DecentralandAssetIdentifier

Expand All @@ -53,14 +55,15 @@ It is an union type defined in the file [src/types.ts](src/types.ts), in that fi

You will need to install `jq`. If you are using MacOS you can install it by running: `brew install jq`.

The lib is being [built with node 14.x](.github/workflows/ci.yml).
The lib is being [built with node 18.x](.github/workflows/build-and-publish.yml).

```bash
make build
yarn
yarn build
```

## Test

```bash
make test
yarn test
```
61 changes: 32 additions & 29 deletions src/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,35 +132,7 @@ export = (
"Catalyst": "0x9b5091588a4bae0a5ea54a35af3c31f57a68ed37",
"POIAllowlist": "0xff7fcdbeaf0a5f2c408564036a9afaef9f38182d"
},
"goerli": {
"MANAToken": "0xe7fDae84ACaba2A5Ba817B6E6D8A2d415DBFEdbe",
"ERC20Predicate": "0xdD6596F2029e6233DEFfaCa316e6A95217d4Dc34",
"RootChainManagerProxy": "0xbbd7cbfa79faee899eaf900f13c9065bf03b1a74",
"RootChainProxy": "0x2890ba17efe978480615e330ecb65333b880928e",
"LANDRegistry": "0x0cfF059845c6Abee7De396d00091016ad72FD324",
"LANDProxy": "0x25b6B4bac4aDB582a0ABd475439dA6730777Fbf7",
"EstateRegistry": "0x5309aE874FC4eB21adCd63f8b6C3f766Cc3B1849",
"EstateProxy": "0xC9A46712E6913c24d15b46fF12221a79c4e251DC",
"RentalsProxyAdmin": "0xa924cbea79a031baa05d76908644d5c5bedeaaed",
"RentalsProxy": "0x92159c78f0f4523b9c60382bb888f30f10a46b3b",
"RentalsImplementation": "0x619cf59b03a4e0c42850429e154ff7fd1d966b3c",
"MarketplaceProxy": "0x5d01fbD3E22892be40F69bdAE7Ad921C8cdA2085",
"MarketplaceImplementation": "0x09B389B3523870798f46555fef26B4476A973E6E",
"MarketplaceLegacyNFT": "0x0fFc7E6D72eE2F287B877533454210621b1B7822",
"DCLRegistrar": "0x6b8da2752827cf926215b43bb8E46Fd7b9dDac35",
"DCLController": "0x6fF05B6271BBEd8F16a46e6073d27aD94224E0Ac",
"DCLControllerV2": "0xe23b047c8ee33d0c423676544bca6d2c9d3faa49",
"ERC721Bid": "0xd7dC1C183B8fFaED6b7f30fFC616Ff81B66812e5",
"ExclusiveMasksCollection": "0x1f0880E0b4514DC58e68B9BE91693bFA8C067ac1",
"NAMEDenylist": "0x71c84760df0537f7db286274817462dc2e6c1366",
"Catalyst": "0x380e46851c47b73b6aa9bea50cf3b50e2cf637cf",
"POIAllowlist": "0xb8c7a7afd42675ab61f0a3732f8d0491825a933b",
"VestingImpl": "0xa1c496c3beca1832a8434ac77ee3a1a53881c12e",
"PeriodicTokenVestingImpl": "0x3b2149a7573e2b0dd157307d427b9380f8f1b2a1",
"VestingFactory": "0x11a970e744ff69db8f461c2d0fc91d4293914301",
"BatchVestings": "0x651440486194aeca2cfff6e344bd604dda8a2d7f"
},
"matic": {
"matic": {
"MetaTxForwarder": "0x0baBda04f62C549A09EF3313Fe187f29c099FF3C",
"MANAToken": "0xA1c57f48F0Deb89f569dFbE6E2B7f46D33606fD4",
"ChildChainManagerProxy": "0xA6FA4fB5f76172d178d61B04b0ecd319C5d1C0aa",
Expand Down Expand Up @@ -207,6 +179,37 @@ export = (
"UpgradeableBeacon": "0x1a91dd8d4eeddc2fac31f36818604b7093dc95e0",
"POI": "0x7a0fad6854de8df1245da952cd3ae7f6893154c1"
},
"arbitrum": {
"GRTMultisig": "0x9be99A553C598898Ff4718e6b1A25Cc37e398943"
},
"goerli": {
"MANAToken": "0xe7fDae84ACaba2A5Ba817B6E6D8A2d415DBFEdbe",
"ERC20Predicate": "0xdD6596F2029e6233DEFfaCa316e6A95217d4Dc34",
"RootChainManagerProxy": "0xbbd7cbfa79faee899eaf900f13c9065bf03b1a74",
"RootChainProxy": "0x2890ba17efe978480615e330ecb65333b880928e",
"LANDRegistry": "0x0cfF059845c6Abee7De396d00091016ad72FD324",
"LANDProxy": "0x25b6B4bac4aDB582a0ABd475439dA6730777Fbf7",
"EstateRegistry": "0x5309aE874FC4eB21adCd63f8b6C3f766Cc3B1849",
"EstateProxy": "0xC9A46712E6913c24d15b46fF12221a79c4e251DC",
"RentalsProxyAdmin": "0xa924cbea79a031baa05d76908644d5c5bedeaaed",
"RentalsProxy": "0x92159c78f0f4523b9c60382bb888f30f10a46b3b",
"RentalsImplementation": "0x619cf59b03a4e0c42850429e154ff7fd1d966b3c",
"MarketplaceProxy": "0x5d01fbD3E22892be40F69bdAE7Ad921C8cdA2085",
"MarketplaceImplementation": "0x09B389B3523870798f46555fef26B4476A973E6E",
"MarketplaceLegacyNFT": "0x0fFc7E6D72eE2F287B877533454210621b1B7822",
"DCLRegistrar": "0x6b8da2752827cf926215b43bb8E46Fd7b9dDac35",
"DCLController": "0x6fF05B6271BBEd8F16a46e6073d27aD94224E0Ac",
"DCLControllerV2": "0xe23b047c8ee33d0c423676544bca6d2c9d3faa49",
"ERC721Bid": "0xd7dC1C183B8fFaED6b7f30fFC616Ff81B66812e5",
"ExclusiveMasksCollection": "0x1f0880E0b4514DC58e68B9BE91693bFA8C067ac1",
"NAMEDenylist": "0x71c84760df0537f7db286274817462dc2e6c1366",
"Catalyst": "0x380e46851c47b73b6aa9bea50cf3b50e2cf637cf",
"POIAllowlist": "0xb8c7a7afd42675ab61f0a3732f8d0491825a933b",
"VestingImpl": "0xa1c496c3beca1832a8434ac77ee3a1a53881c12e",
"PeriodicTokenVestingImpl": "0x3b2149a7573e2b0dd157307d427b9380f8f1b2a1",
"VestingFactory": "0x11a970e744ff69db8f461c2d0fc91d4293914301",
"BatchVestings": "0x651440486194aeca2cfff6e344bd604dda8a2d7f"
},
"mumbai": {
"dAppsAdmin": "0xb919da06d5f81777B13Fc5CBd48635E19500Fbf5",
"MetaTxForwarder": "0xBF6755A83C0dCDBB2933A96EA778E00b717d7004",
Expand Down
Loading

0 comments on commit 426e5a3

Please sign in to comment.