Open j-labs-xyz opened 1 year ago
You have to broadcast the final txn yourself.
Also the ETH wallet probably won't have any gas so the txn won't go through. I recommend getting your own PKP at https://explorer.litprotocol.com/ and then using the resulting Public Key for your publicKey
param in the code here: https://github.com/LIT-Protocol/js-serverless-function-test/blob/main/signTxnTest.js#L7
Note that this test is hardcoded to run on the Polygon chain so make sure you fund it with gas on Polygon if you're gonna fund it with gas. You can easily change that by changing the chainId and "chain" param in the getLatestNonce function here https://github.com/LIT-Protocol/js-serverless-function-test/blob/main/signTxnTest.js#L24 and here https://github.com/LIT-Protocol/js-serverless-function-test/blob/main/signTxnTest.js#L15
You should also do a "git pull" on this repo as I just pushed a few fixes to this test. Also I'm not sure why, but this test is taking a really long time to complete right now. Like a full minute. It should take a lot less.
Thanks @glitch003 for your help, will follow your advice and let you know how I go.
@glitch003
broadcasting txn worked, below is a PR for reference only, no need to merge https://github.com/LIT-Protocol/js-serverless-function-test/pull/4
transactions can be viewed in the explorer https://mumbai.polygonscan.com/address/0x535b0dABaF59c90EeeBEf272b5F778C5369a1445
@glitch003
yarn run sign
seemed to work fine, somehow txn can't be found on the explorer by txn hashhttps://mumbai.polygonscan.com/search?f=0&q=0xf86880852e90edd0008275309450e2dac5e78b5905cb09495547452cee64426db282
Not sure if the tx has been broadcasted successfully or not, as I saw an error "[Lit-JS-SDK] Error parsing response as json. Swallowing and returning as string.".