Giter Site home page Giter Site logo

opensea-js's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opensea-js's Issues

Are referrals and royalties payable to a smart contract?

Apologies if this isn't the most appropriate place to ask this, but I have been unable to get help in the discord. A client of mine would like to split royalty or referral payments among different parties. To do this, we are setting up a small smart contract that is a standard OpenZepplin PaymentSplitter and sending to royalties there.

My question is: Will the manual royalty payment revert because the fallback smart contract takes a bit more gas than a standard Eth transfer? Are the royalty payments sent with a gasLimit that will cause this transaction to revert?

Thanks in advance for your help!

createSellOrder - Error: API Error 400: ['Failed to extract transfer calldata']

Hi @alexanderatallah ! I am trying to write a script to list assets on opensea via opensea.js, and I get the following error when calling createSellOrder:

Already approved proxy for all tokens
Order hashes match
(node:50361) UnhandledPromiseRejectionWarning: Error: API Error 400: ['Failed to extract transfer calldata']
    at OpenSeaAPI.<anonymous> (/Users/jonathanschwartz/Documents/Collectible/node_modules/opensea-js/src/api.ts:418:11)
    at step (/Users/jonathanschwartz/Documents/Collectible/node_modules/opensea-js/lib/api.js:40:23)
    at Object.next (/Users/jonathanschwartz/Documents/Collectible/node_modules/opensea-js/lib/api.js:21:53)
    at fulfilled (/Users/jonathanschwartz/Documents/Collectible/node_modules/opensea-js/lib/api.js:12:58)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

I've followed this example - https://github.com/ProjectOpenSea/opensea-creatures/blob/master/scripts/sell.js#L64

const BASE_DERIVATION_PATH = `44'/60'/0'/0`;

const mnemonicWalletSubprovider = new MnemonicWalletSubprovider({
  mnemonic,
  baseDerivationPath: BASE_DERIVATION_PATH,
});

const infuraRpcSubprovider = new RPCSubprovider({
  rpcUrl,
});

const providerEngine = new Web3ProviderEngine();
providerEngine.addProvider(mnemonicWalletSubprovider);
providerEngine.addProvider(infuraRpcSubprovider);
providerEngine.start();

const seaport = new OpenSeaPort(
    providerEngine,
    {
      networkName: Network.Rinkeby,
    },
    (arg) => console.log(arg)
);

const asset = await seaport.api.getAsset({
      tokenAddress: CONTRACT_ADDR,
      tokenId: TOKEN_ID,
});
// the asset comes back here with all the correct information
console.log(asset);

const listing = await seaport.createSellOrder({
    asset: {
      tokenAddress: CONTRACT_ADDR,
      tokenId: TOKEN_ID
    },
    accountAddress: OWNER_ADDRESS,
    startAmount: 1,
    expirationTime: 0,
});
// ERROR

I've validated my account is unlocked and able to sign messages:

  const w3 = new Web3(providerEngine);
  w3.eth
    .sign("message to sign", OWNER_ADDRESS)
    .then(console.log);
// prints a signature

Throttled requets even with API key

Hey, first of all, thanks for this SDK and API that we are using to build a custom NFT store! I'm having some problems using the API key, I'm getting the throttle message with API key on rinkeby and mainnet, we can make like 7 requests before throttled, and then pretty long throttle interval. We are using the /asset/ to get information about every NFT that we are listing so we can display custom info.

Is this the expected behavior? Is there any way to this differently?

[Bug] Incorrect field name

The returned data field name is inconsistent with the type definition, resulting in incorrect fetching of the value

image
image

NPM install throws git error

I ran NPM install, but it failed with the following error:

code 1
npm ERR! Command failed: /usr/bin/git submodule update -q --init --recursive
npm ERR! error: The following untracked working tree files would be overwritten by checkout:
npm ERR! 	.gitattributes
npm ERR! 	.gitignore
npm ERR! 	LICENSE
npm ERR! 	README.md
npm ERR! Please move or remove them before you switch branches.
npm ERR! Aborting
npm ERR! Unable to checkout '91ee5d23072fd5c1e62bb78eb6d8fa335098ee5f' in submodule path 'src/wyvern-ethereum/utxo-merkle-proof'
npm ERR! Failed to recurse into submodule path 'src/wyvern-ethereum'

I tried it in a different project and on a different computer as well and got the same error. Any thoughts on why this might be happening?

ERROR on createFactorySellOrders

When I launch initial_sale i have this error:

Error: API Error 429: Message: {"detail":"Request was throttled. Expected available in 1 second."}
at OpenSeaAPI. (/Users/aleandrocoppola/Desktop/projects/nft/opensea-creatures/node_modules/opensea-js/src/api.ts:418:11)
at step (/Users/aleandrocoppola/Desktop/projects/nft/opensea-creatures/node_modules/opensea-js/lib/api.js:40:23)
at Object.next (/Users/aleandrocoppola/Desktop/projects/nft/opensea-creatures/node_modules/opensea-js/lib/api.js:21:53)
at fulfilled (/Users/aleandrocoppola/Desktop/projects/nft/opensea-creatures/node_modules/opensea-js/lib/api.js:12:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)

CORS Error suddenly on all API calls

Suddenly getting CORS Errors when calling createfactorySellOrder on a nextjs/vercel frontend.
Worked for a week, didn't change anything, and now doesn't work.

Has anything changed on your server to not allow these requests?

image

GetAssetBalance outdated?

I tried the code in the example to obtain the asset Balance of an ERC1155
I have the following asset variable:

    this.asset = {
      tokenAddress: asset.asset_contract.address, 
      tokenId: asset.token_id, 
      schemaName:'ERC1155'
    }

and then the following code to obtain the asset balance


let accountAddress = this.parcel.owner
    let asset= this.asset
    const balance = await this.seaport.getAssetBalance({
      accountAddress, // string
      asset, // Asset
    })

However I keep obtaining the following error:

image
the contract function does not exists on web3.eth anymore?

According to web3/web3.js#985
it's now web3.eth.Contract() but I'm not certain of that.

Outdated response for bundles?

I recently notices, that the response of bundles using opensea-js is different than the response of the API.

Can't find "orders" inside the json response which is a part of the API response.

fulfillOrder function throwing No Schema Found For Asset error

I cloned the OpenSea-JS repository so that I can integrate OpenSea auctions. I am attempting to call the fulfillOrder function, but getSchema is throwing an error.

I am running this code inside a React Component. Here is how I am initializing the seaport:

import {OpenSeaPort, Network} from '../opensea-js'
import { OrderSide } from '../opensea-js/lib/types.js'

const provider = new Web3.providers.HttpProvider('https://mainnet.infura.io/{api_key}')

const seaport = new OpenSeaPort(provider, {
  networkName: Network.Main
})

After successfully retrieving an order from the api, I am calling:

await seaport.fulfillOrder({ order, accountAddress })

and getting back the error:

Unhandled Rejection (Error): No schema found for this asset; please check back later!

I am confident that a schema does actually exists for the NFT in question. I have tested with a CryptoKitty and a MLBCryptoBaseball figure.

The error is originating from opensea-js/lib/seaport.js line 1720, in the _getSchema function, which is called in from _makeMatchingOrder. _getSchema is reproduced below:

OpenSeaPort.prototype._getSchema = function (schemaName) {
        if (schemaName === void 0) { schemaName = types_1.WyvernSchemaName.ERC721; }
        console.log('schema name ' + schemaName)
        console.log('network name ' + this._networkName)
        console.log(WyvernSchemas.schemas)
        var schema = WyvernSchemas.schemas[this._networkName].filter(function (s) { return s.name == schemaName; })[0];
        console.log(schema)
        if (!schema) {
            throw new Error('No schema found for this asset; please check back later!');
        }
        return schema;
};

The function defaults to the schema name ERC721 when none is input (which is the case here), and then looks for that schema in the list of schemas WyvernSchemas has for the mainnet.

I looked at the result of WyvernSchemas.schemas[main], and WyvernSchemas has 15 schemas for the mainnet, but none with the name ERC721. Is there something wrong with the way I am setting up my environment, or is there somewhere else I could load the schema from?

About the display of Listings and Offers

Description

I am using OpenSea-JS SDK in my application to get the Listings(buyorders) and Offers(sellOrders) of the assets and to display them. But I found that some assets sometimes show Unit Price and Quantity and some assets show Price and Expiration.

So, Which field of the asset shoud i use to determine them? I can't get help from the documentation.

Maybe it's not a sdk problem, but it's very confusing to me.

Snapshot

image
image

Polygon assets access

Hey,
I'm trying to get info about this item:
https://opensea.io/assets/matic/0xa02d547512bb90002807499f05495fe9c4c3943f/0

My code:
const data = await seaport.api.getAsset({ tokenAddress: '0xa02d547512bb90002807499f05495fe9c4c3943f', tokenId: 0 });

My request URL is: https://api.opensea.io/api/v1/asset/0xa02d547512bb90002807499f05495fe9c4c3943f/0/? which is not exist.

I believe the problem is that it doesn't have matic keyword in params, can someone tell me how can I specified it?

How to programmatically create new items under a collection

Is it possible to programmatically create new items under a collection without owning and deploying a smart contract? Basically, I'd like to automate the "Create" -> "Submit NFTs" -> "Add New Item" workflow on the UI programmatically, and I'm wondering what the best way of doing this is.

If I do have to own and deploy my own smart contract to achieve my goal, could you give some guidance on how best to achieve this goal?

Nothing happens on createSellOrder() (code: -32000, message: 'execution reverted')

Hello, I'm trying to re-sell an existing token on OpenSea with a new price, using node.js

I followed the example from this link:
https://github.com/ProjectOpenSea/opensea-creatures/blob/master/scripts/sell.js
But, nothing happens after running the createSellOrder() method (and no any errors). Please tell me what is my mistake?

PS: In Metamask, I created a custom RPC network, where I indicated the Infura API. Also I don't have OpenSea API KEY.
And I installed "@0x/subproviders" manualy with npm. Thank you for your attention, I am a new in NFT. I am hope for your help. Since I have already spent 2 days looking for a solution to the problem

Here is my code:

// Imports
const opensea = require("opensea-js");
const { WyvernSchemaName } = require('opensea-js/lib/types')
const OpenSeaPort = opensea.OpenSeaPort;
const Network = opensea.Network;
const MnemonicWalletSubprovider = require("@0x/subproviders").MnemonicWalletSubprovider;
const RPCSubprovider = require("web3-provider-engine/subproviders/rpc");
const Web3ProviderEngine = require("web3-provider-engine");

require('dotenv').config({ path: "C:/Users/Test/Documents/test/.env" })

// Values
const MNEMONIC = process.env.MNEMONIC;
const NODE_API_KEY = process.env.INFURA_KEY;
const NFT_CONTRACT_ADDRESS = process.env.NFT_CONTRACT_ADDRESS;
const OWNER_ADDRESS = process.env.OWNER_ADDRESS;
const NETWORK = process.env.NETWORK; // mainnet

if (!MNEMONIC || !NODE_API_KEY || !NETWORK || !OWNER_ADDRESS) {
    console.error(
        "Please set a mnemonic, Alchemy/Infura key, owner, network, API key, nft contract, and factory contract address."
    );
    return;
}

if (!NFT_CONTRACT_ADDRESS) {
    console.error("Please either set a factory or NFT contract address.");
    return;
}

const BASE_DERIVATION_PATH = `44'/60'/0'/0`;

const mnemonicWalletSubprovider = new MnemonicWalletSubprovider({
    mnemonic: MNEMONIC,
    baseDerivationPath: BASE_DERIVATION_PATH,
});

const infuraRpcSubprovider = new RPCSubprovider({
    rpcUrl: "https://" + NETWORK + ".infura.io/v3/" + NODE_API_KEY,
});

const providerEngine = new Web3ProviderEngine();
providerEngine.addProvider(mnemonicWalletSubprovider);
providerEngine.addProvider(infuraRpcSubprovider);
providerEngine.start();

const seaport = new OpenSeaPort(
    providerEngine,
    {
        networkName: Network.Main,
        // apiKey: API_KEY, /* i dont have (opensea) API_KEY */
    },
    (arg) => console.log(arg)
);

async function sellItem() {

    try {
        console.log("Auctioning an item for a fixed price...");
        const fixedPriceSellOrder = await seaport.createSellOrder({
            asset: {
                tokenId: "98534702324345435981883704817319191110429273040727973456443680", // example token id
                tokenAddress: NFT_CONTRACT_ADDRESS,
                schemaName: WyvernSchemaName.ERC1155, // Also not work without schemaName
            },
            startAmount: 2,
            expirationTime: 0,
            accountAddress: OWNER_ADDRESS,
        });
        console.log(
            "Successfully created a fixed-price sell order!", fixedPriceSellOrder.asset.openseaLink // This line not displaed after run code
        );
    } catch (e) {
        console.log(e); // This line not displaed after run code
    }

}
sellItem()

Well now on 'createSellOrder' i get:

{ code: -32000, message: 'execution reverted' }
Error: API Error 400: ['Failed to extract transfer calldata']

CORS error

bug
similar issue as #79

It is working fine on localhost but not on a public server when I call "createBuyOrder".

Is there any issue in my code or is it a bug on your side?

Thanks

Port to ethers.js?

Web3.js pulls in a bunch of stuff to my bundle and breaks my build (has an old version of the websocket module that has a .git folder in it and confuses heroku).

Error On Building Branch

I am trying to build code from master branch with tag 0.5.0-rc5 But it is giving me error , I have attached image.
Screen Shot 2019-05-08 at 8 13 53 PM

npm install fails on Mac OS X

Mac OS X 10.15.7
node 15.10.0
when trying to install I'm getting the below wall of errors that I can't quite understand.. anyone can help please?

lapt1:[email protected] adm1$ npm install --save opensea-js
npm WARN deprecated [email protected]: Renamed to @metamask/safe-event-emitter
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Custom ALPHABET bug fixed in v7.0.2
npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/adm1/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm ERR! npm WARN deprecated [email protected]: Renamed to @metamask/safe-event-emitter
npm ERR! npm WARN deprecated [email protected]: this library is no longer supported
npm ERR! npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm ERR! npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm ERR! npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm ERR! npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm ERR! npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm ERR! npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm ERR! npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! npm WARN deprecated [email protected]: Custom ALPHABET bug fixed in v7.0.2
npm ERR! npm WARN deprecated [email protected]: This version of 'buffer' is out-of-date. You must update to v4.9.2 or newer
npm ERR! npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm ERR! npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /Users/adm1/.npm/_cacache/tmp/git-clone-74cc97c0/node_modules/sha3
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c node-gyp rebuild
npm ERR! npm ERR! CXX(target) Release/obj.target/sha3/src/addon.o
npm ERR! npm ERR! gyp info it worked if it ends with ok
npm ERR! npm ERR! gyp info using [email protected]
npm ERR! npm ERR! gyp info using [email protected] | darwin | x64
npm ERR! npm ERR! gyp info find Python using Python version 3.8.2 found at "/Library/Developer/CommandLineTools/usr/bin/python3"
npm ERR! npm ERR! gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
npm ERR! npm ERR! gyp info spawn args [
npm ERR! npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! npm ERR! gyp info spawn args   '-f',
npm ERR! npm ERR! gyp info spawn args   'make',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/Users/adm1/.npm/_cacache/tmp/git-clone-74cc97c0/node_modules/sha3/build/config.gypi',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! npm ERR! gyp info spawn args   '-I',
npm ERR! npm ERR! gyp info spawn args   '/Users/adm1/Library/Caches/node-gyp/15.10.0/include/node/common.gypi',
npm ERR! npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_root_dir=/Users/adm1/Library/Caches/node-gyp/15.10.0',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_lib_file=/Users/adm1/Library/Caches/node-gyp/15.10.0/<(target_arch)/node.lib',
npm ERR! npm ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/adm1/.npm/_cacache/tmp/git-clone-74cc97c0/node_modules/sha3',
npm ERR! npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! npm ERR! gyp info spawn args   '--depth=.',
npm ERR! npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! npm ERR! gyp info spawn args   '--generator-output',
npm ERR! npm ERR! gyp info spawn args   'build',
npm ERR! npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! npm ERR! gyp info spawn args ]
npm ERR! npm ERR! No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
npm ERR! npm ERR! No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
npm ERR! npm ERR! No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
npm ERR! npm ERR! 
npm ERR! npm ERR! 
npm ERR! npm ERR! 
npm ERR! npm ERR! gyp info spawn make
npm ERR! npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! npm ERR! In file included from ../src/addon.cpp:4:
npm ERR! npm ERR! In file included from ../node_modules/nan/nan.h:2818:
npm ERR! npm ERR! ../node_modules/nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
npm ERR! npm ERR!       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
npm ERR! npm ERR!                                           ^
npm ERR! npm ERR! /Users/adm1/Library/Caches/node-gyp/15.10.0/include/node/v8.h:5317:3: note: 'GetContents' has been explicitly marked deprecated here
npm ERR! npm ERR!   V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
npm ERR! npm ERR!   ^
npm ERR! npm ERR! /Users/adm1/Library/Caches/node-gyp/15.10.0/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'
npm ERR! npm ERR! # define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
npm ERR! npm ERR!                                       ^
npm ERR! npm ERR! In file included from ../src/addon.cpp:9:
npm ERR! npm ERR! In file included from ../src/KeccakNISTInterface.h:17:
npm ERR! npm ERR! ../src/KeccakSponge.h:23:9: warning: 'ALIGN' macro redefined [-Wmacro-redefined]
npm ERR! npm ERR! #define ALIGN __attribute__ ((aligned(32)))
npm ERR! npm ERR!         ^
npm ERR! npm ERR! /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/i386/param.h:83:9: note: previous definition is here
npm ERR! npm ERR! #define ALIGN(p)        __DARWIN_ALIGN(p)
npm ERR! npm ERR!         ^
npm ERR! npm ERR! ../src/addon.cpp:83:11: error: no matching member function for call to 'Set'
npm ERR! npm ERR!                 target->Set(className, f);
npm ERR! npm ERR!                 ~~~~~~~~^~~
npm ERR! npm ERR! /Users/adm1/Library/Caches/node-gyp/15.10.0/include/node/v8.h:3716:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR! npm ERR!                                     ^
npm ERR! npm ERR! /Users/adm1/Library/Caches/node-gyp/15.10.0/include/node/v8.h:3719:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
npm ERR! npm ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR! npm ERR!                                     ^
npm ERR! npm ERR! 2 warnings and 1 error generated.
npm ERR! npm ERR! make: *** [Release/obj.target/sha3/src/addon.o] Error 1
npm ERR! npm ERR! gyp ERR! build error 
npm ERR! npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:378:20)
npm ERR! npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! npm ERR! gyp ERR! System Darwin 19.6.0
npm ERR! npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! npm ERR! gyp ERR! cwd /Users/adm1/.npm/_cacache/tmp/git-clone-74cc97c0/node_modules/sha3
npm ERR! npm ERR! gyp ERR! node -v v15.10.0
npm ERR! npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! npm ERR! gyp ERR! not ok

Price Drop: shows selection of non selectable tokens

  • On English auction
  • On Price Drop

an unexpected dropdown of tokens is available.

Since only WETH are accepted, they are not selectable.
When choosing a token, the choice is ignored and WETH remains the selected one.

User issue:
since it would be actually great to have other coins (especially stable coins) the user spends time selecting the token and nothing happens.

Screenshot 2021-04-09 at 11 24 10

Ref:
listing: https://opensea.io/assets/0x495f947276749ce646f68ac8c248420045cb7b5e/93380629908989276154329187712159695682604484101294988604591734364126547279873
Mac Os Big Sur
Firefox 87.0 (64-bit)
Brave Version 1.22.71 Chromium: 89.0.4389.114 (Official Build) (x86_64)

Can't get order info

sometimes, seaport.api.getOrders return { orders: [], count: 1 }, but I can find the order on opensea website
image
image

cheapest items in a collection, via REST API

(Question about the REST api not the JS library, but (a) perhaps you know what I am doing wrong, or (b) can point me elsewhere. Thanks a lot.)

cheapest items in a collection =??

Is there an API endpoint which delivers the same results as this search?

https://opensea.io/assets/superrare?search[sortAscending]=true&search[sortBy]=PRICE&search[toggles][0]=BUY_NOW

I am building a workaround via the orders API endpoint, and then just throw out all more expensive orders for the same item. It mostly works, for some collections.

But for some reason, I am not always seeing the same results as on the opensea.io webpage. Now I am wondering whether it's a bug, or something that I haven't understood yet.

This Python code works:

pip3 install requests
python3 savethistofile.py

savethistofile.py:

import requests # pip install requests
url = "https://api.opensea.io/wyvern/v1/orders"
querystring = {"side" : 1,
               "limit":"10",
               "offset":"0",
               "order_by":"eth_price",
               "order_direction":"asc",
               "is_english" : "false",
               "include_invalid":"false",
               "asset_contract_address": "0xb932a70a57673d89f4acffbe830e8ed7f75fb9e0"
               }
response = requests.request("GET", url, params=querystring)
orders=response.json()["orders"]
print ("%d cheapest sell orders in %s:" % (len(orders), orders[0]['asset']['asset_contract']['name']))
for o in orders:
    a=o["asset"]
    print ("%.4f ETH '%s' (%s)" % (float(o["current_price"])/1000000000000000000, a["name"], a["id"]))

results in:

10 cheapest sell orders in SuperRare:
0.1000 ETH 'meta.morphosis' (14399641)
0.1510 ETH 'meta.morphosis' (14399641)
0.1650 ETH 'meta.morphosis' (14399641)
0.1950 ETH 'meta.morphosis' (14399641)
0.2000 ETH 'The Cent Portal' (6843352)
0.2500 ETH 'Our Lady Of Crypto Vandalized' (13936180)
0.2500 ETH 'The Golden Evil' (15872088)
0.2500 ETH 'meta.morphosis' (14399641)
0.2900 ETH 'King Elvis' (13905469)
0.3000 ETH 'THISISAMERICA®' (13474165)

So e.g. 'meta.morphosis' and 'The Cent Portal' are found correctly.

BUT in contrast to ^ that, the webpage search gives MORE results, below 0.2 ETH:

opensea io-search-superrare-cheapest
https://opensea.io/assets/superrare?search[sortAscending]=true&search[sortBy]=PRICE&search[toggles][0]=BUY_NOW

Can you please

(a) check what is going on there, perhaps (a1) I understood the API call wrong, or (a2) something's bad in the backend.

(b) tell me a different way if there is one, to just query the cheapest xx items in a collection.

Thanks a lot!

Support collectibles' images that changes, eg. Chibi Fighters grow from baby to adult

Some collectibles' images may change as time goes by. For example, Chibi Fighter's purchased directly from Chibi Fighter's site start out as a baby, it looks like https://opensea.io/assets/0x71c118b00759b0851785642541ceb0f4ceea0bd5/2213 . But after a few hours, it grows into an adult and becomes https://chibifighters.io/chibi/2213. Note that it's the same collectible with token ID 2213. The OpenSea API still returns these URLs for this particular collectible after ~17 hours (I presuming it wouldn't change):

{
    "external_link" : "https://chibifighters.io/chibi/2213",
    "image_thumbnail_url" : "https://storage.googleapis.com/opensea-prod.appspot.com/0x71c118b00759b0851785642541ceb0f4ceea0bd5-thumbnail/2213.png",
    "permalink" : "https://opensea.io/assets/0x71c118b00759b0851785642541ceb0f4ceea0bd5/2213",
    "image_preview_url" : "https://storage.googleapis.com/opensea-prod.appspot.com/0x71c118b00759b0851785642541ceb0f4ceea0bd5-preview/2213.png",
    "image_url" : "https://storage.googleapis.com/opensea-prod.appspot.com/0x71c118b00759b0851785642541ceb0f4ceea0bd5/2213.png",
    ...
}

Is there a chance such images that get updated can be supported? Hopefully the URLs above change too, or at least a GET query parameter is appended to the URLs, making it easier to cache them and detect changes in the image without refetching the images again on the client after the first time.

PS: there is an uint adultTime field in the contract representing time to become an adult. I don't know if an event is emitted.

Create Sell Order error

Hey!

Every time the createSellOrder method is called, I get :

Haven't found a fix anywhere in a week so posting this here, might be a bug?

Thank you,
Rayan Boutaleb

createBuyOrder gives TypeError: Cannot read property 'id' of undefined

I am trying to write a node.js script to place a buy order on a token. When I run it, I get:

$ node -r esm make-bid.js 
DEPRECATION NOTICE: Use `asset` instead of `tokenAddress`
TypeError: Cannot read property 'id' of undefined
    at IpcProvider._addResponseCallback (/home/jcarver/code/opensea-ens/node_modules/web3-providers-ipc/src/index.js:176:39)
    at IpcProvider.send (/home/jcarver/code/opensea-ens/node_modules/web3-providers-ipc/src/index.js:214:10)
    at /home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/utils.js:437:99
    at /home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/utils.js:140:28
    at new Promise (<anonymous>)
    at /home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/utils.js:139:35
    at step (/home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/utils.js:40:23)
    at Object.next (/home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/utils.js:21:53)
    at /home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/utils.js:15:71
    at new Promise (<anonymous>)
    at __awaiter (/home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/utils.js:11:12)
    at promisify (/home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/utils.js:137:12)
    at Object.<anonymous> (/home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/utils.js:437:46)
    at step (/home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/utils.js:40:23)
    at Object.next (/home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/utils.js:21:53)
    at /home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/utils.js:15:71
(node:14571) UnhandledPromiseRejectionWarning: Error: You declined to authorize your offer
    at OpenSeaPort.<anonymous> (/home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/seaport.js:577:31)
    at step (/home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/seaport.js:40:23)
    at Object.throw (/home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/seaport.js:21:53)
    at rejected (/home/jcarver/code/opensea-ens/node_modules/opensea-js/lib/seaport.js:13:65)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)

Here is the code that is trying to place the offer:

// From https://github.com/ProjectOpenSea/opensea-js#getting-started

import * as Web3 from 'web3'
import { OpenSeaPort, Network } from 'opensea-js'

// This connects to a geth instance that has accountAddress unlocked
const provider = new Web3.providers.IpcProvider('/home/jcarver/.ethereum/geth.ipc', require('net'));
 
// *************************
// Making an offer, from https://github.com/ProjectOpenSea/opensea-js#making-offers

// Token ID and smart contract address for a non-fungible token:
const tokenId = 'XXXXXXXXXX';
const tokenAddress = '0xfac7bea255a6990f749363002136af6556b31e04';

// The offerer's wallet address:
const accountAddress = "0xZZZZZZZZZZZZZZZZ";

const seaport = new OpenSeaPort(provider, {
  networkName: Network.Main
})

async function makeBid() {
  const offer = await seaport.createBuyOrder({
    tokenId,
    tokenAddress,
    accountAddress,
    // Value of the offer, in units of the payment token (or wrapped ETH if none is specified):
    startAmount: 0.025,
  })
}

