Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Sign maker order #39

Open
Sam53534512 opened this issue May 16, 2022 · 4 comments
Open

Sign maker order #39

Sam53534512 opened this issue May 16, 2022 · 4 comments

Comments

@Sam53534512
Copy link

Rinkeby Test Environment:

         const signer = new ethers.Wallet(“prvatekey”);
         const signerAddress = await signer.getAddress();
         let nonce = await web3.eth.getTransactionCount(signerAddress);
      
   
       const makerOrder: MakerOrder = {
            isOrderAsk: true,
            signer: signerAddress,
            collection: "0xfE484120024431AFcbEadF09DcdCBe9f7e63671F",
            price: "10000000000000000000", // :warning: PRICE IS ALWAYS IN WEI :warning:
            tokenId: "10001", // Token id is 0 if you use the STRATEGY_COLLECTION_SALE strategy
            amount: "1",
            strategy: addresses.STRATEGY_STANDARD_SALE,
            currency: 'ETH',
            nonce: nonce,
            startTime:now,
            endTime: now + 86400, // 1 day validity
            minPercentageToAsk: Math.min(8500, 8500),
            params: paramsValue,
        };
        const { domain, type } = getMakerOrderTypedData(chainId, addresses.EXCHANGE);
      
        const signature = await signer._signTypedData(domain, type, makerOrder);

error:cannot resolve ENS names without a provider (operation="resolveName", value="ETH",
code=UNSUPPORTED_OPERATION, version=wallet/5.6.1)
someone can help me?

@0xShisui
Copy link
Contributor

const signer = new ethers.Wallet(“prvatekey”);, you forgot the pk

@0xShisui 0xShisui changed the title maker order quest Sign maker order May 17, 2022
@Sam53534512
Copy link
Author

Sam53534512 commented May 17, 2022

forgot

yes i forgot,thanks
now I'm testing rinkeby,

const chainId = SupportedChainId.RINKEBY;

let ethersProvider = ethers.getDefaultProvider('rinkeby',{
etherscan: 'key',
});

const signer = new ethers.Wallet('privatekey',ethersProvider);
const signerAddress = await signer.getAddress();
let nonce = await web3.eth.getTransactionCount(signerAddress);

        const makerOrder: MakerOrder = {
            isOrderAsk: true,
            signer: signerAddress,
            collection: "0xfE484120024431AFcbEadF09DcdCBe9f7e63671F",
            price: "100000000000000000", // :warning: PRICE IS ALWAYS IN WEI :warning:
            tokenId: "10001", // Token id is 0 if you use the STRATEGY_COLLECTION_SALE strategy
            amount: "1",
            strategy: addresses.STRATEGY_STANDARD_SALE,
            currency: 'ETH',
            nonce: nonce,
            startTime:now,
            endTime: now + 86400, // 1 day validity
            minPercentageToAsk: Math.min(8500, 8500),
            params: paramsValue,
        };

       const { domain, type } = getMakerOrderTypedData(chainId, addresses.EXCHANGE);
      const signature = await signer._signTypedData(domain, type, makerOrder);

Return results :signature="0xfe7c74b141e3a1d84ea4b3a460c675b24c72e376c4c1ba0dd544641676720fbd70c327758704fd1ca5f2cd03d0e038ddad23dab92c4f1faa48d2d35392f510b41b"
but,It didn't succeed in listing,can you help me?

@0xShisui
Copy link
Contributor

I think you misunderstood something. let nonce = await web3.eth.getTransactionCount(signerAddress);, the order nonce has nothing to do with the account nonce. It's an internal value managed by the LR system. Refer to https://github.com/LooksRare/looksrare-sdk/blob/master/doc/guide.md#how-to-retrieve-the-user-nonce

@Sam53534512
Copy link
Author

Sam53534512 commented May 17, 2022

I think you misunderstood something. let nonce = await web3.eth.getTransactionCount(signerAddress);, the order nonce has nothing to do with the account nonce. It's an internal value managed by the LR system. Refer to https://github.com/LooksRare/looksrare-sdk/blob/master/doc/guide.md#how-to-retrieve-the-user-nonce

thanks,

i get nonce from https://api.looksrare.org/api/v1/orders/nonce, api is Right?

I replaced the original nonce with API and still couldn't create the order,NFT has no state change

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants