Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rabbitholegg/questdk

Package Overview
Dependencies
Maintainers
3
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rabbitholegg/questdk - npm Package Compare versions

Comparing version 2.0.0-alpha.43 to 2.0.0-alpha.44

28

dist/cjs/tokens/erc1155.js

@@ -7,10 +7,32 @@ "use strict";

async function fetchERC1155Metadata(client, contractAddress, tokenId) {
const tokenURI = await client.readContract({
let tokenURI = await client.readContract({
address: contractAddress,
abi: [
'function uri(uint256 tokenId) external view returns (string memory)',
{
inputs: [
{
internalType: 'uint256',
name: 'tokenId',
type: 'uint256',
},
],
name: 'uri',
outputs: [
{
internalType: 'string',
name: '',
type: 'string',
},
],
stateMutability: 'view',
type: 'function',
},
],
functionName: 'uri',
args: [tokenId],
args: [BigInt(tokenId)],
});
if (tokenURI.startsWith('ipfs://')) {
const ipfsIdentifier = tokenURI.split('/').slice(2).join('/');
tokenURI = `https://ipfs.io/ipfs/${ipfsIdentifier}`;
}
const response = await axios_1.default.get(tokenURI);

@@ -17,0 +39,0 @@ return response.data;

@@ -7,10 +7,32 @@ "use strict";

async function fetchERC721Metadata(client, contractAddress, tokenId) {
const tokenURI = await client.readContract({
let tokenURI = await client.readContract({
address: contractAddress,
abi: [
'function tokenURI(uint256 tokenId) external view returns (string memory)',
{
inputs: [
{
internalType: 'uint256',
name: 'tokenId',
type: 'uint256',
},
],
name: 'tokenURI',
outputs: [
{
internalType: 'string',
name: '',
type: 'string',
},
],
stateMutability: 'view',
type: 'function',
},
],
functionName: 'tokenURI',
args: [tokenId],
args: [BigInt(tokenId)],
});
if (tokenURI.startsWith('ipfs://')) {
const ipfsIdentifier = tokenURI.split('/').slice(2).join('/');
tokenURI = `https://ipfs.io/ipfs/${ipfsIdentifier}`;
}
const response = await axios_1.default.get(tokenURI);

@@ -17,0 +39,0 @@ return response.data;

@@ -13,10 +13,32 @@ import fetchQuestActionParams from '../quests/fetchQuestData.js';

export async function fetchERC1155Metadata(client, contractAddress, tokenId) {
const tokenURI = await client.readContract({
let tokenURI = await client.readContract({
address: contractAddress,
abi: [
'function uri(uint256 tokenId) external view returns (string memory)',
{
inputs: [
{
internalType: 'uint256',
name: 'tokenId',
type: 'uint256',
},
],
name: 'uri',
outputs: [
{
internalType: 'string',
name: '',
type: 'string',
},
],
stateMutability: 'view',
type: 'function',
},
],
functionName: 'uri',
args: [tokenId],
args: [BigInt(tokenId)],
});
if (tokenURI.startsWith('ipfs://')) {
const ipfsIdentifier = tokenURI.split('/').slice(2).join('/');
tokenURI = `https://ipfs.io/ipfs/${ipfsIdentifier}`;
}
const response = await axios.get(tokenURI);

@@ -23,0 +45,0 @@ return response.data;

@@ -13,10 +13,32 @@ import fetchQuestActionParams from '../quests/fetchQuestData.js';

export async function fetchERC721Metadata(client, contractAddress, tokenId) {
const tokenURI = await client.readContract({
let tokenURI = await client.readContract({
address: contractAddress,
abi: [
'function tokenURI(uint256 tokenId) external view returns (string memory)',
{
inputs: [
{
internalType: 'uint256',
name: 'tokenId',
type: 'uint256',
},
],
name: 'tokenURI',
outputs: [
{
internalType: 'string',
name: '',
type: 'string',
},
],
stateMutability: 'view',
type: 'function',
},
],
functionName: 'tokenURI',
args: [tokenId],
args: [BigInt(tokenId)],
});
if (tokenURI.startsWith('ipfs://')) {
const ipfsIdentifier = tokenURI.split('/').slice(2).join('/');
tokenURI = `https://ipfs.io/ipfs/${ipfsIdentifier}`;
}
const response = await axios.get(tokenURI);

@@ -23,0 +45,0 @@ return response.data;

2

package.json
{
"name": "@rabbitholegg/questdk",
"description": "",
"version": "2.0.0-alpha.43",
"version": "2.0.0-alpha.44",
"files": [

@@ -6,0 +6,0 @@ "dist",

@@ -18,11 +18,33 @@ import fetchQuestActionParams from '../quests/fetchQuestData.js'

): Promise<any> {
const tokenURI: string = await (client.readContract({
let tokenURI: string = await (client.readContract({
address: contractAddress as Address,
abi: [
'function uri(uint256 tokenId) external view returns (string memory)',
{
inputs: [
{
internalType: 'uint256',
name: 'tokenId',
type: 'uint256',
},
],
name: 'uri',
outputs: [
{
internalType: 'string',
name: '',
type: 'string',
},
],
stateMutability: 'view',
type: 'function',
},
],
functionName: 'uri',
args: [tokenId],
args: [BigInt(tokenId)],
}) as Promise<string>)
if (tokenURI.startsWith('ipfs://')) {
const ipfsIdentifier = tokenURI.split('/').slice(2).join('/')
tokenURI = `https://ipfs.io/ipfs/${ipfsIdentifier}`
}
const response = await axios.get(tokenURI)

@@ -29,0 +51,0 @@ return response.data

@@ -18,11 +18,33 @@ import fetchQuestActionParams from '../quests/fetchQuestData.js'

): Promise<any> {
const tokenURI: string = await (client.readContract({
let tokenURI: string = await (client.readContract({
address: contractAddress as Address,
abi: [
'function tokenURI(uint256 tokenId) external view returns (string memory)',
{
inputs: [
{
internalType: 'uint256',
name: 'tokenId',
type: 'uint256',
},
],
name: 'tokenURI',
outputs: [
{
internalType: 'string',
name: '',
type: 'string',
},
],
stateMutability: 'view',
type: 'function',
},
],
functionName: 'tokenURI',
args: [tokenId],
args: [BigInt(tokenId)],
}) as Promise<string>)
if (tokenURI.startsWith('ipfs://')) {
const ipfsIdentifier = tokenURI.split('/').slice(2).join('/')
tokenURI = `https://ipfs.io/ipfs/${ipfsIdentifier}`
}
const response = await axios.get(tokenURI)

@@ -29,0 +51,0 @@ return response.data

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc