dydxprotocol / v3-client

TypeScript client for dYdX (v3 API).
Apache License 2.0
108 stars 54 forks source link

lpPositionId question : "msg": "Invalid LP position id" #130

Open WuWhite opened 2 years ago

WuWhite commented 2 years ago

image

const withdrawal_result = await web3Client_test.private.createFastWithdrawal(
    {
        lpStarkKey: test_account_info.account.starkKey,
        creditAsset: 'USDC',
        creditAmount: '60',
        debitAmount: '100',
        toAddress: walletAddress,
        lpPositionId: '1',
        expiration:  new Date(new Date().getTime() + 60 * 60 * 1000 * 24 * 8),
        clientId,
    },
    test_account_info.account.positionId,
)

it Always reminding me of 'Invalid LP position id', when i wanna createFastWithdrawal Does anyone have a similar problem?

DenisAl-Hazo commented 2 years ago

I have another problem with this method, seems like it doesnt work

TypeError: Cannot read property 'replace' of undefined
    at stripHexPrefix (/Users/denis/Desktop/dydx/node_modules/@dydxprotocol/starkex-lib/build/src/lib/util.js:109:29)
    at Object.hexToBn (/Users/denis/Desktop/dydx/node_modules/@dydxprotocol/starkex-lib/build/src/lib/util.js:66:32)
    at SignableConditionalTransfer.calculateHash (/Users/denis/Desktop/dydx/node_modules/@dydxprotocol/starkex-lib/build/src/signable/conditional-transfer.js:42:44)
    at SignableConditionalTransfer.getHashBN (/Users/denis/Desktop/dydx/node_modules/@dydxprotocol/starkex-lib/build/src/signable/stark-signable.js:29:39)
    at SignableConditionalTransfer.sign (/Users/denis/Desktop/dydx/node_modules/@dydxprotocol/starkex-lib/build/src/signable/stark-signable.js:37:35)
    at Private.createFastWithdrawal (/Users/denis/Desktop/dydx/node_modules/@dydxprotocol/v3-client/build/src/modules/private.js:361:56)
sirroger5000 commented 2 years ago

Realized that lpPositionId needs to be always 2 ... Don't ask me why.

Got stuck, however with "Invalid signature for fast withdrawal" by calling fast withdrawal

Any idea on that?

monilpat commented 1 year ago

Any update on resolution for "Invalid signature for fast withdrawal"? Thanks!