emblem-vault-sdk 1.9.4 → 1.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +2 -2
- package/dist/index.js +2 -2
- package/docs/bundle.js +2 -2
- package/package.json +1 -1
- package/readme.md +37 -66
- package/src/index.ts +1 -1
package/dist/bundle.js
CHANGED
|
@@ -709477,7 +709477,7 @@ const bignumber_1 = require("@ethersproject/bignumber");
|
|
|
709477
709477
|
const utils_1 = require("./utils");
|
|
709478
709478
|
const sats_connect_1 = require("sats-connect");
|
|
709479
709479
|
const derive_1 = require("./derive");
|
|
709480
|
-
const SDK_VERSION = '1.9.
|
|
709480
|
+
const SDK_VERSION = '1.9.5';
|
|
709481
709481
|
class EmblemVaultSDK {
|
|
709482
709482
|
constructor(apiKey, baseUrl) {
|
|
709483
709483
|
this.apiKey = apiKey;
|
|
@@ -709739,7 +709739,7 @@ class EmblemVaultSDK {
|
|
|
709739
709739
|
let collection = yield this.fetchCuratedContractByName(collectionName);
|
|
709740
709740
|
let mintRequestSig = yield this.requestLocalMintSignature(web3, tokenId, callback);
|
|
709741
709741
|
let remoteMintSig = yield this.requestRemoteMintSignature(web3, tokenId, mintRequestSig, callback);
|
|
709742
|
-
let quote = yield this.getQuote(web3, collection ? collection.price :
|
|
709742
|
+
let quote = yield this.getQuote(web3, collection ? collection.price : remoteMintSig._price, callback);
|
|
709743
709743
|
let mintResponse = yield this.performMint(web3, quote, remoteMintSig, callback);
|
|
709744
709744
|
return { mintResponse };
|
|
709745
709745
|
});
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ const bignumber_1 = require("@ethersproject/bignumber");
|
|
|
36
36
|
const utils_1 = require("./utils");
|
|
37
37
|
const sats_connect_1 = require("sats-connect");
|
|
38
38
|
const derive_1 = require("./derive");
|
|
39
|
-
const SDK_VERSION = '1.9.
|
|
39
|
+
const SDK_VERSION = '1.9.5';
|
|
40
40
|
class EmblemVaultSDK {
|
|
41
41
|
constructor(apiKey, baseUrl) {
|
|
42
42
|
this.apiKey = apiKey;
|
|
@@ -298,7 +298,7 @@ class EmblemVaultSDK {
|
|
|
298
298
|
let collection = yield this.fetchCuratedContractByName(collectionName);
|
|
299
299
|
let mintRequestSig = yield this.requestLocalMintSignature(web3, tokenId, callback);
|
|
300
300
|
let remoteMintSig = yield this.requestRemoteMintSignature(web3, tokenId, mintRequestSig, callback);
|
|
301
|
-
let quote = yield this.getQuote(web3, collection ? collection.price :
|
|
301
|
+
let quote = yield this.getQuote(web3, collection ? collection.price : remoteMintSig._price, callback);
|
|
302
302
|
let mintResponse = yield this.performMint(web3, quote, remoteMintSig, callback);
|
|
303
303
|
return { mintResponse };
|
|
304
304
|
});
|
package/docs/bundle.js
CHANGED
|
@@ -709477,7 +709477,7 @@ const bignumber_1 = require("@ethersproject/bignumber");
|
|
|
709477
709477
|
const utils_1 = require("./utils");
|
|
709478
709478
|
const sats_connect_1 = require("sats-connect");
|
|
709479
709479
|
const derive_1 = require("./derive");
|
|
709480
|
-
const SDK_VERSION = '1.9.
|
|
709480
|
+
const SDK_VERSION = '1.9.5';
|
|
709481
709481
|
class EmblemVaultSDK {
|
|
709482
709482
|
constructor(apiKey, baseUrl) {
|
|
709483
709483
|
this.apiKey = apiKey;
|
|
@@ -709739,7 +709739,7 @@ class EmblemVaultSDK {
|
|
|
709739
709739
|
let collection = yield this.fetchCuratedContractByName(collectionName);
|
|
709740
709740
|
let mintRequestSig = yield this.requestLocalMintSignature(web3, tokenId, callback);
|
|
709741
709741
|
let remoteMintSig = yield this.requestRemoteMintSignature(web3, tokenId, mintRequestSig, callback);
|
|
709742
|
-
let quote = yield this.getQuote(web3, collection ? collection.price :
|
|
709742
|
+
let quote = yield this.getQuote(web3, collection ? collection.price : remoteMintSig._price, callback);
|
|
709743
709743
|
let mintResponse = yield this.performMint(web3, quote, remoteMintSig, callback);
|
|
709744
709744
|
return { mintResponse };
|
|
709745
709745
|
});
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,78 +1,49 @@
|
|
|
1
1
|
# Emblem Vault SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Overview
|
|
4
|
+
The EmblemVault SDK provides developers with the tools needed to interact with the EmblemVault API, facilitating the seamless integration of EmblemVault functionalities into applications.
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## Getting Started
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
npm
|
|
9
|
-
|
|
8
|
+
### Installation
|
|
9
|
+
Install via npm or yarn:
|
|
10
|
+
- `npm install emblemvault-sdk`
|
|
11
|
+
- `yarn add emblemvault-sdk`
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
### Initialization
|
|
14
|
+
Initialize with your API key:
|
|
15
|
+
```javascript
|
|
16
|
+
import EmblemVaultSDK from 'emblemvault-sdk';
|
|
17
|
+
const emblemVaultSDK = new EmblemVaultSDK('YOUR_API_KEY');
|
|
12
18
|
```
|
|
13
|
-
const EmblemVaultSDK = require('emblem-vault-sdk');
|
|
14
|
-
// import EmblemVaultSDK from 'emblem-vault-sdk'
|
|
15
|
-
const apiKey = 'YOUR_API_KEY'; // replace with your actual API key
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
```
|
|
20
|
+
## API Reference
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// Fetch Vaults of type ____ owned by ____
|
|
47
|
-
const TEST_ADDRESS = "0x9dE9ffB62c159A10cbcC19BdAc7962e9C19a1baa"
|
|
48
|
-
sdk.fetchVaultsOfType("created", TEST_ADDRESS).then(vaults => {
|
|
49
|
-
console.log(vaults);
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
// Get all projects that contain Asset Metadata
|
|
53
|
-
projects = sdk.getAllProjects()
|
|
54
|
-
// [
|
|
55
|
-
// "Emblem Test",
|
|
56
|
-
// "Age of Chains",
|
|
57
|
-
// "Age of Rust",
|
|
58
|
-
// "..."
|
|
59
|
-
// ]
|
|
60
|
-
|
|
61
|
-
// Get asset metadata
|
|
62
|
-
const projectName = projects[1]; // valid item from getAllProjects() above
|
|
63
|
-
assets = sdk.getAssetMetadata(projectName)
|
|
64
|
-
console.log(assets)
|
|
65
|
-
// [
|
|
66
|
-
// {
|
|
67
|
-
// "image":"ELECTRUMCARD.jpg",
|
|
68
|
-
// "projectName":"Age of Chains",
|
|
69
|
-
// "projectLogo":"age-of-chains.jpg",
|
|
70
|
-
// "projectSite":"https://www.ageofchains.com/",
|
|
71
|
-
// "assetName":"ELECTRUMCARD"
|
|
72
|
-
// },...
|
|
73
|
-
// ]
|
|
22
|
+
### Asset Metadata Methods
|
|
23
|
+
- **getAssetMetadata(projectName, strict = false)**: Fetch metadata for assets by project name.
|
|
24
|
+
- **getAllAssetMetadata()**: Retrieve metadata for all assets.
|
|
25
|
+
- **getAllProjects()**: Get a list of all projects.
|
|
26
|
+
|
|
27
|
+
### Curated Collections Methods
|
|
28
|
+
- **fetchCuratedContracts(hideUnMintable = false, overrideFunc = false)**: Fetch curated contracts, with optional parameters to hide unmintable contracts or override the fetching function.
|
|
29
|
+
- **fetchCuratedContractByName(name, contracts = false)**: Fetch a curated contract by its name.
|
|
30
|
+
|
|
31
|
+
### Web3 Integration Methods
|
|
32
|
+
- **loadWeb3()**: Dynamically load Web3 and connect to MetaMask.
|
|
33
|
+
|
|
34
|
+
### Minting, Burning, and Claiming Methods
|
|
35
|
+
- **performMintChain(web3, tokenId, collectionName, callback = null)**: Perform the minting process for a specific token in a collection.
|
|
36
|
+
- **performBurn(web3, tokenId, callback = null)**: Burn a token.
|
|
37
|
+
- **performClaimChain(web3, tokenId, serialNumber, callback = null)**: Claim ownership of a token.
|
|
38
|
+
|
|
39
|
+
### Bitcoin Network Methods
|
|
40
|
+
- **getSatsConnectAddress()**: Generate a SatsConnect address for Bitcoin transactions.
|
|
41
|
+
- **generatePSBT(phrase, satsPerByte = 20)**: Generate a Partially Signed Bitcoin Transaction (PSBT).
|
|
42
|
+
- **getTaprootAddressFromMnemonic(phrase)**: Generate a Taproot address from a mnemonic phrase.
|
|
43
|
+
|
|
44
|
+
## Global Declaration
|
|
45
|
+
The `EmblemVaultSDK` is available globally in web applications through the `window` object.
|
|
74
46
|
|
|
75
|
-
```
|
|
76
47
|
|
|
77
48
|
## Simple Html Demo
|
|
78
49
|
|
package/src/index.ts
CHANGED
|
@@ -253,7 +253,7 @@ class EmblemVaultSDK {
|
|
|
253
253
|
let collection = await this.fetchCuratedContractByName(collectionName);
|
|
254
254
|
let mintRequestSig = await this.requestLocalMintSignature(web3, tokenId, callback);
|
|
255
255
|
let remoteMintSig = await this.requestRemoteMintSignature(web3, tokenId, mintRequestSig, callback);
|
|
256
|
-
let quote = await this.getQuote(web3, collection? collection.price:
|
|
256
|
+
let quote = await this.getQuote(web3, collection? collection.price: remoteMintSig._price, callback);
|
|
257
257
|
let mintResponse = await this.performMint(web3, quote, remoteMintSig, callback);
|
|
258
258
|
return {mintResponse}
|
|
259
259
|
}
|