makeBid().then(console.log).catch(console.log);                

If the token ID and account address are important, I am happy to side-channel them. (I'm on the Discord server)

I know that the account is unlocked and connected correctly, because if I run this I see a signed message:

var W3 = require('web3');
const w3 = new W3(provider);
w3.eth.sign('message to sign', accountAddress).then(console.log)

Some environment info:

$ cat package.json 
{
  "name": "ens-bidder",
  "dependencies": {
    "esm": "^3.2.25",
    "opensea-js": "^0.6.3",
    "scrypt": "^6.0.3",
    "web3": "^1.2.1",
  }
}
$ node --version
v8.11.4

Store images on IPFS

If you want to be fully decentralized application, you should also store assets images on IPFS. This will also be able to protect from things like #3 when hosting provider is blocked in some country.

Calling getCurrentPrice results in toBigNumber(...).round is not a function

I am initializing an OpenSea port after cloning the repository. Issue #7 shows exactly how I am initializing it.

When I attempt to call:

seaport.getCurrentPrice(order)

I am getting the error Unhandled Rejection (TypeError): toBigNumber(...).round is not a function, originating in src/opensea-js/lib/seaport.js:704.

I installed web3 and BigNumber using npm install web3 and npm install BigNumber. Is there a different version of BigNumber I should be using to be compatible?

TypeError: Cannot read property 'HttpProvider' of undefined

Hey Guy! I run the demo of README and I paste it above ,

import * as Web3 from 'web3';
import { OpenSeaPort, Network } from 'opensea-js';

// This example provider won't let you make transactions, only read-only calls:
const provider = new Web3.providers.HttpProvider('https://mainnet.infura.io');

const seaport = new OpenSeaPort(provider, {
  networkName: Network.Main,  
});

const asset = {
  tokenAddress: "0x06012c8cf97bead5deae237070f9587f8e7a266d", // CryptoKitties
  tokenId: "1", // Token ID
}

const balance = await seaport.getAssetBalance({
  accountAddress, // string
  asset, // Asset
})

const ownsKitty = balance.greaterThan(0)
console.log(ownsKitty)

However, it print error message

const provider = new Web3.providers.HttpProvider('https://mainnet.infura.io');
                                    ^
TypeError: Cannot read property 'HttpProvider' of undefined

Also , there are some info which may help you,

  • my nodejs version v14.15.4
  • my npm version 6.14.10
  • my web3js version ^1.3.1
  • my openseajs version ^1.1.10

Hope you can give me some advice and I ask same question on discord server

seaport.getAssetBalance() throws: Unable to get current owner from smart contract

I am trying to use seaport.getAssetBalance(). It is throwing an error of: Unable to get current owner from smart contract.

This is an example of my code following the documentation.

const balances = await seaport.getAssetBalance({
  accountAddress: '0x06e98b5030E4A4b43cF284af02EEb4dEBD5a52Aa',
  asset: {
    tokenAddress: addresses.ARTWORK_COLLECTION,
    tokenId: assets[0].tokenId,
    schemaName: 'ERC1155',
   },
})

Please let me know if this issue is common with you.

createSellOrder error

seaport.createSellOrder throws this error -

Error: Order couldn't be validated by the exchange due to a hash mismatch. Make sure your wallet is on the right network!

Wallet is correctly configured to mainnet.
Proxy contract is also approved.

Not sure what the problem is.

it logs this object before throwing error -

{ exchange: '0x7be8076f4ea4a4ad08075c2508e481d6c946d12b',
  maker: '0x99b0ec4881d2687af4e4912aeea8981fdf035b9e',
  taker: '0x0000000000000000000000000000000000000000',
  makerRelayerFee: 250,
  takerRelayerFee: 0,
  makerProtocolFee: 0,
  takerProtocolFee: 0,
  makerReferrerFee: 0,
  waitingForBestCounterOrder: false,
  feeMethod: 1,
  feeRecipient: '0x5b3256965e7c3cf26e11fcaf296dfc8807c01073',
  side: 1,
  saleKind: 0,
  target: '0x1865ef5e4939dac89403ab0b5336c88784aa976d',
  howToCall: 0,
  calldata:
   '0x23b872dd00000000000000000000000099b0ec4881d2687af4e4912aeea8981fdf035b9e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f8',
  replacementPattern:
   '0x000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000',
  staticTarget: '0x0000000000000000000000000000000000000000',
  staticExtradata: '0x',
  paymentToken: '0x0000000000000000000000000000000000000000',
  basePrice: 70000000000000000,
  extra: 0,
  listingTime: 1564643009,
  expirationTime: 1596178931.62,
  salt:
   92656991252690922468403917183146151556450431262719425748760090879821145035700,
  metadata:
   { asset:
      { id: '248',
        address: '0x1865ef5e4939dac89403ab0b5336c88784aa976d' },
     schema: 'ERC721' },
  hash:
   '0x144a3bd2e7f9ea7f20a67bc76c6c39090220ebca939d71532b5f6d1ff46eef63',
  v: 27,
  r:
   '0x8b1223a82f6a0c065a102314874084ede292193998650404b7e403268d10a60a',
  s:
   '0x106f1173c6e1659fd8da25a3a1f0b1eec601b2e03b6e807519cb9aa4e1ed7fa8' }

Outdated doc and issue with transfer ERC20

Yo @alexanderatallah, it's me again from Cryptovoxels,
I'm trying to set up an interface to transfer ERC20s using opensea-js.

I'm using this example from the documentation: Gifting erc tokens
Especially, I'm using this example for my case:

To transfer fungible assets without token IDs, like ERC20 tokens, you can pass in an OpenSeaFungibleToken as the asset, set schemaName to "ERC20", and include quantity in base units (e.g. wei) to indicate how many.

Example for transfering 2 DAI ($2) to another address:

const paymentToken = (await seaport.api.getPaymentTokens({ symbol: 'DAI'}))[0]
const quantity = new BigNumber(Math.pow(10, paymentToken.decimals)).times(2)
const transactionHash = await seaport.transfer({
  asset: {
    tokenAddress: paymentToken.address,
    schemaName: "ERC20"
  },
  fromAddress, // Must own the tokens
  toAddress,
  quantity
})

First off,

this seems outdated since paymentToken is an object with property tokens which is an Array,
so (await seaport.api.getPaymentTokens({ symbol: 'DAI'}))[0] should become await seaport.api.getPaymentTokens({ symbol: 'DAI'})
and paymentToken.decimals becomes paymentToken.tokens[0].decimals, the same applies to paymentToken.address.

Second,
I get a typescript error if I don't set tokenId in the asset object, so I write tokenId:null,, even though the example doesn't specify it.

Third,
I get a typescript error when writing schemaName: 'ERC20', so I changed that to schemaName: WyvernSchemaName.ERC20, .

In the end

I obtain the following code:

const paymentToken = await this.seaport.api.getPaymentTokens({ symbol })
      const bigQuantity = new BigNumber(Math.pow(10, paymentToken.tokens[0].decimals)).times(2)
      const transactionHash = await this.seaport.transfer({
        asset: {
          tokenId: null,
          tokenAddress: paymentToken.tokens[0].address,
          schemaName: WyvernSchemaName.ERC20,
        },
        fromAddress,
        toAddress,
        quantity: bigQuantity,
      })
      return transactionHash

However, this gives me the following error:

TypeError: Cannot read property 'Function' of undefined
    at Object.exports.annotateERC20TransferABI (utils.js:107)
    at OpenSeaPort.<anonymous> (seaport.js:1397)
    at step (seaport.js:40)
    at Object.next (seaport.js:21)
    at seaport.js:15
    at new Promise (<anonymous>)
    at __awaiter (seaport.js:11)
    at OpenSeaPort.transfer (seaport.js:1383)

Which according to the doc is linked to this line:

"type": Web3.AbiType.Function

Is there anything I'm missing or is it an actual bug?

Versions:

"opensea-js: "^1.1.10",
"web3": "^0.20.7",

OpenSea Command Line Trading Bot

A simple command line bot that automatically makes trades on OpenSea to attempt to profit. Pull request should be submitted to the Plunderbot repository.

Details:

This bot would have a budget of ETH to work with. It would automatically purchase items in Dutch auctions on third party marketplaces with prices below a certain threshold and relist them on OpenSea for slightly higher prices.

The interface would be something like this:

plunderbot trade --wallet_mnemonic="<metamask_mnemonic>" --wallet_address="<address>" --eth_budget=.5 --eth_price_threshold=.01 --price_increase_percentage=.05 --asset_classes=cryptokitties,axie

Running this would scan open CryptoKitties and Axie Infinity auctions and purchase any items close to expiration with price below .01, as long as the budget is not exceeded. It would then automatically re-sell these items using placeSellOrder through opensea-js.

Command line arguments:

  • wallet_mnemonic: The mnemonic for the wallet to use.
  • wallet_address: The address of the wallet to use.
  • eth_budget: The amount of ETH the wallet is allowed to spend.
  • price_increase_percentage: How much higher to relist the items.
  • asset_classes: Comma-separated list of asset classes (e.g., cryptokitties,mlbcrypto)

Purchasing from third party auction contracts:

The bot should purchase cheap items from third party auction contracts, such as the CryptoKitties Sale Clock Auction using the bid method and the Axie auction contract. To find open sales, you can use the OpenSea HTTP API to query for assets that are on sale.

MVP:

Support the above command line arguments for the CryptoKitties and Axie sale contracts, with re-listing using opensea-js.

Bonus:

  • Instead of re-listing individual items, list a bundle of items
  • Bid on items for prices slightly below the auction amount to get deals
  • Attempt to determine if assets are undervalued by looking at price history or asset traits
  • Other third party auction contracts (Decentraland, MLB Crypto)

Testing:

We recommend using the Rinkeby test network to test this bot. You can acquire Rinkeby ETH on the test network, and browse open Rinkeby orders on rinkeby.opensea.io. The Rinkeby CryptoKitties auction contract can be found at this address: 0x8a316edee51b65e1627c801dbc09aa413c8f97c2

createBuyOrder returning Unable to get current owner from smart contract

I'm trying to make an offer through createBuyOrder method to a ERC1155 created by createFactorySellOrders but I'm getting "Unable to get current owner from smart contract". Any ideas?

  const offer = await seaport.createBuyOrder({
      asset: order.asset,
      accountAddress,
      startAmount: parseFloat(amount),
      sellOrder: order,
      schemaName,
  });

Response:
Error: Unable to get current owner from smart contract at OpenSeaPort.eval (seaport.js?8b9d:1587)

Everything seems fine when I make an offer on testnets.opensea.io, but got this when trying with the API.

Clean Install Errors

Hi, been trying to execute a npm install --save opensea-js on a clean create-react-app repo, node version v15.3.0 gives me the following error. Any help appreciated

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: [email protected]
npm ERR! node_modules/typescript
npm ERR!   peer typescript@">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" from [email protected]
npm ERR!   node_modules/tsutils
npm ERR!     tsutils@"^3.17.1" from @typescript-eslint/[email protected]
npm ERR!     node_modules/@typescript-eslint/eslint-plugin
npm ERR!       peer @typescript-eslint/eslint-plugin@"^4.0.0" from [email protected]
npm ERR!       node_modules/eslint-config-react-app
npm ERR!         eslint-config-react-app@"^6.0.0" from [email protected]
npm ERR!         node_modules/react-scripts
npm ERR!       1 more (react-scripts)
npm ERR!     tsutils@"^3.17.1" from @typescript-eslint/[email protected]
npm ERR!     node_modules/@typescript-eslint/typescript-estree
npm ERR!       @typescript-eslint/typescript-estree@"4.8.1" from @typescript-eslint/[email protected]
npm ERR!       node_modules/@typescript-eslint/experimental-utils
npm ERR!         @typescript-eslint/experimental-utils@"4.8.1" from @typescript-eslint/[email protected]
npm ERR!         node_modules/@typescript-eslint/eslint-plugin
npm ERR!         1 more (eslint-plugin-jest)
npm ERR!       1 more (@typescript-eslint/parser)
npm ERR!     1 more (@typescript-eslint/typescript-estree)
npm ERR!   typescript@"^2.6.2" from [email protected]
npm ERR!   node_modules/wyvern-js
npm ERR!     wyvern-js@"git+https://github.com/ProjectOpenSea/wyvern-js.git#v3.2.1" from [email protected]
npm ERR!     node_modules/opensea-js
npm ERR!       opensea-js@"*" from the root project
npm ERR!   3 more (awesome-typescript-loader, tslint, typescript-eslint-parser)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript@"^3.2.1" from [email protected]
npm ERR! node_modules/react-scripts
npm ERR!   react-scripts@"4.0.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/johnstorey/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/johnstorey/.npm/_logs/2021-02-01T21_32_08_352Z-debug.log

Sending Enjin items with transfer Error

Using
"opensea-js": "0.5.0-rc15",
"web3": "1.0.0-beta.55",

In trying to send any Enjin item I get

" Error sending token: { code: -32000.."

I'm using this code:

const transactionHash = await seaport.transfer({ asset: { tokenId, tokenAddress }, fromAddress, toAddress, quantity, schemaName });

Where schema name is 'ERC1155'

This also seems to be a problem when trying to place an Enjin item for sale.

Approving transactions on `createSellOrder` after transactions have been approved

Hey @alexanderatallah - here's another one for you:

I'm testing some stuff on rinkeby, and on the OpenSea UI, I've already approved this token for trading via the OpenSea proxy. But when i ran my script which lists ~100 1155 tokens at once, it appears as though opensea.js invokes another transaction:

{ code: -32000, message: 'already known' }
(node:51192) UnhandledPromiseRejectionWarning: Error: Error: Couldn't get permission to approve these tokens for trading. Their contract might not be implemented correctly. Please contact the developer!
    at _callee5$ (/Users/jonathanschwartz/Documents/Collectible/scripts.js:324:43)
    at tryCatch (/Users/jonathanschwartz/Documents/Collectible/node_modules/regenerator-runtime/runtime.js:63:40)
    at Generator.invoke [as _invoke] (/Users/jonathanschwartz/Documents/Collectible/node_modules/regenerator-runtime/runtime.js:293:22)
    at Generator.throw (/Users/jonathanschwartz/Documents/Collectible/node_modules/regenerator-runtime/runtime.js:118:21)
    at asyncGeneratorStep (/Users/jonathanschwartz/Documents/Collectible/scripts/list.js:3:103)
    at _throw (/Users/jonathanschwartz/Documents/Collectible/scripts/list.js:5:291)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:51192) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:51192) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
{ code: -32000, message: 'already known' }
Transaction started: Approving all tokens of this type for trading
{ code: -32000, message: 'already known' }
{ code: -32000, message: 'already known' }
{ code: -32000, message: 'already known' }
{ code: -32000, message: 'already known' }
{ code: -32000, message: 'already known' }
{ code: -32000, message: 'already known' }
Transaction succeeded: Approving all tokens of this type for trading
Order hashes match
Transaction succeeded: Approving all tokens of this type for trading
Order hashes match

When i ran the script again, it worked fine and all tokens were listed. Any idea why I'd have to approve another transaction?

npm install --save opensea-js error

code:
npm ERR! code 128
npm ERR! Command failed: E:\Git\Git\cmd\git.EXE clone -q git://github.com/ProjectOpenSea/wyvern-js.git D:\学习资料\编译 相关_cacache\tmp\git-clone-a87fe90a --config core.longpaths=true
npm ERR! warning: templates not found in C:\Users\233loser\AppData\Local\Temp\pacote-git-template-tmp\git-clone-227d30e5
npm ERR! error: unable to create file src/wyvern-ethereum/test/aux.js: No such file or directory
npm ERR! Encountered 1 file(s) that should have been pointers, but weren't:
npm ERR! src/wyvern-ethereum/utxo-merkle-proof/package.json
npm ERR! fatal: unable to checkout working tree
npm ERR! warning: Clone succeeded, but checkout failed.
npm ERR! You can inspect what was checked out with 'git status'
npm ERR! and retry the checkout with 'git checkout -f HEAD'
npm ERR!
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR! D:\学习资料\编译相关_logs\2019-01-17T03_00_17_843Z-debug.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.