Setting up multiple whitelist using Candy Machine v2 - solana

I am working to deploy my first minting site and wondering how I can go about setting up multiple whitelists. For example, I want to have 3 different whitelist each with a different price, where the first set of minters are on WL1 and can mint from 10am - 11am for 0.7sol, then starting at 11am WL2 can start minting at 0.8sol (and WL1 can continue minting at their whitelist price), and then at noon WL3 can start minting for 0.9sol along with the first two whitelists, and then finally the public mint would start at 1pm for 1sol..is this possible with Candy Machine V2?
I have seen a little bit online about using the endSettings in the config but I'm not exactly sure how that would work given each different whitelist would need to be associated with a different SPL-token I assume?
Any help is appreciated! Thanks.

The only method to implement this with candy machine is doing multiple iterations of config changes.
e.g. first
{
"price": 0,
"number": 6,
"gatekeeper": null,
"solTreasuryAccount": "5mktEkQdDh9hgh3nKLLM5B62vDvWwtums6LFLmK5Jujt",
"splTokenAccount": null,
"splToken": null,
"goLiveDate": "21 Jan 2023 21:00:00 GMT",
"endSettings": {
"endSettingType": { "date":true },
"value":"25 Dec 2022 10:00:00 GMT"
},
"whitelistMintSettings": {
"mode" : { "burnEveryTime": true },
"mint" : "7nE1GmnMmDKiycFkpHF7mKtxt356FQzVonZqBWsTWZNf",
"presale" : true,
"discountPrice" : 0.7
},
"hiddenSettings": null,
"storage": "arweave",
"ipfsInfuraProjectId": null,
"ipfsInfuraSecret": null,
"awsS3Bucket": null,
"noRetainAuthority": false,
"noMutable": false
}
then after 10 AM run update_candy_machine with a new config like this
{
"price": 0,
"number": 6,
"gatekeeper": null,
"solTreasuryAccount": "5mktEkQdDh9hgh3nKLLM5B62vDvWwtums6LFLmK5Jujt",
"splTokenAccount": null,
"splToken": null,
"goLiveDate": "21 Jan 2023 21:00:00 GMT",
"endSettings": {
"endSettingType": { "date":true },
"value":"25 Dec 2022 10:00:00 GMT"
},
"whitelistMintSettings": {
"mode" : { "burnEveryTime": true },
"mint" : "7nE1GmnMmDKiycFkpHF7mKtxt356FQzVonZqBWsTWZNf",
"presale" : true,
"discountPrice" : 0.8
},
"hiddenSettings": null,
"storage": "arweave",
"ipfsInfuraProjectId": null,
"ipfsInfuraSecret": null,
"awsS3Bucket": null,
"noRetainAuthority": false,
"noMutable": false
}
etc.
It is NOT possible to have multiple WL prices etc. at the same time with candy machine.

Related

Error deploying config to Solana network. Error: non-base58 character

I'm testing how Metaplex's Candy Machine works and I'm having the tittle error while uploading using the CMv2-cli.
My config file is the following:
{
"price": 0,
"number": 10,
"gatekeeper": null,
"solTreasuryAccount": "<8TBP4QrwkbDEmmYbA1EJum7HN8S2c1QYvEgTPdfb35Lh>",
"splTokenAccount": null,
"splToken": null,
"goLiveDate": "27 May 2022 09:20:00 UTC",
"endSettings": null,
"whitelistMintSettings": null,
"hiddenSettings": null,
"storage": "arweave-sol",
"ipfsInfuraProjectId": null,
"ipfsInfuraSecret": null,
"nftStorageKey": null,
"awsS3Bucket": null,
"noRetainAuthority": false,
"noMutable": false
}
One of my assets file is the following:
{
"name": "Test #0001",
"symbol": "NB",
"description": "Collection of 10 numbers on the Solana blockchain.",
"seller_fee_basis_points": 500,
"image": "0.png",
"attributes": [
{"trait_type": "Layer-1", "value": "0"},
{"trait_type": "Layer-2", "value": "0"},
{"trait_type": "Layer-3", "value": "0"},
{"trait_type": "Layer-4", "value": "1"}
],
"properties": {
"creators": [{"address": "8TBP4QrwkbDEmmYbA1EJum7HN8S2c1QYvEgTPdfb35Lh ", "share": 100}],
"files": [{"uri": "0.png", "type": "image/png"}]
},
"collection": {"name": "numbers", "family": "numbers"}
}
You have 2 big errors in both files (config and the metadata).
For the config file you should not use the < > symbols, so your config file should look like this:
{
"price": 0,
"number": 10,
"gatekeeper": null,
"solTreasuryAccount": "8TBP4QrwkbDEmmYbA1EJum7HN8S2c1QYvEgTPdfb35Lh",
"splTokenAccount": null,
"splToken": null,
"goLiveDate": "27 May 2022 09:20:00 UTC",
"endSettings": null,
"whitelistMintSettings": null,
"hiddenSettings": null,
"storage": "arweave-sol",
"ipfsInfuraProjectId": null,
"ipfsInfuraSecret": null,
"nftStorageKey": null,
"awsS3Bucket": null,
"noRetainAuthority": false,
"noMutable": false
}
For the asset file you have an extra space at the end of the creators array, so you should remove that extra space from this file and I assume from the rest of ur assets too. Should look like this:
{
"name": "Test #0001",
"symbol": "NB",
"description": "Collection of 10 numbers on the Solana blockchain.",
"seller_fee_basis_points": 500,
"image": "0.png",
"attributes": [
{"trait_type": "Layer-1", "value": "0"},
{"trait_type": "Layer-2", "value": "0"},
{"trait_type": "Layer-3", "value": "0"},
{"trait_type": "Layer-4", "value": "1"}
],
"properties": {
"creators": [{"address": "8TBP4QrwkbDEmmYbA1EJum7HN8S2c1QYvEgTPdfb35Lh", "share": 100}],
"files": [{"uri": "0.png", "type": "image/png"}]
},
"collection": {"name": "numbers", "family": "numbers"}
}

Office.context.mailbox.item.getEntities() returns null for all entities

I followed the sample code that is shared at: https://learn.microsoft.com/en-us/outlook/add-ins/extract-entity-strings-from-an-item#extracting-task-suggestions. I have an email, that has a valid address (1234 Main Street, Redmond, WA 07722). But all the entities on the email are null, including the 'Addresses' entity.
Return value for Office.context.mailbox.item.getEntities():
{ "_data$p$0": { "Addresses": null, "Contacts": null, "EmailAddresses": null, "MeetingSuggestions": null, "PhoneNumbers": null, "TaskSuggestions": null, "Urls": null }, "_filteredData$p$0": {}, "_dateTimeSent$p$0": "2019-11-15T12:01:19.000Z", "_permissionLevel$p$0": 2, "_addresses$p$0": [] }
Any help to get it to work will be greatly appreciated.
Regards
~Surjya.

RethinkDB Query: How to pluck bassed on a date range

Given a table called alerts and a database called database with an array
of objects with a date attribute called History how can I pluck based
on a date range on that date attribute?
with the following query,
r.db("database").table("alerts").pluck("history").limit(10000)
I get back something like the following
{
"history": [
{
"text": "text1" ,
"updateTime": Thu Jun 20 2019 01:29:47 GMT+00:00 ,
},
{
"text": "text2" ,
"updateTime": Thu Jun 20 2019 01:24:59 GMT+00:00 ,
},
]
}
{
"history": [
{
"text": "text3" ,
"updateTime": Thu Jun 20 2018 01:29:47 GMT+00:00 ,
},
{
"text": "text4" ,
"updateTime": Thu Jun 20 2018 01:24:59 GMT+00:00 ,
},
]
}
how can I pluck the sub object called history and only return histories that are in a specific range on the updateTime attribute.
for example between jan/2/2009 to jan/3/2009
You need to filter based on a time range and use pluck on a nested object. Here are some examples about how to do that from the official documentation
r.table("users").filter(function (user) {
return user("subscriptionDate").during(
r.time(2012, 1, 1, 'Z'), r.time(2013, 1, 1, 'Z'));
}).run(conn, callback);
Source: https://www.rethinkdb.com/api/javascript/filter/
r.table('marvel').pluck({'abilities' : {'damage' : true, 'mana_cost' : true}, 'weapons' : true}).run(conn, callback)
Source: https://www.rethinkdb.com/api/javascript/pluck/

Laravel Cashier: Resume a single payment

after a successful payment I store the stripe id on a mysql table. With that id I would like to retrieve all the details stored in the stripe database.
So is it possible to resume a single payment by the stripe id?
Thanks
Here is the documentation you need to use: https://stripe.com/docs/api/php#retrieve_customer
Use the "customer retrieve" Stripe API call to retrieve details about the customer's purchase:
Stripe::setApiKey(Config::get('your_stripe_secret_key_here'));
$customer_object = Customer::retrieve(customers_stripe_id);
This will return the following JSON:
Stripe\Customer JSON: {
"id": "cus_7KJZQ8Z6jfSSMl",
"object": "customer",
"account_balance": 0,
"created": 1447172728,
"currency": "usd",
"default_source": "card_175evz2eZvKYlo2CKoS2WEDk",
"delinquent": false,
"description": "Bingo|www|0c1234567890",
"discount": null,
"email": null,
"livemode": false,
"metadata": {
},
"shipping": null,
"sources": {
"object": "list",
"data": [
{
"id": "card_175evz2eZvKYlo2CKoS2WEDk",
"object": "card",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": null,
"address_zip_check": null,
"brand": "Visa",
"country": "US",
"customer": "cus_7KJZQ8Z6jfSSMl",
"cvc_check": "pass",
"dynamic_last4": null,
"exp_month": 5,
"exp_year": 2016,
"funding": "credit",
"last4": "4242",
"metadata": {
},
"name": null,
"tokenization_method": null
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/customers/cus_7KJZQ8Z6jfSSMl/sources"
},
"subscriptions": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/customers/cus_7KJZQ8Z6jfSSMl/subscriptions"
}
}
Here is Stripe's version of the API call:
\Stripe\Stripe::setApiKey("your_secret_key");
\Stripe\Customer::retrieve("the_customers_id");
Make sure to import the \Stripe classes by adding this at the top of your Model or Controller:
use Stripe\Customer;
use Stripe\Stripe;
if you want to use "Stripe" instead of \Stripe\Stripe and \Stripe\Customer prefixes)

Ruby JSON.parse returns an Array

