-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
213 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules | ||
dist | ||
build | ||
lib | ||
coverage | ||
target | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ node_modules/ | |
# Build and test | ||
dist/ | ||
build/ | ||
lib/ | ||
coverage/ | ||
|
||
# JetBrains | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ node_modules/ | |
.yarn | ||
test/ | ||
src/ | ||
stats.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Bundle stats file | ||
stats.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import sha256 from 'crypto-js/sha256'; | ||
import { sha256 } from 'crypto-hash'; | ||
import { Buffer } from 'buffer'; | ||
|
||
export async function getFileHash(file: Buffer) { | ||
return Buffer.from(sha256(file.toString()).toString()); | ||
} | ||
export const getFileHash = async (file: Buffer) => Buffer.from(await sha256(file.toString())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,8 @@ | |
<button id="metadata" type="button">Get metadata</button> | ||
</div> | ||
<script crossorigin = "anonymous" src="https://unpkg.com/@solana/web3.js@latest/lib/index.iife.min.js"></script> | ||
<script crossorigin = "anonymous" src="../../api/build/metaplex.min.js"></script> | ||
<script crossorigin = "anonymous" src="https://unpkg.com/@solana/[email protected]/lib/index.iife.min.js"></script> | ||
<script src="../../api/lib/index.iife.min.js"></script> | ||
<script src="./index.js"></script> | ||
</body> | ||
</html> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "example-browser", | ||
"name": "example-iife", | ||
"version": "0.0.1", | ||
"license": "MIT", | ||
"repository": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Example Metaplex</title> | ||
</head> | ||
<body> | ||
<div style="text-align: center; padding: 240px 0;"> | ||
<button id="metadata" type="button">Get metadata</button> | ||
</div> | ||
<script type='module' src="./index.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { PublicKey } from '@solana/web3.js'; | ||
import { Metadata, Connection } from '@metaplex/js'; | ||
|
||
const metadataPubkey = new PublicKey('CZkFeERacU42qjApPyjamS13fNtz7y1wYLu5jyLpN1WL'); | ||
const connection = new Connection('devnet'); | ||
const btn = document.getElementById('metadata'); | ||
|
||
const run = async () => { | ||
btn.addEventListener('click', async () => { | ||
const metadata = await Metadata.load(connection, metadataPubkey); | ||
console.log(metadata); | ||
}); | ||
}; | ||
|
||
run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "example-web", | ||
"version": "0.0.1", | ||
"license": "MIT", | ||
"repository": { | ||
"url": "https://github.com/metaplex/js.git" | ||
}, | ||
"private": true, | ||
"scripts": { | ||
"start": "parcel index.html --cache-dir build/cache" | ||
}, | ||
"dependencies": { | ||
"@metaplex/js": "workspace:^0.0.1", | ||
"@solana/spl-token": "^0.1.8", | ||
"@solana/web3.js": "^1.24.1" | ||
}, | ||
"devDependencies": { | ||
"parcel": "next", | ||
"typescript": "^4.4.3" | ||
}, | ||
"browserslist": [ | ||
"last 2 Chrome versions" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.