code: func (api *API) GetBundlesFromAddresses(addresses Hashes, inclusionState ...bool) (bundle.Bundles, error) {
  	txs, err := api.FindTransactionObjects(FindTransactionsQuery{Addresses: addresses})
  	if err != nil {
  		return nil, err
  	}
  
  	if len(txs) == 0 {
  		return bundle.Bundles{}, nil
  	}
  
  	// misuse as a set
  	bundleHashesSet := map[Hash]struct{}{}
  	for i := range txs {
  		bundleHashesSet[txs[i].Bundle] = struct{}{}
  	}
  
  	bundleHashes := make(Hashes, len(bundleHashesSet))
  	i := 0
  	for hash := range bundleHashesSet {
  		bundleHashes[i] = hash
  		i++
  	}
  
  	allTxs, err := api.FindTransactionObjects(FindTransactionsQuery{Bundles: bundleHashes})
  	if err != nil {
  		return nil, err
  	}
  	bundles := bundle.GroupTransactionsIntoBundles(allTxs)
  	sort.Sort(bundle.BundlesByTimestamp(bundles))
  
  	if len(inclusionState) > 0 && inclusionState[0] {
  		// get tail tx hashes
  		hashes := make(Hashes, len(bundles))
  		for i := range bundles {
  			hashes[i] = bundles[i][0].Hash
  		}
  
  		states, err := api.GetLatestInclusion(hashes)
  		if err != nil {
  			return nil, err
  		}
  
  		// set confirmed property on each tx
  		// since bundles are atomic, each tx in the bundle
  		// as the same 'confirmed' state
  		for i := range bundles {
  			bndl := &bundles[i]
  			for j := range *bndl {
  				tx := &(*bndl)[j]
  				tx.Persistence = &states[i]
  			}
  		}
  	}
  
  	return bundles, err
  }
docs: // GetBundlesFromAddresses fetches all bundles from the given addresses and optionally sets
  // the confirmed property on each transaction using GetLatestInclusion.
  // This function does not validate the bundles.