I'm trying to parse a JSON string that I received from Twitter as a response via the RESTful API. I wanted to use the JSON gem, but I've run into an issue. Per the documentation, it appears that the JSON parser returns a Hash, which is what I want. However, when I actually perform the JSON.parse(twitter_result.body), it returns an Array. How can I get the JSON parser to return a Hash?
This is the parser I am using: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/json/rdoc/JSON.html#method-i-parse
"Pretty" JSON output example:
[
{
"created_at": "Sun Dec 08 13:00:52 +0000 2013",
"id": 409668902189137920,
"id_str": "409668902189137920",
"text": "\"All the people departed, and David went home to bless his household.\" 1 Chron. 16:43. Big meeting. Blessed home. Both.",
"source": "HootSuite",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
"in_reply_to_user_id_str": null,
"in_reply_to_screen_name": null,
"user": {
"id": 27500565,
"id_str": "27500565",
"name": "John Piper",
"screen_name": "JohnPiper",
"location": "Minneapolis, MN",
"description": "Founder-Teacher, Desiring God, Chancellor, BCS. Spreading a passion for the supremacy of God in all things for the joy of all peoples through Jesus Christ.",
"url": "http://t.co/qt1rUlRfdl",
"entities": {
"url": {
"urls": [
{
"url": "http://t.co/qt1rUlRfdl",
"expanded_url": "http://www.desiringgod.org",
"display_url": "desiringgod.org",
"indices": [
0,
22
]
}
]
},
"description": {
"urls": [
]
}
},
"protected": false,
"followers_count": 564749,
"friends_count": 107,
[
{
"created_at": "Sun Dec 08 13:00:52 +0000 2013",
"id": 409668902189137920,
"id_str": "409668902189137920",
"text": "\"All the people departed, and David went home to bless his household.\" 1 Chron. 16:43. Big meeting. Blessed home. Both.",
"source": "HootSuite",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
"in_reply_to_user_id_str": null,
"in_reply_to_screen_name": null,
"user": {
"id": 27500565,
"id_str": "27500565",
"name": "John Piper",
"screen_name": "JohnPiper",
"location": "Minneapolis, MN",
"description": "Founder-Teacher, Desiring God, Chancellor, BCS. Spreading a passion for the supremacy of God in all things for the joy of all peoples through Jesus Christ.",
"url": "http://t.co/qt1rUlRfdl",
"entities": {
"url": {
"urls": [
{
"url": "http://t.co/qt1rUlRfdl",
"expanded_url": "http://www.desiringgod.org",
"display_url": "desiringgod.org",
"indices": [
0,
22
]
}
]
},
"description": {
"urls": [
]
}
},
"protected": false,
"followers_count": 564749,
"friends_count": 107,
"listed_count": 9225,
"created_at": "Sun Mar 29 20:48:44 +0000 2009",
"favourites_count": 20,
"utc_offset": -21600,
"time_zone": "Central Time (US & Canada)",
"geo_enabled": true,
"verified": true,
"statuses_count": 7906,
"lang": "en",
"contributors_enabled": false,
"is_translator": false,
"profile_background_color": "570000",
"profile_background_image_url": "http://a0.twimg.com/profile_background_images/38963234/jp_twitter_1920x1200_b_2.jpg",
"profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/38963234/jp_twitter_1920x1200_b_2.jpg",
"profile_background_tile": false,
"profile_image_url": "http://pbs.twimg.com/profile_images/1563845055/2010fallJPmug_normal.jpeg",
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1563845055/2010fallJPmug_normal.jpeg",
"profile_link_color": "5C0606",
"profile_sidebar_border_color": "000000",
"profile_sidebar_fill_color": "CCC2A3",
"profile_text_color": "000000",
"profile_use_background_image": true,
"default_profile": false,
"default_profile_image": false,
"following": true,
"follow_request_sent": false,
"notifications": false
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"retweet_count": 20,
"favorite_count": 31,
"entities": {
"hashtags": [
],
"symbols": [
],
"urls": [
],
"user_mentions": [
]
},
"favorited": false,
"retweeted": false,
"lang": "en"
}
] "listed_count": 9225,
"created_at": "Sun Mar 29 20:48:44 +0000 2009",
"favourites_count": 20,
"utc_offset": -21600,
"time_zone": "Central Time (US & Canada)",
"geo_enabled": true,
"verified": true,
"statuses_count": 7906,
"lang": "en",
"contributors_enabled": false,
"is_translator": false,
"profile_background_color": "570000",
"profile_background_image_url": "http://a0.twimg.com/profile_background_images/38963234/jp_twitter_1920x1200_b_2.jpg",
"profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/38963234/jp_twitter_1920x1200_b_2.jpg",
"profile_background_tile": false,
"profile_image_url": "http://pbs.twimg.com/profile_images/1563845055/2010fallJPmug_normal.jpeg",
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1563845055/2010fallJPmug_normal.jpeg",
"profile_link_color": "5C0606",
"profile_sidebar_border_color": "000000",
"profile_sidebar_fill_color": "CCC2A3",
"profile_text_color": "000000",
"profile_use_background_image": true,
"default_profile": false,
"default_profile_image": false,
"following": true,
"follow_request_sent": false,
"notifications": false
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"retweet_count": 20,
"favorite_count": 31,
"entities": {
"hashtags": [
],
"symbols": [
],
"urls": [
],
"user_mentions": [
]
},
"favorited": false,
"retweeted": false,
"lang": "en"
}
]
JSON output returns an array with one element which is the Hash you're looking for.
Try this:
puts JSON.parse(twitter_result.body)[0]

Resources