What’s the correct way to send tokens in rapid succession (e.g. in a loop)? #asknostr

Something tells me this isn’t the way, especially since I get an ERR_CONNECTION _REFUSED from nostr:npub1kvaln6tm0re4d99q9e4ma788wpvnw0jzkz595cljtfgwhldd75xsj9tkzv right after.

Cc: nostr:npub12rv5lskctqxxs2c8rf2zlzc7xx3qpvzs3w4etgemauy9thegr43sf485vg or any other #ecash dev

Reply to this note

Please Login to reply.

Discussion

You're going to get rate limited by the mint if you swap in a loop. Instead, use wallet.send and set the `amountsToSend` option to

an array of n times `amountPerSend`, then send it.

Single interaction with the mint.

Is the answer still the same if I’m trying to send tokens to 50 different recipients?

I checked the documentation and didn’t see send() accepting an array, but I did see that swap() returns splitProofsToSend (which sounds like what I need).

Either way, I’ll try all of this when I get a chance. Just want to be prepared. 🙏

https://nostrcheck.me/media/c7617e02242f5853fe5b513d411f19b44ad3f0da95a28d33a9b7e927f255dd2d/e3878b50b78798069a94e13521fde5c7164fd4bf53fd89783c4ff52f4bebea1c.webp

Yes, you just mint 50 tokens at once, then spam then out to the recipients

send has an option "amountsToSend" or something!

Alright thanks! 🫡